chore: golemancy redesign cleanup — remove orphaned legacy code and update docs
Build and Publish Mana Loop Docker Image / build-and-publish (push) Successful in 1m19s

This commit is contained in:
2026-06-07 12:54:12 +02:00
parent 59fe6cd111
commit 1a0886f702
13 changed files with 128 additions and 153 deletions
+8 -1
View File
@@ -190,6 +190,13 @@ export const useGameStore = create<GameCoordinatorStore>()(
if (!elements[elem].unlocked) elements[elem] = { ...elements[elem], unlocked: true };
elements[elem] = { ...elements[elem], current: Math.min(elements[elem].max, elements[elem].current + entry.finalRate * HOURS_PER_TICK) };
}
// Compute per-element net regen: produced rate - drain from being used as component
const elementRegen: Record<string, number> = {};
for (const [elem, entry] of Object.entries(conversionResult.rates)) {
const produced = entry.finalRate;
const drained = conversionResult.elementDrain[elem] || 0;
elementRegen[elem] = produced - drained;
}
// Net raw regen = gross regen - conversion drains - incursion
const netRawRegen = Math.max(0, baseRegen * (1 - incursionStrength) * meditationMultiplier - conversionResult.totalRawDrain);
const actualRegen = Math.floor(Math.min(netRawRegen * HOURS_PER_TICK, maxMana - rawMana) * 1000) / 1000;
@@ -305,7 +312,7 @@ export const useGameStore = create<GameCoordinatorStore>()(
// Phase 3: Write
writes.game = { day, hour, incursionStrength };
writes.mana = { rawMana, meditateTicks, totalManaGathered, elements };
writes.mana = { rawMana, meditateTicks, totalManaGathered, elements, elementRegen };
applyTickWrites(writes, storeSetters);
} catch (error: unknown) {