Skip to content

SearchCompletedEvent

A search of the party's cell finished, with whatever it turned up.

Full documentation: SearchCompletedEvent. Wire type: search_completed.

Default visibility: player

Message codes: exploration.search.found, exploration.search.nothing

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 search of the party's cell finished, with whatever it turned up.\n\nEmitted by `Search`, after the referee-visibility\n`DetectionRolledEvent` that reports the\ndie. `InspectTreasure` emits it with\n`exploration.search.nothing` when the thief finds no trap. When the thief finds a trap,\nthe session emits a `TrapEvent` instead.\n\nAn empty result means the searcher found nothing, which doesn't mean nothing is\nthere. Each character gets one attempt per cell per kind of search, so another\ncharacter may still find it.",
  "properties": {
    "code": {
      "title": "Code",
      "type": "string",
      "description": "What happened, like `combat.attack.hit`: two or more lowercase parts separated by dots. The first part is\nthe area of the rules the event comes from, like `combat` or `magic`.\n\nBranch on it, and pass the event to `format_message` to turn it into English.\nBuilding an event with a code in any other format raises a pydantic `ValidationError`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: what the search turned up is the party's to act on."
    },
    "event_type": {
      "const": "search_completed",
      "default": "search_completed",
      "title": "Event Type",
      "type": "string",
      "description": "The event type, `search_completed`, which identifies this class in serialized form."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "The member who searched."
    },
    "kind": {
      "title": "Kind",
      "type": "string",
      "description": "What was searched for: `\"secret_doors\"`, `\"room_traps\"`, `\"construction\"`, or\n`\"treasure_traps\"` for a treasure feature inspected by a thief."
    },
    "found": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Found",
      "type": "array",
      "description": "What turned up, as references like `\"secret_door:north\"`, `\"room_trap:<area id>\"`, or\n`\"construction:<feature id>\"`, and empty when nothing did. A room trap found through a door\nfrom the searched cell has the door's direction in a third segment,\n`\"room_trap:<area id>:<direction>\"`, and one found inside the searched area has none. A found\nsecret door becomes an ordinary door the party can see and use, and a found room trap no longer\nsprings on the party."
    }
  },
  "required": [
    "code",
    "character_id",
    "kind"
  ],
  "title": "SearchCompletedEvent",
  "type": "object"
}