refactor(map): 移除卡牌购买限购逻辑,改为可重复购买
1. 重构SCardComp、ItemListComp、EquipListComp的isPurchased注释与逻辑,不再用于限制重复购买 2. 删除MissionCardComp中的跨波次购买记录集合与相关监听、标记逻辑 3. 调整购买按钮逻辑,购买后保持可见不再隐藏
This commit is contained in:
@@ -71,7 +71,7 @@ export class SCardComp extends CCComp {
|
||||
|
||||
/** 当前技能的卡牌配置 */
|
||||
private cardData: CardConfig | null = null;
|
||||
/** 是否已购买 */
|
||||
/** 购买/逝去动画播放中标记(仅用于跳过新卡的普通逝去动画,不影响再次购买) */
|
||||
private isPurchased: boolean = false;
|
||||
/** 透明度组件(用于淡入淡出动画) */
|
||||
private opacityComp: UIOpacity | null = null;
|
||||
@@ -354,10 +354,10 @@ export class SCardComp extends CCComp {
|
||||
* 购买点击处理:
|
||||
* 1. 扣除金币(失败则提示并中止)。
|
||||
* 2. 派发 UseSkillCard 事件,触发技能生效流程。
|
||||
* 3. 标记已购买,隐藏购买按钮。
|
||||
* 3. 播放购买动画,购买后可继续购买(购买按钮保持可见)。
|
||||
*/
|
||||
private onBuyClick() {
|
||||
if (!this.cardData || this.isPurchased) return;
|
||||
if (!this.cardData) return;
|
||||
|
||||
// 播放按钮点击回弹动画
|
||||
this.playBtnClickAnim();
|
||||
@@ -381,13 +381,8 @@ export class SCardComp extends CCComp {
|
||||
// 派发 UseSkillCard,技能生效流程由 MissSkillsComp 接收处理
|
||||
oops.message.dispatchEvent(GameEvent.UseSkillCard, this.cardData);
|
||||
|
||||
// 标记已购买
|
||||
this.isPurchased = true;
|
||||
if (this.buy_node) {
|
||||
this.buy_node.active = false;
|
||||
}
|
||||
|
||||
// 播放购买动画(卡牌放大 + 淡出)
|
||||
this.isPurchased = true;
|
||||
this.playPurchaseAnim();
|
||||
|
||||
// 派发 CardUsed 事件,通知 MissionCardComp 刷新技能卡池
|
||||
@@ -399,12 +394,9 @@ export class SCardComp extends CCComp {
|
||||
});
|
||||
}
|
||||
|
||||
/** 标记为已购买状态 */
|
||||
/** 标记购买动画播放中(供外部在刷新前保持动画状态,不再用于限购) */
|
||||
setPurchased(): void {
|
||||
this.isPurchased = true;
|
||||
if (this.buy_node) {
|
||||
this.buy_node.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user