feat(walls): windows — see-through barrier, movement follows blocks_movement (#57)
- geometry.Wall carries the stored blocks_sight/blocks_movement switches; sight asks blocksSight, movement and the status rules ask blocks (open door passes both). - worldmap translates both switches; moverules only pushes on a movement barrier. - leakcheck and the tile oracle read blocks_sight independently. - Walls/token-details/tiles groups prove both forms, sight-through, stuck, push and the locked-window open refusal; existing scenes stay byte-identical. Ref #57 # Conflicts: # server/geometry.nim # server/world.nim # server/worldmap.nim # tools/leakcheck.nim
This commit is contained in:
+11
-5
@@ -143,12 +143,16 @@ proc applyGmWalls(truth: var Truth, ids: var seq[int], m: JsonNode) =
|
||||
for w in m["walls"]:
|
||||
truth.walls.add Wall(a: vec(w["a"]), b: vec(w["b"]),
|
||||
door: w["door"].getBool, open: w["open"].getBool,
|
||||
sightDir: wallDir(w["sight_dir"]))
|
||||
sightDir: wallDir(w["sight_dir"]),
|
||||
sightBarrier: w["blocks_sight"].getBool,
|
||||
movementBarrier: w["blocks_movement"].getBool)
|
||||
ids.add w["id"].getInt
|
||||
of "wall":
|
||||
let id = m["id"].getInt
|
||||
let w = Wall(a: vec(m["a"]), b: vec(m["b"]), door: m["door"].getBool,
|
||||
open: m["open"].getBool, sightDir: wallDir(m["sight_dir"]))
|
||||
open: m["open"].getBool, sightDir: wallDir(m["sight_dir"]),
|
||||
sightBarrier: m["blocks_sight"].getBool,
|
||||
movementBarrier: m["blocks_movement"].getBool)
|
||||
var found = false
|
||||
for i in 0 ..< ids.len:
|
||||
if ids[i] == id:
|
||||
@@ -238,11 +242,13 @@ proc wallsFor(truth: Truth, o: Vec, honourDir: bool): seq[Wall] =
|
||||
for w in result.mitems: w.sightDir = wdBoth
|
||||
|
||||
proc clearLine(walls: seq[Wall], o, p: Vec): bool =
|
||||
## The clear-segment oracle: no blocking wall between o and p (independent of the ray fan). The
|
||||
## one-way filter is the checker's own side test, for the sample's viewer `o`.
|
||||
## The clear-segment oracle: no sight-blocking wall between o and p (independent of the ray fan).
|
||||
## Two independent readings: the one-way side test for the sample's viewer `o` (#58) and the GM's
|
||||
## `blocks_sight` switch (#57: a window never blocks, an open door never blocks, a solid or closed
|
||||
## door does). Neither uses the server's vision code.
|
||||
for w in walls:
|
||||
if checkDir and w.sightDir != wdBoth and not w.blindTo(o): continue
|
||||
if w.blocks and segsCross(o, p, w.a, w.b): return false
|
||||
if w.blocksSight and segsCross(o, p, w.a, w.b): return false
|
||||
true
|
||||
|
||||
proc rangeOf(sceneDefault: float, t: TruthToken): float =
|
||||
|
||||
Reference in New Issue
Block a user