feat(heroBox): 实现当前等级技能描述面板功能

1. 新增SkillDescSet结构化技能描述配置表,实现配置驱动的文案生成
2. 改造HeroSkillDesc生成器,支持静态heroInfo和运行时HeroAttrsComp两种数据源
3. 为HeroAttrsComp新增evolve配置快照字段,用于展示等级成长属性
4. 在HeroBoxComp中集成技能描述UI组件,动态渲染当前英雄等级的技能效果
5. 新增设计文档说明方案细节,确保可维护性和可扩展性
This commit is contained in:
panFD
2026-07-30 22:30:26 +08:00
parent 8fa54e894a
commit 04f39217ac
7 changed files with 448 additions and 102 deletions

View File

@@ -20,6 +20,7 @@ import { GameEvent } from "../common/config/GameEvent";
import { HeroInfo } from "../common/config/heroSet";
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
import { getLvColor } from "../common/config/GameSet";
import { buildSkillDesc } from "../common/config/HeroSkillDesc";
const { ccclass, property } = _decorator;
@@ -52,6 +53,10 @@ export class HeroBoxComp extends CCComp {
@property(Node)
private noHero: Node = null;
/** 技能描述标签(多行,展示当前等级触发技能) */
@property(Label)
private skill_label: Label = null;
// ======================== 战斗信息标签(总值 + 附加值) ========================
/** 攻击总值 */
@@ -321,6 +326,9 @@ export class HeroBoxComp extends CCComp {
this.clearStatRow(this.freeze_all_label, this.freeze_plus_label);
this.clearStatRow(this.puncture_all_label, this.puncture_plus_label);
this.clearStatRow(this.crit_dmg_all_label, this.crit_dmg_plus_label);
if (this.skill_label && this.skill_label.isValid) {
this.skill_label.string = "";
}
}
/**
@@ -388,6 +396,11 @@ export class HeroBoxComp extends CCComp {
const finalCritDmg = this.model.getFinalCritDamage();
this.setStatRow(this.crit_dmg_all_label, this.crit_dmg_plus_label, finalCritDmg, finalCritDmg - (this.model.crit_damage ?? 0), "%");
// ---- 技能描述(当前等级触发技能,读运行时 model 最终配置) ----
if (this.skill_label && this.skill_label.isValid) {
this.skill_label.string = buildSkillDesc(this.model);
}
// ---- 图标UUID 变化时重新加载首帧动画) ----
if (hero && heroUuid !== this.iconHeroUuid) {
this.iconHeroUuid = heroUuid;