feedback1b WH: tests pin the own-kill exclusions, every lion off a reserved tile, the summoned count
The own-kill set closes after each of his attacks: a new test kills an enemy his S3 / S2 attack hit by 无动于衷's reflection and by a mark another Kazimierz operator set off, and checks neither counts (fails without the clear). The reserved-tile test checks every lion and the exact free tiles; the B3 test pins the summoned lion count again.
This commit is contained in:
1 parent
20b65a5ff0
commit
ff1b259c61
3 files changed
+90
-7
No files matched your search
@@ -885,10 +885,22 @@ test('summon tiles skip reserved home tiles: 黄金盟誓 never takes the tile o
|
||||
h.step();
|
||||
h.b.dealDamage(null, g, { amount: 1e9, type: 'true' });
|
||||
assert.equal(g.alive, false);
|
||||
assert.ok(h.runUntil(() => u.skill.active, 5));
|
||||
const lion = h.b.allyUnits.find((x) => x.defId === 'token_10040_siege2_vlion' && x.alive);
|
||||
assert.ok(lion, '黄金盟誓 summoned');
|
||||
assert.ok(!(lion.tileR === 10 && lion.tileC === 5), 'not on the dead guard\'s home tile (closest to the enemy)');
|
||||
// the free deployable melee tiles of her 3×3 area just before the cast — the dead guard's home tile among them
|
||||
const HOME = 10 * 100 + 5;
|
||||
let free = [];
|
||||
for (let i = 0; i < 100 && !u.skill.active; i++) {
|
||||
free = [];
|
||||
for (let dr = -1; dr <= 1; dr++) for (let dc = -1; dc <= 1; dc++) {
|
||||
const r = u.tileR + dr, c = u.tileC + dc;
|
||||
if ((dr || dc) && h.b.grid.inRect(r, c) && h.b.grid.canStand(r, c, { ranged: false }) && !h.b.unitAt(r, c)) free.push(r * 100 + c);
|
||||
}
|
||||
h.step();
|
||||
}
|
||||
assert.ok(u.skill.active, 'S3 cast');
|
||||
assert.ok(free.includes(HOME) && free.length >= 2, `the scenario: the guard's home tile is one of the free tiles (${free})`);
|
||||
const lions = h.b.allyUnits.filter((x) => x.defId === 'token_10040_siege2_vlion' && x.alive);
|
||||
assert.ok(lions.every((l) => !(l.tileR === 10 && l.tileC === 5)), 'no lion on the dead guard\'s home tile');
|
||||
assert.deepEqual(lions.map((l) => l.tileR * 100 + l.tileC).sort((a, b) => a - b), free.filter((k) => k !== HOME).sort((a, b) => a - b), 'a lion on every other free tile');
|
||||
assert.ok(h.runUntil(() => g.alive, g.base.respawnTime + 2), 'the guard redeploys on its tile');
|
||||
checkInvariants(h.b);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user