RestedEvent
A rest finished, or was interrupted before it could.
Full documentation: RestedEvent. Wire type: rested.
Default visibility: player
Message codes: exploration.rest.interrupted, exploration.rest.rested
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 rest finished, or was interrupted before it could.\n\nEmitted by `Rest`. A completed rest clears the\nunrested-fatigue penalty, credits running exhaustion, and, for a full day, heals\nnaturally. An interrupted one does none of that, because something wandered in.",
"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: the party knows whether it got its rest."
},
"event_type": {
"const": "rested",
"default": "rested",
"title": "Event Type",
"type": "string",
"description": "The wire discriminator, `rested`."
},
"kind": {
"title": "Kind",
"type": "string",
"description": "How long the party tried to rest: `\"turn\"` for the one-turn breather the dungeon rule\ncalls for, `\"night\"`, or `\"day\"`."
}
},
"required": [
"code",
"kind"
],
"title": "RestedEvent",
"type": "object"
}