package effect import ( "blazing/logic/service/fight/action" "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" ) // Effect 475: 若造成的伤害不足{0},则下{1}回合的攻击必定致命一击 type Effect475 struct { node.EffectNode damageThreshold int critDuration int } func (e *Effect475) Skill_Use() bool { damageThreshold := int(e.Args()[0].IntPart()) damageDone := e.Ctx().Our.SumDamage if damageDone.IntPart() < int64(damageThreshold) { critDuration := int(e.Args()[1].IntPart()) addSubEffect(e.Ctx().Our, e.Ctx().Our, &e.EffectNode, &Effect475_sub{}, critDuration) } return true } type Effect475_sub struct { node.EffectNode } func (e *Effect475_sub) ActionStart(a, b *action.SelectSkillAction) bool { //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, 475, &Effect475{}) }