From 0542402b4da10b5b92e3a79c81d64389cd6bb716 Mon Sep 17 00:00:00 2001 From: Hikari Date: Thu, 26 Mar 2026 10:25:06 -0700 Subject: [PATCH] fix: use computePartyCombatPower in quest panel for consistent CP display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The quest panel was computing party combat power with a simplified hand-rolled loop (base combatPower × count only) that did not account for upgrade multipliers, prestige bonus, equipment set bonuses, echo or crafted multipliers, or the active companion bonus. This meant the displayed "you have X combat power" value diverged from the value used by the auto-quest engine (computePartyCombatPower), which could show the player an incorrect picture of whether a quest was startable — particularly after upgrades or equipment began boosting combat power. Replacing the loop with computePartyCombatPower(state) makes the quest card display fully consistent with the auto-quest eligibility check. Closes #157 --- apps/web/src/components/game/questPanel.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/web/src/components/game/questPanel.tsx b/apps/web/src/components/game/questPanel.tsx index 64b6596..02ee9a9 100644 --- a/apps/web/src/components/game/questPanel.tsx +++ b/apps/web/src/components/game/questPanel.tsx @@ -11,7 +11,10 @@ /* eslint-disable max-statements -- Many local variables needed for quest state */ import { useState, type JSX } from "react"; import { useGame } from "../../context/gameContext.js"; -import { zoneFailureChance } from "../../engine/tick.js"; +import { + computePartyCombatPower, + zoneFailureChance, +} from "../../engine/tick.js"; import { cdnImage } from "../../utils/cdn.js"; import { LockToggle } from "../ui/lockToggle.js"; import { ZoneSelector } from "./zoneSelector.js"; @@ -208,7 +211,7 @@ const QuestPanel = (): JSX.Element => { ); } - const { adventurers, autoQuest, bosses, quests, zones } = state; + const { autoQuest, bosses, quests, zones } = state; const activeZone = zones.find((zone) => { return zone.id === activeZoneId; @@ -226,11 +229,7 @@ const QuestPanel = (): JSX.Element => { : quests.find((quest) => { return quest.id === activeZone.unlockQuestId; }); - let partyCombatPower = 0; - for (const adventurer of adventurers) { - const contribution = adventurer.combatPower * adventurer.count; - partyCombatPower = partyCombatPower + contribution; - } + const partyCombatPower = computePartyCombatPower(state); const zoneQuests = quests.filter(({ zoneId }) => { return zoneId === activeZoneId; });