fix(fight): 修复战斗命中判断逻辑并移除冗余命中检查 - 修复 NewSel32 中的命中判断,将 Side 字段改为 Hit 字段 - 移除 EffectAttackMiss 中的冗余命中判断逻辑 - 移除 EffectDefeatTrigger 中的重复命中检查 - 移除 EffectPhysicalAttackAddStatus 中的冗余命中判断 - 移除多个效果文件中的重复命中检查逻辑 - 修正 Effect136 中的命中处理逻辑,确保在技能命中时正确触发 - 移除其他多个效果中的重复命中检查代码 ```
68 lines
1.7 KiB
Go
68 lines
1.7 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/info"
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
)
|
||
|
||
// Effect3:能力操作类效果(重置/反转/偷取等)
|
||
type Effect3 struct {
|
||
node.EffectNode
|
||
Reverse bool
|
||
Level int8
|
||
OpType info.EnumAbilityOpType
|
||
}
|
||
|
||
// ----------------------
|
||
// 执行时逻辑
|
||
// ----------------------
|
||
func (e *Effect3) OnSkill() bool {
|
||
|
||
// 遍历六项能力值(攻击、防御、速度等)
|
||
for i := 0; i < 6; i++ {
|
||
if e.Reverse {
|
||
// 对对手生效
|
||
e.Ctx().Opp.SetProp(e.Ctx().Our, int8(i), e.Level, e.OpType)
|
||
} else {
|
||
// 对自己生效
|
||
e.Ctx().Our.SetProp(e.Ctx().Our, int8(i), e.Level, e.OpType)
|
||
}
|
||
}
|
||
|
||
return true
|
||
}
|
||
|
||
// ----------------------
|
||
// 工厂函数
|
||
// ----------------------
|
||
func newEffect3(reverse bool, level int8, opType info.EnumAbilityOpType) *Effect3 {
|
||
return &Effect3{
|
||
Reverse: reverse,
|
||
Level: level,
|
||
OpType: opType,
|
||
}
|
||
}
|
||
|
||
// ----------------------
|
||
// 注册所有效果
|
||
// ----------------------
|
||
func init() {
|
||
effects := []struct {
|
||
id int
|
||
reverse bool
|
||
level int8
|
||
opType info.EnumAbilityOpType
|
||
}{
|
||
{3, false, -1, info.AbilityOpType.RESET}, // 解除自身能力下降状态
|
||
{33, true, 1, info.AbilityOpType.RESET}, // 消除对手能力提升状态
|
||
{63, false, 0, info.AbilityOpType.BounceWeaken}, // 将能力下降反馈给对手
|
||
{85, false, -1, info.AbilityOpType.StealStrengthen}, // 将对手提升效果转移到自己
|
||
{143, true, 1, info.AbilityOpType.Reverse}, // 反转对手能力提升为下降
|
||
}
|
||
|
||
for _, e := range effects {
|
||
input.InitEffect(input.EffectType.Skill, e.id, newEffect3(e.reverse, e.level, e.opType))
|
||
}
|
||
}
|