fix: 修复属性设置逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-17 10:57:11 +08:00
committed by cnb
parent ed8e3327b4
commit 1e37d71878
8 changed files with 68 additions and 7 deletions

View File

@@ -16,8 +16,11 @@ func (e *Effect190) Skill_Use_ex() bool {
}
// 消除对手所有能力强化状态
for i, _ := range e.Ctx().Opp.Prop[:] {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
for i, v := range e.Ctx().Opp.Prop[:] {
if v>0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0)
}
}
return true

View File

@@ -16,6 +16,9 @@ func (e *Effect477) Skill_Use_ex() bool {
}
for i, effectId := range e.SideEffectArgs[1:] {
if effectId == 0 {
continue
}
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(effectId))
}

View File

@@ -15,7 +15,9 @@ func (e *Effect483) OnSkill() bool {
if !e.IsFirst() { // 后出手
v = v * 2
}
if v == 0 {
continue
}
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(v))
}

View File

@@ -23,7 +23,10 @@ func (e *Effect504) OnSkill() bool {
}
} else {
for i, effectId := range e.SideEffectArgs[1:] {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(effectId))
if effectId!=0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(effectId))
}
}
}

View File

@@ -18,6 +18,9 @@ func (e *Effect516) Skill_Use() bool {
if currentHp.Cmp(threshold) < 0 {
v *= 2
}
if v == 0 {
continue
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(v))
}

View File

@@ -14,9 +14,11 @@ func (e *Effect523) Action_end() bool {
// 检查对手是否还活着
if e.Ctx().Opp.CurrentPet.Info.Hp > 0 {
// 提升自身的全部能力等级
for i := 0; i < 6; i++ {
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(e.SideEffectArgs[i]))
for i, v := range e.SideEffectArgs {
if v == 0 {
continue
}
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), int8(v))
}
}

View File

@@ -0,0 +1,42 @@
package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
type Effect538 struct {
node.EffectNode
}
func (e *Effect538) Skill_Use() bool {
if e.Ctx().SkillEntity == nil {
return true
}
isadd := false
// 消除对手所有能力强化状态
for i, v := range e.Ctx().Opp.Prop[:] {
if v > 0 {
if e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), 0) {
isadd = true
}
}
}
if isadd {
for i, v := range e.SideEffectArgs[1:] {
if v != 0 {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(v))
}
}
}
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 538, &Effect538{})
}

View File

@@ -17,6 +17,9 @@ func (e *Effect448) SetArgs(t *input.Input, a ...int) {
func (e *Effect448) OnSkill() bool {
for i, v := range e.SideEffectArgs[1:] {
if v == 0 {
continue
}
if e.rev {
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), int8(v))
} else {