PartyMovedEvent
The party moved a cell or turned in place, with its new cell and facing.
Full documentation: PartyMovedEvent. Wire type: party_moved.
Default visibility: player
Message codes: exploration.party.moved, exploration.party.turned
JSON Schema
{
"$defs": {
"Visibility": {
"description": "Who may see an event: the players, or only the referee.\n\nEvery event has one of these values, because in B/X the referee makes some rolls behind a screen. Filter\na log on it before you show anything to a player, or call\n`GameSession.view`, which builds the players' view and the referee's\nview for you. A narrator that plays the referee reads every event.\n\nA serialized event contains the lowercase value. The values stay fixed within a `schema_version`, the version\nstamp of the saved format.\n\nExamples:\n ```python\n from osrlib.core.events import DamageDealtEvent, HitPointsReportedEvent, Visibility\n\n log = [\n DamageDealtEvent(target_id=\"monster-0001\", amount=5),\n HitPointsReportedEvent(target_id=\"monster-0001\", current_hp=2, max_hp=7),\n ]\n shown = [event.code for event in log if event.visibility is Visibility.PLAYER]\n assert shown == [\"combat.damage.dealt\"] # the goblin's remaining hit points stay hidden\n ```",
"enum": [
"player",
"referee"
],
"title": "Visibility",
"type": "string"
}
},
"description": "The party moved a cell or turned in place, with its new cell and facing.\n\nEmitted by `MoveParty` with the cell it\nstepped into, and by `TurnParty` with the\nunchanged cell and the new facing. Redraw a first-person view from this event.\n\nTwo moves that leave the party's cell work differently:\n\n- A `MoveParty` through a passage, a `TransitionSpec`\n that the party walks through, emits it with the cell the party arrives on. When the\n passage leads to another level, this event comes after that level's\n `LocationEnteredEvent`.\n- A `UseStairs` to another cell of the same level\n emits it only when the gate on the stairs has success text. The event is for the\n landing cell, and its `narrative` contains the text.\n\nA step that a wall, a closed door, or the edge of the map blocks emits no event. The\nsession refuses the command with the rejection code `exploration.move.blocked`, and\nnothing in the game changes.",
"properties": {
"code": {
"title": "Code",
"type": "string",
"description": "What happened, like `combat.attack.hit`: two or more lowercase parts separated by dots. The first part is\nthe area of the rules the event comes from, like `combat` or `magic`.\n\nBranch on it, and pass the event to `format_message` to turn it into English.\nBuilding an event with a code in any other format raises a pydantic `ValidationError`."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "player",
"description": "Player visibility: the party knows where it stands."
},
"event_type": {
"const": "party_moved",
"default": "party_moved",
"title": "Event Type",
"type": "string",
"description": "The event type, `party_moved`, which identifies this class in serialized form."
},
"x": {
"title": "X",
"type": "integer",
"description": "The column the party is in after the step or turn, counting from zero at the level's west edge."
},
"y": {
"title": "Y",
"type": "integer",
"description": "The row the party is in after the step or turn, counting from zero at the level's north edge."
},
"facing": {
"title": "Facing",
"type": "string",
"description": "The direction the party now faces, as the lowercase value of a\n`Direction` (`\"north\"`, `\"east\"`, `\"south\"`, `\"west\"`). After\na step, the party faces the way it went, so this changes on a step as well as on a turn. After\na step through a passage, the party faces the way the adventure's author set for the passage's\nfar side."
},
"narrative": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Narrative",
"description": "The success text the adventure's author wrote on the gate of a transition that took the party to\nanother cell of the same level, or `None`.\n\nFor a transition to another level, the text is on the\n`LocationEnteredEvent` instead.\n`format_message` adds it after the line it builds from the\ncode."
}
},
"required": [
"code",
"x",
"y",
"facing"
],
"title": "PartyMovedEvent",
"type": "object"
}