diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 2a46f237..a923a0cd 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -13,6 +13,8 @@ * 5. **特殊卡执行** —— 处理英雄升级卡(SpecialUpgrade,按 UUID 精确升级)和 * 英雄刷新卡(SpecialRefresh)。 * 6. **准备/战斗阶段切换** —— 控制卡牌面板的 展开/收起 动画。 + * 7. **战前英雄限定** —— 仅开局提供 3 次免费三选一,showHeros 按钮初始即永久隐藏, + * 后续不再提供手动插卡入口。 * * 关键设计: * - 3 个 CHeroComp 由 cardPrefab 动态实例化生成,通过 cacheCardComps() 映射为有序数组 cardComps[], @@ -264,6 +266,8 @@ export class MissionCardComp extends CCComp { this.hideAllHeroBoxSlots(); this.initCardsPanelPos(); this.initPanelLayout(); + // 初始即永久隐藏手动插卡按钮,任何阶段都不再激活 + this.updateShowHerosVisibility(); mLogger.log(this.debugMode, "MissionCardComp", "onLoad init", { slots: this.cardComps.length, }); @@ -889,6 +893,8 @@ export class MissionCardComp extends CCComp { // 抽 1 张后关闭英雄卡池面板 this.hideCardsPanel(); } + // 英雄数量变化后同步 showHeros 可见性(满员/次数耗尽即隐藏) + this.updateShowHerosVisibility(); mLogger.log(this.debugMode, "MissionCardComp", "refresh hero pool after buy", { triggerSlot: heroIdx }); @@ -1237,22 +1243,18 @@ export class MissionCardComp extends CCComp { } /** - * 英雄招募按钮:每次都展开三选一面板,玩家选 1; - * 开局免费三选一次数未用完时不扣面板开启费。 - * 满员(HERO_MAX_NUM)时气泡提示并拦截,不扣费、不计数。 + * 英雄招募按钮:永久禁用,不再提供手动插卡入口。 + * 战前 3 个英雄由系统自动连续弹出三选一完成。 */ private onShowHerosClick() { oops.audio.playEffect("music/button"); - // 满员拦截 - if (this.getAliveHeroCount() >= this.getMissionHeroMaxNum()) { - this.showSmallTip("panel_hero_full", "英雄槽已满"); - return; - } + this.updateShowHerosVisibility(); + } - // 开局免费次数内不扣面板开启费 - if (this.openingFreePicks <= 0 && !this.tryPayPanelOpenCost(0)) return; - this.slideToPanel(0); - this.showCardsPanel(); + /** 控制 showHeros 按钮可见性:初始即永久隐藏,任何阶段都不再激活 */ + private updateShowHerosVisibility() { + if (!this.showHeros || !this.showHeros.isValid) return; + this.showHeros.active = false; } // ======================== 英雄信息盒(herosBoxNode) ======================== @@ -1826,13 +1828,7 @@ export class MissionCardComp extends CCComp { this.cardsHideScale = new Vec3(0, 0, this.cardsBaseScale.z); } - /** - * 进入准备阶段: - * - 初始化面板布局(如尚未初始化)。 - * - 收起覆盖面板回到英雄面板(index=0),作为默认展示。 - * - 激活 showHeros 按钮可见性。 - * - 显示卡牌面板(从底部滑入)。 - */ + /** 进入准备阶段:不再自动激活 showHeros 按钮,仅维护面板基础状态 */ private enterPreparePhase() { if (!this.cards_node || !this.cards_node.isValid) return; this.initCardsPanelPos(); @@ -1840,10 +1836,8 @@ export class MissionCardComp extends CCComp { if (!this.hasInitPanelLayout) { this.initPanelLayout(); } - // 显式激活「显示英雄卡池」按钮本身,让玩家可见可点 - if (this.showHeros && this.showHeros.isValid) { - this.showHeros.active = true; - } + // 开局三选一期满后永久隐藏 showHeros(战前限定,不随阶段恢复) + this.updateShowHerosVisibility(); // 刷新所有刷新按钮的费用显示(含刷新石/金币切换与置灰状态) this.updateDrawCostUI(); // 显示卡牌面板(默认进入准备阶段时展开,缩放放大到 1,点亮按钮 active 高亮)