Files
ark-stronghold-protocol/shared/highGround.js
T
sganggs 83fc408a55 feedback4: every melee chess whose trait reads 可以放置于远程位 may stand on a 高台, normal or elite, any module
The owner's decision of 2026-10-05 reverses the one of 2026-10-04 (elite 歌蕾蒂娅 with HOK-Y only) and follows PRTS:
the line is the 钩索师 / 推击手 branch trait (歌蕾蒂娅, 崖心, 见行者, normal and elite) and every module keeps it, so
the loadout no longer matters. Raised with the PRTS source in PR #69 by @sunstricken (its own change covered only
歌蕾蒂娅; its test page is not taken). GitHub #153.

- shared/highGround.js: meleeOnHighGround(rec) reads the trait without a module (traitBase, else trait); no module id.
- board.js positionClass(rec) widens those six records; placeClass(ps, rec) = positionClass(rec) for every server
  check (g.move, swaps, merge tile, evictions, audit, invariants). The client's piecePosition mirrors it.
- bot.js: the existing 高台 preference (a 高台 whose range covers the road) now applies to all six; comments.
- Docs: DESIGN §3 and §6.6, DATA (placement), PLAYING §4, META, research 03 C2, code comments. data/ unchanged
  (build-data --offline gives identical files).
- Tests: board, feedback1-placement (each holder with default / no module / every module on each 高台, a 重装
  refused, client highlights, swap, battle, bots), gameLogic.

Golden: 16 scenarios moved, every one because tools/golden.mjs lays operators out by positionClass and now places
歌蕾蒂娅 (normal, or elite with HOK-X) beside the enemy path like a ranged operator instead of on the busiest melee
tile, which shifts the others: roster-010, roster-012, roster-029, roster-040, roster-041; bond-deputShip-high,
bond-indomShip-low, bond-preciShip-low, bond-preciShip-high, bond-suntShip-low, bond-swiftShip-high; boss-boss_2-pair,
boss-boss_4-pair, boss-boss_6-pair, hidden-boss_8-pair, hidden-boss_10-pair. roster-031 (elite with HOK-Y, already
widened) and all matches are unchanged.
2026-10-05 23:20:56 +08:00

33 lines
1.9 KiB
JavaScript

// shared/highGround.js — which MELEE chess may stand on a 高台 (a ranged deploy tile).
//
// The owner's decision of 2026-10-05, reversing the one of 2026-10-04 (elite 歌蕾蒂娅 with HOK-Y only): follow PRTS. A
// MELEE chess whose trait reads 「可以放置于远程位」 may stand on a 高台 as well as on the ground. The line is the 钩索师 /
// 推击手 branch trait (PRTS 歌蕾蒂娅 · 特性, raised with the PRTS source in PR #69 by @sunstricken; PRTS 新人入门: both
// branches "可部署在高台和地面"): 歌蕾蒂娅, 崖心 and 见行者, normal and elite. It is the branch's own text, not a module
// effect — every module of the three keeps it — so the loadout does not matter: any module, or none. The text read is
// the record's trait without a module (`traitBase`, which an elite with modules carries; else `trait`). A module talent
// such as the 教官's Y module ("可以额外部署在远程位") is a 部署效果, which 卫戍协议 switches off (PRTS 卫戍协议/帮助
// §战斗部署), and is not read. The battle keeps position MELEE: on a 高台 the unit attacks and blocks nothing.
/** The trait line that lets a MELEE chess stand on a ranged (高台) tile. */
export const PLACE_ON_RANGED = '可以放置于远程位';
/**
* The record's trait text without a module ('' when it has none).
* @param {object|null} rec a chess record
* @returns {string}
*/
export function baseTraitText(rec) {
const t = rec ? rec.traitBase || rec.trait : null;
return t && typeof t.desc === 'string' ? t.desc : '';
}
/**
* Whether a MELEE chess record may also stand on a 高台: its trait reads 「可以放置于远程位」. Normal or elite, any module.
* @param {object|null} rec a chess record (normal or golden)
* @returns {boolean}
*/
export function meleeOnHighGround(rec) {
return !!rec && rec.position === 'MELEE' && baseTraitText(rec).includes(PLACE_ON_RANGED);
}