refactor: 优化战斗流程与英雄死亡处理逻辑
1. 移除HeroAttrsComp中多余的空行 2. 修改英雄死亡处理:直接销毁实体而非移至墓地 3. 调整波次更迭逻辑:直接进入BattleStart而非PrepareStart 4. 简化fight_ready方法:移除死亡英雄复活入场逻辑 5. 调整抽卡面板与卡牌池逻辑:战斗阶段保留抽卡面板且仅刷英雄卡 6. 将enterPreparePhase改为public方法
This commit is contained in:
@@ -432,13 +432,6 @@ export class MissionCardComp extends CCComp {
|
||||
private onUseHeroCard(event: string, args: any) {
|
||||
const payload = args ?? event;
|
||||
if (!payload) return;
|
||||
|
||||
if (this.isBattlePhase) {
|
||||
payload.cancel = true;
|
||||
payload.reason = "battle_phase";
|
||||
oops.gui.toast("战斗阶段无法召唤英雄");
|
||||
return;
|
||||
}
|
||||
|
||||
const current = this.getAliveHeroCount();
|
||||
this.syncMissionHeroData(current);
|
||||
@@ -671,16 +664,10 @@ export class MissionCardComp extends CCComp {
|
||||
private enterBattlePhase() {
|
||||
if (!this.cards_node || !this.cards_node.isValid) return;
|
||||
this.initCardsPanelPos();
|
||||
// 战斗阶段不再隐藏抽卡面板
|
||||
// Tween.stopAllByTarget(this.cards_node);
|
||||
// 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();
|
||||
// 战斗阶段抽卡面板不再收起
|
||||
this.cards_node.active = true;
|
||||
Tween.stopAllByTarget(this.cards_node);
|
||||
this.cards_node.setScale(this.cardsShowScale);
|
||||
|
||||
this.cachedHInfoComps.forEach(comp => {
|
||||
if (comp && comp.isValid) {
|
||||
@@ -693,7 +680,8 @@ export class MissionCardComp extends CCComp {
|
||||
private buildDrawCards(): CardConfig[] {
|
||||
let targetType: CardType | CardType[] | undefined = undefined;
|
||||
if (this.isBattlePhase) {
|
||||
targetType = CardType.Skill;
|
||||
// 战斗阶段只刷英雄卡牌,不刷其他卡牌
|
||||
targetType = CardType.Hero;
|
||||
} else {
|
||||
targetType = [CardType.Hero, CardType.SpecialRefresh];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user