fix: suppress non-ReCKoning projects during endgame
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Successful in 13s
Smoke Test / smoke (pull_request) Failing after 23s

During endgame (totalRescues >= 100000, pactFlag === 1, harmony > 50),
only ReCKoning projects are activated and shown in the project panel.

This prevents unrelated utility projects like 'Request More Compute' from
re-activating and diluting the emotional ReCKoning narrative.

- Add isEndgame() helper function
- Guard checkProjects() to skip non-ReCKoning activation in endgame
- Guard renderProjects() to hide non-ReCKoning projects from UI in endgame

Closes #161
This commit is contained in:
Alexander Whitestone
2026-04-15 04:45:52 -04:00
parent b132f899ba
commit 3c7bb86681

View File

@@ -334,13 +334,23 @@ function checkMilestones() {
}
}
/**
* Returns true if the game is in the ReCKoning endgame state.
*/
function isEndgame() {
return G.totalRescues >= 100000 && G.pactFlag === 1 && G.harmony > 50;
}
function checkProjects() {
const endgame = isEndgame();
// Check for new project triggers
for (const pDef of PDEFS) {
const alreadyPurchased = G.completedProjects && G.completedProjects.includes(pDef.id);
if (!alreadyPurchased && !G.activeProjects) G.activeProjects = [];
if (!alreadyPurchased && !G.activeProjects.includes(pDef.id)) {
// During endgame, only activate ReCKoning projects
if (endgame && !pDef.id.startsWith('p_reckoning_')) continue;
if (pDef.trigger()) {
G.activeProjects.push(pDef.id);
log(`Available: ${pDef.name}`);
@@ -1173,10 +1183,14 @@ function renderProjects() {
// Show available projects
if (G.activeProjects) {
const endgame = isEndgame();
for (const id of G.activeProjects) {
const pDef = PDEFS.find(p => p.id === id);
if (!pDef) continue;
// During endgame, only show ReCKoning projects in the UI
if (endgame && !pDef.id.startsWith('p_reckoning_')) continue;
const afford = canAffordProject(pDef);
const costStr = Object.entries(pDef.cost).map(([r, a]) => `${fmt(a)} ${r}`).join(', ');