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

@@ -15,7 +15,7 @@
* 依赖:
* - HeroInfo / HeroList(heroSet)—— 英雄静态配置与全量 UUID 列表
* - CardLiteComp —— 轻量卡片组件
* - buildSkillDesc(HeroSkillDesc)—— 技能描述生成器
* - buildHeroSkillDesc(HeroSkillText)—— 技能描述生成器(局外等级口径)
*/
import { _decorator, Animation, AnimationClip, Button, Label, Node, Prefab, Sprite, UITransform, Vec3, Widget, instantiate, resources, tween, Tween } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
@@ -23,7 +23,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { oops } from "db://oops-framework/core/Oops";
import { mLogger } from "../common/Logger";
import { HeroInfo, HeroList, SkillTriggerType, LvFieldEntry, LvReviveEntry, LvTriggerEntry, TriggerGrouped } from "../common/config/heroSet";
import { buildSkillDesc } from "../common/config/HeroSkillDesc";
import { buildHeroSkillDesc } from "../common/HeroSkillText";
import { GameEvent } from "../common/config/GameEvent";
import { HERO_UPGRADE_NEED_FRAGMENTS, CARD_LV_BG_COLORS } from "../common/config/GameSet";
import { CardLiteComp } from "./CardLiteComp";
@@ -405,7 +405,8 @@ export class HerosListComp extends CCComp {
this.updateCdDisplay(hero)
if (this.info_node) {
const desc = buildSkillDesc(hero)
// Label 承载:HeroSkillText 输出富文本,剥离 BBCode 标签转纯文本
const desc = buildHeroSkillDesc(hero.uuid, true, true).replace(/<[^>]+>/g, "")
const infoLabel = this.info_node.getChildByName("info")?.getComponent(Label)
|| this.info_node.getComponent(Label)
|| this.info_node.getComponentInChildren(Label)
@@ -518,7 +519,7 @@ export class HerosListComp extends CCComp {
// ---- 大招:skills[1] 及以后(英雄出场即激活,与能量条同语义,恒不锁定) ----
Object.values(hero.skills).slice(1).forEach(hSkill => {
// 技能等级展示与 buildSkillDesc 同规则:lv_entries 取 ≤lv 最大档的 s_lv,无生效档回退配置 lv
// 技能等级展示与 HeroSkillText 取档同规则:lv_entries 取 ≤lv 最大档的 s_lv,无生效档回退配置 lv
const sLv = hSkill.lv_entries?.length
? (hSkill.lv_entries.filter(e => e.lv <= lv).pop()?.s_lv ?? hSkill.lv)
: hSkill.lv