From f08b0794fd93e494a2ba3e8e62107ea80f0cddd6 Mon Sep 17 00:00:00 2001 From: panFD Date: Tue, 1 Sep 2026 20:53:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(herosListComp):=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E8=8B=B1=E9=9B=84=E5=B1=9E=E6=80=A7=E5=B1=95=E7=A4=BA=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将英雄属性计算改为使用局外等级和统一的属性计算接口,对齐技能面板的显示口径 --- assets/script/game/map/HerosListComp.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/assets/script/game/map/HerosListComp.ts b/assets/script/game/map/HerosListComp.ts index 04bddb2d..67d0cffd 100644 --- a/assets/script/game/map/HerosListComp.ts +++ b/assets/script/game/map/HerosListComp.ts @@ -22,7 +22,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; 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 { HeroInfo, HeroList, SkillTriggerType, LvFieldEntry, LvReviveEntry, LvTriggerEntry, TriggerGrouped, getHeroDisplayStats } from "../common/config/heroSet"; import { buildHeroSkillDesc } from "../common/HeroSkillText"; import { GameEvent } from "../common/config/GameEvent"; import { HERO_UPGRADE_NEED_FRAGMENTS, CARD_LV_BG_COLORS } from "../common/config/GameSet"; @@ -390,12 +390,14 @@ export class HerosListComp extends CCComp { const hero = HeroInfo[uuid] if (!hero) return - const heroLv = Math.max(1, Math.floor(hero.lv ?? 1)) - const suffix = heroLv >= 2 ? "★".repeat(heroLv - 1) : "" - this.setLabelText(this.name_node, `${suffix}${hero.name || ""}${suffix}`) - this.setLabelText(this.ap_node, `${(hero.ap ?? 0) * heroLv}`) - this.setLabelText(this.def_node, `${(hero.def ?? 0) * heroLv}`) - this.setLabelText(this.hp_node, `${(hero.hp ?? 0) * heroLv}`) + // 属性按当前局外等级计算(与技能面板 updateSkillIcons 同源,均为 getHeroOuterLv) + const heroLv = Math.max(1, smc.getHeroOuterLv(uuid)) + this.setLabelText(this.name_node, hero.name || "") + // 属性面板与运行时口径一致:基础值 × 品质系数 + 职业成长 + bonus + lv12 专项 + const stats = getHeroDisplayStats(hero, heroLv) + this.setLabelText(this.ap_node, `${stats.ap}`) + this.setLabelText(this.def_node, `${stats.def}`) + this.setLabelText(this.hp_node, `${stats.hp}`) this.updateCdDisplay(hero)