Files
bl/logic/service/fight/effect/effect_93.go
昔念 5e007894ea
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
```
feat(fight): 添加技能实体空值检查

为Effect93的Skill_Use方法添加空值检查,当技能实体为空时直接返回true,
避免潜在的空指针引用错误
```
2026-03-12 01:17:02 +08:00

38 lines
631 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* n%几率额外附加m点固定伤害
*/
func init() {
input.InitEffect(input.EffectType.Skill, 93, &Effect93{})
}
type Effect93 struct {
node.EffectNode
}
func (e *Effect93) Skill_Use() bool {
if e.Ctx().SkillEntity == nil {
return true
}
// 概率判定
ok, _, _ := e.Input.Player.Roll(int(e.Args()[0].IntPart()), 100)
if !ok {
return true
}
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: e.Args()[1],
})
return true
}