Files
bl/logic/service/fight/effect/effect_9.go
昔念 e2a184b687 feat(rpc): 优化客户端连接管理,使用 sync.Map 替代普通 map
将 `Clientmap` 从普通 map 改为 `sync.Map`,提升并发安全性。新增
`addClient` 和 `getClient` 方法封装存取逻辑,并在多处调用点进行了替换。

fix(fight): 修复战斗逻辑中技能ID与攻击时间字段引用错误

将 `attacker.AttackValue.SkillID` 和
`attacker.AttackValue.AttackTime` 的访问方式修正为正确的字段路径。

refactor(fight): 调整战斗结束信息处理流程

合并 `FightOverInfo` 结构到 `FightC` 中,简化广播发送逻辑,统一通过
`f.FightOverInfo` 发送战斗结果。

refactor(effect): 修改效果叠加判断逻辑并增强健壮性

更新效果节点比较方法,增加参数匹配检查以支持更精确的效果识别;同时添加
`equalInts` 工具函数用于数组内容对比。
2025-11-07 22:50:34 +08:00

44 lines
880 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/common/utils"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* 连续使用每次威力增加n最高威力m
*/
func init() {
t := &Effect9{
EffectNode: node.EffectNode{},
}
t.Duration(-1)
t.MaxStack(-1)
input.InitEffect(input.EffectType.Skill, 9, t)
}
type Effect9 struct {
node.EffectNode
Skillid int //记录使用的技能 如果技能变了就删除effect
UseSkillCount int //技能使用了多少次切换后置0
}
func (e *Effect9) Skill_Hit(ctx input.Ctx) bool {
if e.Skillid != 0 && ctx.SkillEntity.ID != e.Skillid {
e.Alive(false)
e.UseSkillCount = 0
return true
}
e.Skillid = ctx.SkillEntity.ID
add := e.EffectNode.SideEffectArgs[0] * e.UseSkillCount
ctx.SkillEntity.Power += utils.Min(add, e.EffectNode.SideEffectArgs[1])
e.UseSkillCount++
return true
}