Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
实现1383-1387技能效果,包括自然祝福状态下的属性强化、自然祝福层数管理、护盾效果等
49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
)
|
|
|
|
// Effect 1391: {0}回合内若对手使用属性技能则造成伤害前令对手{1},未触发则消除对手回合类效果
|
|
type Effect1391 struct {
|
|
RoundEffectArg0Base
|
|
pending bool
|
|
triggered bool
|
|
}
|
|
|
|
func (e *Effect1391) Skill_Use_ex() bool {
|
|
if len(e.Args()) < 2 || e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() != info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
e.pending = true
|
|
return true
|
|
}
|
|
|
|
func (e *Effect1391) SkillHit() bool {
|
|
if !e.pending || e.triggered || len(e.Args()) < 2 {
|
|
return true
|
|
}
|
|
if e.Ctx().SkillEntity == nil || e.Ctx().SkillEntity.Category() == info.Category.STATUS {
|
|
return true
|
|
}
|
|
|
|
if addStatusByID(e.Ctx().Our, e.Ctx().Opp, int(e.Args()[1].IntPart())) {
|
|
e.triggered = true
|
|
e.pending = false
|
|
}
|
|
return true
|
|
}
|
|
|
|
func (e *Effect1391) TurnEnd() {
|
|
if !e.triggered && e.Duration() == 1 {
|
|
e.Ctx().Opp.CancelTurn(e.Ctx().Our)
|
|
}
|
|
e.EffectNode.TurnEnd()
|
|
}
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 1391, &Effect1391{})
|
|
}
|