Files
bl/logic/service/fight/effect/516.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

33 lines
650 B
Go

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 516: {0},体力值低于1/{6}时强化效果翻倍
type Effect516 struct {
node.EffectNode
}
func (e *Effect516) Skill_Use() bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
threshold := maxHp.Div(e.Args()[6]) // 1/n
for i, v := range e.SideEffectArgs[:6] {
if currentHp.Cmp(threshold) < 0 {
v *= 2
}
if v == 0 {
continue
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(v))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 516, &Effect516{})
}