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

55 lines
1.2 KiB
Go

package effect
import (
"blazing/logic/service/fight/node"
)
// -----------------------------------------------------------
// 注册
// -----------------------------------------------------------
func init() {
initskill(4, &Effect4{})
initskill(5, &Effect5{})
}
// Effect 4: 技能使用成功时,{1}%改变自身{0}等级{2}
type Effect4 struct {
node.EffectNode
}
// -----------------------------------------------------------
// 技能触发时调用
// -----------------------------------------------------------
func (e *Effect4) Skill_Use() bool {
ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[1], 100)
if !ok {
return true
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[2]))
return true
}
// Effect 5: 技能使用成功时,{1}%改变对手{0}等级{2}
type Effect5 struct {
node.EffectNode
}
// -----------------------------------------------------------
// 技能触发时调用
// -----------------------------------------------------------
func (e *Effect5) Skill_Use() bool {
// 概率判定
ok, _, _ := e.Input.Player.Roll(e.SideEffectArgs[1], 100)
if !ok {
return true
}
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(e.SideEffectArgs[0]), int8(e.SideEffectArgs[2]))
return true
}