feat(player): 添加 UseCoins 方法统一处理玩家金币消耗逻辑 重构购买物品和变更外观功能,使用 UseCoins 方法替代手动操作 Coins 字段, 确保金币扣除的安全性和一致性。同时修复可能因并发导致的金币超扣问题。 此外,调整部分战斗系统接口参数传递方式,将 DamageZone 指
45 lines
649 B
Go
45 lines
649 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
/**
|
|
* 下n回合自身攻击技能必定打出致命一击
|
|
*/
|
|
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 58, &Effect58{
|
|
EffectNode: node.EffectNode{},
|
|
})
|
|
|
|
}
|
|
|
|
type Effect58 struct {
|
|
node.EffectNode
|
|
can bool
|
|
}
|
|
|
|
func (e *Effect58) OnSkill() bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
e.can = true
|
|
|
|
return true
|
|
}
|
|
|
|
func (e *Effect58) Skill_Hit_Pre(a, b *action.SelectSkillAction) bool {
|
|
if !e.Hit() {
|
|
return true
|
|
}
|
|
if !e.can {
|
|
return true
|
|
}
|
|
e.Ctx().SkillEntity.Crit = 16
|
|
|
|
return true
|
|
}
|