fix(抽卡): 修复战斗阶段可抽卡及卡牌面板未隐藏的问题
- 战斗开始后隐藏卡牌面板并清空卡牌,而非刷新战斗卡牌 - 在抽卡逻辑开始时检查战斗阶段,阻止战斗时抽卡 - 注释掉卡池中三个特殊刷新卡牌配置
This commit is contained in:
@@ -302,13 +302,11 @@ 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);
|
||||
this.clearAllCards();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -537,6 +535,10 @@ export class MissionCardComp extends CCComp {
|
||||
* 3. 重新布局槽位 → 从卡池构建 4 张卡 → 分发到槽位。
|
||||
*/
|
||||
private onClickDraw() {
|
||||
if (this.isBattlePhase) {
|
||||
oops.gui.toast("战斗阶段无法抽卡");
|
||||
return;
|
||||
}
|
||||
const cost = this.getRefreshCost();
|
||||
const currentCoin = this.getMissionCoin();
|
||||
if (currentCoin < cost) {
|
||||
@@ -616,10 +618,15 @@ export class MissionCardComp extends CCComp {
|
||||
private enterBattlePhase() {
|
||||
if (!this.cards_node || !this.cards_node.isValid) return;
|
||||
this.initCardsPanelPos();
|
||||
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 })
|
||||
.call(() => {
|
||||
if (this.cards_node && this.cards_node.isValid) {
|
||||
this.cards_node.active = false;
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}
|
||||
|
||||
/** 构建本次抽卡结果,保证最终可分发4条数据 */
|
||||
|
||||
Reference in New Issue
Block a user