2026-03-09 18:49:51 +08:00
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/logic/service/fight/action"
|
|
|
|
|
"blazing/logic/service/fight/info"
|
|
|
|
|
"blazing/logic/service/fight/input"
|
|
|
|
|
"blazing/logic/service/fight/node"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 461 - 使用后若自身体力低于1/m则从下回合开始必定致命一击
|
|
|
|
|
type Effect461 struct {
|
|
|
|
|
node.EffectNode
|
|
|
|
|
can bool
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (e *Effect461) Skill_Use() bool {
|
|
|
|
|
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
|
|
|
|
|
currentHp := e.Ctx().Our.CurrentPet.GetHP()
|
|
|
|
|
threshold := maxHp.Div(e.Args()[1]) // 1/m
|
|
|
|
|
|
|
|
|
|
if currentHp.Cmp(threshold) < 0 {
|
|
|
|
|
e.can = true
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
func (e *Effect461) SetArgs(t *input.Input, a ...int) {
|
|
|
|
|
e.EffectNode.SetArgs(t, a...)
|
2026-03-09 19:16:17 +08:00
|
|
|
e.EffectNode.Duration(1) // 持续n回合
|
2026-03-09 18:49:51 +08:00
|
|
|
}
|
|
|
|
|
func (e *Effect461) ActionStart(a, b *action.SelectSkillAction) bool {
|
|
|
|
|
if !e.can {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
//fmt.Println(e.Ctx().SkillEntity)
|
|
|
|
|
if e.Ctx().SkillEntity == nil {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
if e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
e.Ctx().SkillEntity.XML.CritRate = 16
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
func init() {
|
|
|
|
|
input.InitEffect(input.EffectType.Skill, 461, &Effect461{})
|
|
|
|
|
|
|
|
|
|
}
|