map change

This commit is contained in:
2026-11-15 20:05:02 +01:00
parent 319436a5f9
commit 3e565cf8c7
15 changed files with 242 additions and 26 deletions

View File

@@ -191,5 +191,32 @@ for (const id of ['crucible', 'colosseum', 'foundry', 'arena64']) {
ok(worst === 0, `${A.shape} wall of ${id} keeps the robot inside`);
}
// mine layer: drop one, it arms, anyone driving over it gets launched - including the owner later on
{
const mk = () => {
const s = RC.Combat.create({ robots: [RC.stats({ ...RC.STARTER, gadget: 'mines' }), RC.stats(RC.STARTER)], seed: 5 });
s.robots[0].x = 0; s.robots[0].z = 0; s.robots[0].a = 0;
s.robots[1].x = 9; s.robots[1].z = 9;
return s;
};
let s = mk();
RC.Combat.step(s, 1 / 60, [{ fire3: true }, {}]);
ok(s.mines.length === 1 && s.robots[0].gUses === 2, 'mine is dropped and costs a charge');
for (let i = 0; i < 120; i++) RC.Combat.step(s, 1 / 60, [{}, {}]);
ok(s.mines.length === 1 && s.mines[0].arm <= 0, 'it arms without blowing up the robot that laid it');
const b = s.robots[1], mn = s.mines[0], hp0 = b.hp, dealt0 = s.robots[0].dealt;
b.x = mn.x; b.z = mn.z; b.y = 0;
RC.Combat.step(s, 1 / 60, [{}, {}]);
ok(hp0 - b.hp > 10 && b.vy > 4 && s.mines.length === 0, 'driving over it hurts and throws the robot up');
ok(s.robots[0].dealt - dealt0 > 10, 'the damage counts for whoever laid the mine');
s = mk();
RC.Combat.step(s, 1 / 60, [{ fire3: true }, {}]);
for (let i = 0; i < 60 * 4; i++) RC.Combat.step(s, 1 / 60, [{}, {}]);
const a2 = s.robots[0], m2 = s.mines[0], h0 = a2.hp;
a2.x = m2.x; a2.z = m2.z; a2.y = 0;
RC.Combat.step(s, 1 / 60, [{}, {}]);
ok(h0 - a2.hp > 10, 'once the grace time is over your own mine gets you too');
}
console.log(fails ? `${fails} failure(s)` : 'all ok');
process.exit(fails ? 1 : 0);