generated from nhcarrigan/template
fix: use computePartyCombatPower in quest panel for consistent CP display
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
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user