refactor(talent): 重构天赋升级消耗计算逻辑

1.  将天赋升级消耗从按等级索引改为按阶位统一配置
2.  调整getTalentUpgradeCost入参和计算逻辑
3.  更新天赋已投入点数的统计方式,优化计算效率
4.  修正天赋升级消耗判断的参数传递错误
This commit is contained in:
panFD
2026-09-04 23:24:01 +08:00
parent fcb9f293dc
commit cf27211171
3 changed files with 16 additions and 14 deletions

View File

@@ -260,7 +260,7 @@ export class TalentsComp extends CCComp {
this.showSmallTip(tab?.node ?? null, "该天赋已满级");
return;
}
const cost = getTalentUpgradeCost(lv);
const cost = getTalentUpgradeCost(cfg.tier);
if (cost <= 0) return;
if (smc.getTalentPoints() < cost) {
this.showSmallTip(tab?.node ?? null, "天赋点不足");