44 lines
845 B
Go
44 lines
845 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// Effect 548: 消除对手能力提升状态,消除成功后恢复{0}点体力
|
|
type Effect548 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect548) OnSkill() bool {
|
|
|
|
healAmount := e.Args()[0] // 恢复体力值
|
|
|
|
// 检查对手是否有能力提升状态
|
|
hasPositiveStatus := false
|
|
for i, prop := range e.Ctx().Opp.Prop {
|
|
if prop > 0 {
|
|
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
|
|
hasPositiveStatus = true
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
// 如果成功消除了能力提升状态,则恢复体力
|
|
if hasPositiveStatus {
|
|
e.Ctx().Our.Heal(
|
|
e.Ctx().Our,
|
|
&action.SelectSkillAction{},
|
|
healAmount,
|
|
)
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 548, &Effect548{})
|
|
}
|