```
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

@@ -19,7 +19,7 @@ func (e *Effect468) SkillHit() bool {
if v < 0 { if v < 0 {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0) e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), 0)
ispwoer = true ispwoer = true
return true
} }
} }

View File

@@ -11,7 +11,7 @@ type Effect470 struct {
node.EffectNode node.EffectNode
} }
func (e *Effect470) SkillHit() bool { func (e *Effect470) Skill_Use_ex() bool {
if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS { if e.Ctx().SkillEntity != nil && e.Ctx().SkillEntity.Category() != info.Category.STATUS {
chance := e.Args()[1].IntPart() // m% chance := e.Args()[1].IntPart() // m%
success, _, _ := e.Input.Player.Roll(int(chance), 100) success, _, _ := e.Input.Player.Roll(int(chance), 100)

View File

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

View File

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