From 61bab929211ed45041851de604d072247916e3b3 Mon Sep 17 00:00:00 2001 From: 1 <1@72wo.cn> Date: Tue, 23 Sep 2025 19:49:17 +0000 Subject: [PATCH] =?UTF-8?q?refactor(fight/input):=20=E5=B0=86Death?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E7=A7=BB=E8=87=B3attr.go=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9EProp=E6=96=B9=E6=B3=95=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=B1=9E=E6=80=A7=E5=8F=98=E6=9B=B4=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=95=88=E6=9E=9C=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../effect/{effect_stat.go => effect_4_5.go} | 5 ++--- logic/service/fight/input/attr.go | 19 +++++++++++++++++++ logic/service/fight/input/input.go | 8 -------- 3 files changed, 21 insertions(+), 11 deletions(-) rename logic/service/fight/effect/{effect_stat.go => effect_4_5.go} (80%) create mode 100644 logic/service/fight/input/attr.go diff --git a/logic/service/fight/effect/effect_stat.go b/logic/service/fight/effect/effect_4_5.go similarity index 80% rename from logic/service/fight/effect/effect_stat.go rename to logic/service/fight/effect/effect_4_5.go index 269013b5..b0e0a2dd 100644 --- a/logic/service/fight/effect/effect_stat.go +++ b/logic/service/fight/effect/effect_4_5.go @@ -46,11 +46,10 @@ func (e *EffectStat) SkillUseEnd(opp *input.Input) { t, _, _ := e.Input.Player.Roll(e.EffectNode.SideEffectArgs[1], 100) if t { if !e.etype { //自身 - - e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]] = int8(int(e.Input.AttackValue.Prop[e.EffectNode.SideEffectArgs[0]]) + e.EffectNode.SideEffectArgs[2]) + e.Input.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]) + opp.Prop(e.EffectNode.SideEffectArgs[0], e.EffectNode.SideEffectArgs[2]) } } diff --git a/logic/service/fight/input/attr.go b/logic/service/fight/input/attr.go new file mode 100644 index 00000000..0bc4c40a --- /dev/null +++ b/logic/service/fight/input/attr.go @@ -0,0 +1,19 @@ +package input + +func (u *Input) Death() { + + u.CurrentPet.Info.Hp = 0 + + //todo 待实现死亡effet + +} + +// 1是添加,-1是减少,0是清除 +func (u *Input) Prop(prop, level int) { + //todo 待交互 + + u.AttackValue.Prop[prop] = u.AttackValue.Prop[prop] + int8(level) + + //todo 待交互 + +} diff --git a/logic/service/fight/input/input.go b/logic/service/fight/input/input.go index 6282439e..fd8f8177 100644 --- a/logic/service/fight/input/input.go +++ b/logic/service/fight/input/input.go @@ -57,14 +57,6 @@ func (i *Input) GetPet(id uint32) (ii *info.BattlePetEntity, Reason info.ChangeP } -func (u *Input) Death() { - - - u.CurrentPet.Info.Hp = 0 - - //todo 待实现死亡effet - -} // GetStatusBonus 获取最高的状态倍率 // 遍历状态数组,返回存在的状态中最高的倍率(无状态则返回1.0) func (i *Input) GetStatusBonus() float64 {