Files
bl/logic/service/fight/effect/1378.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

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.CurrentPet.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{})
}