fix: check victory condition before game-over on day overflow
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m3s

This commit is contained in:
2026-06-10 22:57:34 +02:00
parent 51710e2e1b
commit 05232ae03b
3 changed files with 11 additions and 10 deletions
+9 -8
View File
@@ -136,21 +136,22 @@ export const useGameStore = create<GameCoordinatorStore>()(
prestigeUpgrades: ctx.prestige.prestigeUpgrades,
};
if (day > MAX_DAY) {
const insightGained = calcInsight(insightParams, disciplineEffects);
addLog('The loop ends. Gained ' + insightGained + ' Insight.');
writes.ui = { ...(writes.ui || {}), gameOver: true, victory: false };
if (ctx.combat.maxFloorReached >= 100 && ctx.prestige.signedPacts.includes(100)) {
const insightGained = calcInsight(insightParams, disciplineEffects) * 3;
addLog('VICTORY! The Awakened One falls! Gained ' + insightGained + ' Insight!');
writes.ui = { ...(writes.ui || {}), gameOver: true, victory: true };
writes.prestige = { ...(writes.prestige || {}), loopInsight: insightGained };
writes.game = { day, hour };
applyTickWrites(writes, storeSetters);
return;
}
if (ctx.combat.maxFloorReached >= 100 && ctx.prestige.signedPacts.includes(100)) {
const insightGained = calcInsight(insightParams, disciplineEffects) * 3;
addLog('VICTORY! The Awakened One falls! Gained ' + insightGained + ' Insight!');
writes.ui = { ...(writes.ui || {}), gameOver: true, victory: true };
if (day > MAX_DAY) {
const insightGained = calcInsight(insightParams, disciplineEffects);
addLog('The loop ends. Gained ' + insightGained + ' Insight.');
writes.ui = { ...(writes.ui || {}), gameOver: true, victory: false };
writes.prestige = { ...(writes.prestige || {}), loopInsight: insightGained };
writes.game = { day, hour };
applyTickWrites(writes, storeSetters);
return;
}