fix: pact system boon counts and signedPactDetails population
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m30s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m30s
- Fix multi-element guardians (floors 130,140,150,170,190,200,210,230,240) to have exactly 2 boons per spec instead of 3-4 - Fix signedPactDetails never being populated: pipeline processPactRitual now includes signedPactDetails in writes with floor, guardianId, signedAt time, and skillLevels - Fix completePactRitual in prestigeStore to also populate signedPactDetails - Update gameStore.ts call site to pass signedPactDetails and current day/hour to processPactRitual Fixes #309, fixes #308
This commit is contained in:
@@ -209,7 +209,7 @@ export const useGameStore = create<GameCoordinatorStore>()(
|
||||
rawMana = Math.max(0, Math.min(rawMana + netRawRegen * HOURS_PER_TICK, maxMana));
|
||||
let totalManaGathered = ctx.mana.totalManaGathered + Math.max(0, actualRegen);
|
||||
|
||||
const pactResult = processPactRitual(ctx.prestige.pactRitualFloor, ctx.prestige.pactRitualProgress, ctx.prestige.signedPacts, ctx.prestige.defeatedGuardians, ctx.prestige.prestigeUpgrades.pactAffinity || 0, disciplineEffects.bonuses.pactAffinityBonus || 0);
|
||||
const pactResult = processPactRitual(ctx.prestige.pactRitualFloor, ctx.prestige.pactRitualProgress, ctx.prestige.signedPacts, ctx.prestige.defeatedGuardians, ctx.prestige.prestigeUpgrades.pactAffinity || 0, disciplineEffects.bonuses.pactAffinityBonus || 0, ctx.prestige.signedPactDetails, day, hour);
|
||||
if (pactResult.writes) writes.prestige = { ...(writes.prestige || {}), ...pactResult.writes };
|
||||
pactResult.logs.forEach(l => addLog(l));
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
import { useManaStore } from '../manaStore';
|
||||
import { getGuardianForFloor } from '../../data/guardian-encounters';
|
||||
import { HOURS_PER_TICK } from '../../constants';
|
||||
import type { PrestigeState } from '../prestigeStore';
|
||||
|
||||
export interface PactRitualResult {
|
||||
writes: {
|
||||
signedPacts?: number[];
|
||||
deficientGuardians?: number[];
|
||||
defeatedGuardians?: number[];
|
||||
signedPactDetails?: PrestigeState['signedPactDetails'];
|
||||
pactRitualFloor: number | null;
|
||||
pactRitualProgress: number;
|
||||
} | null;
|
||||
@@ -19,7 +21,17 @@ export interface PactRitualResult {
|
||||
* Process pact ritual progression. Advances progress and completes signing
|
||||
* when enough enough hours have accumulated.
|
||||
*/
|
||||
export function processPactRitual(pactRitualFloor: number | null, pactRitualProgress: number, signedPacts: number[], defeatedGuardians: number[], pactAffinityUpgrade: number, pactAffinityBonus: number): PactRitualResult {
|
||||
export function processPactRitual(
|
||||
pactRitualFloor: number | null,
|
||||
pactRitualProgress: number,
|
||||
signedPacts: number[],
|
||||
defeatedGuardians: number[],
|
||||
pactAffinityUpgrade: number,
|
||||
pactAffinityBonus: number,
|
||||
signedPactDetails: PrestigeState['signedPactDetails'],
|
||||
currentDay: number,
|
||||
currentHour: number,
|
||||
): PactRitualResult {
|
||||
if (pactRitualFloor === null) return { writes: null, logs: [] };
|
||||
const logs: string[] = [];
|
||||
const guardian = getGuardianForFloor(pactRitualFloor);
|
||||
@@ -41,6 +53,15 @@ export function processPactRitual(pactRitualFloor: number | null, pactRitualProg
|
||||
writes: {
|
||||
signedPacts: [...signedPacts, pactRitualFloor],
|
||||
defeatedGuardians: defeatedGuardians.filter(f => f !== pactRitualFloor),
|
||||
signedPactDetails: {
|
||||
...signedPactDetails,
|
||||
[pactRitualFloor]: {
|
||||
floor: pactRitualFloor,
|
||||
guardianId: guardian.name || `floor-${pactRitualFloor}`,
|
||||
signedAt: { day: currentDay, hour: currentHour },
|
||||
skillLevels: {},
|
||||
},
|
||||
},
|
||||
pactRitualFloor: null,
|
||||
pactRitualProgress: 0,
|
||||
},
|
||||
|
||||
@@ -166,9 +166,19 @@ export const usePrestigeStore = create<PrestigeStore>()(
|
||||
}
|
||||
}
|
||||
|
||||
const floor = state.pactRitualFloor;
|
||||
set({
|
||||
signedPacts: [...state.signedPacts, state.pactRitualFloor],
|
||||
defeatedGuardians: state.defeatedGuardians.filter(f => f !== state.pactRitualFloor),
|
||||
signedPacts: [...state.signedPacts, floor],
|
||||
defeatedGuardians: state.defeatedGuardians.filter(f => f !== floor),
|
||||
signedPactDetails: {
|
||||
...state.signedPactDetails,
|
||||
[floor]: {
|
||||
floor,
|
||||
guardianId: guardian.name || `floor-${floor}`,
|
||||
signedAt: { day: 0, hour: 0 },
|
||||
skillLevels: {},
|
||||
},
|
||||
},
|
||||
pactRitualFloor: null,
|
||||
pactRitualProgress: 0,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user