Skip to content

ReactionRolledEvent

How monsters react to meeting the party.

Full documentation: ReactionRolledEvent. Wire type: reaction_rolled.

Default visibility: referee

Message codes: encounter.reaction.rolled

JSON Schema

{
  "$defs": {
    "Visibility": {
      "description": "Who may see an event: the players, or only the referee.\n\nEvery event has one of these values, because in B/X the referee makes some rolls behind a screen. Filter\na log on it before you show anything to a player, or call\n`GameSession.view`, which builds the players' view and the referee's\nview for you. A narrator that plays the referee reads every event.\n\nA serialized event contains the lowercase value. The values stay fixed within a `schema_version`, the version\nstamp of the saved format.\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": "How monsters react to meeting the party.\n\n`roll_reaction` reports one of these each time it's called, which is when\nthe party meets monsters that aren't already fighting. Use the result to decide how the monsters act.",
  "properties": {
    "code": {
      "default": "encounter.reaction.rolled",
      "title": "Code",
      "type": "string",
      "description": "Fixed at `encounter.reaction.rolled`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "referee",
      "description": "Referee visibility: the players learn a monster's mood from what it does, not from the dice."
    },
    "event_type": {
      "const": "reaction_rolled",
      "default": "reaction_rolled",
      "title": "Event Type",
      "type": "string",
      "description": "The fixed string that identifies this event class in a serialized event."
    },
    "roll": {
      "title": "Roll",
      "type": "integer",
      "description": "The 2d6 total, before the modifier."
    },
    "modifier": {
      "default": 0,
      "title": "Modifier",
      "type": "integer",
      "description": "The CHA modifier to reactions of the character who spoke to the monsters, or 0 when no one did."
    },
    "total": {
      "title": "Total",
      "type": "integer",
      "description": "The roll plus the modifier, which is the number osrlib looks up on the reaction table. osrlib reads a total\noutside 2 to 12 as the nearest end of the table."
    },
    "result": {
      "title": "Result",
      "type": "string",
      "description": "How the monsters react, as a `ReactionResult` value: `attacks`,\n`hostile`, `uncertain`, `indifferent`, or `friendly`."
    }
  },
  "required": [
    "roll",
    "total",
    "result"
  ],
  "title": "ReactionRolledEvent",
  "type": "object"
}