Files
bl/logic/service/fight/effect/effect_41.go
昔念 f224bef17a feat(fight): 移除无用代码并优化技能效果逻辑
- 删除了多个未使用的技能效果文件(effect_10-16_94_99_14.go、effect_61_70_118.go、
  effect_66.go、effect_67.go、effect_78_86_106.go、effect_84_92.go、prop.go)
- 修正了部分技能效果中的错误逻辑判断和数值计算方式
- 调整了伤害计算与治疗效果的参数使用顺序,使其符合预期行为
- 注释掉调试打印语句及测试调用,减少冗余输出
- 修复了部分效果中对技能分类的错误比较条件

此次修改提升了战斗系统代码的整洁性和准确性。
2025-11-14 02:04:19 +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
}