Skip to content

XpAwardedEvent

One character was awarded experience.

Full documentation: XpAwardedEvent. Wire type: xp_awarded.

Default visibility: player

Message codes: session.xp.awarded

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": "One character was awarded experience.\n\nEmitted wherever an award lands: inside the end-of-adventure award on\n`TravelToTown`, at each encounter's end\nwhen the ruleset awards immediately, and from the referee's\n`AwardXP`. When the award crosses a threshold, a\n`CharacterLeveledUpEvent` for the\nsame member follows it at once.",
  "properties": {
    "code": {
      "default": "session.xp.awarded",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `session.xp.awarded`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: it goes on the character's sheet."
    },
    "event_type": {
      "const": "xp_awarded",
      "default": "xp_awarded",
      "title": "Event Type",
      "type": "string",
      "description": "The wire discriminator, `xp_awarded`."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "The member who received it."
    },
    "award": {
      "title": "Award",
      "type": "integer",
      "description": "The award as the session handed it over, before the character's own adjustment."
    },
    "modified_award": {
      "title": "Modified Award",
      "type": "integer",
      "description": "What was actually added, after the class's prime-requisite percentage, rounded down. This\nis the number to show beside the character."
    },
    "level_after": {
      "title": "Level After",
      "type": "integer",
      "description": "The member's level once the award was applied."
    }
  },
  "required": [
    "character_id",
    "award",
    "modified_award",
    "level_after"
  ],
  "title": "XpAwardedEvent",
  "type": "object"
}