Files
pixelheros/assets/script/game/common/config/TalentSet.ts
walkpan 78e325e8e5 refactor(talent): 天赋升级系统重构为金币消耗模式
- 移除碎片相关配置与数据结构,统一使用 costs 数组配置每级金币消耗
- 优化天赋配置文案,去除名称中的冗余字样,精简属性描述文本
- 清理 SingletonModuleComp 存档及云端同步中的碎片字段
- 修改 TalentsComp 界面逻辑,升级校验、扣除及重置返还全面切换为金币体系
- 调整界面显示细节:等级格式变更为 current/max,消耗仅显示纯数值
2026-05-10 23:59:39 +08:00

71 lines
3.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* @file TalentSet.ts
* @description 天赋系统配置数据,包含经验要求、消耗、每个天赋的具体加成数值和描述。
*/
export enum TalentType {
Attack = 1, // 攻击强化
Hp = 2, // 生命强化
Critical = 3, // 暴击强化
WindFury = 4, // 风怒强化
Freeze = 5, // 冰冻强化
Puncture = 6, // 穿刺强化
DeadTrigger = 7,// 亡语强化
Summon = 8, // 召唤强化
BuyDiscount = 9,// 采购优惠
RefreshDiscount = 10, // 刷新优惠
SellBonus = 11 // 出售补贴
}
export interface TalentInfo {
/** 天赋 ID */
id: number;
/** 天赋名称 */
name: string;
/** 天赋图标或标识(可选) */
icon?: string;
/** 描述模板,使用 {value} 替换具体数值 */
desc: string;
/** 最大等级 */
maxLevel: number;
/** 每一级的加成数值从第1级到最大级 */
values: number[];
/** 每一级的金币消耗数量,下标 0 表示升到 1 级 */
costs: number[];
}
export const TalentConfig = {
// 玩家升级所需经验配置
expRequirements: [
{ maxLevel: 10, expPerLevel: 100 },
{ maxLevel: 20, expPerLevel: 150 },
{ maxLevel: 30, expPerLevel: 200 }
],
// 所有天赋定义(使用数组维护)
talents: [
{ id: TalentType.Attack, name: "攻击", icon: "⚔️", desc: "+{value}%",
maxLevel: 5, values: [3, 6, 9, 12, 15], costs: [1, 1, 2, 2, 3] },
{ id: TalentType.Hp, name: "生命", icon: "❤️", desc: "+{value}%",
maxLevel: 5, values: [5, 10, 15, 20, 25], costs: [1, 1, 2, 2, 3] },
{ id: TalentType.Critical, name: "暴击率", icon: "🔥", desc: "+{value}%",
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
{ id: TalentType.WindFury, name: "风怒率", icon: "⚡", desc: "+{value}%",
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
{ id: TalentType.Freeze, name: "冰冻率", icon: "❄️", desc: "+{value}%",
maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] },
{ id: TalentType.Puncture, name: "穿刺", icon: "🗡️", desc: "+{value}",
maxLevel: 5, values: [0.2, 0.4, 0.6, 0.8, 1.0], costs: [1, 1, 2, 2, 3] },
{ id: TalentType.DeadTrigger, name: "亡语额外触发", icon: "🛡️", desc: "+{value}次",
maxLevel: 1, values: [1], costs: [25] },
{ id: TalentType.Summon, name: "召唤额外触发", icon: "🛡️", desc: "+{value}次",
maxLevel: 1, values: [1], costs: [25] },
{ id: TalentType.BuyDiscount, name: "购买优惠", icon: "🛒", desc: "-{value}金币",
maxLevel: 1, values: [1], costs: [10] },
{ id: TalentType.RefreshDiscount, name: "刷新优惠", icon: "🔄", desc: "-{value}金币",
maxLevel: 1, values: [1], costs: [10] },
{ id: TalentType.SellBonus, name: "出售返还", icon: "💰", desc: "+{value}金币",
maxLevel: 1, values: [1], costs: [10] }
] as TalentInfo[]
};