fix: suppress non-ReCKoning projects during endgame
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:
14
js/engine.js
14
js/engine.js
@@ -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(', ');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user