feat(walls): proto 2 typed wall record, inert geometry, derived kind (#54)
wall.add/wall.update take thickness, position, height and the eight raw switches; kind is output-only and the GM wall frames echo the full typed record. Geometry is stored but inert (0/full/centre behaviour), and the legacy kind/open wire adapter is gone. proto is bumped to 2 with the harness default, and BannedAlways gains every wall field name with a WALLDATA positive control. Tests: schema-7 migrated scene vs the same walls authored via raw switches gives byte-identical player frames, refusals and per-tile statuses. Nim 382 / Node 113 green.
This commit is contained in:
@@ -84,9 +84,8 @@ test('grow push and squeeze (5.6): pushed clear of a wall, or flagged squeezed w
|
||||
const gm = await gmConnect(s.origin, gmKey)
|
||||
const alice = await namedPlayer(s.origin, gm, 'Alice')
|
||||
// a 40 px corridor at x in [500, 540]: a token of r=15 fits, r=25 does not
|
||||
const left = await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [500, 0], b: [500, 900],
|
||||
kind: 'wall' })
|
||||
await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [540, 0], b: [540, 900], kind: 'wall' })
|
||||
const left = await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [500, 0], b: [500, 900] })
|
||||
await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [540, 0], b: [540, 900] })
|
||||
// the token sits mid-corridor: r=15 fits between the walls, so it starts unlocked
|
||||
const pushee = await gm.ws.request({ t: 'token.create', scene: gm.sceneId, kind: 'pc',
|
||||
pos: [400, 400], descriptive_name: 'Alice',
|
||||
@@ -124,8 +123,7 @@ test('grow push and squeeze (5.6): pushed clear of a wall, or flagged squeezed w
|
||||
const free = await gm.ws.request({ t: 'token.create', scene: gm.sceneId, kind: 'pc',
|
||||
pos: [1000, 900], descriptive_name: 'Bob',
|
||||
actual_name: 'Bob', radius: 10 })
|
||||
await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [1010, 700], b: [1010, 1100],
|
||||
kind: 'wall' })
|
||||
await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [1010, 700], b: [1010, 1100] })
|
||||
const grown = await mutate(gm.ws, { t: 'token.resize', id: free.id, radius: 60 })
|
||||
assert.equal(grown.ack.ok, true)
|
||||
const pushed = await grown.wait(m => m.t === 'token' && m.id === free.id && m.radius === 60)
|
||||
@@ -150,7 +148,7 @@ test('stuck from a wall and from a GM placement, cleared by the removal and by a
|
||||
|
||||
// a wall added over the token gives it stuck(walls) (5.5 SET)
|
||||
const add = await mutate(gm.ws, { t: 'wall.add', scene: gm.sceneId, a: [990, 800],
|
||||
b: [990, 1200], kind: 'wall' })
|
||||
b: [990, 1200] })
|
||||
const wall = add.ack
|
||||
let frame = await add.wait(m => m.t === 'token' && m.id === tok.id && m.statuses.length > 0)
|
||||
assert.deepEqual(frame.statuses, [{ status: 'stuck', source: 'walls' }])
|
||||
@@ -175,8 +173,7 @@ test('stuck from a wall and from a GM placement, cleared by the removal and by a
|
||||
assert.deepEqual(frameOf(gm.ws, tok.id).statuses, [])
|
||||
|
||||
// a GM placement on a wall is stuck too (5.5 SET)
|
||||
await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [990, 800], b: [990, 1200],
|
||||
kind: 'wall' })
|
||||
await gm.ws.request({ t: 'wall.add', scene: gm.sceneId, a: [990, 800], b: [990, 1200] })
|
||||
const placed = await gm.ws.request({ t: 'token.create', scene: gm.sceneId, kind: 'npc',
|
||||
pos: [990, 1000], descriptive_name: 'a guard',
|
||||
actual_name: 'Vex' })
|
||||
|
||||
Reference in New Issue
Block a user