refactor(skill-text): 重构技能文案系统,拆分英雄/卡牌语境

1.  将原HeroSkillDesc拆分为CardSkillText(卡牌/道具通用)和HeroSkillText(英雄专属)
2.  移除废弃的HeroSkillDesc文件与相关引用
3.  统一技能文案生成逻辑,修复数值漂移问题
4.  调整英雄配置中技能解锁等级与分档规则
5.  优化技能弹窗UI与参数传递逻辑
This commit is contained in:
panFD
2026-08-28 08:36:39 +08:00
parent 423653c4c8
commit 10a6d18836
17 changed files with 1698 additions and 1782 deletions

View File

@@ -22,7 +22,7 @@ import { HeroInfo, calcGrowBonus } from "../common/config/heroSet";
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
import { Hero } from "../hero/Hero";
import { FacSet, FightSet, getLvColor, NumberFormatter } from "../common/config/GameSet";
import { buildSkillDescMoreRich, ISkillDescSource } from "../common/config/HeroSkillDesc";
import { buildHeroSkillDesc } from "../common/HeroSkillText";
import { MissionEconomy } from "./MissionEconomy";
import { UIID } from "../common/config/GameUIConfig";
import { HeroMoreCom } from "./HeroMoreCom";
@@ -200,9 +200,9 @@ export class HeroBoxComp extends CCComp {
}
/**
* 构建升级前后对比富文本(当前能力 vs 升级后能力)。
* 数据源取 HeroInfo 静态配置,分别按当前 lv 与 nextLv 渲染同一份技能描述,
* 与英雄信息弹窗(buildSkillDescMoreRich)同一套文案规则,杜绝数值漂移。
* 构建升级前后对比富文本(当前属性/能力 vs 升级后属性/能力)。
* 技能描述统一按局外等级口径渲染(buildHeroSkillDesc),与英雄信息弹窗同一套
* 文案规则;战斗内升级不改变局外等级,故技能段前后一致,仅属性段随等级变化。
*
* @param heroLv 当前英雄等级
* @param nextLv 目标等级
@@ -212,21 +212,6 @@ export class HeroBoxComp extends CCComp {
const hero = HeroInfo[this.model?.hero_uuid ?? 0];
if (!hero) return "";
const buildSource = (lv: number): ISkillDescSource => ({
lv: lv,
skills: hero.skills,
call: hero.call,
dead: hero.dead,
fstart: hero.fstart,
atking: hero.atking,
atked: hero.atked,
field: hero.field,
revive: hero.revive,
grow_type: hero.grow_type,
ap: hero.ap,
hp: hero.hp,
});
// ---- 属性成长(固定基础值 + 成长类型指数递增 + 一次性加成) ----
const attrLine = (lv: number): string => {
const grow = calcGrowBonus(hero, lv);
@@ -235,9 +220,10 @@ export class HeroBoxComp extends CCComp {
return `攻击 <color=#27AE60>${ap}</color> 生命 <color=#27AE60>${hp}</color>`;
};
// ---- 升级前后能力对比(当前 vs 升级后,同一份文案规则按 lv 渲染) ----
const curDesc = buildSkillDescMoreRich(buildSource(heroLv));
const nextDesc = buildSkillDescMoreRich(buildSource(nextLv));
// ---- 升级前后能力对比(局外等级口径,战斗内升级技能段不变) ----
const skillDesc = buildHeroSkillDesc(hero.uuid);
const curDesc = skillDesc;
const nextDesc = skillDesc;
return `<outline color=#000000 width=2>` + [
`<b>当前 Lv.${heroLv}:</b>`,