fix(fight): 修复战斗命中判断逻辑并移除冗余命中检查

- 修复 NewSel32 中的命中判断,将 Side 字段改为 Hit 字段
- 移除 EffectAttackMiss 中的冗余命中判断逻辑
- 移除 EffectDefeatTrigger 中的重复命中检查
- 移除 EffectPhysicalAttackAddStatus 中的冗余命中判断
- 移除多个效果文件中的重复命中检查逻辑
- 修正 Effect136 中的命中处理逻辑,确保在技能命中时正确触发
- 移除其他多个效果中的重复命中检查代码
```
This commit is contained in:
2026-01-04 21:41:10 +08:00
parent 1bd6840e98
commit 0f524aab85
90 changed files with 117 additions and 331 deletions

View File

@@ -27,7 +27,7 @@ type Input struct {
// info.BattleActionI
Effects []Effect //effects 实际上全局就是effect无限回合 //effects容器 技能的
EffectCache []Effect //这里是命中前执行的容器,也就是命中前执行的所有逻辑相关,理论上一个effect被激活,就应该同时将其他的effect取消激活
Effect_Lost []Effect
EffectLost []Effect
// 删掉伤害记录,可以在回调中记录,而不是每次调用记录
SumDamage alpacadecimal.Decimal //伤害
// DamageZone struct {
@@ -105,6 +105,7 @@ func (our *Input) SetOPP(t *Input) {
}
func (our *Input) RecoverEffect() {
//println("恢复效果",our.UserID)
//根本没释放技能,这些效果全部失效
for _, e := range our.EffectCache {
@@ -114,9 +115,10 @@ func (our *Input) RecoverEffect() {
}
//这时候将被覆盖的效果全部装回来enterturn
for _, e := range our.Effect_Lost {
for _, e := range our.EffectLost {
if e.Duration() > 0 || e.Duration() == -1 {
e.Alive(true)
// e.Alive(true)
our.AddEffect(e.GetInput(), e)
}
}
@@ -125,15 +127,18 @@ func (our *Input) RecoverEffect() {
func (our *Input) ReactvieEffect() {
//根本没释放技能,这些效果全部失效
for _, e := range our.Effect_Lost {
for _, e := range our.EffectLost {
e.Alive(false)
// our.AddEffect(e.GetInput(), e)
}
//这时候将被覆盖的效果全部装回来enterturn
for _, e := range our.EffectCache {
e.Alive(true)
// e.Alive(true)
//因为后手方实际上是到了他出手阶段重新添加的结果,而非后手方重新激活效果
our.AddEffect(e.GetInput(), e)
}
}
@@ -250,7 +255,7 @@ func (our *Input) Parseskill(skill *action.SelectSkillAction) {
//t.SetArgs(i, temparg[:args]...) //设置入参
loste := our.AddEffect(our, t)
if loste != nil {
our.Effect_Lost = append(our.Effect_Lost, loste)
our.EffectLost = append(our.EffectLost, loste)
}
// }