Files
bl/logic/service/fight/effect/effect_41.go
2025-11-13 23:48:34 +08:00

50 lines
909 B
Go

package effect
import (
element "blazing/common/data/Element"
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
*m~n回合对本方的火系攻击伤害减半
*/
func init() {
input.InitEffect(input.EffectType.Skill, 41, &Effect41{})
}
type Effect41 struct {
node.EffectNode
}
// 伤害落实前触发,限制最大伤害
func (e *Effect41) 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.STATUS {
return true
}
if e.Ctx().SkillEntity.Type().Secondary != nil {
return true
}
if e.Ctx().SkillEntity.Type().Primary != element.ElementTypeFire {
return true
}
if t.Type == info.DamageType.Red {
t.Damage = t.Damage.Div(decimal.NewFromInt(2))
}
return true
}