Files
bl/logic/service/fight/effect/effct_122.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

57 lines
1.1 KiB
Go

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
func init() {
input.InitEffect(input.EffectType.Skill, 122, &Effect122{
isfrist: true,
rev: true,
})
input.InitEffect(input.EffectType.Skill, 148, &Effect122{
isfrist: false,
rev: true,
})
input.InitEffect(input.EffectType.Skill, 588, &Effect122{
isfrist: true,
rev: false,
})
input.InitEffect(input.EffectType.Skill, 186, &Effect122{
isfrist: false,
rev: false,
})
}
// Effect 122: 先出手时,{1}%改变对方{0}等级{2}
type Effect122 struct {
node.EffectNode
isfrist bool
rev bool
}
func (e *Effect122) OnSkill() bool {
if e.IsFirst() == e.isfrist {
propIndex := int(e.Args()[0].IntPart())
chance := int(e.Args()[1].IntPart())
changeAmount := int(e.Args()[2].IntPart())
ok, _, _ := e.Input.Player.Roll(chance, 100)
if ok {
if e.rev {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(propIndex), int8(changeAmount))
} else {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(propIndex), int8(changeAmount))
}
}
}
return true
}