Skip to content

GameOverEvent

Every party member is dead and the session has ended.

Full documentation: GameOverEvent. Wire type: game_over.

Default visibility: player

Message codes: session.game_over

JSON Schema

{
  "$defs": {
    "Visibility": {
      "description": "Who is allowed to see an event.\n\nEvery event has one of these two values, and the split exists because B/X keeps some rolls behind the\nreferee's screen. Filter a log on it before you show anything to a player, or call\n`GameSession.view`, which builds the player's and the referee's\nviews for you. A narrator playing referee reads both.\n\nThe values are the lowercase strings and they serialize into every event, so a renamed value is a\n`schema_version` bump.\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": "Every party member is dead and the session has ended.\n\nEmitted by whatever command's events killed the last member: a lost battle, a\ntrap, a fall down a chute, starvation, a poison that finished someone while the\nreferee was moving the clock. It closes that command's result, and the session\nmode becomes `game_over`.\n\nPlay commands are refused from there. A referee can still act, and\n`PlaceParty` is the way out, because carrying\nthe fallen back to town is the first step of a revival.",
  "properties": {
    "code": {
      "default": "session.game_over",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `session.game_over`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: it's the party's ending."
    },
    "event_type": {
      "const": "game_over",
      "default": "game_over",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `game_over`."
    },
    "reason": {
      "title": "Reason",
      "type": "string",
      "description": "Why the session ended, as a short phrase. Every ending reports the party falling. What\nkilled them is in the events just before it."
    }
  },
  "required": [
    "reason"
  ],
  "title": "GameOverEvent",
  "type": "object"
}