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