Files
bl/logic/service/fight/effect/524.go
xinian 322d5ea64d
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
feat: 新增战斗技能效果 524-580
2026-03-17 15:25:08 +08:00

36 lines
887 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 524 - {0}回合内若被对手击败则对手疲惫{1}回合
type Effect524 struct {
node.EffectNode
}
func (e *Effect524) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func (e *Effect524) SwitchOut(in *input.Input) bool {
if e.Input == in {
if !e.Ctx().Our.CurrentPet.Alive() { // 被击败
// 给对手添加疲惫状态
tiredEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Tired))
if tiredEffect != nil {
tiredEffect.Duration(int(e.Args()[1].IntPart()))
e.Ctx().Opp.AddEffect(e.Ctx().Our, tiredEffect)
}
}
e.Alive(false)
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 524, &Effect524{})
}