feedback1 WC: tactician summons never left out of range with a full hand; source fixes
Review follow-up to the water / tactical point change. - Re-orienting 伺夜 / 缪尔赛思 in place while hand and temp are full could leave a placed 狼群 / 流形 outside the new range (it had nowhere to go and stayed put). The re-orientation is now refused with HAND_FULL when a summon it would leave out has no stack and no free slot. On the other paths (promotion, an owner moved with no room) such a summon leaves the board and its stack comes back at the next round start (grantTokensFor), so no out-of-range placement reaches the battle. - Citation corrected: the 深水区 rule comes from the PRTS page 深水区 (地形信息 tile_deepsea: 部署类型 全部位, 地形机制 "拒绝部署(待补充)"), corroborated by PRTS 作战机制 (地形标记 AdvancedBuildableMask lists 深水). There is no PRTS page 地形. - grid.js: the tie-break note now says what changed on 战场#08 (no gate route; a few off-route smoothed steps of the boss field go around the water). - Documented the known limit of the inactive act1 m05: its 特制水上平台 tiles are deployable in the prep's deploy map only; the sim does not model the canoes and keeps those tiles non-standable. - gameLogic.summonRange reuses facing.js rangeTiles.
This commit is contained in:
1 parent
c92867656d
commit
60ed4fdab9
14 files changed
+136
-63
No files matched your search
@@ -1,19 +1,21 @@
|
||||
// Player reports after the 0.1.0 release, placement legality on the server (PlayerState / board.js), the client's
|
||||
// mirror (ui/gameLogic.js canPlace / boardTargets = the drag highlights) and the bots:
|
||||
// #3 "有水池的那张图干员可以错误的被部署到水里" — 战场#08(下半) 涨潮控制 (act2autochess_m04): the 深水区 (tile_deepsea,
|
||||
// board (10–12, 6)) refuses deployment (PRTS 地形 深水区 "地形机制:拒绝部署"; 特制水上平台 "在水上建立可以部署任意
|
||||
// 单位的平台" on every 深水区 of the season-1 战场#05) although the level's buildableType says ALL.
|
||||
// board (10–12, 6)) refuses deployment (PRTS 深水区 地形信息 "地形机制:拒绝部署(待补充)"; 特制水上平台
|
||||
// "在水上建立可以部署任意单位的平台" on every 深水区 of the season-1 战场#05) although the level's buildableType
|
||||
// says ALL.
|
||||
// #9 "干员伺夜这样的战术家的战术点能被错误的被放到攻击范围之外" — the tacticians' summons (伺夜's 狼群, 缪尔赛思's 流形)
|
||||
// read "只能部署在召唤者攻击范围内" (token description; PRTS 狼群 特性): the piece may only stand on a tile of its
|
||||
// owner's attack range (the rotated grid of its board tile and facing). Re-orienting the owner in place keeps the
|
||||
// piece while it is still inside, else sends it back to its stack [ASSUMED]; moving the owner sends it back anyway
|
||||
// (PRTS 卫戍协议/帮助 "移动干员时,其所属召唤物全部退场并重置至手牌区").
|
||||
// piece while it is still inside, else sends it back to its stack [ASSUMED] (refused, HAND_FULL, when it would have
|
||||
// nowhere to go); moving the owner sends it back anyway (PRTS 卫戍协议/帮助 "移动干员时,其所属召唤物全部退场并重置
|
||||
// 至手牌区") — with no room it leaves the board until the next round start.
|
||||
// The sim side (突袭 landing tile, tactical point) is test/sim/feedback1-water.test.js.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { buildDeployMap, canPlace as boardCanPlace, legalTiles, positionClass, tileKey, ownerRangeKeys } from '../../server/match/board.js';
|
||||
import { ERR } from '../../shared/constants.js';
|
||||
import { DATA, makeMatch, give, checkInvariants, chessOfTier } from './harness.js';
|
||||
import { DATA, makeMatch, give, giveItem, checkInvariants, chessOfTier } from './harness.js';
|
||||
import { botPrep, planLayout } from '../../server/match/bot.js';
|
||||
import { placementContext, canPlace as clientCanPlace, boardTargets, deployMap as clientDeployMap } from '../../public/js/ui/gameLogic.js';
|
||||
|
||||
@@ -171,6 +173,41 @@ test('#9 re-orienting the tactician: a summon still inside the new range stays,
|
||||
m.dispose();
|
||||
});
|
||||
|
||||
test('#9 hand and temp full: a re-orientation that would push 狼群 out is refused (HAND_FULL); a move drops it until the next round', () => {
|
||||
const { h, m, ps } = prep();
|
||||
const vigil = give(m, ps, VIGIL);
|
||||
assert.deepEqual(move(m, vigil.uid, board(10, 4), 'RIGHT'), { ok: true });
|
||||
assert.deepEqual(move(m, stackOf(ps, WOLF).uid, board(11, 5)), { ok: true });
|
||||
const wolf = ps.board.get('11,5');
|
||||
assert.equal(stackOf(ps, WOLF), null, 'its only copy is placed: no stack left to return onto');
|
||||
const toasts = [];
|
||||
const toast = m.toast.bind(m);
|
||||
m.toast = (p, kind, text) => { toasts.push(text); return toast(p, kind, text); };
|
||||
const golden = Object.keys(DATA.items).find((id) => DATA.items[id].isGolden && DATA.items[id].itemType === 'EQUIP');
|
||||
while (ps.hand.includes(null)) giveItem(m, ps, golden);
|
||||
while (ps.temp.includes(null)) giveItem(m, ps, golden, 'temp');
|
||||
// facing LEFT would leave (11,5) outside her range and the wolf has nowhere to go: refused, nothing changes
|
||||
assert.equal(move(m, vigil.uid, board(10, 4), 'LEFT').error, ERR.HAND_FULL);
|
||||
assert.equal(ps.board.get('10,4').dir, 'RIGHT');
|
||||
assert.equal(ps.board.get('11,5'), wolf);
|
||||
// facing UP keeps it inside: allowed
|
||||
assert.deepEqual(move(m, vigil.uid, board(10, 4), 'UP'), { ok: true });
|
||||
assert.equal(ps.board.get('11,5'), wolf);
|
||||
checkInvariants(m);
|
||||
// moving her (her summons go back to the hand; with no room a normal summon stays put) to (9,9) facing RIGHT, whose
|
||||
// range (rows 8–10, cols 9–12) leaves the wolf out: it leaves the board — no illegal placement reaches the battle
|
||||
assert.deepEqual(move(m, vigil.uid, board(9, 9), 'RIGHT'), { ok: true });
|
||||
assert.equal(ps.board.get('11,5'), undefined, 'outside her range with nowhere to go: removed');
|
||||
assert.ok(toasts.some((t) => t.includes('狼群') && t.includes('下回合返还')), toasts.join(' / '));
|
||||
assert.equal(ps.battleInput().units.filter((u) => u.kind === 'token').length, 0);
|
||||
checkInvariants(m);
|
||||
// …and its stack comes back at the next round start (grantTokensFor, "干员所属召唤物会于下一回合返还")
|
||||
h.toPrep(2);
|
||||
assert.ok(stackOf(ps, WOLF), 'the wolf is back in the hand / temp');
|
||||
checkInvariants(m);
|
||||
m.dispose();
|
||||
});
|
||||
|
||||
test('#9 swaps: a summon dragged onto its tactician, or an operator onto the summon, must leave the summon inside the range', () => {
|
||||
const { m, ps } = prep();
|
||||
const vigil = give(m, ps, VIGIL);
|
||||
|
||||
@@ -220,7 +220,7 @@ describe('#7 audit: every stage × deploy field (server = official level data =
|
||||
|
||||
test('independent check against the raw official level files (buildableType / heightType + non-hidden devices)', { skip: !HAS_LEVELS && 'no .cache/gamedata level files (run node tools/build-data.mjs once)' }, () => {
|
||||
// trap_040_canoe 特制水上平台 "在水上建立可以部署任意单位的平台"; tile_deepsea refuses deployment whatever its
|
||||
// buildableType (PRTS 地形 深水区 "地形机制:拒绝部署" — player report #3 after 0.1.0, 战场#08's pool)
|
||||
// buildableType (PRTS 深水区 地形信息 "地形机制:拒绝部署(待补充)" — player report #3 after 0.1.0, 战场#08's pool)
|
||||
const ROLE = { trap_1105_accrate: 'block', trap_032_mound: 'block', trap_1106_achplat: 'platform', trap_040_canoe: 'water' };
|
||||
for (const [id, st] of Object.entries(DATA.stages)) {
|
||||
const lv = JSON.parse(readFileSync(levelFile(id), 'utf8'));
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// Player report #3 after the 0.1.0 release: "有水池的那张图干员可以错误的被部署到水里,突袭分队干员也会自动落到水里".
|
||||
// The pool is the 深水区 (tile_deepsea) of 战场#08(下半) 涨潮控制 (act2autochess_m04: board (10–12, 6), the partner's
|
||||
// (10–12, 14), boss (3–5, 6) / (3–5, 14)). The level file says buildableType ALL, but the tile refuses deployment
|
||||
// officially: PRTS 地形 深水区 "地形机制:拒绝部署", and the season-1 战场#05 puts a 特制水上平台 ("在水上建立可以部署任意单位
|
||||
// 的平台") on every one of its 深水区 tiles. The sim side: `grid.canStand` refuses it, so no automatic placement (the
|
||||
// 突袭 landing tile, a tactician's tactical point, summon tiles) ever picks a water tile. The prep side (placement on
|
||||
// the board) is test/match/feedback1-placement.test.js.
|
||||
// officially: PRTS 深水区 地形信息 "地形机制:拒绝部署(待补充)", and the season-1 战场#05 puts a 特制水上平台
|
||||
// ("在水上建立可以部署任意单位的平台") on every one of its 深水区 tiles. The sim side: `grid.canStand` refuses it, so
|
||||
// no automatic placement (the 突袭 landing tile, a tactician's tactical point, summon tiles) ever picks a water tile.
|
||||
// The prep side (placement on the board) is test/match/feedback1-placement.test.js.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { makeBattle, chessRec, enemyRec, checkInvariants } from '../helpers/battleHarness.js';
|
||||
@@ -22,7 +22,7 @@ test('the stage data: 战场#08\'s 深水区 refuses deployment (effective build
|
||||
const raw = st.raw ?? st;
|
||||
const d = raw.tiles.d;
|
||||
assert.equal(d.tileKey, 'tile_deepsea');
|
||||
assert.equal(d.buildable, 'NONE', 'PRTS 地形 深水区: 拒绝部署');
|
||||
assert.equal(d.buildable, 'NONE', 'PRTS 深水区 地形信息: 拒绝部署');
|
||||
assert.equal(d.buildableType, 'ALL', 'the level file\'s own value is kept');
|
||||
const deploy = new Set([...raw.deployTiles.normal.melee, ...raw.deployTiles.normal.rangedOnly].map(([r, c]) => `${r},${c}`));
|
||||
for (const [r, c] of WATER) assert.ok(!deploy.has(`${r},${c}`), `deployTiles.normal excludes ${r},${c}`);
|
||||
|
||||
@@ -47,7 +47,8 @@ function official(sid, { crates: extraCrates = [], blocks: extraBlocks = [], rec
|
||||
const inside = (r, c) => (rect ? r >= rect.r0 && r <= rect.r1 && c >= rect.c0 && c <= rect.c1 : r >= 0 && r < H && c >= 0 && c < W);
|
||||
const passable = (r, c) => inside(r, c) && ['ALL', 'WALK_ONLY'].includes(tile(r, c).passableMask) && !blocked.has(`${r},${c}`);
|
||||
// non-blockable walkable terrain: not LOWLAND buildable for melee (floor, gates, goal, teleports) — and the 深水区,
|
||||
// which refuses deployment whatever its buildableType (PRTS 地形 深水区 "拒绝部署"; player report #3 after 0.1.0)
|
||||
// which refuses deployment whatever its buildableType (PRTS 深水区 地形信息 "拒绝部署(待补充)"; player report #3
|
||||
// after 0.1.0)
|
||||
const nb = (r, c) => {
|
||||
const t = tile(r, c);
|
||||
if (t.tileKey === 'tile_deepsea') return true;
|
||||
|
||||
Reference in new issue
Block a user