Skip to content

UndeadTurnedEvent

A cleric held up a holy symbol, and this is what happened.

Full documentation: UndeadTurnedEvent. Wire type: undead_turned.

Default visibility: player

Message codes: magic.turning.destroyed, magic.turning.failed, magic.turning.turned

JSON Schema

{
  "$defs": {
    "TurningTypeOutcome": {
      "description": "How one kind of undead fared against a turning attempt.\n\nTurning is read off a table once per kind of undead present, not once per monster, and these are those\nreadings. You find them on an `UndeadTurnedEvent`'s `types`.",
      "properties": {
        "template_id": {
          "title": "Template Id",
          "type": "string",
          "description": "The monster template's content id, like `\"skeleton\"`."
        },
        "column": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Column",
          "description": "The turning table column this kind is read under, which follows its Hit Dice. `None` when the kind is too\nstrong for the table to give it a column."
        },
        "outcome": {
          "title": "Outcome",
          "type": "string",
          "description": "The verdict: `turn` when the roll met the threshold, `fail` when it didn't or there was no column,\n`destroy` when the table destroys this kind outright at the cleric's level, and `unaffected` for a creature\nthat isn't undead at all."
        },
        "threshold": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Threshold",
          "description": "The 2d6 total the cleric needed for this kind. `None` when the table gives an automatic result rather than\na number."
        }
      },
      "required": [
        "template_id",
        "outcome"
      ],
      "title": "TurningTypeOutcome",
      "type": "object"
    },
    "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 cleric held up a holy symbol, and this is what happened.\n\n`turn_undead` emits one of these per attempt. Turning resolves in two\nsteps: the table is read once per kind of undead present, and then a second roll decides how many Hit Dice\nof the kinds that succumbed are actually affected. What then happens to each monster arrives as its own\nevents, a condition gained or a death.",
  "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 player rolls the turning dice."
    },
    "event_type": {
      "const": "undead_turned",
      "default": "undead_turned",
      "title": "Event Type",
      "type": "string",
      "description": "The wire name for this event type."
    },
    "caster_id": {
      "title": "Caster Id",
      "type": "string",
      "description": "The entity id of the cleric who turned."
    },
    "roll": {
      "title": "Roll",
      "type": "integer",
      "description": "The 2d6 read against the turning table."
    },
    "hd_pool": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Hd Pool",
      "description": "The second 2d6, the Hit Dice of undead the turning reaches. `None` when nothing succumbed and no second\nroll was made. Undead are taken weakest first, and Hit Dice left over when the next one is too large go to\nwaste rather than being spent elsewhere."
    },
    "types": {
      "default": [],
      "items": {
        "$ref": "#/$defs/TurningTypeOutcome"
      },
      "title": "Types",
      "type": "array",
      "description": "One `TurningTypeOutcome` per kind of undead present, in the order\nthe candidates were given."
    },
    "affected_ids": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Affected Ids",
      "type": "array",
      "description": "The entity ids of the monsters the Hit Dice pool actually reached. At least one monster is always\naffected when any kind succumbed, even when the pool could not pay for it."
    }
  },
  "required": [
    "code",
    "caster_id",
    "roll"
  ],
  "title": "UndeadTurnedEvent",
  "type": "object"
}