Skip to content

PlaceParty

Referee: teleport the party to a location.

Full documentation: PlaceParty. Wire type: place_party.

Legal session modes: battle, encounter, exploring, game_over, town

JSON Schema

{
  "$defs": {
    "Direction": {
      "description": "The four grid directions.\n\nThe wire values are lowercase \u2014 they serialize into commands, events, and\nsaves; changing them is a `schema_version` bump.",
      "enum": [
        "north",
        "east",
        "south",
        "west"
      ],
      "title": "Direction",
      "type": "string"
    },
    "PartyLocation": {
      "description": "Where the party is: the base town, or a dungeon cell with facing.",
      "properties": {
        "kind": {
          "enum": [
            "town",
            "dungeon"
          ],
          "title": "Kind",
          "type": "string"
        },
        "dungeon_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dungeon Id"
        },
        "level_number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Level Number"
        },
        "position": {
          "anyOf": [
            {
              "maxItems": 2,
              "minItems": 2,
              "prefixItems": [
                {
                  "type": "integer"
                },
                {
                  "type": "integer"
                }
              ],
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Position"
        },
        "facing": {
          "anyOf": [
            {
              "$ref": "#/$defs/Direction"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "kind"
      ],
      "title": "PartyLocation",
      "type": "object"
    }
  },
  "description": "Referee: teleport the party to a location.\n\nReferee commands are legal in every mode, except that the party cannot be\nteleported out of an open encounter or battle. Placing into a dungeon marks\nthe cell explored and switches the session to `exploring`; placing in town\nswitches it to `town`.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`\n\nRejections:\n    - `session.command.encounter_in_progress` \u2014 an encounter or battle is\n      open.\n    - `session.command.unknown_location` \u2014 the location names no dungeon\n      level.\n    - `session.command.out_of_bounds` \u2014 the position is off the level's grid.\n\nEvents:\n    [`LocationEnteredEvent`][osrlib.crawl.events.LocationEnteredEvent] for the\n    destination.",
  "properties": {
    "command_type": {
      "const": "place_party",
      "default": "place_party",
      "title": "Command Type",
      "type": "string"
    },
    "location": {
      "$ref": "#/$defs/PartyLocation"
    }
  },
  "required": [
    "location"
  ],
  "title": "PlaceParty",
  "type": "object"
}