Skip to content

ObjectiveRevealedEvent

A hidden objective surfaced: the party can now be told what it's being asked for.

Full documentation: ObjectiveRevealedEvent. Wire type: objective_revealed.

Default visibility: player

Message codes: session.quest.objective_revealed

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": "A hidden objective surfaced: the party can now be told what it's being asked for.\n\nEmitted by `RevealObjective`. An\nobjective the adventure didn't mark hidden is visible from the start and is\nnever revealed.",
  "properties": {
    "code": {
      "default": "session.quest.objective_revealed",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `session.quest.objective_revealed`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the party is being told what to do."
    },
    "event_type": {
      "const": "objective_revealed",
      "default": "objective_revealed",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `objective_revealed`."
    },
    "quest_id": {
      "title": "Quest Id",
      "type": "string",
      "description": "The quest the objective belongs to."
    },
    "quest_name": {
      "default": "",
      "title": "Quest Name",
      "type": "string",
      "description": "The quest's display name, resolved when the event is made so a renderer holds no adventure\nto look it up in. It defaults empty only so an event written by an older version still parses.\nThe engine always fills it."
    },
    "objective_id": {
      "title": "Objective Id",
      "type": "string",
      "description": "Which objective, as the id the adventure gave it."
    },
    "name": {
      "default": "",
      "title": "Name",
      "type": "string",
      "description": "The objective's display label: the name its author wrote, or its id when the adventure\nwrote none. It defaults empty for the same parsing reason as `quest_name`."
    },
    "narrative": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Narrative",
      "description": "The offer beat the author wrote for this objective, or `None`. The journal contains the same\nline."
    }
  },
  "required": [
    "quest_id",
    "objective_id"
  ],
  "title": "ObjectiveRevealedEvent",
  "type": "object"
}