feat(游戏配置): 调整任务初始状态和卡池升级规则

- 删除冗余的 GameConst.ts.meta 文件
- 新增卡池升级每波减免金额常量 CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE
- 任务开始时初始等级设为1,波次从1开始,并给予初始金币
- 卡池升级费用根据已完成的波次进行减免
- 调整加载页面和胜利界面的UI元素位置和样式
This commit is contained in:
walkpan
2026-03-29 12:29:00 +08:00
parent 9a7bafed2f
commit 0490ae51c7
6 changed files with 37 additions and 34 deletions

View File

@@ -96,7 +96,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -650,
"y": -266,
"z": 0
},
"_lrot": {
@@ -108,8 +108,8 @@
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"x": 2,
"y": 2,
"z": 1
},
"_mobility": 0,
@@ -136,13 +136,13 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 740,
"height": 1300
"width": 432,
"height": 936
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
"y": 0.5
},
"_id": ""
},
@@ -167,18 +167,18 @@
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 134
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "d7d869bc-06aa-4876-806f-487e68b96780@dc000",
"__uuid__": "d7d869bc-06aa-4876-806f-487e68b96780@1e2d6",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
@@ -210,12 +210,12 @@
"__prefab": {
"__id__": 8
},
"_alignFlags": 45,
"_alignFlags": 1,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_left": 360,
"_right": 360,
"_top": -20,
"_bottom": -10,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,

View File

@@ -4515,7 +4515,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@7645f",
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@4a554",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
@@ -4867,7 +4867,7 @@
"propertyPath": [
"_active"
],
"value": false
"value": true
},
{
"__type__": "CCPropertyOverrideInfo",

View File

@@ -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
/** 卡池等级上限 */

View File

@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "553dfb74-22f0-490d-a17e-b67757160d9b",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -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;

View File

@@ -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;