Files
bl/logic/service/fight/effect/effect_4_5.go
昔念 499a0ba5ab
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
fix(fight): 移除无用依赖并优化技能效果逻辑

- 移除了github.com/alpacahq/alpacadecimal依赖,简化了生命值恢复计算逻辑
- 修复了effect_4_5.go中技能参数索引错误,统一了概率判定和属性设置的参数使用
2026-03-12 21:01:58 +08:00

60 lines
1.4 KiB
Go

package effect
import (
"blazing/logic/service/fight/node"
)
// -----------------------------------------------------------
// 注册
// -----------------------------------------------------------
func init() {
initskill(4, &Effect4{})
initskill(5, &Effect5{})
}
// -----------------------------------------------------------
// 构造
// -----------------------------------------------------------
// -----------------------------------------------------------
// 主体结构
// -----------------------------------------------------------
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
}
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
}