33 lines
650 B
Go
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{})
|
|
|
|
}
|