Files
bl/logic/service/fight/effect/effect_50.go
昔念 55ff5c6119 ```
refactor(effect): 更新状态枚举类型为 EnumPetStatus

将多个技能效果文件中的 EnumBattleStatus 类型统一更新为 EnumPetStatus,
以更准确地反映其用途。同时修改了相关函数签名和变量声明。

此外,清理了部分注释格式,并补充了关于被动效果不能被免疫的说明。
```
2025-11-14 00:26:34 +08:00

49 lines
973 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回合自身受到物理攻击伤害减半
// ---- Effect50 ----
type Effect50 struct {
node.EffectNode
StatusID int
}
func (e *Effect50) Damage_DIV_ex(t *info.DamageZone) bool {
if !e.Hit() {
return true
}
if e.Ctx().SkillEntity == nil {
return true
}
if e.Ctx().SkillEntity.Category() != info.Category.PHYSICAL {
return true
}
//fmt.Println("Effect50_o", t.Damage)
if t.Type == info.DamageType.Red {
t.Damage = t.Damage.Div(decimal.NewFromInt(int64(e.Args()[1])))
}
//fmt.Println("Effect50_n", t.Damage)
return true
}
func (e *Effect50) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}
// ---- 注册所有效果 ----
func init() {
input.InitEffect(input.EffectType.Skill, 50, &Effect50{})
}