Files
bl/logic/service/fight/effect/196.go
xinian 069d961585
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构效果 150、196、437 实现
2026-03-08 16:22:54 +08:00

37 lines
1.0 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/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 196 - n%令对方XX等级-m若先出手则j%使对方XX等级-k
type Effect196 struct {
node.EffectNode
}
func (e *Effect196) OnSkill() bool {
if e.Input.FightC.IsFirst(e.Input.Player) { // 先出手
chance := e.Args()[4].IntPart() // j%
effectValue := e.Args()[5].IntPart() // 等级-k
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[3].IntPart()), int8(effectValue), info.AbilityOpType.SUB)
}
} else { // 后出手
chance := e.Args()[1].IntPart() // j%
effectValue := e.Args()[2].IntPart() // 等级-k
success, _, _ := e.Input.Player.Roll(int(chance), 100)
if success {
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[0].IntPart()), int8(effectValue), info.AbilityOpType.SUB)
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 196, &Effect196{})
}