diff --git a/logic/service/fight/boss/NewSeIdx_54.go b/logic/service/fight/boss/NewSeIdx_54.go index aaea2d957..377db1529 100644 --- a/logic/service/fight/boss/NewSeIdx_54.go +++ b/logic/service/fight/boss/NewSeIdx_54.go @@ -10,7 +10,7 @@ type NewSel54 struct { NewSel0 } -func (e *NewSel54) Action_end() bool { +func (e *NewSel54) Skill_Use_ex() bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true diff --git a/logic/service/fight/boss/NewSeIdx_71.go b/logic/service/fight/boss/NewSeIdx_71.go index d1e59b043..a71c5328e 100644 --- a/logic/service/fight/boss/NewSeIdx_71.go +++ b/logic/service/fight/boss/NewSeIdx_71.go @@ -10,7 +10,7 @@ type NewSel71 struct { NewSel0 } -func (e *NewSel71) Action_end() bool { +func (e *NewSel71) Skill_Use_ex() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } diff --git a/logic/service/fight/effect/150.go b/logic/service/fight/effect/150.go index 6ba21b308..15ecfb871 100644 --- a/logic/service/fight/effect/150.go +++ b/logic/service/fight/effect/150.go @@ -11,7 +11,7 @@ type Effect150 struct { node.EffectNode } -func (e *Effect150) Action_end() bool { +func (e *Effect150) Skill_Use() bool { e.Ctx().Opp.SetProp(e.Ctx().Opp, 1, int8(e.SideEffectArgs[1]), info.AbilityOpType.SUB) e.Ctx().Opp.SetProp(e.Ctx().Opp, 3, int8(e.SideEffectArgs[1]), info.AbilityOpType.SUB) diff --git a/logic/service/fight/effect/424.go b/logic/service/fight/effect/424.go index 00c6b770d..d17be3fb5 100644 --- a/logic/service/fight/effect/424.go +++ b/logic/service/fight/effect/424.go @@ -11,7 +11,7 @@ type Effect424 struct { node.EffectNode } -func (e *Effect424) Action_end() bool { +func (e *Effect424) Skill_Use() bool { e.Ctx().Opp.SetProp(e.Ctx().Our, 4, int8(e.Args()[1].IntPart()), info.AbilityOpType.SUB) return true } diff --git a/logic/service/fight/effect/effect_409.go b/logic/service/fight/effect/effect_409.go index aad5f61d9..5bb2f8d2d 100644 --- a/logic/service/fight/effect/effect_409.go +++ b/logic/service/fight/effect/effect_409.go @@ -15,7 +15,7 @@ func (e *Effect409) SetArgs(t *input.Input, a ...int) { e.EffectNode.SetArgs(t, a...) e.EffectNode.Duration(a[0]) // 持续n回合 } -func (e *Effect409) Action_end() bool { +func (e *Effect409) Skill_Use() bool { e.Ctx().Opp.SetProp(e.Ctx().Our, 4, int8(int(e.Args()[1].IntPart())), info.AbilityOpType.SUB) return true diff --git a/logic/service/fight/effect/effect_419.go b/logic/service/fight/effect/effect_419.go index bbe59547a..6aa8ec1cf 100644 --- a/logic/service/fight/effect/effect_419.go +++ b/logic/service/fight/effect/effect_419.go @@ -13,7 +13,7 @@ type Effect419 struct { node.EffectNode } -func (e *Effect419) Action_end() bool { +func (e *Effect419) Skill_Use() bool { for _, V := range e.Ctx().Opp.Prop[:] { if V > 0 { fixedDamage := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart())) // k点固定伤害 diff --git a/logic/service/fight/effect/effect_439.go b/logic/service/fight/effect/effect_439.go index 146dbb261..cd0d5e650 100644 --- a/logic/service/fight/effect/effect_439.go +++ b/logic/service/fight/effect/effect_439.go @@ -26,7 +26,7 @@ func (e *Effect439) SetArgs(t *input.Input, a ...int) { e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0]) } -func (e *Effect439) Action_end() bool { +func (e *Effect439) Skill_Use() bool { var isprop bool for _, v := range e.Ctx().Our.Prop { if v < 0 { @@ -35,11 +35,10 @@ func (e *Effect439) Action_end() bool { } if e.Ctx().Our.StatEffect_Exist_all() || isprop { e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ - Type: info.DamageType.Fixed, - Damage: e.Args()[1], - }) + Type: info.DamageType.Fixed, + Damage: e.Args()[1], + }) } - return true } diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index 6eb8f210a..94c114a09 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -248,26 +248,14 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) } } - // if defender.CurrentPet.Info.Hp > 0 { - // //技能使用后 - // defender.Exec(func(effect input.Effect) bool { - // effect.Ctx().SkillEntity = currentSkill - // effect.Skill_Use_ex() - // return true - // }) - // } - - // //技能使用后 - // attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果 - // effect.Ctx().SkillEntity = currentSkill - // effect.SkillUseed() - // return true - // }) - // defender.Exec(func(effect input.Effect) bool { - // effect.Ctx().SkillEntity = currentSkill - // effect.Action_end_ex() - // return true - // }) + if defender.CurrentPet.Info.Hp > 0 { + //技能使用后 + defender.Exec(func(effect input.Effect) bool { + effect.Ctx().SkillEntity = currentSkill + effect.Skill_Use_ex() + return true + }) + } if defender.CurrentPet.Info.Hp <= 0 && attacker.CurrentPet.Info.Hp <= 0 { //先手方死亡,触发反同归于尽 attacker.CurrentPet.Info.Hp = 1 @@ -280,9 +268,10 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) //技能使用后 attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果 effect.Ctx().SkillEntity = currentSkill - effect.Action_end() + effect.Skill_Use() return true }) + } if defender.CurrentPet.Info.Hp <= 0 { @@ -294,11 +283,22 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) //技能使用后 defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果 effect.Ctx().SkillEntity = currentSkill - effect.Action_end_ex() + effect.Skill_Use_ex() return true }) } - + //技能使用后 + attacker.Exec(func(effect input.Effect) bool { //技能使用后的我方效果 + effect.Ctx().SkillEntity = currentSkill + effect.Action_end() + return true + }) + //技能使用后 + defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果 + effect.Ctx().SkillEntity = currentSkill + effect.Action_end_ex() + return true + }) } f.Broadcast(func(ff *input.Input) { diff --git a/logic/service/fight/input/interface.go b/logic/service/fight/input/interface.go index 597f03723..21231e4f4 100644 --- a/logic/service/fight/input/interface.go +++ b/logic/service/fight/input/interface.go @@ -33,10 +33,9 @@ type Effect interface { DamageLock(*info.DamageZone) bool //锁定伤害 DamageLockEx(*info.DamageZone) bool //被动方锁定伤害 Damage_Shield(*info.DamageZone) bool // 护盾值变化时触发 - //Damage_Use() bool // 伤害作用 - //Skill_Use_ex() bool //技能PP减少节点 - //Action_end() bool //技能PP减少节点 - //Action_end_ex() bool + Skill_Use() bool //技能使用节点 + Skill_Use_ex() bool //技能PP减少节点 + Action_end() bool Action_end_ex() bool //OnDefeat(opp *Input) bool // 精灵被击败时触发 diff --git a/logic/service/fight/node/fight.go b/logic/service/fight/node/fight.go index d00a79d2c..307de7de8 100644 --- a/logic/service/fight/node/fight.go +++ b/logic/service/fight/node/fight.go @@ -30,3 +30,12 @@ func (e *EffectNode) HookAction() bool { // panic("not implemented") // TODO: Implement return true } +func (e *EffectNode) Skill_Use_ex() bool { + // panic("not implemented") // TODO: Implement + return true +} + +func (e *EffectNode) Skill_Use() bool { + // panic("not implemented") // TODO: Implement + return true +}