From fb55f18a39f0f8e79949670bf4925aac81bfcc04 Mon Sep 17 00:00:00 2001 From: 1 <1@72wo.cn> Date: Tue, 23 Sep 2025 19:28:19 +0000 Subject: [PATCH] =?UTF-8?q?refactor(fight/effect):=20=E9=87=8D=E6=9E=84Ski?= =?UTF-8?q?llUseEnd=E6=96=B9=E6=B3=95=E7=AD=BE=E5=90=8D=EF=BC=8C=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E6=B7=BB=E5=8A=A0input=E5=8F=82=E6=95=B0=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B1=9E=E6=80=A7=E6=8F=90=E5=8D=87=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logic/service/fight/effect/effect_62.go | 6 +++--- logic/service/fight/effect/effect_stat.go | 16 +++++++++++++--- logic/service/fight/fightc.go | 5 +---- logic/service/fight/input/nodemanger.go | 1 + logic/service/fight/node/attack.go | 4 +--- logic/service/fight/node/skill.go | 3 +++ 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/logic/service/fight/effect/effect_62.go b/logic/service/fight/effect/effect_62.go index a2e5ec437..0a1fa3d6c 100644 --- a/logic/service/fight/effect/effect_62.go +++ b/logic/service/fight/effect/effect_62.go @@ -41,15 +41,15 @@ func (this *Effect62) TurnEnd(e *input.Input) { } -func (this *Effect62) SkillUseEnd() bool { +func (this *Effect62)SkillUseEnd(*input.Input) { if this.Hide { //如果还在隐藏,就直接返回 - return true + //return true } defer func() { //延迟处理 //this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this) //如果生效就移除 }() //否则触发秒杀 在对面使用技能后 - return true + //return true } diff --git a/logic/service/fight/effect/effect_stat.go b/logic/service/fight/effect/effect_stat.go index b6617bfed..269013b5f 100644 --- a/logic/service/fight/effect/effect_stat.go +++ b/logic/service/fight/effect/effect_stat.go @@ -38,10 +38,20 @@ type EffectStat struct { // addrA := unsafe.Pointer(baseAddr + 4) //根据攻击算其他字段 // *(*uint32)(addrA) = 100 // } -func (this *EffectStat) SkillUseEnd() { - if !this.etype { //自身 +func (e *EffectStat) SkillUseEnd(opp *input.Input) { + // for i := 0; i < 6; i++ { //堆叠属性提升 + // ret.FAttack.Prop[i] = int8(attacker.GetProp(i, true)) + // ret.FAttack.Prop[i] = int8(defender.GetProp(i, true)) + // } + t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100) + if t { + if !e.etype { //自身 - } else { //对方 + e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]] = int8(int(e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]]) + e.EffectNode.SideEffectArgs[2]) + } else { //对方 + opp.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]] = int8(int(e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]]) + e.EffectNode.SideEffectArgs[2]) + } } + } diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index ba678d338..d69ac97e9 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -541,10 +541,7 @@ func (f *FightC) enterturn(fattack, sattack BattleActionI) { SAttack: *f.Second.AttackValue, } - for i := 0; i < 6; i++ { //堆叠属性提升 - ret.FAttack.Prop[i] = int8(attacker.GetProp(i, true)) - ret.FAttack.Prop[i] = int8(defender.GetProp(i, true)) - } + for i := 0; i < 20; i++ { //堆叠状态剩余回合 ate, ok := attacker.GetStatusEffect(i) if ok { diff --git a/logic/service/fight/input/nodemanger.go b/logic/service/fight/input/nodemanger.go index 4131c0925..0ec643ad0 100644 --- a/logic/service/fight/input/nodemanger.go +++ b/logic/service/fight/input/nodemanger.go @@ -15,6 +15,7 @@ type Effect interface { OnTurnStart(opp *Input) bool //回合开始 UseSkill(opp *Input) bool //使用技能 可以取消用技能节点 + SkillUseEnd(opp *Input) // OnSkillPP() bool //技能PP减少节点 // BeforeMultiHit() bool //多段攻击前 // BeforeHit() bool //命中前 diff --git a/logic/service/fight/node/attack.go b/logic/service/fight/node/attack.go index 4015c36a2..7917564b4 100644 --- a/logic/service/fight/node/attack.go +++ b/logic/service/fight/node/attack.go @@ -16,9 +16,7 @@ func (this *EffectNode) TakeHit(opp *input.Input, skill *info.SkillEntity) { } -func (this *EffectNode) SkillUseEnd() bool { - panic("not implemented") // TODO: Implement -} + func (this *EffectNode) BeforeMultiHit() bool { panic("not implemented") // TODO: Implement diff --git a/logic/service/fight/node/skill.go b/logic/service/fight/node/skill.go index 2bc51adf8..ec2f4fee0 100644 --- a/logic/service/fight/node/skill.go +++ b/logic/service/fight/node/skill.go @@ -18,3 +18,6 @@ func (e *EffectNode) OnSkill(opp *input.Input, skill *info.SkillEntity) { func (e *EffectNode) OnSkillPP() bool { panic("not implemented") // TODO: Implement } +func (this *EffectNode) SkillUseEnd(*input.Input) { + +}