Files
bl/logic/service/fight/effect/196.go
xinian 78a68148ce
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
chore: update fight logic and effect implementations
2026-04-05 02:25:44 +08:00

36 lines
948 B
Go

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 196: {1}%令对方{0}等级{2};若先出手,则{4}%使对方{3}等级{5}
type Effect196 struct {
node.EffectNode
}
func (e *Effect196) OnSkill() bool {
if e.IsFirst() { // 先出手
chance := e.Args()[4].IntPart() // j%
effectValue := e.Args()[5].IntPart() // 等级-k
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
e.TargetInput().SetProp(e.TargetInput(), int8(e.Args()[3].IntPart()), int8(effectValue))
}
} else { // 后出手
chance := e.Args()[1].IntPart() // j%
effectValue := e.Args()[2].IntPart() // 等级-k
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
e.TargetInput().SetProp(e.TargetInput(), int8(e.Args()[0].IntPart()), int8(effectValue))
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 196, &Effect196{})
}