```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

fix(fight): 修复战斗效果和属性设置中的边界条件问题

- 修复Effect468中负值处理后提前返回的问题
- 重命名Effect470的SkillHit方法为Skill_Use_ex以匹配实际功能
- 注释掉调试用的println语句
- 在SetProp方法中添加属性值边界检查,确保属性值在-6到6范围内
```
This commit is contained in:
昔念
2026-03-10 16:02:38 +08:00
parent f58463c0d4
commit ab2ebcd56d
4 changed files with 9 additions and 3 deletions

View File

@@ -257,7 +257,7 @@ func (our *Input) CalculatePower(deftype *Input, skill *info.SkillEntity) alpaca
Mul(typeRate). // 克制系数
Mul(skill.Criticalrandom()) //随机波动
println(baseDamage.IntPart(), damage.IntPart(), attackDec.IntPart(), defenseDec.IntPart(), "技能伤害")
//println(baseDamage.IntPart(), damage.IntPart(), attackDec.IntPart(), defenseDec.IntPart(), "技能伤害")
return damage
}

View File

@@ -34,6 +34,9 @@ func (target *Input) SetProp(source *Input, index, level int8) bool {
case level < 0:
if target.AttackValue.Prop[index] > -6 {
target.AttackValue.Prop[index] += level
if target.AttackValue.Prop[index] < -6 {
target.AttackValue.Prop[index] = -6
}
} else {
return false
}
@@ -41,6 +44,9 @@ func (target *Input) SetProp(source *Input, index, level int8) bool {
case level > 0:
if target.AttackValue.Prop[index] < 6 {
target.AttackValue.Prop[index] += level
if target.AttackValue.Prop[index] > 6 {
target.AttackValue.Prop[index] = 6
}
} else {
return false
}