2 Commits

Author SHA1 Message Date
hikari 0542402b4d fix: use computePartyCombatPower in quest panel for consistent CP display
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m5s
CI / Lint, Build & Test (pull_request) Failing after 1m10s
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
2026-03-26 10:25:06 -07:00
hikari 689133d05d fix: preserve autoAdventurer setting across prestige
The auto-buy adventurers toggle was silently reset to false on every
prestige because it was not included in the list of automation preferences
carried forward into the fresh state. This mirrors the existing handling
for autoBoss and autoQuest.

Closes #156
2026-03-26 10:24:53 -07:00
2 changed files with 8 additions and 8 deletions
+1
View File
@@ -263,6 +263,7 @@ const buildPostPrestigeState = (
* Preserve automation preferences across prestige — the player explicitly * Preserve automation preferences across prestige — the player explicitly
* opted into these settings and would not expect them to silently reset. * opted into these settings and would not expect them to silently reset.
*/ */
autoAdventurer: currentState.autoAdventurer ?? false,
autoBoss: currentState.autoBoss ?? false, autoBoss: currentState.autoBoss ?? false,
autoQuest: currentState.autoQuest ?? false, autoQuest: currentState.autoQuest ?? false,
+6 -7
View File
@@ -11,7 +11,10 @@
/* eslint-disable max-statements -- Many local variables needed for quest state */ /* eslint-disable max-statements -- Many local variables needed for quest state */
import { useState, type JSX } from "react"; import { useState, type JSX } from "react";
import { useGame } from "../../context/gameContext.js"; 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 { cdnImage } from "../../utils/cdn.js";
import { LockToggle } from "../ui/lockToggle.js"; import { LockToggle } from "../ui/lockToggle.js";
import { ZoneSelector } from "./zoneSelector.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) => { const activeZone = zones.find((zone) => {
return zone.id === activeZoneId; return zone.id === activeZoneId;
@@ -226,11 +229,7 @@ const QuestPanel = (): JSX.Element => {
: quests.find((quest) => { : quests.find((quest) => {
return quest.id === activeZone.unlockQuestId; return quest.id === activeZone.unlockQuestId;
}); });
let partyCombatPower = 0; const partyCombatPower = computePartyCombatPower(state);
for (const adventurer of adventurers) {
const contribution = adventurer.combatPower * adventurer.count;
partyCombatPower = partyCombatPower + contribution;
}
const zoneQuests = quests.filter(({ zoneId }) => { const zoneQuests = quests.filter(({ zoneId }) => {
return zoneId === activeZoneId; return zoneId === activeZoneId;
}); });