From 91690658b5d23d09289721b735512855536eabc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Sat, 6 Dec 2025 15:11:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(boss-effect):=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=EF=BC=8C=E6=8F=90=E5=8D=87=E6=95=B0=E5=80=BC=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E4=B8=8E=E8=BF=90=E7=AE=97=E5=87=86=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对多个 boss 技能效果文件中的参数调用进行了统一调整,将原先直接使用 `e.Args()[index]` 的地方, 改为通过 `e.Args()[index].IntPart()` 或 `e.Args()[index]` 进行类型转换后再参与逻辑判断或数值计算。 同时修正了部分 HP 比较方式,由整型比较转为 decimal --- logic/service/fight/boss/NewSeIdx_12.go | 4 ++-- logic/service/fight/boss/NewSeIdx_17.go | 2 +- logic/service/fight/boss/NewSeIdx_22.go | 4 +--- logic/service/fight/boss/NewSeIdx_23.go | 8 +++---- logic/service/fight/boss/NewSeIdx_24.go | 5 +++-- logic/service/fight/boss/NewSeIdx_27.go | 2 +- logic/service/fight/boss/NewSeIdx_28.go | 4 ++-- logic/service/fight/boss/NewSeIdx_29.go | 2 +- logic/service/fight/boss/NewSeIdx_3.go | 2 +- logic/service/fight/boss/NewSeIdx_31.go | 4 ++-- logic/service/fight/boss/NewSeIdx_32.go | 4 ++-- logic/service/fight/boss/NewSeIdx_33.go | 6 ++---- logic/service/fight/boss/NewSeIdx_34.go | 4 ++-- logic/service/fight/boss/NewSeIdx_35.go | 4 ++-- logic/service/fight/boss/NewSeIdx_36.go | 4 ++-- logic/service/fight/boss/NewSeIdx_37.go | 4 ++-- logic/service/fight/boss/NewSeIdx_38.go | 2 +- logic/service/fight/boss/NewSeIdx_39.go | 4 +--- logic/service/fight/boss/NewSeIdx_40.go | 2 +- logic/service/fight/boss/NewSeIdx_41.go | 4 +--- logic/service/fight/boss/NewSeIdx_44.go | 2 +- logic/service/fight/boss/NewSeIdx_45.go | 2 +- logic/service/fight/boss/NewSeIdx_5.go | 6 +++--- logic/service/fight/boss/NewSeIdx_50.go | 5 +++-- logic/service/fight/boss/NewSeIdx_6.go | 4 ++-- logic/service/fight/boss/NewSeIdx_61.go | 2 +- logic/service/fight/boss/NewSeIdx_62.go | 4 ++-- logic/service/fight/boss/NewSeIdx_63.go | 6 ++---- logic/service/fight/boss/NewSeIdx_64.go | 2 +- logic/service/fight/boss/NewSeIdx_65.go | 6 ++---- logic/service/fight/boss/NewSeIdx_66.go | 2 +- logic/service/fight/boss/NewSeIdx_67.go | 2 +- logic/service/fight/boss/NewSeIdx_7.go | 2 +- logic/service/fight/boss/NewSeIdx_8_30.go | 2 +- logic/service/fight/boss/NewSeIdx_9.go | 4 ++-- .../fight/effect/EffectDefeatTrigger.go | 2 +- .../effect/EffectPhysicalAttackAddStatus.go | 2 +- logic/service/fight/effect/effect_101.go | 2 +- logic/service/fight/effect/effect_105.go | 4 +--- logic/service/fight/effect/effect_107.go | 2 +- logic/service/fight/effect/effect_115.go | 2 +- logic/service/fight/effect/effect_130.go | 2 +- logic/service/fight/effect/effect_134.go | 8 +++---- logic/service/fight/effect/effect_135.go | 4 ++-- logic/service/fight/effect/effect_136.go | 4 +--- logic/service/fight/effect/effect_28.go | 4 +--- logic/service/fight/effect/effect_34.go | 2 +- logic/service/fight/effect/effect_36.go | 2 +- logic/service/fight/effect/effect_37.go | 6 ++---- logic/service/fight/effect/effect_38.go | 4 ++-- logic/service/fight/effect/effect_41.go | 5 +++-- logic/service/fight/effect/effect_46.go | 4 ++-- logic/service/fight/effect/effect_47.go | 2 +- logic/service/fight/effect/effect_48.go | 2 +- logic/service/fight/effect/effect_49.go | 6 ++---- logic/service/fight/effect/effect_54.go | 4 +--- logic/service/fight/effect/effect_57.go | 4 +--- logic/service/fight/effect/effect_59.go | 4 ++-- logic/service/fight/effect/effect_65.go | 4 ++-- logic/service/fight/effect/effect_68.go | 2 +- logic/service/fight/effect/effect_7.go | 20 +++++++++++++++++- logic/service/fight/effect/effect_76.go | 2 +- logic/service/fight/effect/effect_77.go | 4 +--- logic/service/fight/effect/effect_8.go | 21 +++++++++++++++++-- logic/service/fight/effect/effect_88.go | 6 ++---- logic/service/fight/effect/effect_89.go | 4 +--- logic/service/fight/effect/effect_93.go | 2 +- logic/service/fight/effect/effect_95.go | 2 +- .../effect_EffectConditionalAddDamage.go | 2 +- logic/service/fight/input/effect.go | 5 +++-- logic/service/fight/input/fight.go | 6 +++--- logic/service/fight/input/interface.go | 16 +++++++------- logic/service/fight/node/dagame.go | 6 +++--- logic/service/fight/node/node.go | 12 +++++++++-- .../service/pet_fusion_material_service.go | 2 +- public/config/bossbuff和特性.xml | 6 +++--- 76 files changed, 172 insertions(+), 157 deletions(-) diff --git a/logic/service/fight/boss/NewSeIdx_12.go b/logic/service/fight/boss/NewSeIdx_12.go index 1feb8a838..d20fe06d2 100644 --- a/logic/service/fight/boss/NewSeIdx_12.go +++ b/logic/service/fight/boss/NewSeIdx_12.go @@ -26,12 +26,12 @@ func (e *NewSel12) Damage_DIV_ex(t *info.DamageZone) bool { return true } // 3. 概率判定(Args()[1]为触发概率) - success, _, _ := e.Input.Player.Roll(e.Args()[1], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) if !success { return true } - e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0]), 1, info.AbilityOpType.ADD) + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), 1, info.AbilityOpType.ADD) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_17.go b/logic/service/fight/boss/NewSeIdx_17.go index 2ec148f9c..afc4ad092 100644 --- a/logic/service/fight/boss/NewSeIdx_17.go +++ b/logic/service/fight/boss/NewSeIdx_17.go @@ -24,7 +24,7 @@ func (e *NewSel17) Action_start(a, b *action.SelectSkillAction) bool { return true } - if e.Ctx().Our.CurrentPet.HP <= int(e.Args()[0]) { + if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Args()[0]) == -1 { e.Ctx().SkillEntity.CritRate = 16 } diff --git a/logic/service/fight/boss/NewSeIdx_22.go b/logic/service/fight/boss/NewSeIdx_22.go index 4f3e8d1fa..c39a98ffe 100644 --- a/logic/service/fight/boss/NewSeIdx_22.go +++ b/logic/service/fight/boss/NewSeIdx_22.go @@ -3,8 +3,6 @@ package effect import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" - - "github.com/alpacahq/alpacadecimal" ) // 22. 被打时受到直接攻击伤害提高至n倍;(a1: n) @@ -21,7 +19,7 @@ func (e *NewSel22) Damage_DIV_ex(t *info.DamageZone) bool { if t.Type != info.DamageType.Red { return true } - t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0]))) + t.Damage = t.Damage.Mul(e.Args()[0]) return true diff --git a/logic/service/fight/boss/NewSeIdx_23.go b/logic/service/fight/boss/NewSeIdx_23.go index ef292becd..280d10d52 100644 --- a/logic/service/fight/boss/NewSeIdx_23.go +++ b/logic/service/fight/boss/NewSeIdx_23.go @@ -35,8 +35,8 @@ func (e *NewSel23) Compare_Pre(fattack *action.SelectSkillAction, sattack *actio return true } - full32 := int(e.Args()[0])<<16 | int(e.Args()[1]) - if int(e.Ctx().Our.CurrentPet.Info.Hp) <= full32 { + //full32 := int(e.Args()[0])<<16 | int(e.Args()[1]) + if int(e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Args()[0])) == -1 { sattack.SkillEntity.Priority = math.MaxInt } @@ -44,8 +44,8 @@ func (e *NewSel23) Compare_Pre(fattack *action.SelectSkillAction, sattack *actio } func (e *NewSel23) OnSkill() bool { - full32 := int(e.Args()[0])<<16 | int(e.Args()[1]) - if int(e.Ctx().Our.CurrentPet.Info.Hp) <= full32 { + //full32 := int(e.Args()[0])<<16 | int(e.Args()[1]) + if int(e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Args()[0])) == -1 { e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ Type: info.DamageType.Red, diff --git a/logic/service/fight/boss/NewSeIdx_24.go b/logic/service/fight/boss/NewSeIdx_24.go index 95b8bc98d..4623a4f6c 100644 --- a/logic/service/fight/boss/NewSeIdx_24.go +++ b/logic/service/fight/boss/NewSeIdx_24.go @@ -3,6 +3,7 @@ package effect import ( "blazing/logic/service/fight/input" + "github.com/alpacahq/alpacadecimal" "github.com/samber/lo" ) @@ -22,9 +23,9 @@ func (e *NewSel24) Skill_Hit_ex() bool { return true } - _, ok := lo.Find(e.Args(), func(item int) bool { + _, ok := lo.Find(e.Args(), func(item alpacadecimal.Decimal) bool { - return skill.ID == item + return skill.ID == int(item.IntPart()) }) if !ok { return true diff --git a/logic/service/fight/boss/NewSeIdx_27.go b/logic/service/fight/boss/NewSeIdx_27.go index 912a1b8a9..34ef1a769 100644 --- a/logic/service/fight/boss/NewSeIdx_27.go +++ b/logic/service/fight/boss/NewSeIdx_27.go @@ -30,7 +30,7 @@ func (e *NewSel27) Damage_DIV_ex(t *info.DamageZone) bool { e.index = 0 } - if e.Args()[e.index] == e.Ctx().SkillEntity.Type { + if int(e.Args()[e.index].IntPart()) == e.Ctx().SkillEntity.Type { e.index++ return true } diff --git a/logic/service/fight/boss/NewSeIdx_28.go b/logic/service/fight/boss/NewSeIdx_28.go index 36ea82a69..e9c54b2bd 100644 --- a/logic/service/fight/boss/NewSeIdx_28.go +++ b/logic/service/fight/boss/NewSeIdx_28.go @@ -21,10 +21,10 @@ func (e *NewSel28) Damage_ADD(t *info.DamageZone) bool { return true } - if e.Ctx().SkillEntity.Type != int(e.Args()[0]) { + if e.Ctx().SkillEntity.Type != int(e.Args()[0].IntPart()) { return true } - t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[1])).Div(alpacadecimal.NewFromInt(100)))) + t.Damage = t.Damage.Add(t.Damage.Mul(e.Args()[1]).Div(alpacadecimal.NewFromInt(100))) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_29.go b/logic/service/fight/boss/NewSeIdx_29.go index c62662126..8c4cbdbc0 100644 --- a/logic/service/fight/boss/NewSeIdx_29.go +++ b/logic/service/fight/boss/NewSeIdx_29.go @@ -23,7 +23,7 @@ func (e *NewSel29) Action_start(a, b *action.SelectSkillAction) bool { if e.Ctx().SkillEntity.Category() == info.Category.STATUS { return true } - e.Ctx().SkillEntity.Accuracy += e.Args()[0] + e.Ctx().SkillEntity.Accuracy += int(e.Args()[0].IntPart()) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_3.go b/logic/service/fight/boss/NewSeIdx_3.go index d0160079a..eee7dc4d8 100644 --- a/logic/service/fight/boss/NewSeIdx_3.go +++ b/logic/service/fight/boss/NewSeIdx_3.go @@ -20,7 +20,7 @@ func (e *NewSel3) Damage_DIV_ex(t *info.DamageZone) bool { } if t.Type == info.DamageType.Red { - reduceRatio := alpacadecimal.NewFromInt(100).Sub(alpacadecimal.NewFromInt(int64(e.Args()[0]))).Div(alpacadecimal.NewFromInt(100)) + reduceRatio := alpacadecimal.NewFromInt(100).Sub(e.Args()[0]).Div(alpacadecimal.NewFromInt(100)) t.Damage = t.Damage.Mul(reduceRatio) } diff --git a/logic/service/fight/boss/NewSeIdx_31.go b/logic/service/fight/boss/NewSeIdx_31.go index 699a24406..aaa0780b1 100644 --- a/logic/service/fight/boss/NewSeIdx_31.go +++ b/logic/service/fight/boss/NewSeIdx_31.go @@ -15,14 +15,14 @@ func (e *NewSel31) Action_end_ex() bool { return true } // 3. 概率判定(Args()[1]为触发概率) - success, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !success { return true } if e.Ctx().Our.CurrentPet.Info.Hp == 0 { - e.Ctx().Our.CurrentPet.Info.Hp = uint32(e.Args()[1]) + e.Ctx().Our.CurrentPet.Info.Hp = uint32(e.Args()[1].IntPart()) } diff --git a/logic/service/fight/boss/NewSeIdx_32.go b/logic/service/fight/boss/NewSeIdx_32.go index 754f0cbbe..bb458ee33 100644 --- a/logic/service/fight/boss/NewSeIdx_32.go +++ b/logic/service/fight/boss/NewSeIdx_32.go @@ -18,14 +18,14 @@ func (e *NewSel32) OnSkill() bool { return true } - success, _, _ := e.Input.Player.Roll(e.Args()[0]/10, 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[0].Div(alpacadecimal.NewFromInt(10)).IntPart()), 100) if !success { return true } e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ Type: info.DamageType.Fixed, - Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)), + Damage: e.Ctx().Opp.CurrentPet.GetHP(), }) return true } diff --git a/logic/service/fight/boss/NewSeIdx_33.go b/logic/service/fight/boss/NewSeIdx_33.go index d9c872497..f7d03207c 100644 --- a/logic/service/fight/boss/NewSeIdx_33.go +++ b/logic/service/fight/boss/NewSeIdx_33.go @@ -2,8 +2,6 @@ package effect import ( "blazing/logic/service/fight/input" - - "github.com/alpacahq/alpacadecimal" ) // 33. 精灵体力降低到 1/n 时有 m% 几率体力回满;(a1: n, a2: m 百分比) @@ -18,9 +16,9 @@ func (e *NewSel33) Action_end_ex() bool { } // 3. 概率判定(Args()[1]为触发概率) - cmp := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[0]))) + cmp := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0]) if e.Ctx().Our.CurrentPet.GetHP().Cmp(cmp) == -1 { - success, _, _ := e.Input.Player.Roll(e.Args()[1], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) if !success { return true } diff --git a/logic/service/fight/boss/NewSeIdx_34.go b/logic/service/fight/boss/NewSeIdx_34.go index de24bdc86..0dddfef26 100644 --- a/logic/service/fight/boss/NewSeIdx_34.go +++ b/logic/service/fight/boss/NewSeIdx_34.go @@ -25,12 +25,12 @@ func (e *NewSel34) Damage_DIV_ex(t *info.DamageZone) bool { } // 3. 概率判定(Args()[1]为触发概率) - success, _, _ := e.Input.Player.Roll(e.Args()[1], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) if !success { return true } - e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[0]), -1, info.AbilityOpType.SUB) + e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[0].IntPart()), -1, info.AbilityOpType.SUB) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_35.go b/logic/service/fight/boss/NewSeIdx_35.go index 7fe28416e..aa9fa46eb 100644 --- a/logic/service/fight/boss/NewSeIdx_35.go +++ b/logic/service/fight/boss/NewSeIdx_35.go @@ -24,12 +24,12 @@ func (e *NewSel35) Damage_DIV_ex(t *info.DamageZone) bool { } // 3. 概率判定(Args()[1]为触发概率) - success, _, _ := e.Input.Player.Roll(e.Args()[1], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) if !success { return true } - e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0]), 1, info.AbilityOpType.ADD) + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), 1, info.AbilityOpType.ADD) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_36.go b/logic/service/fight/boss/NewSeIdx_36.go index c8b5c4c8d..fb90ecb0d 100644 --- a/logic/service/fight/boss/NewSeIdx_36.go +++ b/logic/service/fight/boss/NewSeIdx_36.go @@ -29,7 +29,7 @@ func (e *NewSel36) Turn_Start(fattack *action.SelectSkillAction, sattack *action } func (e *NewSel36) Damage_DIV_ex(t *info.DamageZone) bool { - e.Ctx().Our.AttackValue.State = uint32(e.Args()[e.index]) + e.Ctx().Our.AttackValue.State = uint32(e.Args()[e.index].IntPart()) //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { @@ -43,7 +43,7 @@ func (e *NewSel36) Damage_DIV_ex(t *info.DamageZone) bool { return true } - if e.Args()[e.index] != e.Ctx().SkillEntity.Type { + if int(e.Args()[e.index].IntPart()) != e.Ctx().SkillEntity.Type { t.Damage = alpacadecimal.NewFromInt(0) } diff --git a/logic/service/fight/boss/NewSeIdx_37.go b/logic/service/fight/boss/NewSeIdx_37.go index 4b5dc1171..6b41d6d61 100644 --- a/logic/service/fight/boss/NewSeIdx_37.go +++ b/logic/service/fight/boss/NewSeIdx_37.go @@ -11,7 +11,7 @@ type NewSel37 struct { NewSel0 } -func (e *NewSel37) Damage_Lock_ex(t *info.DamageZone) bool { +func (e *NewSel37) DamageLock_ex(t *info.DamageZone) bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } @@ -20,7 +20,7 @@ func (e *NewSel37) Damage_Lock_ex(t *info.DamageZone) bool { return true } - if t.Damage.IntPart() > int64(e.Args()[0]) { + if t.Damage.IntPart() > int64(e.Args()[0].IntPart()) { e.Ctx().Opp.CurrentPet.Info.Hp = 0 diff --git a/logic/service/fight/boss/NewSeIdx_38.go b/logic/service/fight/boss/NewSeIdx_38.go index b35659e0b..fb5b42396 100644 --- a/logic/service/fight/boss/NewSeIdx_38.go +++ b/logic/service/fight/boss/NewSeIdx_38.go @@ -19,7 +19,7 @@ func (e *NewSel39) Damage_ADD(t *info.DamageZone) bool { return true } - t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0])))) + t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0].IntPart())))) return true } diff --git a/logic/service/fight/boss/NewSeIdx_39.go b/logic/service/fight/boss/NewSeIdx_39.go index c6dafba0b..6fe75e642 100644 --- a/logic/service/fight/boss/NewSeIdx_39.go +++ b/logic/service/fight/boss/NewSeIdx_39.go @@ -3,8 +3,6 @@ package effect import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" - - "github.com/alpacahq/alpacadecimal" ) // 39. 偶数伤害(dmg) 提升到 n * dmg;(a1: n) @@ -23,7 +21,7 @@ func (e *NewSel39) Damage_Mul(t *info.DamageZone) bool { return true } - t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0]))) + t.Damage = t.Damage.Mul(e.Args()[0]) return true } diff --git a/logic/service/fight/boss/NewSeIdx_40.go b/logic/service/fight/boss/NewSeIdx_40.go index b397b7735..c12e1e977 100644 --- a/logic/service/fight/boss/NewSeIdx_40.go +++ b/logic/service/fight/boss/NewSeIdx_40.go @@ -23,7 +23,7 @@ func (e *NewSel40) Damage_DIV_ex(t *info.DamageZone) bool { return true } - t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(1).Div(alpacadecimal.NewFromInt(int64(e.Args()[0])))) + t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(1).Div(e.Args()[0])) return true } diff --git a/logic/service/fight/boss/NewSeIdx_41.go b/logic/service/fight/boss/NewSeIdx_41.go index 5fb4e003d..bfc244668 100644 --- a/logic/service/fight/boss/NewSeIdx_41.go +++ b/logic/service/fight/boss/NewSeIdx_41.go @@ -2,8 +2,6 @@ package effect import ( "blazing/logic/service/fight/input" - - "github.com/alpacahq/alpacadecimal" ) // 41. 每回合恢复自身n点体力;(a1: n) @@ -14,7 +12,7 @@ type NewSel41 struct { func (e *NewSel41) Turn_End() { - e.Ctx().Our.Heal(e.Ctx().Our, nil, alpacadecimal.NewFromInt(int64(e.Args()[0]))) + e.Ctx().Our.Heal(e.Ctx().Our, nil, e.Args()[0]) } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_44.go b/logic/service/fight/boss/NewSeIdx_44.go index 146abe320..01845cbcd 100644 --- a/logic/service/fight/boss/NewSeIdx_44.go +++ b/logic/service/fight/boss/NewSeIdx_44.go @@ -17,7 +17,7 @@ func (e *NewSel44) Action_end_ex() bool { } if e.Ctx().Our.CurrentPet.Info.Hp == 0 { - if e.count >= e.Args()[0] { + if e.count >= int(e.Args()[0].IntPart()) { return true } diff --git a/logic/service/fight/boss/NewSeIdx_45.go b/logic/service/fight/boss/NewSeIdx_45.go index 3c1e0d1bc..261c28814 100644 --- a/logic/service/fight/boss/NewSeIdx_45.go +++ b/logic/service/fight/boss/NewSeIdx_45.go @@ -23,7 +23,7 @@ func (e *NewSel45) Action_start(a, b *action.SelectSkillAction) bool { if e.Ctx().SkillEntity.Category() == info.Category.STATUS { return true } - e.Ctx().SkillEntity.CritRate = e.Args()[0] + e.Ctx().SkillEntity.CritRate = int(e.Args()[0].IntPart()) return true } diff --git a/logic/service/fight/boss/NewSeIdx_5.go b/logic/service/fight/boss/NewSeIdx_5.go index 44215c1fe..e4165b39c 100644 --- a/logic/service/fight/boss/NewSeIdx_5.go +++ b/logic/service/fight/boss/NewSeIdx_5.go @@ -14,7 +14,7 @@ type NewSel5 struct { NewSel0 } -func (e *NewSel5) Damage_Lock_ex(t *info.DamageZone) bool { +func (e *NewSel5) DamageLock_ex(t *info.DamageZone) bool { //魂印特性有不在场的情况,绑定时候将精灵和特性绑定 if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true @@ -23,8 +23,8 @@ func (e *NewSel5) Damage_Lock_ex(t *info.DamageZone) bool { return true } - _, ok := lo.Find(append(e.Args(), 8), func(item int) bool { - return item == e.Ctx().SkillEntity.Type + _, ok := lo.Find(append(e.Args(), alpacadecimal.NewFromInt(8)), func(item alpacadecimal.Decimal) bool { + return int(item.IntPart()) == e.Ctx().SkillEntity.Type }) if !ok { return true diff --git a/logic/service/fight/boss/NewSeIdx_50.go b/logic/service/fight/boss/NewSeIdx_50.go index 0c5437205..fd1615ff2 100644 --- a/logic/service/fight/boss/NewSeIdx_50.go +++ b/logic/service/fight/boss/NewSeIdx_50.go @@ -3,6 +3,7 @@ package effect import ( "blazing/logic/service/fight/input" + "github.com/alpacahq/alpacadecimal" "github.com/samber/lo" ) @@ -22,9 +23,9 @@ func (e *NewSel50) EFFect_Befer(in *input.Input, effEffect input.Effect) bool { if in != e.Ctx().Opp { return true } - _, ok := lo.Find(e.Args(), func(item int) bool { + _, ok := lo.Find(e.Args(), func(item alpacadecimal.Decimal) bool { - return effEffect.ID().Suffix() == uint16(item) + return effEffect.ID().Suffix() == uint16(item.IntPart()) }) if ok { return false diff --git a/logic/service/fight/boss/NewSeIdx_6.go b/logic/service/fight/boss/NewSeIdx_6.go index d7130a2e2..0a7ad5efe 100644 --- a/logic/service/fight/boss/NewSeIdx_6.go +++ b/logic/service/fight/boss/NewSeIdx_6.go @@ -24,7 +24,7 @@ func (e *NewSel6) Action_end_ex() bool { } // 3. 概率判定(Args()[1]为触发概率) - success, _, _ := e.Input.Player.Roll(e.Args()[1], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) if !success { return true } @@ -32,7 +32,7 @@ func (e *NewSel6) Action_end_ex() bool { duration := int(e.Input.FightC.GetRand().Int31n(2)) // 默认随机 2~3 回合 duration++ // 5. 获取状态效果实例并设置参数 - statusEffect := input.Geteffect(input.EffectType.Status, int(e.Args()[0])) + statusEffect := input.Geteffect(input.EffectType.Status, int(e.Args()[0].IntPart())) if statusEffect == nil { return true } diff --git a/logic/service/fight/boss/NewSeIdx_61.go b/logic/service/fight/boss/NewSeIdx_61.go index a17d6d5c8..c65c5f221 100644 --- a/logic/service/fight/boss/NewSeIdx_61.go +++ b/logic/service/fight/boss/NewSeIdx_61.go @@ -21,7 +21,7 @@ func (e *NewSel61) Damage_DIV_ex(t *info.DamageZone) bool { return true } // 3. 概率判定(Args()[1]为触发概率) - success, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !success { return true } diff --git a/logic/service/fight/boss/NewSeIdx_62.go b/logic/service/fight/boss/NewSeIdx_62.go index 7e6cd09b9..23c84da50 100644 --- a/logic/service/fight/boss/NewSeIdx_62.go +++ b/logic/service/fight/boss/NewSeIdx_62.go @@ -24,11 +24,11 @@ func (e *NewSel62) Damage_ADD(t *info.DamageZone) bool { if e.Ctx().SkillEntity.Category() != info.Category.PHYSICAL { return true } - success, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !success { return true } - t.Damage = t.Damage.Add(alpacadecimal.NewFromInt(int64(e.Args()[1]))) + t.Damage = t.Damage.Add(alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_63.go b/logic/service/fight/boss/NewSeIdx_63.go index 36150ad37..283aea754 100644 --- a/logic/service/fight/boss/NewSeIdx_63.go +++ b/logic/service/fight/boss/NewSeIdx_63.go @@ -3,8 +3,6 @@ package effect import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" - - "github.com/alpacahq/alpacadecimal" ) // 63. 特殊攻击有n%几率使伤害提高m点(a1: n, a2: m) @@ -24,11 +22,11 @@ func (e *NewSel63) Damage_ADD(t *info.DamageZone) bool { if e.Ctx().SkillEntity.Category() != info.Category.SPECIAL { return true } - success, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !success { return true } - t.Damage = t.Damage.Add(alpacadecimal.NewFromInt(int64(e.Args()[1]))) + t.Damage = t.Damage.Add(e.Args()[1]) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_64.go b/logic/service/fight/boss/NewSeIdx_64.go index 9e6952f5a..1c5f6bd63 100644 --- a/logic/service/fight/boss/NewSeIdx_64.go +++ b/logic/service/fight/boss/NewSeIdx_64.go @@ -20,7 +20,7 @@ func (e *NewSel64) Skill_Hit_ex() bool { return true } - skill.CritRate -= int(e.Args()[0]) + skill.CritRate -= int(e.Args()[0].IntPart()) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_65.go b/logic/service/fight/boss/NewSeIdx_65.go index 5d1ad15b6..232b3c9d5 100644 --- a/logic/service/fight/boss/NewSeIdx_65.go +++ b/logic/service/fight/boss/NewSeIdx_65.go @@ -3,8 +3,6 @@ package effect import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" - - "github.com/alpacahq/alpacadecimal" ) // 65. 物理攻击或特殊攻击伤害增加m%(a1: 1=物理/3=特殊, a2: m) @@ -21,11 +19,11 @@ func (e *NewSel65) Damage_ADD(t *info.DamageZone) bool { return true } - if e.Ctx().SkillEntity.Category() != info.EnumCategory(e.Args()[0]) { + if e.Ctx().SkillEntity.Category() != info.EnumCategory(e.Args()[0].IntPart()) { return true } - t.Damage = t.Damage.Add(t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[1])))) + t.Damage = t.Damage.Add(t.Damage.Mul(e.Args()[1])) return true } func init() { diff --git a/logic/service/fight/boss/NewSeIdx_66.go b/logic/service/fight/boss/NewSeIdx_66.go index 569dd10d4..79295b129 100644 --- a/logic/service/fight/boss/NewSeIdx_66.go +++ b/logic/service/fight/boss/NewSeIdx_66.go @@ -32,7 +32,7 @@ func (e *NewSel66) OnSkill() bool { duration++ // 获取状态效果 - eff := input.Geteffect(input.EffectType.Status, int(e.Args()[1])) + eff := input.Geteffect(input.EffectType.Status, int(e.Args()[1].IntPart())) if eff == nil { return true } diff --git a/logic/service/fight/boss/NewSeIdx_67.go b/logic/service/fight/boss/NewSeIdx_67.go index 8d94978ba..a37dd9293 100644 --- a/logic/service/fight/boss/NewSeIdx_67.go +++ b/logic/service/fight/boss/NewSeIdx_67.go @@ -32,7 +32,7 @@ func (e *NewSel67) OnSkill() bool { duration++ // 获取状态效果 - eff := input.Geteffect(input.EffectType.Status, int(e.Args()[1])) + eff := input.Geteffect(input.EffectType.Status, int(e.Args()[1].IntPart())) if eff == nil { return true } diff --git a/logic/service/fight/boss/NewSeIdx_7.go b/logic/service/fight/boss/NewSeIdx_7.go index be0a84128..027af4144 100644 --- a/logic/service/fight/boss/NewSeIdx_7.go +++ b/logic/service/fight/boss/NewSeIdx_7.go @@ -22,7 +22,7 @@ func (e *NewSel7) Skill_Hit_ex() bool { if skill.AttackTime == 2 { return true } - success, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if success { skill.SetMiss() diff --git a/logic/service/fight/boss/NewSeIdx_8_30.go b/logic/service/fight/boss/NewSeIdx_8_30.go index bc0793962..7eb753b1b 100644 --- a/logic/service/fight/boss/NewSeIdx_8_30.go +++ b/logic/service/fight/boss/NewSeIdx_8_30.go @@ -23,7 +23,7 @@ func (e *NewSel30) Action_start(a, b *action.SelectSkillAction) bool { if e.Ctx().SkillEntity.Category() == info.Category.STATUS { return true } - e.Ctx().SkillEntity.CritRate += e.Args()[0] + e.Ctx().SkillEntity.CritRate += int(e.Args()[0].IntPart()) return true } diff --git a/logic/service/fight/boss/NewSeIdx_9.go b/logic/service/fight/boss/NewSeIdx_9.go index 4a8577324..38c07e5e1 100644 --- a/logic/service/fight/boss/NewSeIdx_9.go +++ b/logic/service/fight/boss/NewSeIdx_9.go @@ -14,8 +14,8 @@ func (e *NewSel9) Action_end_ex() bool { if e.ID().GetCatchTime() != e.Ctx().Our.CurrentPet.Info.CatchTime { return true } - full32 := int64(e.Args()[0])<<32 | int64(e.Args()[1]) - if e.Ctx().Our.CurrentPet.Info.Hp > uint32(e.Args()[0]) && e.Ctx().Our.CurrentPet.Info.Hp < uint32(full32) { + + if e.Ctx().Our.CurrentPet.GetHP().Cmp(e.Args()[0]) == -1 { e.Ctx().Our.Heal(e.Ctx().Our, nil, e.Ctx().Our.CurrentPet.GetMaxHP()) diff --git a/logic/service/fight/effect/EffectDefeatTrigger.go b/logic/service/fight/effect/EffectDefeatTrigger.go index c00592353..fa0524e98 100644 --- a/logic/service/fight/effect/EffectDefeatTrigger.go +++ b/logic/service/fight/effect/EffectDefeatTrigger.go @@ -98,7 +98,7 @@ func (e *EffectDefeatTrigger) triggerByID(at info.AttackValue) { // ----------------------------------------------------------- // triggerHealSelfOnDefeat:击败对方后,恢复自身最大体力的1/n(对应Effect66) -func (e *EffectDefeatTrigger) triggerHealSelfOnDefeat(at info.AttackValue) { +func (e *EffectDefeatTrigger) triggerHealSelfOnDefeat(_ info.AttackValue) { // 计算恢复量:自身最大体力 / n(n=SideEffectArgs[0]) maxHP := e.Ctx().Our.CurrentPet.Info.MaxHp healAmount := alpacadecimal.NewFromInt(int64(maxHP)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))) diff --git a/logic/service/fight/effect/EffectPhysicalAttackAddStatus.go b/logic/service/fight/effect/EffectPhysicalAttackAddStatus.go index 4d7c1d8b9..c41bde459 100644 --- a/logic/service/fight/effect/EffectPhysicalAttackAddStatus.go +++ b/logic/service/fight/effect/EffectPhysicalAttackAddStatus.go @@ -59,7 +59,7 @@ func (e *EffectPhysicalAttackAddStatus) Skill_Use_ex() bool { } // 3. 概率判定(Args()[1]为触发概率) - success, _, _ := e.Input.Player.Roll(e.Args()[1], 100) + success, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100) if !success { return true } diff --git a/logic/service/fight/effect/effect_101.go b/logic/service/fight/effect/effect_101.go index 0181a456f..5ffedfa26 100644 --- a/logic/service/fight/effect/effect_101.go +++ b/logic/service/fight/effect/effect_101.go @@ -28,7 +28,7 @@ func (e *Effect101) OnSkill() bool { } e.Input.Heal( - e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Mul(alpacadecimal.NewFromInt(int64(e.Args()[0])).Div(alpacadecimal.NewFromInt(100))), + e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Mul(e.Args()[0].Div(alpacadecimal.NewFromInt(100))), ) return true } diff --git a/logic/service/fight/effect/effect_105.go b/logic/service/fight/effect/effect_105.go index 0654c1b65..92d43f177 100644 --- a/logic/service/fight/effect/effect_105.go +++ b/logic/service/fight/effect/effect_105.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" ) /** @@ -28,7 +26,7 @@ func (e *Effect105) OnSkill() bool { } e.Input.Heal( - e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(int64(e.Args()[0]))), + e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(e.Args()[0]), ) return true } diff --git a/logic/service/fight/effect/effect_107.go b/logic/service/fight/effect/effect_107.go index 2262a4c23..d33742fd2 100644 --- a/logic/service/fight/effect/effect_107.go +++ b/logic/service/fight/effect/effect_107.go @@ -31,7 +31,7 @@ func (e *Effect107) Skill_Useed() bool { //说明伤害小于N if d == -1 { - e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[1]), 1, info.AbilityOpType.ADD) + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[1].IntPart()), 1, info.AbilityOpType.ADD) } return true } diff --git a/logic/service/fight/effect/effect_115.go b/logic/service/fight/effect/effect_115.go index e57fde665..019e689b1 100644 --- a/logic/service/fight/effect/effect_115.go +++ b/logic/service/fight/effect/effect_115.go @@ -28,7 +28,7 @@ func (e *Effect115) OnSkill() bool { return true } // 概率判定 - ok, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !ok { return true } diff --git a/logic/service/fight/effect/effect_130.go b/logic/service/fight/effect/effect_130.go index 686b09aa1..a003d3aa4 100644 --- a/logic/service/fight/effect/effect_130.go +++ b/logic/service/fight/effect/effect_130.go @@ -21,7 +21,7 @@ func (e *Effect130) OnSkill() bool { return true } - if e.Ctx().Opp.CurrentPet.PetInfo.Gender != e.Args()[0] { + if e.Ctx().Opp.CurrentPet.PetInfo.Gender != int(e.Args()[0].IntPart()) { return true } // 4. 附加固定伤害(从SideEffectArgs[0]获取伤害值) diff --git a/logic/service/fight/effect/effect_134.go b/logic/service/fight/effect/effect_134.go index 8ce63ef09..2ddcc9e7a 100644 --- a/logic/service/fight/effect/effect_134.go +++ b/logic/service/fight/effect/effect_134.go @@ -4,8 +4,6 @@ import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) /** @@ -21,17 +19,17 @@ type Effect134 struct { node.EffectNode } -func (e *Effect134) Damage_Floor(t *info.DamageZone) bool { +func (e *Effect134) DamageFloor(t *info.DamageZone) bool { if !e.Hit() { return true } // fmt.Println("Effect134_old", t.Damage.IntPart()) if t.Type == info.DamageType.Red { - is := t.Damage.Cmp(alpacadecimal.NewFromInt(int64(e.Args()[0]))) + is := t.Damage.Cmp(e.Args()[0]) if is == -1 { - e.Ctx().Our.HealPP(e.Args()[1]) + e.Ctx().Our.HealPP(int(e.Args()[1].IntPart())) } diff --git a/logic/service/fight/effect/effect_135.go b/logic/service/fight/effect/effect_135.go index 8607ea6f0..d33e7465a 100644 --- a/logic/service/fight/effect/effect_135.go +++ b/logic/service/fight/effect/effect_135.go @@ -21,14 +21,14 @@ type Effect135 struct { node.EffectNode } -func (e *Effect135) Damage_Floor(t *info.DamageZone) bool { +func (e *Effect135) DamageFloor(t *info.DamageZone) bool { if !e.Hit() { return true } // fmt.Println("Effect135_old", t.Damage.IntPart()) if t.Type == info.DamageType.Red { - t.Damage = alpacadecimal.Max(t.Damage, alpacadecimal.NewFromInt(int64(e.Args()[0]))) + t.Damage = alpacadecimal.Max(t.Damage, e.Args()[0]) } //fmt.Println("Effect135_new", t.Damage.IntPart()) diff --git a/logic/service/fight/effect/effect_136.go b/logic/service/fight/effect/effect_136.go index 2d8af23fb..e742d8fe8 100644 --- a/logic/service/fight/effect/effect_136.go +++ b/logic/service/fight/effect/effect_136.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" ) /** @@ -25,7 +23,7 @@ func init() { // 命中之后 func (e *Effect136) OnSkill() bool { if !e.Hit() { - heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[0]))) + heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[0]) e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal) } diff --git a/logic/service/fight/effect/effect_28.go b/logic/service/fight/effect/effect_28.go index a83e73cd8..58182acc7 100644 --- a/logic/service/fight/effect/effect_28.go +++ b/logic/service/fight/effect/effect_28.go @@ -4,8 +4,6 @@ import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) /** @@ -30,7 +28,7 @@ func (e *Effect28) OnSkill() bool { e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{ Type: info.DamageType.Fixed, - Damage: alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)).Div(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[0]))), + Damage: e.Ctx().Opp.CurrentPet.GetHP().Div(e.Args()[0]), }) return true } diff --git a/logic/service/fight/effect/effect_34.go b/logic/service/fight/effect/effect_34.go index fe10c48f7..839a2f4fc 100644 --- a/logic/service/fight/effect/effect_34.go +++ b/logic/service/fight/effect/effect_34.go @@ -32,7 +32,7 @@ func (e *Effect34) OnSkill() bool { } // 被攻击时候反弹 -func (e *Effect34) Damage_Floor(t *info.DamageZone) bool { +func (e *Effect34) DamageFloor(t *info.DamageZone) bool { if !e.can { return true diff --git a/logic/service/fight/effect/effect_36.go b/logic/service/fight/effect/effect_36.go index 2c8666690..068f34678 100644 --- a/logic/service/fight/effect/effect_36.go +++ b/logic/service/fight/effect/effect_36.go @@ -29,7 +29,7 @@ func (e *Effect36) OnSkill() bool { e.can = true return true } -func (e *Effect36) Damage_Floor(b *info.DamageZone) bool { +func (e *Effect36) DamageFloor(b *info.DamageZone) bool { if !e.can { return true } diff --git a/logic/service/fight/effect/effect_37.go b/logic/service/fight/effect/effect_37.go index a6995632a..744cf71c1 100644 --- a/logic/service/fight/effect/effect_37.go +++ b/logic/service/fight/effect/effect_37.go @@ -3,8 +3,6 @@ package effect import ( "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) // 自身体力小于1/n时威力为m倍 @@ -15,9 +13,9 @@ type Effect37 struct { func (e *Effect37) Skill_Hit() bool { - cmphp := e.GetInput().CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[0]))) + cmphp := e.GetInput().CurrentPet.GetMaxHP().Div(e.Args()[0]) if e.GetInput().CurrentPet.GetHP().Cmp(cmphp) == -1 { - e.Ctx().SkillEntity.Power *= e.Args()[1] + e.Ctx().SkillEntity.Power *= int(e.Args()[1].IntPart()) } return true } diff --git a/logic/service/fight/effect/effect_38.go b/logic/service/fight/effect/effect_38.go index d8b9d1a90..1562e3cb5 100644 --- a/logic/service/fight/effect/effect_38.go +++ b/logic/service/fight/effect/effect_38.go @@ -36,11 +36,11 @@ func (e *Effect38) OnSkill() bool { // 命中之后 func (e *Effect38_sub) Turn_Start(fattack *action.SelectSkillAction, sattack *action.SelectSkillAction) { - if uint32(e.Args()[0]) < e.Ctx().Our.CurrentPet.Info.MaxHp { + if e.Args()[0].Cmp(e.Ctx().Our.CurrentPet.GetMaxHP()) == -1 { e.l.Do(func() { e.oldtype = e.Ctx().Our.CurrentPet.Info.MaxHp - e.Ctx().Our.CurrentPet.Info.MaxHp -= uint32(e.Args()[0]) + e.Ctx().Our.CurrentPet.GetMaxHP().Sub(e.Args()[0]) }) diff --git a/logic/service/fight/effect/effect_41.go b/logic/service/fight/effect/effect_41.go index a730644f9..8fa3affc2 100644 --- a/logic/service/fight/effect/effect_41.go +++ b/logic/service/fight/effect/effect_41.go @@ -26,9 +26,10 @@ func (e *Effect41) SetArgs(t *input.Input, a ...int) { e.EffectNode.SetArgs(t, a...) t1 := e.Input.FightC t2 := t1.GetRand() - n := t2.Int31n(int32(e.Args()[1]-e.Args()[0]+1)) + int32(e.Args()[0]) - e.EffectNode.Duration(int(n)) + n := t2.Int31n(int32(e.Args()[1].Sub(e.Args()[0]).Add(alpacadecimal.NewFromInt(1)).IntPart())) + + e.EffectNode.Duration(int(e.Args()[0].Add(alpacadecimal.NewFromInt(int64(n))).IntPart())) } diff --git a/logic/service/fight/effect/effect_46.go b/logic/service/fight/effect/effect_46.go index dddc4fed1..03e8c7a36 100644 --- a/logic/service/fight/effect/effect_46.go +++ b/logic/service/fight/effect/effect_46.go @@ -13,7 +13,7 @@ import ( type Effect46 struct { node.EffectNode //StatusID int - conut int + conut int64 } func (e *Effect46) Damage_DIV_ex(t *info.DamageZone) bool { @@ -26,7 +26,7 @@ func (e *Effect46) Damage_DIV_ex(t *info.DamageZone) bool { if e.Ctx().SkillEntity.Category() == info.Category.STATUS { return true } - if e.Args()[0] == e.conut { + if e.Args()[0].IntPart() == e.conut { e.Alive(false) return true } diff --git a/logic/service/fight/effect/effect_47.go b/logic/service/fight/effect/effect_47.go index 9e439deeb..1ad17233a 100644 --- a/logic/service/fight/effect/effect_47.go +++ b/logic/service/fight/effect/effect_47.go @@ -25,7 +25,7 @@ func (e *Effect47) SetArgs(t *input.Input, a ...int) { //e.CanStack(-1)//后续的不会顶掉这个效果 e.EffectNode.SetArgs(t, a...) - e.Duration(e.Args()[0]) //次数类,无限回合 + e.Duration(int(e.Args()[0].IntPart())) //次数类,无限回合 } diff --git a/logic/service/fight/effect/effect_48.go b/logic/service/fight/effect/effect_48.go index 704d0eda9..877155310 100644 --- a/logic/service/fight/effect/effect_48.go +++ b/logic/service/fight/effect/effect_48.go @@ -32,7 +32,7 @@ func (e *Effect48) SetArgs(t *input.Input, a ...int) { //e.CanStack(-1)//后续的不会顶掉这个效果 e.EffectNode.SetArgs(t, a...) - e.Duration(e.Args()[0]) //次数类,无限回合 + e.Duration(int(e.Args()[0].IntPart())) //次数类,无限回合 } diff --git a/logic/service/fight/effect/effect_49.go b/logic/service/fight/effect/effect_49.go index 488a0d226..fee3ac952 100644 --- a/logic/service/fight/effect/effect_49.go +++ b/logic/service/fight/effect/effect_49.go @@ -4,8 +4,6 @@ import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) // 可以抵挡n点伤害 @@ -27,8 +25,8 @@ func (e *Effect49) Damage_SUB_ex(t *info.DamageZone) bool { //fmt.Println("Effect49_o", t.Damage) if t.Type == info.DamageType.Red { - if alpacadecimal.NewFromInt(int64(e.Args()[0])).Cmp(t.Damage) == -1 { - t.Damage = t.Damage.Sub(alpacadecimal.NewFromInt(int64(e.Args()[0]))) + if e.Args()[0].Cmp(t.Damage) == -1 { + t.Damage = t.Damage.Sub(e.Args()[0]) } } diff --git a/logic/service/fight/effect/effect_54.go b/logic/service/fight/effect/effect_54.go index 8d9ffcc8f..aea015763 100644 --- a/logic/service/fight/effect/effect_54.go +++ b/logic/service/fight/effect/effect_54.go @@ -4,8 +4,6 @@ import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) // n 回合使对方攻击伤害是正常状态下的 1/m @@ -29,7 +27,7 @@ func (e *Effect54) Damage_DIV_ex(t *info.DamageZone) bool { //fmt.Println("Effect54_o", t.Damage) if t.Type == info.DamageType.Red { - t.Damage = t.Damage.Div(alpacadecimal.NewFromInt(int64(e.Args()[1]))) + t.Damage = t.Damage.Div(e.Args()[1]) } //fmt.Println("Effect54_n", t.Damage) diff --git a/logic/service/fight/effect/effect_57.go b/logic/service/fight/effect/effect_57.go index a94376b31..3e7cf9cd9 100644 --- a/logic/service/fight/effect/effect_57.go +++ b/logic/service/fight/effect/effect_57.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" ) /** @@ -33,7 +31,7 @@ func (e *Effect57) OnSkill() bool { if !e.Hit() { return true } - heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(alpacadecimal.NewFromInt(int64(e.Args()[1]))) + heal := e.Ctx().Our.CurrentPet.GetMaxHP().Div(e.Args()[1]) e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, heal) return true } diff --git a/logic/service/fight/effect/effect_59.go b/logic/service/fight/effect/effect_59.go index d44b4814e..9abcae576 100644 --- a/logic/service/fight/effect/effect_59.go +++ b/logic/service/fight/effect/effect_59.go @@ -52,8 +52,8 @@ func (e *Effect59) Switch(in *input.Input, at info.AttackValue, oldpet *info.Bat return true } - e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0]), 1, info.AbilityOpType.ADD) - e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[1]), 1, info.AbilityOpType.ADD) + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[0].IntPart()), 1, info.AbilityOpType.ADD) + e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.Args()[1].IntPart()), 1, info.AbilityOpType.ADD) e.Alive(false) return true } diff --git a/logic/service/fight/effect/effect_65.go b/logic/service/fight/effect/effect_65.go index 5f9ff5e27..844db05ab 100644 --- a/logic/service/fight/effect/effect_65.go +++ b/logic/service/fight/effect/effect_65.go @@ -26,12 +26,12 @@ func (e *Effect65) Skill_Hit() bool { return true } - if info.EnumCategory(e.Ctx().SkillEntity.Move.Type) != info.EnumCategory(e.Args()[1]) { + if info.EnumCategory(e.Ctx().SkillEntity.Move.Type) != info.EnumCategory(e.Args()[1].IntPart()) { return true } //技能威力=【165-65*【当前体力百分比】】,任意体力百分比对应的威力浮动范围∈[-10,+10] - e.Ctx().SkillEntity.Power *= e.Args()[2] + e.Ctx().SkillEntity.Power *= int(e.Args()[2].IntPart()) return true } diff --git a/logic/service/fight/effect/effect_68.go b/logic/service/fight/effect/effect_68.go index fa3e0b297..804f9e0bd 100644 --- a/logic/service/fight/effect/effect_68.go +++ b/logic/service/fight/effect/effect_68.go @@ -15,7 +15,7 @@ type Effect68 struct { StatusID int } -func (e *Effect68) Damage_Lock_ex(t *info.DamageZone) bool { +func (e *Effect68) DamageLock_ex(t *info.DamageZone) bool { if !e.Hit() { return true } diff --git a/logic/service/fight/effect/effect_7.go b/logic/service/fight/effect/effect_7.go index 46033669f..ba81f94df 100644 --- a/logic/service/fight/effect/effect_7.go +++ b/logic/service/fight/effect/effect_7.go @@ -22,6 +22,7 @@ func init() { type Effect7 struct { node.EffectNode + max alpacadecimal.Decimal } func (e *Effect7) Action_start(a, b *action.SelectSkillAction) bool { @@ -31,7 +32,7 @@ func (e *Effect7) Action_start(a, b *action.SelectSkillAction) bool { return true } -func (e *Effect7) Damage_Lock(t *info.DamageZone) bool { +func (e *Effect7) DamageFloor(t *info.DamageZone) bool { if !e.Hit() { return true } @@ -40,6 +41,23 @@ func (e *Effect7) Damage_Lock(t *info.DamageZone) bool { if e.Ctx().Our.CurrentPet.Info.Hp <= e.Ctx().Opp.CurrentPet.Info.Hp { t.Damage = alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp - e.Ctx().Our.CurrentPet.Info.Hp)) + e.max = t.Damage + + } + + } + // fmt.Println("Effect7_new", t.Damage.IntPart()) + return true +} +func (e *Effect7) DamageLock(t *info.DamageZone) bool { + if !e.Hit() { + return true + } + //fmt.Println("Effect7_old", t.Damage.IntPart()) + if t.Type == info.DamageType.Red { + if t.Damage.Cmp(e.max) == 1 { + + t.Damage = e.max } diff --git a/logic/service/fight/effect/effect_76.go b/logic/service/fight/effect/effect_76.go index 1d6eca612..6fcaf9fd3 100644 --- a/logic/service/fight/effect/effect_76.go +++ b/logic/service/fight/effect/effect_76.go @@ -28,7 +28,7 @@ func (e *Effect76) OnSkill() bool { return true } // 概率判定 - ok, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !ok { return true } diff --git a/logic/service/fight/effect/effect_77.go b/logic/service/fight/effect/effect_77.go index faec09d36..52266f4eb 100644 --- a/logic/service/fight/effect/effect_77.go +++ b/logic/service/fight/effect/effect_77.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" ) /** @@ -33,6 +31,6 @@ func (e *Effect77) OnSkill() bool { if !e.Hit() { return true } - e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(e.Args()[1]))) + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[1]) return true } diff --git a/logic/service/fight/effect/effect_8.go b/logic/service/fight/effect/effect_8.go index 1171ed156..12c8bcc21 100644 --- a/logic/service/fight/effect/effect_8.go +++ b/logic/service/fight/effect/effect_8.go @@ -20,10 +20,11 @@ func init() { type Effect8 struct { node.EffectNode + max alpacadecimal.Decimal } -// 伤害落实前触发,限制最大伤害 -func (e *Effect8) Damage_Lock(t *info.DamageZone) bool { +// DamageFloor 伤害落实前触发,限制最大伤害 +func (e *Effect8) DamageFloor(t *info.DamageZone) bool { if t.Type == info.DamageType.Red { t.Damage = alpacadecimal.NewFromInt(utils.Min(t.Damage.IntPart(), int64(e.Ctx().Opp.CurrentPet.Info.Hp)-1)) @@ -32,3 +33,19 @@ func (e *Effect8) Damage_Lock(t *info.DamageZone) bool { return true } +func (e *Effect8) DamageLock(t *info.DamageZone) bool { + if !e.Hit() { + return true + } + //fmt.Println("Effect7_old", t.Damage.IntPart()) + if t.Type == info.DamageType.Red { + if t.Damage.Cmp(e.max) == 1 { + + t.Damage = e.max + + } + + } + // fmt.Println("Effect7_new", t.Damage.IntPart()) + return true +} diff --git a/logic/service/fight/effect/effect_88.go b/logic/service/fight/effect/effect_88.go index 50c14e999..d5a0aa37d 100644 --- a/logic/service/fight/effect/effect_88.go +++ b/logic/service/fight/effect/effect_88.go @@ -4,8 +4,6 @@ import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" - - "github.com/alpacahq/alpacadecimal" ) /** @@ -28,13 +26,13 @@ func (e *Effect88) Damage_Mul(t *info.DamageZone) bool { return true } // 概率判定 - ok, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !ok { return true } if t.Type == info.DamageType.Red { - t.Damage = t.Damage.Mul(alpacadecimal.NewFromInt(int64(e.SideEffectArgs[1]))) + t.Damage = t.Damage.Mul(e.Args()[1]) } diff --git a/logic/service/fight/effect/effect_89.go b/logic/service/fight/effect/effect_89.go index 7aad9ce3e..fecde7a3d 100644 --- a/logic/service/fight/effect/effect_89.go +++ b/logic/service/fight/effect/effect_89.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" ) /** @@ -37,7 +35,7 @@ func (e *Effect89) Skill_Useed() bool { return true } - e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(alpacadecimal.NewFromInt(int64(e.Args()[1])))) + e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Ctx().Our.SumDamage.Div(e.Args()[1])) return true } diff --git a/logic/service/fight/effect/effect_93.go b/logic/service/fight/effect/effect_93.go index fd07bd1f2..14f37a905 100644 --- a/logic/service/fight/effect/effect_93.go +++ b/logic/service/fight/effect/effect_93.go @@ -28,7 +28,7 @@ func (e *Effect93) OnSkill() bool { return true } // 概率判定 - ok, _, _ := e.Input.Player.Roll(e.Args()[0], 100) + ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100) if !ok { return true } diff --git a/logic/service/fight/effect/effect_95.go b/logic/service/fight/effect/effect_95.go index 38d8d5711..e8cc228d3 100644 --- a/logic/service/fight/effect/effect_95.go +++ b/logic/service/fight/effect/effect_95.go @@ -36,7 +36,7 @@ func (e *Effect95) Action_start(a, b *action.SelectSkillAction) bool { if !e.Ctx().Opp.StatEffect_Exist(input.StatusSleep) { return true } - e.Ctx().SkillEntity.CritRate += e.Args()[0] + e.Ctx().SkillEntity.CritRate += int(e.Args()[0].IntPart()) return true } diff --git a/logic/service/fight/effect/effect_EffectConditionalAddDamage.go b/logic/service/fight/effect/effect_EffectConditionalAddDamage.go index ec110d06b..253ee3396 100644 --- a/logic/service/fight/effect/effect_EffectConditionalAddDamage.go +++ b/logic/service/fight/effect/effect_EffectConditionalAddDamage.go @@ -98,7 +98,7 @@ func conditionIsFrozen(e *EffectConditionalAddDamage) bool { // conditionIsTypeX:判断对方是否为X属性对方为X性则附加n点伤害 func conditionIsTypeX(e *EffectConditionalAddDamage) bool { // 示例:假设Args[0]为目标属性值,判断对方属性是否匹配 - return e.Ctx().Opp.CurrentPet.PetInfo.Gender == e.Args()[0] + return e.Ctx().Opp.CurrentPet.PetInfo.Gender == int(e.Args()[0].IntPart()) } // conditionIsAbnormal:判断对方是否处于任意异常状态 diff --git a/logic/service/fight/input/effect.go b/logic/service/fight/input/effect.go index d294d26a4..85e6a40e3 100644 --- a/logic/service/fight/input/effect.go +++ b/logic/service/fight/input/effect.go @@ -8,6 +8,7 @@ import ( "blazing/modules/blazing/model" + "github.com/alpacahq/alpacadecimal" "github.com/brunoga/deep" "github.com/gogf/gf/v2/util/gconv" "github.com/tnnmigga/enum" @@ -143,14 +144,14 @@ func (our *Input) GetCurrAttr(id int) model.PetInfo { } // 比较两个[]int是否内容相等 -func equalInts(a, b []int) bool { +func equalInts(a, b []alpacadecimal.Decimal) bool { // 先判断长度是否相等 if len(a) != len(b) { return false } // 逐个比较元素 for i := range a { - if a[i] != b[i] { + if a[i].IntPart() != b[i].IntPart() { return false } } diff --git a/logic/service/fight/input/fight.go b/logic/service/fight/input/fight.go index 08279e548..872e1ac9e 100644 --- a/logic/service/fight/input/fight.go +++ b/logic/service/fight/input/fight.go @@ -127,7 +127,7 @@ func (our *Input) Damage(in *Input, sub *info.DamageZone) { if ok { ok = our.Opp.Exec(func(t Effect) bool { - t.Damage_Floor(sub) //红伤落实,内部有befer + t.DamageFloor(sub) //红伤落实,内部有befer return true }) @@ -158,7 +158,7 @@ func (our *Input) Damage(in *Input, sub *info.DamageZone) { if ok && in != our { ok = our.Opp.Exec(func(t Effect) bool { - t.Damage_Lock(sub) + t.DamageLock(sub) return true }) @@ -167,7 +167,7 @@ func (our *Input) Damage(in *Input, sub *info.DamageZone) { if ok { our.Exec(func(t Effect) bool { - t.Damage_Lock_ex(sub) + t.DamageLock_ex(sub) return true }) diff --git a/logic/service/fight/input/interface.go b/logic/service/fight/input/interface.go index 671a6ed8a..c4d552458 100644 --- a/logic/service/fight/input/interface.go +++ b/logic/service/fight/input/interface.go @@ -3,6 +3,8 @@ package input import ( "blazing/logic/service/fight/action" "blazing/logic/service/fight/info" + + "github.com/alpacahq/alpacadecimal" ) type Effect interface { @@ -23,12 +25,12 @@ type Effect interface { Damage_ADD(*info.DamageZone) bool // 攻击前触发 ,这时候就是+区间 Damage_Mul(*info.DamageZone) bool // 攻击触发 - Damage_Floor(*info.DamageZone) bool // 保底伤害 - Damage_DIV_ex(*info.DamageZone) bool //受击前触发 这时候就是百分比减伤区间 - Damage_SUB_ex(*info.DamageZone) bool // 受击触发 这时候就是点数减伤 - Damage_Lock(*info.DamageZone) bool //锁定伤害 - Damage_Lock_ex(*info.DamageZone) bool //被动方锁定伤害 - Damage_Shield(*info.DamageZone) bool // 护盾值变化时触发 + DamageFloor(*info.DamageZone) bool // 保底伤害 + Damage_DIV_ex(*info.DamageZone) bool //受击前触发 这时候就是百分比减伤区间 + Damage_SUB_ex(*info.DamageZone) bool // 受击触发 这时候就是点数减伤 + DamageLock(*info.DamageZone) bool //锁定伤害 + DamageLock_ex(*info.DamageZone) bool //被动方锁定伤害 + Damage_Shield(*info.DamageZone) bool // 护盾值变化时触发 //Damage_Use() bool // 伤害作用 Skill_Use_ex() bool //技能PP减少节点 Skill_Useed() bool //技能PP减少节点 @@ -51,7 +53,7 @@ type Effect interface { //boss是进入防守方才被添加抵御异常状态效果的,boss免疫的实质是给挑战者挂载一个阻止添加给对手的debuff EFFect_Befer(in *Input, effEffect Effect) bool //属性免疫 SetArgs(input *Input, param ...int) - Args() []int + Args() []alpacadecimal.Decimal // 治疗相关触发 Heal_Pre(action.BattleActionI, *int) bool // 治疗前触发 回复翻倍效果 //Heal(action.BattleActionI) bool // 治疗生效时触发 药剂反噬 diff --git a/logic/service/fight/node/dagame.go b/logic/service/fight/node/dagame.go index eee398554..86960d141 100644 --- a/logic/service/fight/node/dagame.go +++ b/logic/service/fight/node/dagame.go @@ -11,7 +11,7 @@ func (e *EffectNode) Damage_Mul(_ *info.DamageZone) bool { return true } -func (e *EffectNode) Damage_Floor(_ *info.DamageZone) bool { +func (e *EffectNode) DamageFloor(_ *info.DamageZone) bool { return true } @@ -23,11 +23,11 @@ func (e *EffectNode) Damage_SUB_ex(_ *info.DamageZone) bool { return true } -func (e *EffectNode) Damage_Lock(_ *info.DamageZone) bool { +func (e *EffectNode) DamageLock(_ *info.DamageZone) bool { return true } -func (e *EffectNode) Damage_Lock_ex(_ *info.DamageZone) bool { +func (e *EffectNode) DamageLock_ex(_ *info.DamageZone) bool { return true } diff --git a/logic/service/fight/node/node.go b/logic/service/fight/node/node.go index 364daee42..b9c6cb58e 100644 --- a/logic/service/fight/node/node.go +++ b/logic/service/fight/node/node.go @@ -4,6 +4,8 @@ import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "sync" + + "github.com/alpacahq/alpacadecimal" ) // 检查,激活,延后 @@ -97,9 +99,15 @@ func (e *EffectNode) SetArgs(t *input.Input, a ...int) { e.SideEffectArgs = a } -func (e *EffectNode) Args() []int { +func (e *EffectNode) Args() []alpacadecimal.Decimal { + var ret []alpacadecimal.Decimal - return e.SideEffectArgs + for _, v := range e.SideEffectArgs { + ret = append(ret, alpacadecimal.NewFromInt(int64(v))) + + } + + return ret } diff --git a/modules/blazing/service/pet_fusion_material_service.go b/modules/blazing/service/pet_fusion_material_service.go index 27e2ff206..f38f76b83 100644 --- a/modules/blazing/service/pet_fusion_material_service.go +++ b/modules/blazing/service/pet_fusion_material_service.go @@ -65,7 +65,7 @@ func (s *PetFusionMaterialService) Data(Material1 [4]uint32) uint32 { }) if effect.Trait1Idx != 0 { - r := grand.Intn(3) + r := grand.Intn(4) switch r { case 0: return gconv.Uint32(effect2s[effect.Trait1Idx].Remark) diff --git a/public/config/bossbuff和特性.xml b/public/config/bossbuff和特性.xml index 951d8edfb..dc22fc317 100644 --- a/public/config/bossbuff和特性.xml +++ b/public/config/bossbuff和特性.xml @@ -379,7 +379,7 @@ - + @@ -420,8 +420,8 @@ - - + +