Files
bl/logic/service/fight/effect/516.go

30 lines
619 B
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 516 - 1 1 1 1 1 1 1 体力低于1/n时强化效果翻倍
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
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(v))
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 516, &Effect516{})
}