From 499a0ba5ab16affbf5b5508ad702462bd0c4a876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Thu, 12 Mar 2026 21:01:58 +0800 Subject: [PATCH] =?UTF-8?q?```=20fix(fight):=20=E7=A7=BB=E9=99=A4=E6=97=A0?= =?UTF-8?q?=E7=94=A8=E4=BE=9D=E8=B5=96=E5=B9=B6=E4=BC=98=E5=8C=96=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E6=95=88=E6=9E=9C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了github.com/alpacahq/alpacadecimal依赖,简化了生命值恢复计算逻辑 - 修复了effect_4_5.go中技能参数索引错误,统一了概率判定和属性设置的参数使用 --- logic/service/fight/effect/effect_43.go | 5 +---- logic/service/fight/effect/effect_4_5.go | 8 ++++---- logic/service/fight/fightc.go | 10 +++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/logic/service/fight/effect/effect_43.go b/logic/service/fight/effect/effect_43.go index 848d6ed1..bc97c01f 100644 --- a/logic/service/fight/effect/effect_43.go +++ b/logic/service/fight/effect/effect_43.go @@ -4,8 +4,6 @@ import ( "blazing/logic/service/fight/action" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) /** @@ -23,9 +21,8 @@ type Effect43 struct { func (e *Effect43) OnSkill() bool { - tt := alpacadecimal.NewFromInt(int64(e.Ctx().Our.CurrentPet.Info.MaxHp)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))) //fmt.Println("恢复自身最大体量的1/n", tt.IntPart()) - e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, tt) + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0])) return true } diff --git a/logic/service/fight/effect/effect_4_5.go b/logic/service/fight/effect/effect_4_5.go index 1f9ca6c9..8939b396 100644 --- a/logic/service/fight/effect/effect_4_5.go +++ b/logic/service/fight/effect/effect_4_5.go @@ -28,12 +28,12 @@ type Effect4 struct { // 技能触发时调用 // ----------------------------------------------------------- func (e *Effect4) Skill_Use() bool { - ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[0], 100) + ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[1], 100) if !ok { return true } - e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[1]), int8(e.SideEffectArgs[2])) + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[2])) return true } @@ -48,12 +48,12 @@ type Effect5 struct { func (e *Effect5) Skill_Use() bool { // 概率判定 - ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[0], 100) + ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[1], 100) if !ok { return true } - e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[1]), int8(e.SideEffectArgs[2])) + e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[2])) return true } diff --git a/logic/service/fight/fightc.go b/logic/service/fight/fightc.go index 816a0d56..9a953dac 100644 --- a/logic/service/fight/fightc.go +++ b/logic/service/fight/fightc.go @@ -330,12 +330,12 @@ func (f *FightC) enterturn(firstAttack, secondAttack *action.SelectSkillAction) }) f.Switch = make(map[uint32]*action.ActiveSwitchAction) if f.closefight && f.Info.Mode == info.BattleMode.PET_MELEE { - // f.Broadcast(func(fighter *input.Input) { - // if fighter.UserID != f.WinnerId { - // fighter.Player.SendPackCmd(2505, &attackValueResult) - // } + f.Broadcast(func(fighter *input.Input) { + if fighter.UserID != f.WinnerId { + fighter.Player.SendPackCmd(2505, &attackValueResult) + } - // }) + }) return } f.Broadcast(func(fighter *input.Input) {