feat(player): 添加 UseCoins 方法统一处理玩家金币消耗逻辑

重构购买物品和变更外观功能,使用 UseCoins 方法替代手动操作 Coins 字段,
确保金币扣除的安全性和一致性。同时修复可能因并发导致的金币超扣问题。

此外,调整部分战斗系统接口参数传递方式,将 DamageZone 指
This commit is contained in:
2025-11-13 21:36:18 +08:00
parent 6e01848b04
commit 5e3d558d30
24 changed files with 306 additions and 114 deletions

View File

@@ -6,10 +6,15 @@ import (
"blazing/logic/service/fight/input"
)
func (e *EffectNode) Compare_Pre(fattack, sattack *action.SelectSkillAction) bool {
return false
func (e *EffectNode) Skill_Hit_Pre(fattack, sattack *action.SelectSkillAction) bool {
return true
}
func (e *EffectNode) Turn_Start() {
func (e *EffectNode) Compare_Pre(fattack, sattack *action.SelectSkillAction) bool { //比较前对优先级的修改 {
return true
}
func (e *EffectNode) Turn_Start(fattack, sattack *action.SelectSkillAction) {
//panic("not implemented") // TODO: Implement
}
func (e *EffectNode) Turn_End() {

View File

@@ -1,34 +1,36 @@
package node
func (e *EffectNode) Damage_ADD() bool {
import "blazing/logic/service/fight/info"
func (e *EffectNode) Damage_ADD(_ *info.DamageZone) bool {
return true
}
func (e *EffectNode) Damage_Mul() bool {
func (e *EffectNode) Damage_Mul(_ *info.DamageZone) bool {
return true
}
func (e *EffectNode) Damage_Floor() bool {
func (e *EffectNode) Damage_Floor(_ *info.DamageZone) bool {
return true
}
func (e *EffectNode) Damage_DIV_ex() bool {
func (e *EffectNode) Damage_DIV_ex(_ *info.DamageZone) bool {
return true
}
func (e *EffectNode) Damage_SUB_ex() bool {
func (e *EffectNode) Damage_SUB_ex(_ *info.DamageZone) bool {
return true
}
func (e *EffectNode) Damage_Lock() bool {
func (e *EffectNode) Damage_Lock(_ *info.DamageZone) bool {
return true
}
func (e *EffectNode) Damage_Lock_ex() bool {
func (e *EffectNode) Damage_Lock_ex(_ *info.DamageZone) bool {
return true
}
func (e *EffectNode) Damage_Shield() bool {
func (e *EffectNode) Damage_Shield(_ *info.DamageZone) bool {
return true
}

View File

@@ -12,9 +12,6 @@ func (e *EffectNode) Calculate_Pre() bool {
return true
}
func (e *EffectNode) Skill_Hit_Pre() bool {
return true
}
func (e *EffectNode) Skill_Hit() bool {
return true
}