Files
bl/logic/service/fight/effect/1378.go
xinian 9c6f3988de
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构 CurrentPet 为 CurPet
2026-04-04 04:34:43 +08:00

67 lines
1.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 1378: 全属性+{0}{1}%概率强化效果翻倍,未触发则{2}回合内每回合{3}
type Effect1378 struct{ node.EffectNode }
func (e *Effect1378) OnSkill() bool {
if len(e.Args()) < 9 {
return true
}
boost := int8(e.Args()[0].IntPart())
ok, _, _ := e.Input.Player.Roll(int(e.Args()[1].IntPart()), 100)
if ok {
boost *= 2
}
for i := 0; i < 6; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), boost)
}
if ok || e.Args()[2].IntPart() <= 0 {
return true
}
sub := e.Ctx().Our.InitEffect(
input.EffectType.Sub,
1378,
int(e.Args()[2].IntPart()),
int(e.Args()[3].IntPart()),
int(e.Args()[4].IntPart()),
int(e.Args()[5].IntPart()),
int(e.Args()[6].IntPart()),
int(e.Args()[7].IntPart()),
int(e.Args()[8].IntPart()),
)
if sub != nil {
e.Ctx().Our.AddEffect(e.Ctx().Our, sub)
}
return true
}
type Effect1378Sub struct{ RoundEffectArg0Base }
func (e *Effect1378Sub) TurnEnd() {
if len(e.Args()) >= 7 && e.Ctx().Our.CurPet[0].Info.Hp > 0 {
changes := []int{
int(e.Args()[1].IntPart()),
int(e.Args()[2].IntPart()),
int(e.Args()[3].IntPart()),
int(e.Args()[4].IntPart()),
int(e.Args()[5].IntPart()),
int(e.Args()[6].IntPart()),
}
applyEffectPropChanges(e.Ctx().Our, e.Ctx().Our, changes, false)
}
e.EffectNode.TurnEnd()
}
func init() {
input.InitEffect(input.EffectType.Skill, 1378, &Effect1378{})
input.InitEffect(input.EffectType.Sub, 1378, &Effect1378Sub{})
}