refactor(config): 统一初始金币配置并调整刷新时机

1. 将分散的初始金币常量迁移到FightSet枚举中,删除冗余的CardInitCoins
2. 调整刷新费用UI更新时机,确保驻场技能效果正确生效
This commit is contained in:
panFD
2026-06-20 14:42:19 +08:00
parent 107e7fde96
commit 0a281a95d1
4 changed files with 6 additions and 4 deletions

View File

@@ -112,8 +112,6 @@ export const CardsUpSet: Record<number, number> = {
5: 250, 5: 250,
} }
/**初始coin数 */
export const CardInitCoins = 4
/** 卡池升级每波减免金额 */ /** 卡池升级每波减免金额 */
export const CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE = 10 export const CARD_POOL_UPGRADE_DISCOUNT_PER_WAVE = 10
/** 卡池默认初始等级 */ /** 卡池默认初始等级 */

View File

@@ -44,6 +44,7 @@ export enum FightSet {
PUNCTURE_DOWN = 50, PUNCTURE_DOWN = 50,
REFRESH_COST = 2, REFRESH_COST = 2,
BASE_COST = 5, BASE_COST = 5,
INIT_COIN = 7, // 初始金币数
// 刷新成本 // 刷新成本
/** 卡池等级上限(对应 CardLV 最大值) */ /** 卡池等级上限(对应 CardLV 最大值) */
MAX_CARD_POOL_LEVEL = 5, MAX_CARD_POOL_LEVEL = 5,

View File

@@ -505,6 +505,10 @@ export class MissionCardComp extends CCComp {
if (!smc.finish_guides.includes(3)) { if (!smc.finish_guides.includes(3)) {
oops.gui.open(UIID.Guide3); oops.gui.open(UIID.Guide3);
} }
// 驻场技能可能影响刷新费用(如"刷新优惠"),延迟到下一帧刷新费用 UI
// 确保 MissSkillsComp 已创建 SkillBoxComp 并注册驻场效果
this.scheduleOnce(() => this.updateCoinAndCostUI(), 0);
} }
/** 解除按钮监听,避免节点销毁后回调泄漏 */ /** 解除按钮监听,避免节点销毁后回调泄漏 */

View File

@@ -45,7 +45,6 @@ import { mLogger } from "../common/Logger";
import { Monster } from "../hero/Mon"; import { Monster } from "../hero/Mon";
import { Skill } from "../skill/Skill"; import { Skill } from "../skill/Skill";
import { Tooltip } from "../skill/Tooltip"; import { Tooltip } from "../skill/Tooltip";
import { CardInitCoins } from "../common/config/CardSet";
import { Timer } from "db://oops-framework/core/common/timer/Timer"; import { Timer } from "db://oops-framework/core/common/timer/Timer";
import { FieldSkillType } from "../common/config/SkillSet"; import { FieldSkillType } from "../common/config/SkillSet";
import { FieldSkillHelper } from "../hero/FieldSkillHelper"; import { FieldSkillHelper } from "../hero/FieldSkillHelper";
@@ -734,7 +733,7 @@ export class MissionComp extends CCComp {
// 重置所有的战局得分数据,防止上一局的数据污染 // 重置所有的战局得分数据,防止上一局的数据污染
smc.resetScores(); smc.resetScores();
smc.vmdata.mission_data.coin = Math.max(0, Math.floor(CardInitCoins)); smc.vmdata.mission_data.coin = Math.max(0, Math.floor(FightSet.INIT_COIN));
// 【评分系统 - 效率分】记录初始获得的金币收入 // 【评分系统 - 效率分】记录初始获得的金币收入
smc.vmdata.scores.gold_earned += smc.vmdata.mission_data.coin; smc.vmdata.scores.gold_earned += smc.vmdata.mission_data.coin;
} }