fix: issues #221 #217 #225 #227 #224 #226 - crafting refunds, mana tracking, cancel slot, multi-element guardians, spell kill advance
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m59s

This commit is contained in:
2026-05-31 01:18:01 +02:00
parent e4f4b297e8
commit 6793461a9f
16 changed files with 263 additions and 63 deletions
+5 -1
View File
@@ -182,8 +182,12 @@ export const useGameStore = create<GameCoordinatorStore>()(
const effectiveRegen = Math.max(0, baseRegen * (1 - incursionStrength) * meditationMultiplier - totalConversionPerTick);
const rawAfterConversion = ctx.mana.rawMana + rawManaDelta;
const regenFromMeditation = Math.max(0, effectiveRegen * HOURS_PER_TICK);
const roomLeft = Math.max(0, maxMana - Math.max(0, rawAfterConversion));
// Only count regen that actually fits below the cap (fix #224)
const actualRegenAdded = Math.floor(Math.min(regenFromMeditation, roomLeft) * 1000) / 1000;
let rawMana = Math.max(0, Math.min(rawAfterConversion + effectiveRegen * HOURS_PER_TICK, maxMana));
let totalManaGathered = ctx.mana.totalManaGathered;
let totalManaGathered = ctx.mana.totalManaGathered + Math.max(0, actualRegenAdded);
if (ctx.combat.currentAction === 'convert') {
const convertResult = useManaStore.getState().processConvertAction(rawMana);