feat(游戏配置): 调整任务初始状态和卡池升级规则
- 删除冗余的 GameConst.ts.meta 文件 - 新增卡池升级每波减免金额常量 CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE - 任务开始时初始等级设为1,波次从1开始,并给予初始金币 - 卡池升级费用根据已完成的波次进行减免 - 调整加载页面和胜利界面的UI元素位置和样式
This commit is contained in:
@@ -38,6 +38,8 @@ export const CardsUpSet: Record<number, number> = {
|
||||
}
|
||||
|
||||
export const CardInitCoins = 4
|
||||
/** 卡池升级每波减免金额 */
|
||||
export const CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE = 10
|
||||
/** 卡池默认初始等级 */
|
||||
export const CARD_POOL_INIT_LEVEL = CardKind.LV1
|
||||
/** 卡池等级上限 */
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "553dfb74-22f0-490d-a17e-b67757160d9b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -13,6 +13,7 @@ import { mLogger } from "../common/Logger";
|
||||
import { Monster } from "../hero/Mon";
|
||||
import { Skill } from "../skill/Skill";
|
||||
import { Tooltip } from "../skill/Tooltip";
|
||||
import { CardInitCoins } from "../common/config/CardSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
|
||||
@@ -222,9 +223,9 @@ export class MissionComp extends CCComp {
|
||||
smc.vmdata.mission_data.in_fight=false
|
||||
smc.vmdata.mission_data.fight_time=0
|
||||
smc.vmdata.mission_data.mon_num=0
|
||||
smc.vmdata.mission_data.level=0
|
||||
smc.vmdata.mission_data.level = 1
|
||||
smc.vmdata.mission_data.mon_max = Math.max(1, Math.floor(this.maxMonsterCount))
|
||||
this.currentWave = 0;
|
||||
this.currentWave = 1;
|
||||
this.FightTime=FightSet.FiIGHT_TIME
|
||||
this.rewards=[] // 改为数组,用于存储掉落物品列表
|
||||
this.revive_times = 1; // 每次任务开始重置复活次数
|
||||
@@ -241,7 +242,7 @@ export class MissionComp extends CCComp {
|
||||
this.heapTrendBaseMB = -1;
|
||||
this.monsterCountSyncTimer = 0;
|
||||
this.lastPrepareCoinWave = 0;
|
||||
smc.vmdata.mission_data.coin = 0;
|
||||
smc.vmdata.mission_data.coin = Math.max(0, Math.floor(CardInitCoins));
|
||||
|
||||
// 重置全局属性加成和主角引用 (确保新一局数据干净)
|
||||
// smc.role = null;
|
||||
|
||||
Reference in New Issue
Block a user