Compare commits

...

1 Commits

Author SHA1 Message Date
Metatron
c4ef8063ed fix: suppress non-ReCKoning projects during endgame (closes #128)
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Successful in 8s
Smoke Test / smoke (pull_request) Failing after 12s
When endgame conditions are met (totalRescues >= 100000, pactFlag === 1,
harmony > 50), non-ReCKoning projects like 'Request More Compute'
(p_wire_budget) were still activating and rendering alongside the
ReCKoning sequence.

Changes:
- checkProjects(): skip non-ReCKoning project activation during endgame
- renderProjects(): skip non-ReCKoning project rendering during endgame

Both guards check endgame conditions and only allow projects with id
starting with 'p_reckoning_' to activate/display during endgame.

All existing tests pass.
2026-04-14 22:33:22 -04:00

View File

@@ -335,12 +335,18 @@ function checkMilestones() {
}
function checkProjects() {
// Suppress non-ReCKoning projects during endgame sequence (#128)
const isEndgame = G.totalRescues >= 100000 && G.pactFlag === 1 && G.harmony > 50;
const hasReCKoning = G.activeProjects && G.activeProjects.some(id => id.startsWith('p_reckoning_'));
// 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 allow ReCKoning projects to activate (#128)
if (isEndgame && !pDef.id.startsWith('p_reckoning_')) continue;
if (pDef.trigger()) {
G.activeProjects.push(pDef.id);
log(`Available: ${pDef.name}`);
@@ -1173,7 +1179,11 @@ function renderProjects() {
// Show available projects
if (G.activeProjects) {
const isEndgame = G.totalRescues >= 100000 && G.pactFlag === 1 && G.harmony > 50;
for (const id of G.activeProjects) {
// During endgame, suppress non-ReCKoning projects from display (#128)
if (isEndgame && !id.startsWith('p_reckoning_')) continue;
const pDef = PDEFS.find(p => p.id === id);
if (!pDef) continue;