TriggerFiredEvent
A trigger the adventure's author wrote fired.
Full documentation: TriggerFiredEvent. Wire type: trigger_fired.
Default visibility: referee
Message codes: session.trigger.fired
JSON Schema
{
"$defs": {
"Visibility": {
"description": "Who may see an event: the players, or only the referee.\n\nEvery event has one of these values, because in B/X the referee makes some rolls behind a screen. Filter\na log on it before you show anything to a player, or call\n`GameSession.view`, which builds the players' view and the referee's\nview for you. A narrator that plays the referee reads every event.\n\nA serialized event contains the lowercase value. The values stay fixed within a `schema_version`, the version\nstamp of the saved format.\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 trigger the adventure's author wrote fired.\n\nA trigger is a rule the adventure's author wrote: when a given event happens, run\ngiven commands. Emitted by `MarkTriggerFired`\nevery time it runs, including for a trigger that has fired before. The session keeps\nonly whether a trigger has fired, and these events are the record of each firing.\n\nIt has referee visibility, because which trigger fired is part of how the adventure\nworks, not part of the story the players see. Text the author wrote for the players\ngoes in the journal and arrives as a\n`JournalEntryAddedEvent` or as one of\nthe quest events.",
"properties": {
"code": {
"default": "session.trigger.fired",
"title": "Code",
"type": "string",
"description": "The message code, always `session.trigger.fired`."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "referee",
"description": "Referee visibility: which triggers an adventure has is hidden from the players."
},
"event_type": {
"const": "trigger_fired",
"default": "trigger_fired",
"title": "Event Type",
"type": "string",
"description": "The event type, `trigger_fired`, which identifies this class in serialized form."
},
"trigger_id": {
"title": "Trigger Id",
"type": "string",
"description": "Which trigger fired, as the id the adventure gave it."
},
"narrative": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Narrative",
"description": "The text the author wrote for this firing, or `None`. The author wrote it, not the engine,\nand `format_message` adds it after the line it builds from the\ncode. This event has referee visibility, so the players don't see this text. Text meant for\nthem belongs in the journal."
}
},
"required": [
"trigger_id"
],
"title": "TriggerFiredEvent",
"type": "object"
}