Skip to content

HealingAppliedEvent

Hit points restored, or refused.

Full documentation: HealingAppliedEvent. Wire type: healing_applied.

Default visibility: player

Message codes: combat.healing.applied, combat.healing.blocked

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": "Hit points restored, or refused.\n\n`apply_healing` emits this, and so does a regeneration tick inside\n`EffectsLedger.advance`. Read `amount` rather than what was\nasked for: healing is capped at the hit points the creature was missing, and a cursed creature may have had\nit halved.\n\nHealing can also be refused outright, and then the code says blocked and `amount` is 0. A creature that's\ndiseased takes no magical healing, and one that's weakened takes none at all.",
  "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 wound closing is plain to see. The hit points behind it ride the referee-visible\n`HitPointsReportedEvent`."
    },
    "event_type": {
      "const": "healing_applied",
      "default": "healing_applied",
      "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 was healed."
    },
    "amount": {
      "title": "Amount",
      "type": "integer",
      "description": "The hit points actually restored, after the cap and any halving. 0 when the healing was blocked."
    },
    "source": {
      "title": "Source",
      "type": "string",
      "description": "Where the healing came from: `magical` for a spell or potion, `natural` for rest, `regeneration` for a\nregenerating creature's own tick."
    }
  },
  "required": [
    "code",
    "target_id",
    "amount",
    "source"
  ],
  "title": "HealingAppliedEvent",
  "type": "object"
}