Skip to content

InitiativeRolledEvent

Initiative rolled for a round: every roll (re-rolls included) and the acting order.

Full documentation: InitiativeRolledEvent. Wire type: initiative_rolled.

Default visibility: player

Message codes: combat.initiative.rolled

JSON Schema

{
  "$defs": {
    "InitiativeRoll": {
      "description": "One participant's (or side's) initiative rolls: re-rolls included, ties re-roll.",
      "properties": {
        "key": {
          "title": "Key",
          "type": "string"
        },
        "rolls": {
          "items": {
            "type": "integer"
          },
          "title": "Rolls",
          "type": "array"
        },
        "modifier": {
          "default": 0,
          "title": "Modifier",
          "type": "integer"
        },
        "total": {
          "title": "Total",
          "type": "integer"
        }
      },
      "required": [
        "key",
        "rolls",
        "total"
      ],
      "title": "InitiativeRoll",
      "type": "object"
    },
    "Visibility": {
      "description": "Who may see an event.\n\nThe wire values are `\"player\"` and `\"referee\"` \u2014 lowercase, serialized into every\nevent; changing them is a `schema_version` bump.",
      "enum": [
        "player",
        "referee"
      ],
      "title": "Visibility",
      "type": "string"
    }
  },
  "description": "Initiative rolled for a round: every roll (re-rolls included) and the acting order.\n\nEmitted once per round by\n[`roll_initiative`][osrlib.core.combat.roll_initiative]. `mode` is `\"side\"` when\none roll sets the order for an entire side, or `\"individual\"` when each\ncombatant rolls separately.",
  "properties": {
    "code": {
      "default": "combat.initiative.rolled",
      "title": "Code",
      "type": "string"
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player"
    },
    "event_type": {
      "const": "initiative_rolled",
      "default": "initiative_rolled",
      "title": "Event Type",
      "type": "string"
    },
    "mode": {
      "enum": [
        "side",
        "individual"
      ],
      "title": "Mode",
      "type": "string"
    },
    "entries": {
      "items": {
        "$ref": "#/$defs/InitiativeRoll"
      },
      "title": "Entries",
      "type": "array"
    },
    "order": {
      "items": {
        "type": "string"
      },
      "title": "Order",
      "type": "array"
    }
  },
  "required": [
    "mode",
    "entries",
    "order"
  ],
  "title": "InitiativeRolledEvent",
  "type": "object"
}