feat(卡牌): 调整战斗阶段卡牌逻辑与配置
- 战斗阶段不再隐藏卡牌面板,改为刷新为技能卡 - 移除特殊升级卡,统一刷新卡费用为1并调整权重 - 修复卡牌组件布局参数,确保战斗阶段显示正确
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 },
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user