refactor(fight/effect): 重构伤害处理逻辑,统一使用DamageZone管理伤害值并优化Effect接口,移除过时方法
This commit is contained in:
@@ -2,7 +2,6 @@ package effect
|
||||
|
||||
import (
|
||||
"blazing/common/utils"
|
||||
"blazing/logic/service/fight/info"
|
||||
"blazing/logic/service/fight/input"
|
||||
"blazing/logic/service/fight/node"
|
||||
)
|
||||
@@ -23,7 +22,7 @@ type Effect8 struct {
|
||||
}
|
||||
|
||||
// 伤害落实前触发,限制最大伤害
|
||||
func (e *Effect8) BeforeAttacked(opp *input.Input, skill *info.SkillEntity) {
|
||||
func (e *Effect8) Attack(opp *input.Input, eff *input.EffectID) {
|
||||
|
||||
// //在这里修改伤害
|
||||
// if opp.GetEffect(input.EffectType.Damage, 0).MaxStack() != 0 { //限制最大伤害
|
||||
@@ -31,8 +30,8 @@ func (e *Effect8) BeforeAttacked(opp *input.Input, skill *info.SkillEntity) {
|
||||
// }
|
||||
|
||||
opp.Pet(e.Input, func() { //我方取敌方属性
|
||||
dg := utils.Min(e.Input.GetEffect(input.EffectType.Damage, 0).Stack(), int(opp.CurrentPet.Info.Hp)-1)
|
||||
e.Input.GetEffect(input.EffectType.Damage, 0).Stack(dg)
|
||||
|
||||
e.Input.DamageZone[0] = utils.Min(e.Input.GetDamage(0), int(opp.CurrentPet.Info.Hp)-1)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user