Repository navigation
Conversation
A MoveParty across the side of a cell that a passage stands on lands the party on the passage's destination. The move makes the usual can't-move checks, evaluates the passage's gate as UseStairs does, and costs what a step onto the landing cell costs. It emits what UseStairs emits for the same destination, with via="passage", then a PartyMovedEvent for the landing cell. Within one level, doors the party opened swing shut as they do after any step. LevelSpec.passage_at finds a passage by cell and side. transition_at and UseStairs ignore passages, and the player view shows a passage's side as open. validate_adventure refuses a passage whose side or far cell breaks the crossing, one that lands on its own cell or on a far cell, two passages on one cell and side, and a trap whose transition is a passage, with the exact lines the acceptance tests pin. SCHEMA_VERSION stays 4. No draw sequence or golden file changed.
A review of the passage chunk found that the LocationEnteredEvent class docstring, the gates module docstring, the GateSpec docstring, and the odometer sentence in docs/adaptations.md left passages out. This corrects them, removes the passage tests' xfail marker, and adds docs/phase-17-plan.md as the record of the phase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements the passage contract from pull requests 153 and 154. A passage is a transition the party crosses by walking across one side of its cell with
MoveParty, instead of taking it withUseStairs. osr-forge's map tracing and re-pod's level splitting need it, and it ships in osrlib 2.0.What changed:
TransitionSpecrefuses a passage with noside, and any other kind with one.LevelSpec.passage_atfinds a passage by cell and side, andtransition_atandUseStairsignore passages.MovePartymakes its can't-move checks, then crosses a passage on that side if there is one. The crossing evaluates the gate and takes the toll through the helpersUseStairsuses. It emits the same arrival events withvia="passage", then aPartyMovedEventfor the landing cell, and costs what a step onto the landing cell costs."open". Sight, light, and fighting space still treat it as the wall it is.validate_adventurerefuses the cases the contract lists, with the exact lines the tests pin.docs/phase-17-plan.mdcover passages. The second commit corrects four docstrings a review found outside the first diff, and removes the tests' xfail marker.SCHEMA_VERSIONstays 4, and no golden file or test changed.Checked locally:
uv run pytest tests/test_passages.py(38 passed, unmarked),ruff format --check,ruff check,pyright(0 errors),pytest(2989 passed, 146 skipped), andmkdocs build --strict. A fresh reviewer also ran cases no test covers: a keyed encounter on the landing cell, a gated passage within one level, an overloaded party, a refused gate, arrivals on a passage cell by other means, the far cell under a lit torch, and a replay through a passage pair. Each behaved as the plan says.