Skip to content

EquipmentDestroyedEvent

What a victim carried was destroyed with it, except any magic items that saved.

Full documentation: EquipmentDestroyedEvent. Wire type: equipment_destroyed.

Default visibility: player

Message codes: combat.equipment.destroyed

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": "What a victim carried was destroyed with it, except any magic items that saved.\n\n`destroy_equipment` reports this when a death destroys the victim and\nwhat it carries, as a dragon's breath or *disintegrate* does. It reports no event for a victim that carried\nnothing.\n\nWhen the ruleset's `magic_item_death_save` flag is on, `destroy_equipment` rolls a save for each magic item, and\n`saved_items` lists the ones that survive. `destroy_equipment` leaves them in the victim's inventory.\n\nWhen the victim is a party member in a dungeon, a `GameSession` moves the\nsaved items to a drop pile on the party's cell, in the same command. The party picks them up with\n`TakeTreasure` and the feature id `\"pile\"`.",
  "properties": {
    "code": {
      "default": "combat.equipment.destroyed",
      "title": "Code",
      "type": "string",
      "description": "Fixed at `combat.equipment.destroyed`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the players see what was lost."
    },
    "event_type": {
      "const": "equipment_destroyed",
      "default": "equipment_destroyed",
      "title": "Event Type",
      "type": "string",
      "description": "The fixed string that identifies this event class in a serialized event."
    },
    "target_id": {
      "title": "Target Id",
      "type": "string",
      "description": "The entity id of the victim."
    },
    "item_names": {
      "items": {
        "type": "string"
      },
      "title": "Item Names",
      "type": "array",
      "description": "The display names of the items that were destroyed."
    },
    "saved_items": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Saved Items",
      "type": "array",
      "description": "The instance ids of the magic items that passed their save and still exist. Empty when none survived,\nwhich is always so when the ruleset's `magic_item_death_save` flag is off."
    }
  },
  "required": [
    "target_id",
    "item_names"
  ],
  "title": "EquipmentDestroyedEvent",
  "type": "object"
}