diff --git a/logic/service/fight/boss/NewSeIdx_12.go b/logic/service/fight/boss/NewSeIdx_12.go
index 1feb8a83..d20fe06d 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 2ec148f9..afc4ad09 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 4f3e8d1f..c39a98ff 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 ef292bec..280d10d5 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 95b8bc98..4623a4f6 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 912a1b8a..34ef1a76 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 36ea82a6..e9c54b2b 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 c6266212..8c4cbdbc 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 d0160079..eee7dc4d 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 699a2440..aaa0780b 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 754f0cbb..bb458ee3 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 d9c87249..f7d03207 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 de24bdc8..0dddfef2 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 7fe28416..aa9fa46e 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 c8b5c4c8..fb90ecb0 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 4b5dc117..6b41d6d6 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 b35659e0..fb5b4239 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 c6dafba0..6fe75e64 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 b397b773..c12e1e97 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 5fb4e003..bfc24466 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 146abe32..01845cbc 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 3c1e0d1b..261c2881 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 44215c1f..e4165b39 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 0c543720..fd1615ff 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 d7130a2e..0a7ad5ef 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 a17d6d5c..c65c5f22 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 7e6cd09b..23c84da5 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 36150ad3..283aea75 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 9e6952f5..1c5f6bd6 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 5d1ad15b..232b3c9d 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 569dd10d..79295b12 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 8d94978b..a37dd929 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 be0a8412..027af414 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 bc079396..7eb753b1 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 4a857732..38c07e5e 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 c0059235..fa0524e9 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 4d7c1d8b..c41bde45 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 0181a456..5ffedfa2 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 0654c1b6..92d43f17 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 2262a4c2..d33742fd 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 e57fde66..019e689b 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 686b09aa..a003d3aa 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 8ce63ef0..2ddcc9e7 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 8607ea6f..d33e7465 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 2d8af23f..e742d8fe 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 a83e73cd..58182acc 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 fe10c48f..839a2f4f 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 2c866669..068f3467 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 a6995632..744cf71c 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 d8b9d1a9..1562e3cb 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 a730644f..8fa3affc 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 dddc4fed..03e8c7a3 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 9e439dee..1ad17233 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 704d0eda..87715531 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 488a0d22..fee3ac95 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 8d9ffcc8..aea01576 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 a94376b3..3e7cf9cd 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 d44b4814..9abcae57 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 5f9ff5e2..844db05a 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 fa3e0b29..804f9e0b 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 46033669..ba81f94d 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 1d6eca61..6fcaf9fd 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 faec09d3..52266f4e 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 1171ed15..12c8bcc2 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 50c14e99..d5a0aa37 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 7aad9ce3..fecde7a3 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 fd07bd1f..14f37a90 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 38d8d571..e8cc228d 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 ec110d06..253ee339 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 d294d26a..85e6a40e 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 08279e54..872e1ac9 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 671a6ed8..c4d55245 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 eee39855..86960d14 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 364daee4..b9c6cb58 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 27e2ff20..f38f76b8 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 951d8edf..dc22fc31 100644
--- a/public/config/bossbuff和特性.xml
+++ b/public/config/bossbuff和特性.xml
@@ -379,7 +379,7 @@
-
+
@@ -420,8 +420,8 @@
-
-
+
+