refactor(heroDesc): 统一英雄技能描述文案生成逻辑
1. 将原英雄卡片手写的复活/重生描述统一改为通过buildSkillDescMoreRich生成 2. 新增buildHeroDescSource方法构造1级技能描述数据源,保证与英雄信息弹窗文案一致 3. 修正多处技能描述文本,将复活统一改为重生并补充回合重生次数说明 4. 将开局类buff描述改为回合开始,匹配实际生效时机
This commit is contained in:
@@ -21,6 +21,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { CardConfig, CardType } from "../common/config/CardSet";
|
||||
import { HeroInfo } from "../common/config/heroSet";
|
||||
import { buildSkillDescMoreRich, ISkillDescSource } from "../common/config/HeroSkillDesc";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { outlineRich } from "../common/RichOutline";
|
||||
@@ -284,10 +285,11 @@ export class CHeroComp extends CCComp {
|
||||
// 背景:按 card_lv 激活对应颜色子节点(1→green 2→blue 3→purple 4→red 5→yellow)
|
||||
this.updateBgNode();
|
||||
|
||||
// 描述富文本:直接取 heroSet 的 info 字段(单条手写文案)
|
||||
// 描述富文本:不再单独手写 info,统一套用英雄 1 级能力介绍(buildSkillDescMoreRich)
|
||||
// 与英雄信息弹窗/升级确认框同一套文案规则,杜绝手写文案与数值漂移
|
||||
// outlineRich 为整段富文本包裹描边,提升深色面板可读性
|
||||
if (this.info_rich) {
|
||||
const desc = hero?.info || this.cardData.info || "";
|
||||
const desc = hero ? buildSkillDescMoreRich(this.buildHeroDescSource(hero)) : (this.cardData.info || "");
|
||||
this.info_rich.string = outlineRich(desc);
|
||||
this.info_rich.node.active = !!desc;
|
||||
}
|
||||
@@ -464,6 +466,26 @@ export class CHeroComp extends CCComp {
|
||||
return model.hero_uuid ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造英雄 1 级能力描述数据源(ISkillDescSource)。
|
||||
* lv 恒为 1,由各 resolver 取 1 级生效档,与英雄信息弹窗初始展示口径一致。
|
||||
* @param hero HeroInfo 静态配置项
|
||||
* @returns 描述数据源
|
||||
*/
|
||||
private buildHeroDescSource(hero: typeof HeroInfo[number]): ISkillDescSource {
|
||||
return {
|
||||
lv: 1,
|
||||
call: hero.call,
|
||||
dead: hero.dead,
|
||||
fstart: hero.fstart,
|
||||
fend: hero.fend,
|
||||
atking: hero.atking,
|
||||
atked: hero.atked,
|
||||
field: hero.field,
|
||||
revive: hero.revive,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 为英雄图标加载 idle 动画剪辑,提取首帧 SpriteFrame 静止展示。
|
||||
* 与 HInfoComp 的 updateHeroAnimation 一致,零运行时开销。
|
||||
|
||||
Reference in New Issue
Block a user