DeathEvent
A creature has been killed.
Full documentation: DeathEvent. Wire type: death.
Default visibility: player
Message codes: combat.death.died, combat.death.permanent
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 creature has been killed.\n\n`kill` emits this, whether death came from damage, from a failed save, or from\nan effect running out, and there it arrives after the\n`ConditionGainedEvent` for `dead` and before the hit point\nreport.\n\n`deal_damage` emits a second one, with the permanent code, the first time\na monster that is already dead takes enough damage of the kind it cannot regenerate to reach its full hit\npoints. That one comes after the `HitPointsReportedEvent` and\nhas no condition event with it, because the monster was already carrying `dead`.\n\nThe code tells you whether the death can be undone. An ordinary death can be, by magic or by regeneration.\nA permanent one cannot, which is what fire and acid do to a troll.",
"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: a creature falling is plain to see."
},
"event_type": {
"const": "death",
"default": "death",
"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 died."
}
},
"required": [
"code",
"target_id"
],
"title": "DeathEvent",
"type": "object"
}