Skip to content

BattleRoundEvent

A battle round began.

Full documentation: BattleRoundEvent. Wire type: battle_round.

Default visibility: player

Message codes: battle.round.started

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 battle round began.\n\nEmitted at the top of every\n`ResolveBattleRound`, before the\ndeclarations post and initiative is rolled. It's the marker a transcript can\ngroup the rest of the round's events under.",
  "properties": {
    "code": {
      "default": "battle.round.started",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `battle.round.started`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: everyone at the table knows which round it is."
    },
    "event_type": {
      "const": "battle_round",
      "default": "battle_round",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `battle_round`."
    },
    "round": {
      "title": "Round",
      "type": "integer",
      "description": "Which round of this battle is starting, counting from one."
    }
  },
  "required": [
    "round"
  ],
  "title": "BattleRoundEvent",
  "type": "object"
}