From a76a7e680e211460200d25ff1215a7f125a78308 Mon Sep 17 00:00:00 2001 From: xinian Date: Sat, 7 Mar 2026 20:18:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=88=98=E6=96=97?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=B8=AD=E7=9A=84=E6=8A=80=E8=83=BD=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E9=A1=BA=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/service/fight/fightc.go | 18 +++++++++++++++++- logic/service/fight/input/interface.go | 1 + logic/service/fight/node/skill.go | 4 ++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index 7ec0f1e2..2dda4502 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -219,7 +219,9 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) f.TrueFirst = attacker } else { + f.TrueFirst = defender + } } @@ -227,6 +229,13 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) attacker.RecoverEffect() currentSkill = nil + if i == 0 { + //反转先后手 + originalSkill = f.copySkill(secondAttack) + f.Second.ReactvieEffect() + currentSkill = originalSkill + attacker, defender = defender, attacker + } } else { f.processSkillAttack(attacker, defender, currentSkill) currentSkill = originalSkill //还原技能 @@ -276,11 +285,18 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) }) } - if defender.CurrentPet.Info.Hp == 0 { + if defender.CurrentPet.Info.Hp <= 0 { f.TURNOVER(defender) break + } else { + //技能使用后 + defender.Exec(func(effect input.Effect) bool { //技能使用后的我方效果 + effect.Ctx().SkillEntity = currentSkill + effect.Action_end_ex() + return true + }) } } diff --git a/logic/service/fight/input/interface.go b/logic/service/fight/input/interface.go index 6d5d7804..c12cc94a 100644 --- a/logic/service/fight/input/interface.go +++ b/logic/service/fight/input/interface.go @@ -38,6 +38,7 @@ type Effect interface { SkillUseed() bool //技能PP减少节点 ActionEndEx() bool Action_end() bool + Action_end_ex() bool //OnDefeat(opp *Input) bool // 精灵被击败时触发 // 首发其实就是切换的精灵为nil diff --git a/logic/service/fight/node/skill.go b/logic/service/fight/node/skill.go index 2e28a4cd..1ef026c8 100644 --- a/logic/service/fight/node/skill.go +++ b/logic/service/fight/node/skill.go @@ -19,6 +19,10 @@ func (e *EffectNode) SkillHit() bool { func (e *EffectNode) SkillHit_ex() bool { return true } +func (e *EffectNode) Action_end_ex() bool { + return true +} + func (e *EffectNode) CalculatePre() bool { return true }