From 50ff3fd150bda26577d078d247789910909e99b7 Mon Sep 17 00:00:00 2001 From: panw Date: Tue, 21 Apr 2026 14:34:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=8D=A1=E7=89=8C):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=88=98=E6=96=97=E9=98=B6=E6=AE=B5=E5=8D=A1=E7=89=8C=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=B8=8E=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 战斗阶段不再隐藏卡牌面板,改为刷新为技能卡 - 移除特殊升级卡,统一刷新卡费用为1并调整权重 - 修复卡牌组件布局参数,确保战斗阶段显示正确 --- assets/resources/gui/element/card.prefab | 14 +++++------ assets/script/game/common/config/CardSet.ts | 8 +++--- assets/script/game/map/MissionCardComp.ts | 28 +++++++++++++++------ 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/assets/resources/gui/element/card.prefab b/assets/resources/gui/element/card.prefab index 16d73ba2..6a121323 100644 --- a/assets/resources/gui/element/card.prefab +++ b/assets/resources/gui/element/card.prefab @@ -5982,8 +5982,8 @@ }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, - "y": -101.274, + "x": -69.28199999999998, + "y": 94.34899999999999, "z": 0 }, "_lrot": { @@ -6389,11 +6389,11 @@ "__prefab": { "__id__": 283 }, - "_alignFlags": 20, + "_alignFlags": 9, "_target": null, - "_left": -5.638999999999996, + "_left": -4.281999999999989, "_right": 0, - "_top": 196.274, + "_top": 0.6510000000000034, "_bottom": -6.274000000000001, "_horizontalCenter": 0, "_verticalCenter": 0, @@ -6404,7 +6404,7 @@ "_isAbsHorizontalCenter": true, "_isAbsVerticalCenter": true, "_originalWidth": 0, - "_originalHeight": 0, + "_originalHeight": 40, "_alignMode": 2, "_lockFlags": 0, "_id": "" @@ -8440,7 +8440,7 @@ "__id__": 390 } ], - "_active": false, + "_active": true, "_components": [ { "__id__": 396 diff --git a/assets/script/game/common/config/CardSet.ts b/assets/script/game/common/config/CardSet.ts index f8bd4ffc..bc3ff07e 100644 --- a/assets/script/game/common/config/CardSet.ts +++ b/assets/script/game/common/config/CardSet.ts @@ -93,11 +93,9 @@ export const CardPoolList: CardConfig[] = [ { uuid: 6304, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "神圣治疗", info: "恢复场上随机3个友方单位的生命值", is_inst: true, t_times: 1, t_inv: 0 }, { uuid: 6305, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体护盾", info: "随机3个友方获得2次伤害免疫", is_inst: true, t_times: 1, t_inv: 0 }, - { uuid: 7001, type: CardType.SpecialUpgrade, cost: 6, weight: 16, pool_lv: 1 ,kind: CKind.Card }, - { uuid: 7002, type: CardType.SpecialUpgrade, cost: 6, weight: 14, pool_lv: 2 ,kind: CKind.Card }, - { uuid: 7101, type: CardType.SpecialRefresh, cost: 4, weight: 14, pool_lv: 1 ,kind: CKind.Card }, - { uuid: 7102, type: CardType.SpecialRefresh, cost: 4, weight: 14, pool_lv: 1 ,kind: CKind.Card }, - { uuid: 7103, type: CardType.SpecialRefresh, cost: 5, weight: 12, pool_lv: 2 ,kind: CKind.Card }, + { uuid: 7101, type: CardType.SpecialRefresh, cost: 1, weight: 12, pool_lv: 1 ,kind: CKind.Card }, + { uuid: 7102, type: CardType.SpecialRefresh, cost: 1, weight: 12, pool_lv: 1 ,kind: CKind.Card }, + { uuid: 7103, type: CardType.SpecialRefresh, cost: 1, weight: 12, pool_lv: 1 ,kind: CKind.Card }, ] diff --git a/assets/script/game/map/MissionCardComp.ts b/assets/script/game/map/MissionCardComp.ts index 85ffc794..a9559b5e 100644 --- a/assets/script/game/map/MissionCardComp.ts +++ b/assets/script/game/map/MissionCardComp.ts @@ -117,6 +117,9 @@ export class MissionCardComp extends CCComp { // ======================== 运行时状态 ======================== + /** 当前是否为战斗阶段 */ + private isBattlePhase: boolean = false; + /** 预留图集缓存(后续接入按钮/卡面图标时复用) */ private uiconsAtlas: SpriteAtlas | null = null; /** 四个槽位对应的 CardComp 控制器缓存(有序数组) */ @@ -191,6 +194,7 @@ export class MissionCardComp extends CCComp { * 6. 执行首次抽卡并分发到 4 个槽位。 */ onMissionStart() { + this.isBattlePhase = false; this.enterPreparePhase(); this.poolLv = CARD_POOL_INIT_LEVEL; const missionData = this.getMissionData(); @@ -297,9 +301,13 @@ export class MissionCardComp extends CCComp { this.playCoinChangeAnim(v > 0); } - /** 战斗开始:收起卡牌面板 */ + /** 战斗开始:不收起面板,而是刷新为战斗阶段卡牌 */ private onFightStart() { + this.isBattlePhase = true; this.enterBattlePhase(); + this.layoutCardSlots(); + const cards = this.buildDrawCards(); + this.dispatchCardsToSlots(cards); } /** @@ -331,6 +339,7 @@ export class MissionCardComp extends CCComp { /** 新一波:展开面板 → 刷新费用 UI → 重新抽卡分发 */ private onNewWave() { + this.isBattlePhase = false; this.enterPreparePhase(); this.updateCoinAndCostUI(); this.layoutCardSlots(); @@ -605,22 +614,25 @@ export class MissionCardComp extends CCComp { this.cards_node.active = true; Tween.stopAllByTarget(this.cards_node); this.cards_node.setScale(this.cardsShowScale); - tween(this.cards_node) - .to(this.cardsPanelMoveDuration, { - scale: this.cardsHideScale - }) - .start(); + // 取消战斗阶段隐藏面板的逻辑 } /** 构建本次抽卡结果,保证最终可分发4条数据 */ private buildDrawCards(): CardConfig[] { - const cards = getCardsByLv(this.poolLv); + let targetType: CardType | CardType[] | undefined = undefined; + if (this.isBattlePhase) { + targetType = CardType.Skill; + } else { + targetType = [CardType.Hero, CardType.SpecialRefresh]; + } + const cards = getCardsByLv(this.poolLv, targetType); + /** 正常情况下直接取前4 */ if (cards.length >= 4) return cards.slice(0, 4); /** 兜底:当返回不足4张时循环补齐,保证分发不缺位 */ const filled = [...cards]; while (filled.length < 4) { - const fallback = getCardsByLv(this.poolLv); + const fallback = getCardsByLv(this.poolLv, targetType); if (fallback.length === 0) break; filled.push(fallback[filled.length % fallback.length]); }