2026-03-08 16:22:54 +08:00
|
|
|
package effect
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"blazing/logic/service/fight/input"
|
|
|
|
|
"blazing/logic/service/fight/node"
|
|
|
|
|
)
|
|
|
|
|
|
2026-03-28 21:57:22 +08:00
|
|
|
// Effect 196: {1}%令对方{0}等级{2};若先出手,则{4}%使对方{3}等级{5}
|
2026-03-08 16:22:54 +08:00
|
|
|
type Effect196 struct {
|
|
|
|
|
node.EffectNode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (e *Effect196) OnSkill() bool {
|
2026-03-09 12:28:37 +08:00
|
|
|
if e.IsFirst() { // 先出手
|
2026-03-08 16:22:54 +08:00
|
|
|
chance := e.Args()[4].IntPart() // j%
|
|
|
|
|
effectValue := e.Args()[5].IntPart() // 等级-k
|
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|
|
|
|
if success {
|
2026-03-08 23:24:18 +08:00
|
|
|
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[3].IntPart()), int8(effectValue))
|
2026-03-08 16:22:54 +08:00
|
|
|
}
|
|
|
|
|
} else { // 后出手
|
|
|
|
|
chance := e.Args()[1].IntPart() // j%
|
|
|
|
|
effectValue := e.Args()[2].IntPart() // 等级-k
|
|
|
|
|
success, _, _ := e.Input.Player.Roll(int(chance), 100)
|
|
|
|
|
if success {
|
2026-03-08 23:24:18 +08:00
|
|
|
e.Ctx().Opp.SetProp(e.Ctx().Opp, int8(e.Args()[0].IntPart()), int8(effectValue))
|
2026-03-08 16:22:54 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
func init() {
|
|
|
|
|
input.InitEffect(input.EffectType.Skill, 196, &Effect196{})
|
|
|
|
|
|
|
|
|
|
}
|