Files
bl/logic/service/fight/effect/effect_88.go
昔念 6afae2c704 fix(fight): 调整技能命中逻辑与效果触发时机
移除冗余的 Calculate_Pre 调用注释,优化技能命中判断流程。
将 SkillID 赋值操作移动至命中条件判断内部,确保仅在技能命中时记录。
注释掉部分不再使用的接口方法定义,保持代码整洁。
2025-11-14 04:23:50 +08:00

43 lines
717 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
* n%几率伤害为m倍
*/
func init() {
input.InitEffect(input.EffectType.Skill, 88, &Effect88{
EffectNode: node.EffectNode{},
})
}
type Effect88 struct {
node.EffectNode
}
func (e *Effect88) Damage_Mul(t *info.DamageZone) bool {
if !e.Hit() {
return true
}
// 概率判定
ok, _, _ := e.Input.Player.Roll(e.Args()[0], 100)
if !ok {
return true
}
if t.Type == info.DamageType.Red {
e.Ctx().Our.DamageZone.Damage = e.Ctx().Our.DamageZone.Damage.Mul(decimal.NewFromInt(int64(e.SideEffectArgs[1])))
}
return true
}