Skip to content

TurnParty

Turn the party in place to a new facing (takes no game time).

Full documentation: TurnParty. Wire type: turn_party.

Legal session modes: exploring

JSON Schema

{
  "$defs": {
    "Direction": {
      "description": "The four grid directions the party faces and moves in.\n\nYou use these for the way `MoveParty` steps, the side of a\ncell `OpenDoor` works on, and the way a transition turns the\nparty on arrival. There is no up or down. A\n`TransitionSpec` moves the party between levels.\n\nThe values are lowercase strings, like `\"north\"`, and they appear in commands, events, and saves.",
      "enum": [
        "north",
        "east",
        "south",
        "west"
      ],
      "title": "Direction",
      "type": "string"
    }
  },
  "description": "Turn the party in place to a new facing (takes no game time).\n\nThe party must already be in a dungeon (see\n`EnterDungeon`). A turn never fails once the\nsession is `exploring`.\n\nModes:\n    `exploring`\n\nRejections:\n    - `session.command.wrong_mode` - the session is not exploring a dungeon.\n\nEvents:\n    `PartyMovedEvent` with the unchanged\n    position and the new facing.",
  "properties": {
    "command_type": {
      "const": "turn_party",
      "default": "turn_party",
      "title": "Command Type",
      "type": "string",
      "description": "The name that identifies the command class in serialized data. Each command class fixes\nit to a distinct snake_case string, like `\"move_party\"` or `\"open_door\"`, and constructing\nthe class sets it, so you never pass it yourself.\n`parse_command` and the\n`AnyCommand` union use it to rebuild the right class\nfrom a serialized mapping. A class's value never changes between releases."
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source",
      "description": "Who or what issued the command on whose behalf: an authored trigger or quest id, or the\nname of one of your game's systems. The engine never reads it, so a command with a\n`source` does exactly what the same command without one does. The session logs and\nreplays it with the command, so the log alone shows why something happened. Leave it\n`None` when there's nothing to record. An empty string fails validation when the command\nis constructed."
    },
    "facing": {
      "$ref": "#/$defs/Direction",
      "description": "The direction the party ends up facing. Its position doesn't change and no game time\npasses. The new facing is on the\n`PartyMovedEvent`, so you can redraw a first-person\nview from that event."
    }
  },
  "required": [
    "facing"
  ],
  "title": "TurnParty",
  "type": "object"
}