refactor(fight): 重构战斗流程实现并完善效果处理机制
This commit is contained in:
@@ -64,8 +64,34 @@ func (this *EffectNode) ParamSize(t int) int {
|
||||
return this.paramSize
|
||||
|
||||
}
|
||||
func (this *EffectNode) GetSkill(t int) *info.BattleSkillEntity {
|
||||
pet, _ := this.ctx.Value(info.BattleSkillEntityCtx).(*info.BattleSkillEntity)
|
||||
func (this *EffectNode) GetSkill() *info.BattleSkillEntity {
|
||||
pet, ok := this.ctx.Value(info.BattleSkillEntityCtx).(*info.BattleSkillEntity)
|
||||
|
||||
if !ok { //effect不一定来自技能,也有特性 能量珠 boss effect
|
||||
return nil
|
||||
}
|
||||
return pet
|
||||
|
||||
}
|
||||
|
||||
// 获取对方精灵
|
||||
func (this *EffectNode) GetBattle() *info.BattleContainer1V1 {
|
||||
pet, _ := this.ctx.Value(info.BattleContainerCtx).(*info.BattleContainer1V1)
|
||||
|
||||
return pet
|
||||
|
||||
}
|
||||
|
||||
// 获取自身精灵
|
||||
func (this *EffectNode) GetOwnerPet() *info.BattlePetEntity {
|
||||
pet, _ := this.ctx.Value(info.Pet_O_Ctx).(*info.BattlePetEntity)
|
||||
|
||||
return pet
|
||||
|
||||
}
|
||||
|
||||
func (this *EffectNode) GetTargetPet() *info.BattlePetEntity {
|
||||
pet, _ := this.ctx.Value(info.Pet_T_Ctx).(*info.BattlePetEntity)
|
||||
|
||||
return pet
|
||||
|
||||
|
||||
Reference in New Issue
Block a user