feedback5 WE: 联防 is played on its own map, the escaped template level (GitHub #41, item 3) — act2autochess constData escapedBattleTemplateMapSinglePlayer / MultiPlayer = level_act1autochess_escaped_single / _multi name the level of the 联防 battle, and its map is the field: two road halves (cols 3–9 and 11–17, rows 9–12) joined at col 10, no water, crates or devices (until 0.1.3 the round's stage, opened to both halves). tools/build-data.mjs builds both into data/stages.json after the 11 battle stages (kind 'unite', helpers 1 / 2, weight 0, inactive, no modes, the name 联防阵地(N名玩家) the remake's own label [ASSUMED]; validation ties config.unite.templates to them); regenerated offline, a JSON compare shows only the two added records. unite.js uniteStageId picks the map of the helper count (escaped_single's routes enter at col 10, escaped_multi's at col 18 through (9,10)); match/unitePhase.js fields the 联防 battle on it (the round's stage only with data that lacks it); each helper on its prep tiles, the first of two shifted 8 columns onto the right half as before (the official halves; player_map_lr_offset 8). Client: screens/game.js draws the shown field's own map and restores the board's on leaving it (a 2-line change in a file of the R5 split; render/app.js enterBattle already loads m.field stageId); the dev mock's 联防 follows. The 联防 BGM (PR #110) is unchanged. Tests: test/match/feedback5-unite-map.test.js (both combat modes, 1 and 2 helpers, degraded data), test/data.test.js, test/render/tiles.test.js. Docs: DATA §12, META §4, DESIGN §3, PLAYING §5. Golden: fields unite-1 / unite-2 (the battle's stage → the 联防 map) and the 6 co-op match scenarios with a 联防 round (coop2-NORMAL-3, coop2-HARD-4, coop3-ABYSS-5, coop4-FUNNY-6, coop4-ABYSS-7, coop2-NORMAL-8-serverrun); roster / bonds unchanged (tools/golden.mjs leaves the 联防 maps out of its stage list)

This commit is contained in:
sganggs committed 2026-10-05 18:17:08 +08:00
1 parent db1b44bb71
commit 8a43624935
19 files changed
+386 -174

No files matched your search

+21 -5
View File
@@ -2449,15 +2449,26 @@ function stageDisplayName(stageId, raw) {
return name;
}
/**
* The 联防 maps' names: the tables and PRTS name neither map, so the label is the remake's own [ASSUMED] (PRTS
* 卫戍协议/帮助 §联防阶段 calls the joined field "一处阵地"); no screen shows it today.
*/
const UNITE_STAGE_NAMES = { 1: '联防阵地(1名玩家)', 2: '联防阵地(2名玩家)' };
/**
* Build data/stages.json: 19×21 terrain grids (row 0 = bottom), legend, devices, special terrain
* parameters, deployable tiles and helper ground paths.
* parameters, deployable tiles and helper ground paths — the 11 battle stages of stageDatasDict, then the two 联防
* maps: act2autochess constData escapedBattleTemplateMapSinglePlayer / MultiPlayer name the level of the 联防 battle
* (level_act1autochess_escaped_single / _multi), whose own map is the 联防 field — a road, not the round's stage (GitHub
* #41). They carry `kind: 'unite'` and `helpers` (1 / 2), weight 0, no modes, and are never drawn as a match stage.
*/
function buildStages(ctx, modesById) {
const researchStages = ctx.research.maps?.stages || {};
const out = {};
for (const stageId of ctx.stageIds) {
const sd = ctx.act.stageDatasDict[stageId];
const unite = [['escapedBattleTemplateMapSinglePlayer', 1], ['escapedBattleTemplateMapMultiPlayer', 2]]
.filter(([k]) => ctx.act.constData[k]).map(([k, helpers]) => ({ stageId: templateIdOf(ctx.act.constData[k]), helpers }));
for (const { stageId, helpers } of [...ctx.stageIds.map((id) => ({ stageId: id, helpers: 0 })), ...unite]) {
const sd = helpers ? null : ctx.act.stageDatasDict[stageId];
const lv = ctx.levels[stageId];
const map = lv.mapData?.map || [];
const tiles = lv.mapData?.tiles || [];
@@ -2554,10 +2565,11 @@ function buildStages(ctx, modesById) {
const p2 = officialPath(gridStage, activeBlocking, a, b);
if (p2) groundPathsWithDevices[k] = p2;
}
const modes = [...(sd.mode || [])];
const modes = [...(sd?.mode || [])];
const o = lv.options || {};
out[stageId] = {
id: stageId, name: stageDisplayName(stageId, researchStages[stageId]?.name), weight: sd.weight, active: sd.weight > 0,
id: stageId, name: helpers ? UNITE_STAGE_NAMES[helpers] : stageDisplayName(stageId, researchStages[stageId]?.name),
weight: sd ? sd.weight : 0, active: sd ? sd.weight > 0 : false, ...(helpers ? { kind: 'unite', helpers } : {}),
modes, size: [H, W], rows, tiles: glyphTiles,
devices, mapChars, special, runes, globalBuffs,
deployTiles: { normal: deployIn(9, 12, 2, 10), bossLeft: deployIn(1, 5, 2, 10), bossRight: deployIn(1, 5, 10, 18) },
@@ -3444,6 +3456,10 @@ function validateAll(f) {
if (s.rows.some((r) => r.includes('?'))) err(`stage ${s.id}: unknown tile glyph`);
if (s.name !== s.id && /[A-Za-z]/.test(s.name)) err(`stage ${s.id}: Latin text in player-facing name "${s.name}"`);
}
// the 联防 field of 1 / 2 helpers is the map of its template (server/match/unite.js uniteStageId)
for (const [n, id] of Object.entries(config.unite.templates)) {
if (stages[id]?.kind !== 'unite' || stages[id].helpers !== Number(n) || stages[id].active) err(`unite template ${id}: no inactive 联防 stage for ${n} helper(s)`);
}
for (const m of Object.values(config.modes)) {
for (const [r, rd] of Object.entries(m.rounds)) {
const tpls = rd.template ? [rd.template] : Object.values(rd.bossTemplates || {});
+10 -5
View File
@@ -22,8 +22,9 @@
// turn; bonds from the board (bondsMeta.computeBonds) with 0–120 layers
// bonds 46 battles: every bond at its activation threshold (1 layer) and at its top tier (999 layers), 8 operators
// fields 22 battles: every Final Assault / Hidden Core leader on its pair and its solo template (a shared boss pool,
// ended at 200 game s) and 联防 fields (1 and 2 helpers, carried HP / SP, a knocked-out operator, two
// leakers' enemies with a summoned-only kind and a bounty)
// ended at 200 game s) and 联防 fields (1 and 2 helpers on the 联防 map of their count — boards laid out on a
// battle stage —, carried HP / SP, a knocked-out operator, two leakers' enemies with a summoned-only kind and
// a bounty)
// matches 16 bot-only matches (solo 标准 / 险境 / 绝境 / 终极 ×2 seeds, co-op 2 / 3 / 4, one server-run combat match,
// two with LP and layers raised at the first prep so they reach the Hidden Core) run to the end in virtual
// time with the match's default bot rehearsal
@@ -57,6 +58,7 @@ import { buildBattleSpec, createBattleFromSpec } from '../server/sim/spec.js';
import { createRng, deriveSeed } from '../server/sim/rng.js';
import { GameData } from '../server/match/gamedata.js';
import { setupMatchWaves, buildNormalWave, buildBossWave, buildUniteWave, isFlyKey, routeByMotion } from '../server/match/waves.js';
import { uniteStageId } from '../server/match/unite.js';
import { buildDeployMap, positionClass, canPlace, ownerRangeKeys, tileKey } from '../server/match/board.js';
import { computeBonds, bondSnapshot } from '../server/match/bondsMeta.js';
import { Match } from '../server/match/Match.js';
@@ -230,7 +232,8 @@ const ENEMY_COLS = Object.freeze(['spawned', 'killed', 'leaked', 'dmg', 'taken']
const CHESS = Object.values(data.chess).sort((a, b) => byId(a.chessId, b.chessId));
const VISIBLE = CHESS.filter((c) => c.visible);
const STAGES = Object.keys(data.stages).sort(byId);
// the battle stages (the two 联防 maps, stages.json kind 'unite', are the 联防 fields' own: server/match/unite.js uniteStageId)
const STAGES = Object.keys(data.stages).filter((id) => data.stages[id].kind !== 'unite').sort(byId);
const BANDS = Object.keys(data.bands).sort(byId);
const EQUIPS = Object.values(data.items).filter((i) => i.itemType === 'EQUIP').map((i) => i.id).sort(byId);
const BOSSES = Object.keys(data.bosses).sort((a, b) => Number(a.replace(/\D/g, '')) - Number(b.replace(/\D/g, '')));
@@ -586,7 +589,9 @@ export function fieldScenarios() {
const modeId = helpers === 1 ? 'mode_multi_normal' : 'mode_multi_hard';
const gd = gdFor(modeId);
const round = helpers === 1 ? 7 : 11;
const stageId = STAGES[(i * 5) % STAGES.length];
// the helpers' boards are laid out on the round's stage; the 联防 battle runs on its own map (GitHub #41)
const boardStageId = STAGES[(i * 5) % STAGES.length];
const stageId = uniteStageId(gd, helpers) ?? boardStageId;
const seed = deriveSeed(20261005, `unite:${helpers}`);
const src = normalWave(gd, round, seed);
const leakers = helpers === 1 ? ['p2', 'p3'] : ['p3', 'p4'];
@@ -601,7 +606,7 @@ export function fieldScenarios() {
let uid = 1;
const players = [];
for (let h = 0; h < helpers; h++) {
const t = team(gd, stageId, 'normal', uid, 8, helpers > 1 && h === 0 ? 8 : 0);
const t = team(gd, boardStageId, 'normal', uid, 8, helpers > 1 && h === 0 ? 8 : 0);
uid = t.nextUid;
// carried end state of the helper's own battle: HP ratio + SP, one knocked out, summons with SP only
t.units.forEach((u, k) => {