Skip to content

SpellForgottenEvent

A caster forgot a memorized spell, because the caster no longer has room for it.

Full documentation: SpellForgottenEvent. Wire type: spell_forgotten.

Default visibility: player

Message codes: magic.memory.forgotten

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 caster forgot a memorized spell, because the caster no longer has room for it.\n\n`forget_excess_memorized` reports one of these for each copy the\ncaster forgets. That happens when energy drain takes a caster's levels, and the caster has fewer spell slots\nthan spells in memory. A caster who forgot two copies gets two events.",
  "properties": {
    "code": {
      "default": "magic.memory.forgotten",
      "title": "Code",
      "type": "string",
      "description": "Fixed at `magic.memory.forgotten`."
    },
    "visibility": {
      "$ref": "#/$defs/Visibility",
      "default": "player",
      "description": "Player visibility: the caster's memory is the player's to track."
    },
    "event_type": {
      "const": "spell_forgotten",
      "default": "spell_forgotten",
      "title": "Event Type",
      "type": "string",
      "description": "The fixed string that identifies this event class in a serialized event."
    },
    "caster_id": {
      "title": "Caster Id",
      "type": "string",
      "description": "The entity id of the caster."
    },
    "spell_id": {
      "title": "Spell Id",
      "type": "string",
      "description": "The spell's content id."
    },
    "reversed": {
      "default": false,
      "title": "Reversed",
      "type": "boolean",
      "description": "True when the forgotten copy was the spell's reversed form."
    }
  },
  "required": [
    "caster_id",
    "spell_id"
  ],
  "title": "SpellForgottenEvent",
  "type": "object"
}