42 lines
847 B
Go
42 lines
847 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// Effect 430: 消除对手能力提升状态,若消除状态成功,则自身{0}等级+{1}
|
|
type Effect430 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect430) Skill_Use() bool {
|
|
var isadd bool
|
|
// 检查对手是否有能力强化状态
|
|
for i, v := range e.Ctx().Opp.Prop[:] {
|
|
if v > 0 {
|
|
|
|
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
|
|
isadd = true
|
|
}
|
|
return true
|
|
}
|
|
|
|
}
|
|
if !isadd {
|
|
return true
|
|
}
|
|
|
|
// 如果成功消除了状态,提升自身能力等级
|
|
effectType := int8(e.Args()[0].IntPart()) // XX类型
|
|
effectValue := int8(e.Args()[1].IntPart()) // 等级m
|
|
|
|
e.Ctx().Our.SetProp(e.Ctx().Our, effectType, effectValue)
|
|
return true
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 430, &Effect430{})
|
|
|
|
}
|