refactor(fight/effect): 重构技能伤害计算逻辑,将伤害处理移至Effect0.OnSkill方法并优化效果调用流程

This commit is contained in:
1
2025-09-23 18:35:23 +00:00
parent a524e651aa
commit 5a023ccd1c
6 changed files with 55 additions and 40 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/gogf/gf/v2/util/gconv"
"github.com/jinzhu/copier"
"github.com/mohae/deepcopy"
)
type Input struct {
@@ -27,9 +26,9 @@ type Input struct {
func NewInput(c common.FightI, p common.PlayerI) *Input {
ret := &Input{FightC: c, Player: p}
t := ret.GetDamageEffect(0)
ret.AddEffect(deepcopy.Copy(t).(Effect)) //添加默认基类,实现继承
p.SetFightC(c) //给玩家设置战斗容器
t, _ := Geteffect(4000000)
ret.AddEffect(t) //添加默认基类,实现继承
p.SetFightC(c) //给玩家设置战斗容器
return ret
}