fix(herosListComp): 修正英雄属性展示计算逻辑
将英雄属性计算改为使用局外等级和统一的属性计算接口,对齐技能面板的显示口径
This commit is contained in:
@@ -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 { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { oops } from "db://oops-framework/core/Oops";
|
import { oops } from "db://oops-framework/core/Oops";
|
||||||
import { mLogger } from "../common/Logger";
|
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 { buildHeroSkillDesc } from "../common/HeroSkillText";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
import { HERO_UPGRADE_NEED_FRAGMENTS, CARD_LV_BG_COLORS } from "../common/config/GameSet";
|
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]
|
const hero = HeroInfo[uuid]
|
||||||
if (!hero) return
|
if (!hero) return
|
||||||
|
|
||||||
const heroLv = Math.max(1, Math.floor(hero.lv ?? 1))
|
// 属性按当前局外等级计算(与技能面板 updateSkillIcons 同源,均为 getHeroOuterLv)
|
||||||
const suffix = heroLv >= 2 ? "★".repeat(heroLv - 1) : ""
|
const heroLv = Math.max(1, smc.getHeroOuterLv(uuid))
|
||||||
this.setLabelText(this.name_node, `${suffix}${hero.name || ""}${suffix}`)
|
this.setLabelText(this.name_node, hero.name || "")
|
||||||
this.setLabelText(this.ap_node, `${(hero.ap ?? 0) * heroLv}`)
|
// 属性面板与运行时口径一致:基础值 × 品质系数 + 职业成长 + bonus + lv12 专项
|
||||||
this.setLabelText(this.def_node, `${(hero.def ?? 0) * heroLv}`)
|
const stats = getHeroDisplayStats(hero, heroLv)
|
||||||
this.setLabelText(this.hp_node, `${(hero.hp ?? 0) * 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)
|
this.updateCdDisplay(hero)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user