28 lines
536 B
Go
28 lines
536 B
Go
|
|
package effect
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"blazing/logic/service/fight/input"
|
|||
|
|
"blazing/logic/service/fight/node"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// 412 - 若自身体力小于1/n,则每次攻击不消耗PP值
|
|||
|
|
type Effect412 struct {
|
|||
|
|
node.EffectNode
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (e *Effect412) HookPP(count *int) bool {
|
|||
|
|
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
|
|||
|
|
currentHp := e.Ctx().Our.CurrentPet.GetHP()
|
|||
|
|
threshold := maxHp.Div(e.Args()[0]) // 1/n
|
|||
|
|
|
|||
|
|
if currentHp.Cmp(threshold) < 0 {
|
|||
|
|
*count = 0
|
|||
|
|
}
|
|||
|
|
return true
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func init() {
|
|||
|
|
input.InitEffect(input.EffectType.Skill, 412, &Effect412{})
|
|||
|
|
|
|||
|
|
}
|