Skip to content

SetDoorState

Referee: rewrite a door's overlay anywhere (None fields stay unchanged).

Full documentation: SetDoorState. Wire type: set_door_state.

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"
    }
  },
  "description": "Referee: rewrite a door's overlay anywhere (`None` fields stay unchanged).\n\nReferee commands are legal in every mode; the door may be on any level of any\ndungeon, not just under the party.\n\nModes:\n    `town`, `exploring`, `encounter`, `battle`, `game_over`\n\nRejections:\n    - `session.command.unknown_location` \u2014 `dungeon_id` or `level_number`\n      resolves to nothing.\n    - `session.command.no_door` \u2014 no door edge at that cell and direction.\n\nEvents:\n    A referee-visibility [`DoorEvent`][osrlib.crawl.events.DoorEvent] when the\n    open state actually changes; otherwise none.",
  "properties": {
    "command_type": {
      "const": "set_door_state",
      "default": "set_door_state",
      "title": "Command Type",
      "type": "string"
    },
    "dungeon_id": {
      "title": "Dungeon Id",
      "type": "string"
    },
    "level_number": {
      "minimum": 1,
      "title": "Level Number",
      "type": "integer"
    },
    "x": {
      "title": "X",
      "type": "integer"
    },
    "y": {
      "title": "Y",
      "type": "integer"
    },
    "direction": {
      "$ref": "#/$defs/Direction"
    },
    "open": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Open"
    },
    "wedged": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Wedged"
    },
    "discovered": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Discovered"
    },
    "unlocked": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Unlocked"
    }
  },
  "required": [
    "dungeon_id",
    "level_number",
    "x",
    "y",
    "direction"
  ],
  "title": "SetDoorState",
  "type": "object"
}