82 lines
1.6 KiB
Go
82 lines
1.6 KiB
Go
package fight
|
||
|
||
func NewFightBase() *FightBase {
|
||
return &FightBase{}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 每场战斗需要new一个类,因为客户端有同时进行多场战斗的需求,所以这里不能是单例
|
||
/// </summary>
|
||
type FightBase struct {
|
||
/// <summary>
|
||
/// 战斗类型
|
||
/// </summary>
|
||
fightType FightType
|
||
/// <summary>
|
||
/// 战斗是否进行中
|
||
/// </summary>
|
||
fightIng bool
|
||
/// <summary>
|
||
/// 所有参战角色集合
|
||
/// </summary>
|
||
Roles []*FightRole
|
||
/// <summary>
|
||
/// 当前回合满足行动值大于等于100的所有角色
|
||
/// </summary>
|
||
CanAtkRoles []*FightRole
|
||
/// <summary>
|
||
/// 最后一次攻击的角色
|
||
/// </summary>
|
||
LastActionRole FightRole
|
||
/// <summary>
|
||
/// 是否自动战斗
|
||
/// </summary>
|
||
AutoFight bool
|
||
/// <summary>
|
||
/// 战斗AI
|
||
/// </summary>
|
||
FightAI FightAI
|
||
/// <summary>
|
||
/// 随机数种子
|
||
/// </summary>
|
||
RandSeed int64
|
||
/// <summary>
|
||
/// 事件系统
|
||
/// </summary>
|
||
FightEvent IFightEvent
|
||
/// <summary>
|
||
/// 战报
|
||
/// </summary>
|
||
FightLog FightLog
|
||
|
||
/// <summary>
|
||
/// 是否可进入下个循环
|
||
/// </summary>
|
||
/// <remarks>
|
||
/// 客户端专用逻辑
|
||
/// </remarks>
|
||
ToNextRound bool
|
||
}
|
||
|
||
/// <summary>
|
||
/// 开始战斗
|
||
/// </summary>
|
||
func (this *FightBase) StartFight() {
|
||
this.fightIng = true
|
||
|
||
// FightDebug.Log("=========开始战斗=========")
|
||
|
||
//记录战报
|
||
// var com = new(ComStartFight)
|
||
// FightLog.AddCommand(com)
|
||
//不直接用enum,防止装箱拆箱
|
||
this.FightEvent.Emit(int(EventType_OnFightStart))
|
||
|
||
// BeforeStart()
|
||
// EmitCaptainSkill()
|
||
// EmitPassiveSkillSkill()
|
||
// //todo...符文技??
|
||
// InitRoleOperateValue()
|
||
// TurnRound()
|
||
}
|