refactor(map): 移除所有卡牌购买的扣费逻辑,改为免费获取
统一调整四个卡牌组件的购买流程,删除MissionEconomy导入和扣费校验代码,更新注释说明当前为免费购买模式,简化日志输出内容
This commit is contained in:
@@ -21,7 +21,6 @@ import { buildEquipRich } from "../common/config/HeroSkillDesc";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { getCardIconId, setSpriteFrame } from "../common/CardIconHelper";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { MissionEconomy } from "./MissionEconomy";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -327,19 +326,7 @@ export class EquipListComp extends CCComp {
|
||||
|
||||
oops.audio.playEffect("music/button");
|
||||
|
||||
// 扣费
|
||||
const cost = this.cardData.cost ?? 0;
|
||||
const success = MissionEconomy.spendCoin(cost);
|
||||
if (!success) {
|
||||
oops.message.dispatchEvent(GameEvent.ShowSmallTip, "buy_coin");
|
||||
mLogger.log(this.debugMode, "EquipListComp", "purchase failed: not enough coin", {
|
||||
uuid: this.cardData.uuid,
|
||||
cost
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 派发 UseEquipCard,装备生效流程由 MissEquipComp 接收处理
|
||||
// 购买不花费金币(免费获取),直接派发装备生效事件
|
||||
oops.message.dispatchEvent(GameEvent.UseEquipCard, this.cardData);
|
||||
|
||||
// 播放购买动画(卡牌放大 + 淡出)
|
||||
@@ -350,8 +337,7 @@ export class EquipListComp extends CCComp {
|
||||
oops.message.dispatchEvent(GameEvent.CardUsed, this);
|
||||
|
||||
mLogger.log(this.debugMode, "EquipListComp", "equipment purchased", {
|
||||
uuid: this.cardData.uuid,
|
||||
cost
|
||||
uuid: this.cardData.uuid
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user