SavingThrowRolledEvent
A saving throw and how it went.
Full documentation: SavingThrowRolledEvent. Wire type: saving_throw_rolled.
Default visibility: player
Message codes: combat.save.auto, combat.save.failed, combat.save.passed
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 saving throw and how it went.\n\n`saving_throw` emits one of these whenever a creature gets a chance to\navoid something. What passing or failing means belongs to whatever called for the save, so read this event\nalongside the ones around it.\n\nA creature whose defenses pass the save for it rolls nothing, and then `roll` and `required` are both `None`.",
"properties": {
"code": {
"title": "Code",
"type": "string",
"description": "What happened, as two or more lowercase segments separated by dots and namespaced by subsystem, like\n`combat.attack.hit`. This is what you branch on and what\n`format_message` looks up. Anything else raises a validation error."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "player",
"description": "Player visibility: saving throws are rolled in the open, monsters included."
},
"event_type": {
"const": "saving_throw_rolled",
"default": "saving_throw_rolled",
"title": "Event Type",
"type": "string",
"description": "The wire name for this event type."
},
"target_id": {
"title": "Target Id",
"type": "string",
"description": "The entity id of whoever saved."
},
"category": {
"title": "Category",
"type": "string",
"description": "Which of the five saving throws it was, as a\n`SaveCategory` value: `death`, `wands`, `paralysis`, `breath`, or\n`spells`."
},
"roll": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Roll",
"description": "The d20 as it landed, before modifiers. `None` on an automatic save."
},
"modifier": {
"default": 0,
"title": "Modifier",
"type": "integer",
"description": "Everything added to the roll: a ward, a ring, the situation the caller attested."
},
"required": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Required",
"description": "The number the creature needed to meet or beat. `None` on an automatic save."
}
},
"required": [
"code",
"target_id",
"category"
],
"title": "SavingThrowRolledEvent",
"type": "object"
}