Files
bl/logic/service/fight/effect/effect_28.go
昔念 0b5cfac0b2 ```
feat(fight): 调整战斗逻辑与伤害计算流程

- 移除 `Over` 方法中的冗余回调参数 `fn`
- 修复部分技能效果中错误的伤害目标对象(Our/Opp)
- 优化战斗循环逻辑,使用 `over` channel 替代 `quit` 作为战斗结束信号
- 增加回合效果执行前的存活状态判断
- 修正伤害计算过程中对血量扣减的逻辑错误
-
2025-11-12 01:19:24 +08:00

37 lines
646 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
* 降低对方 1/n 的 体力
*/
func init() {
input.InitEffect(input.EffectType.Skill, 28, &Effect28{
EffectNode: node.EffectNode{},
})
}
type Effect28 struct {
node.EffectNode
}
func (e *Effect28) OnSkill() bool {
if !e.Hit() {
return true
}
e.Ctx().Our.Damage(&info.DamageZone{
Type: info.DamageType.Fixed,
Damage: decimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Hp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))),
})
return true
}