refactor(fight/effect): 重构伤害处理逻辑,统一使用DamageZone管理伤害值并优化Effect接口,移除过时方法

This commit is contained in:
1
2025-09-26 02:09:33 +00:00
parent 6a3a8ba20f
commit 728f3a52d6
10 changed files with 171 additions and 199 deletions

View File

@@ -20,18 +20,19 @@ type Input struct {
*info.AttackValue
FightC common.FightI
// info.BattleActionI
Effects *utils.OrderedMap[int, Effect] //effects 实际上全局就是effect无限回合 //effects容器 技能的
//Damage decimal.Decimal //造成伤害
First bool //是否先手
Effects *utils.OrderedMap[int, Effect] //effects 实际上全局就是effect无限回合 //effects容器 技能的
DamageZone map[info.EnumCategory]int //伤害容器
First bool //是否先手
}
func NewInput(c common.FightI, p common.PlayerI) *Input {
ret := &Input{FightC: c, Player: p}
ret.Effects = utils.NewOrderedMap[int, Effect]()
t := Geteffect(EffectType.Damage, 0)
t.Effect.SetArgs(ret)
ret.AddEffect(t) //添加默认基类,实现继承
p.SetFightC(c) //给玩家设置战斗容器
ret.DamageZone = make(map[info.EnumCategory]int)
// t := Geteffect(EffectType.Damage, 0)
// t.Effect.SetArgs(ret)
// ret.AddEffect(t) //添加默认基类,实现继承
p.SetFightC(c) //给玩家设置战斗容器
return ret