Resonance ping: right click with the drill lights up nearby veins through fog (t50)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 16:47:35 -04:00
co-authored by Claude Opus 5.5
parent ef4ba6d24a
commit 569ec6e5b6
9 changed files with 103 additions and 11 deletions
+17
View File
@@ -171,4 +171,21 @@ check('a mold and what sets inside it stay safe from the drill', run(`(() => {
for (const i of moldCellsAt(mo.kind, mo.x, mo.y).walls) if (crumbly(i)) return false;
return true;
})()`));
// Resonance ping (t50): finds natural veins within reach of the bit, under fog too, and
// nothing else.
flatWorld(run, 240, 160, 150);
const ping = run(`(() => {
player.bitTier = 0; const cx = 100, cy = 100, r = pingRadius();
setCell(cy * W + cx + 10, CUV, 20, F_NAT); setCell(cy * W + cx - 20, FEV, 20, F_NAT);
setCell(cy * W + cx + r + 5, AUV, 20, F_NAT); // out of reach
setCell((cy + 5) * W + cx, CUV, 20, 0); // not natural (set loose)
setCell((cy - 5) * W + cx, STONE, 20, F_NAT); // not a vein
const p = resonancePing(cx, cy);
player.bitTier = BIT_TIERS.length - 1; const far = resonancePing(cx, cy);
return { n: p.cells.length, found: p.found.map(m => MD[m].name), r, farFound: far.found.map(m => MD[m].name), farR: far.r };
})()`);
check('a ping finds natural veins in reach', ping.n === 2 && ping.found.includes('Copper ore vein') && ping.found.includes('Iron ore vein'), JSON.stringify(ping));
check('it skips rock, loose ore and veins out of reach', !ping.found.includes('Gold ore vein') && ping.n === 2, JSON.stringify(ping));
check('a better bit pings farther', ping.farR > ping.r && ping.farFound.includes('Gold ore vein'), JSON.stringify(ping));
check('a ping never changes the world', run('(() => { const h0 = mat.reduce((a, m, i) => (a * 31 + m + i) | 0, 0); resonancePing(100, 100); return h0 === mat.reduce((a, m, i) => (a * 31 + m + i) | 0, 0); })()'));
done();