go_dreamfactory/modules/battle/fight/fightbase.go
2022-09-08 17:25:12 +08:00

82 lines
1.6 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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()
}