fix(fight): 修复技能效果获取逻辑并调整伤害计算方式

-
This commit is contained in:
2025-09-24 19:46:42 +08:00
parent 9b078d7820
commit 805fe8ec8d
4 changed files with 38 additions and 25 deletions

View File

@@ -27,10 +27,11 @@ type Input struct {
func NewInput(c common.FightI, p common.PlayerI) *Input {
ret := &Input{FightC: c, Player: p}
t := ret.GetDamageEffect(0)
ret.Effects = utils.NewOrderedMap[int, Effect]()
t := GetDamageEffect(0)
ret.AddEffect(t) //添加默认基类,实现继承
p.SetFightC(c) //给玩家设置战斗容器
ret.Effects = utils.NewOrderedMap[int, Effect]()
return ret
}
@@ -72,7 +73,7 @@ func (i *Input) GetStatusBonus() float64 {
maxBonus := 1.0 // 默认无状态倍率
for statusIdx := 0; statusIdx < 20; statusIdx++ {
t, ok := i.GetStatusEffect(statusIdx)
t, ok := GetStatusEffect(statusIdx)
// 检查状态是否存在数组中值为1表示存在该状态
if ok && t.Stack() > 0 {