46 lines
921 B
Go
46 lines
921 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
)
|
|
|
|
// Effect 461: 若自身生命值低于1/{0}则从下回合开始必定致命一击
|
|
type Effect461 struct {
|
|
FixedDuration1Base
|
|
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()[0]) // 1/m
|
|
|
|
if currentHp.Cmp(threshold) < 0 {
|
|
e.can = true
|
|
|
|
}
|
|
|
|
return true
|
|
}
|
|
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{})
|
|
|
|
}
|