feat(游戏配置): 调整任务初始状态和卡池升级规则
- 删除冗余的 GameConst.ts.meta 文件 - 新增卡池升级每波减免金额常量 CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE - 任务开始时初始等级设为1,波次从1开始,并给予初始金币 - 卡池升级费用根据已完成的波次进行减免 - 调整加载页面和胜利界面的UI元素位置和样式
This commit is contained in:
@@ -3,7 +3,7 @@ import { _decorator, instantiate, Label, Node, NodeEventType, Prefab, SpriteAtla
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { CARD_POOL_INIT_LEVEL, CARD_POOL_MAX_LEVEL, CardConfig, CardsUpSet, getCardsByLv } from "../common/config/CardSet";
|
||||
import { CARD_POOL_INIT_LEVEL, CARD_POOL_MAX_LEVEL, CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE, CardConfig, CardsUpSet, getCardsByLv } from "../common/config/CardSet";
|
||||
import { CardComp } from "./CardComp";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
||||
@@ -181,6 +181,7 @@ export class MissionCardComp extends CCComp {
|
||||
|
||||
private onNewWave() {
|
||||
this.enterPreparePhase();
|
||||
this.updateCoinAndCostUI();
|
||||
this.layoutCardSlots();
|
||||
const cards = this.buildDrawCards();
|
||||
this.dispatchCardsToSlots(cards);
|
||||
@@ -497,7 +498,10 @@ export class MissionCardComp extends CCComp {
|
||||
}
|
||||
|
||||
private getUpgradeCost(lv: number): number {
|
||||
return CardsUpSet[lv] ?? 0;
|
||||
const baseCost = Math.max(0, Math.floor(CardsUpSet[lv] ?? 0));
|
||||
const completedWave = Math.max(0, this.getCurrentWave() - 1);
|
||||
const discount = Math.max(0, Math.floor(CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE)) * completedWave;
|
||||
return Math.max(0, baseCost - discount);
|
||||
}
|
||||
|
||||
private getRefreshCost(): number {
|
||||
@@ -695,6 +699,11 @@ export class MissionCardComp extends CCComp {
|
||||
return Math.max(0, Math.floor(missionData?.coin ?? 0));
|
||||
}
|
||||
|
||||
private getCurrentWave(): number {
|
||||
const missionData = this.getMissionData();
|
||||
return Math.max(1, Math.floor(missionData?.level ?? 1));
|
||||
}
|
||||
|
||||
private setMissionCoin(value: number) {
|
||||
const missionData = this.getMissionData();
|
||||
if (!missionData) return;
|
||||
|
||||
Reference in New Issue
Block a user