Files
bl/logic/service/fight/effect/1380.go
xinian d86b75408b
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 新增技能效果1378-1382
2026-04-02 23:32:21 +08:00

46 lines
1.3 KiB
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 1380: 牺牲自身全部体力,使对手全属性-{0}且{1}回合内先制-{2}
type Effect1380 struct{ node.EffectNode }
func (e *Effect1380) Skill_Use() bool {
if len(e.Args()) < 3 {
return true
}
applyAllPropDown(e.Ctx().Our, e.Ctx().Opp, int8(e.Args()[0].IntPart()))
sub := e.Ctx().Our.InitEffect(input.EffectType.Sub, 1380, int(e.Args()[1].IntPart()), int(e.Args()[2].IntPart()))
if sub != nil {
e.Ctx().Opp.AddEffect(e.Ctx().Our, sub)
}
e.Ctx().Our.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Ctx().Our.CurrentPet.GetHP(),
})
return true
}
type Effect1380Sub struct{ RoundEffectArg0Base }
func (e *Effect1380Sub) ComparePre(fattack, sattack *action.SelectSkillAction) bool {
current := actionByPlayer(fattack, sattack, e.Ctx().Our.UserID)
if current == nil || current.SkillEntity == nil || len(e.Args()) < 2 {
return true
}
current.SkillEntity.XML.Priority -= int(e.Args()[1].IntPart())
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 1380, &Effect1380{})
input.InitEffect(input.EffectType.Sub, 1380, &Effect1380Sub{})
}