Skip to content

HealingPurchasedEvent

The party paid for a temple service, and the temple cast it.

Full documentation: HealingPurchasedEvent. Wire type: healing_purchased.

Default visibility: player

Message codes: town.healing.purchased

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": "The party paid for a temple service, and the temple cast it.\n\nEmitted by `PurchaseHealing` in town,\nfollowed by the kernel events of the spell the temple casts. The fee can come from\nmore than one member, so `payers` and `payments_gp` show which purses paid and how\nmuch each one paid.",
  "properties": {
    "code": {
      "default": "town.healing.purchased",
      "title": "Code",
      "type": "string",
      "description": "The message code, always `town.healing.purchased`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the party bought it."
    },
    "event_type": {
      "const": "healing_purchased",
      "default": "healing_purchased",
      "title": "Event Type",
      "type": "string",
      "description": "The event type, `healing_purchased`, which identifies this class in serialized form."
    },
    "character_id": {
      "title": "Character Id",
      "type": "string",
      "description": "The member the service was cast on. Their purse is charged first, but the party covers\nwhatever is left, so read `payers` for who actually paid."
    },
    "service": {
      "title": "Service",
      "type": "string",
      "description": "Which service was bought, as its key in\n`HEALING_SERVICES`, like `\"cure_light_wounds\"`."
    },
    "cost_gp": {
      "title": "Cost Gp",
      "type": "integer",
      "description": "What it cost, in gold pieces."
    },
    "payers": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Payers",
      "type": "array",
      "description": "The ids of the members whose purses paid, in the order they were charged: the treated\nmember first, then the rest of the party in marching order, dead members included. Each purse\npays as much of the fee still owed as its coins' value covers, in whole gold pieces, until the\nfee is paid. A member whose purse paid nothing isn't listed. It's empty on an event loaded from\na save written before the field existed."
    },
    "payments_gp": {
      "default": [],
      "items": {
        "type": "integer"
      },
      "title": "Payments Gp",
      "type": "array",
      "description": "What each purse in `payers` paid, in gold pieces and in the same order. The entries sum to\n`cost_gp`."
    }
  },
  "required": [
    "character_id",
    "service",
    "cost_gp"
  ],
  "title": "HealingPurchasedEvent",
  "type": "object"
}