fix: check victory condition before game-over on day overflow
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m3s
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m3s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user