refactor(talent): 天赋升级系统重构为金币消耗模式

- 移除碎片相关配置与数据结构,统一使用 costs 数组配置每级金币消耗
- 优化天赋配置文案,去除名称中的冗余字样,精简属性描述文本
- 清理 SingletonModuleComp 存档及云端同步中的碎片字段
- 修改 TalentsComp 界面逻辑,升级校验、扣除及重置返还全面切换为金币体系
- 调整界面显示细节:等级格式变更为 current/max,消耗仅显示纯数值
This commit is contained in:
walkpan
2026-05-10 23:59:39 +08:00
parent 5e5a152fec
commit 78e325e8e5
3 changed files with 48 additions and 155 deletions

View File

@@ -8,7 +8,7 @@ import { WxCloudApi } from "../wx_clound_client_api/WxCloudApi";
import { GameEvent } from "./config/GameEvent";
import { GameScoreStats } from "./config/HeroAttrs";
import { mLogger } from "./Logger";
import { TalentFragmentType, TalentType } from "./config/TalentSet";
import { TalentType } from "./config/TalentSet";
import { gameDataSync } from "./GameDataSync";
import { FightSet } from "./config/GameSet";
@@ -23,7 +23,6 @@ export interface GameDate{
talents: Record<TalentType, number>,
player_level: number,
player_exp: number,
talent_fragments: Record<TalentFragmentType, number>,
talent_points?: number,
}
}
@@ -67,7 +66,6 @@ export class SingletonModuleComp extends ecs.Comp {
talents: Record<TalentType, number>;
player_level: number;
player_exp: number;
talent_fragments: Record<TalentFragmentType, number>;
talent_points?: number;
} = {
talents: {
@@ -85,16 +83,6 @@ export class SingletonModuleComp extends ecs.Comp {
}, // 存储各个天赋的等级: { talent_id: level }
player_level: 1, // 玩家等级
player_exp: 0, // 玩家当前经验
talent_fragments: {
[TalentFragmentType.Power]: 0,
[TalentFragmentType.Tempest]: 0,
[TalentFragmentType.Vitality]: 0,
[TalentFragmentType.Frost]: 0,
[TalentFragmentType.Tactics]: 0,
[TalentFragmentType.Spirit]: 0,
[TalentFragmentType.Trade]: 0,
[TalentFragmentType.Fate]: 0
}, // 当前拥有的天赋碎片库存
talent_points: 0, // 兼容旧存档的历史字段
};
@@ -266,9 +254,6 @@ export class SingletonModuleComp extends ecs.Comp {
}
if (typeof remoteCol.player_level === 'number') this.collection.player_level = remoteCol.player_level;
if (typeof remoteCol.player_exp === 'number') this.collection.player_exp = remoteCol.player_exp;
if (remoteCol.talent_fragments) {
Object.assign(this.collection.talent_fragments, remoteCol.talent_fragments);
}
if (typeof remoteCol.talent_points === 'number') this.collection.talent_points = remoteCol.talent_points;
}
}