Skip to content

AddMember

Referee: add a character to the party during play.

Full documentation: AddMember. Wire type: add_member.

Legal session modes: exploring, town

JSON Schema

{
  "$defs": {
    "AbilityScore": {
      "description": "Which of the six abilities a score belongs to.\n\nUse these as the keys of a score dictionary, which is how every function here and in\n`osrlib.core.character` passes a character's abilities\naround. Include all six keys: a `Character` raises a\npydantic `ValidationError` for a score dictionary that's missing one.\n\nCharacters and saved games contain the lowercase values, and they stay fixed within a\n`schema_version`, the version stamp that identifies a serialized model's format.",
      "enum": [
        "str",
        "int",
        "wis",
        "dex",
        "con",
        "cha"
      ],
      "title": "AbilityScore",
      "type": "string"
    },
    "ActiveCondition": {
      "description": "One condition a creature currently has, paired with the effect that granted it.\n\nYou read these from a creature's `conditions` tuple rather than building them.\n`EffectsLedger.attach` and\n`grant_condition` add them. To ask whether a creature has a condition\nfrom any effect, call `has_condition` instead of scanning the tuple.\n\nEach record contains the id of the effect that granted it, so two effects can grant the same condition, and\nending one effect removes only the record that effect granted. A creature charmed twice has two records, and\nreleasing one charm leaves the other in place. Records compare by value, and a creature never has the same\ncondition from the same effect twice.\n\nExamples:\n    ```python\n    from osrlib.core.effects import ActiveCondition, Condition\n\n    active = ActiveCondition(condition=Condition.ASLEEP, effect_id=\"effect-0001\")\n    assert active.condition is Condition.ASLEEP\n    assert active.model_dump(mode=\"json\") == {\"condition\": \"asleep\", \"effect_id\": \"effect-0001\"}\n    ```",
      "properties": {
        "condition": {
          "$ref": "#/$defs/Condition",
          "description": "The condition the creature has."
        },
        "effect_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Effect Id",
          "description": "The id of the `ActiveEffect` that granted the condition and will take\nit back. `None` marks a condition that doesn't come from a timed effect. In osrlib, that's `dead`."
        }
      },
      "required": [
        "condition"
      ],
      "title": "ActiveCondition",
      "type": "object"
    },
    "ActiveModifier": {
      "description": "One live modifier on a creature, paired with the effect that granted it.\n\nThese are the entries of a creature's `stat_modifiers` tuple. Attaching an effect turns each\n`ModifierSpec` in its definition into one of these. When the effect\nexpires or is released, the ledger removes them again, the same way it removes conditions. Nothing else in\nosrlib writes the tuple, so each modifier on a creature belongs to an effect on the ledger.\n\nRead them through `modifier_total` rather than scanning the tuple,\nbecause it applies the scope fields and the rule that spell bonuses don't add up.\n`modifier_values`, `modifier_dice`,\nand `has_modifier` cover the other ways the combat code reads them.",
      "properties": {
        "kind": {
          "title": "Kind",
          "type": "string",
          "description": "Which statistic the modifier adjusts, one of `MODIFIER_KINDS`. Any\nother value raises pydantic's `ValidationError`."
        },
        "value": {
          "default": 0,
          "title": "Value",
          "type": "integer",
          "description": "The signed adjustment, like +1 for *bless*'s attack bonus or -1 for *protection from evil*'s penalty on\nattackers. For `ac_set` and `ac_set_vs_missile` it's the armour class to set, and for `strength_set` the\nstrength score. Leave it at 0 for a kind that uses `dice` or acts as a flag."
        },
        "dice": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Dice",
          "description": "A dice expression rolled instead of adding `value`, for a kind that grants dice, like *striking*'s `\"1d6\"`\nof extra weapon damage. osrlib checks it with `parse`, so a malformed\nexpression raises `ContentValidationError` when you build the\n`ModifierSpec`, not when the combat code rolls it."
        },
        "element": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Element",
          "description": "Narrows the modifier to one damage or save element, like `\"fire\"` for *resist fire*. The modifier counts\nonly for a roll with that same element. `None` means every element."
        },
        "versus_other_alignment": {
          "default": false,
          "title": "Versus Other Alignment",
          "type": "boolean",
          "description": "True narrows the modifier to rolls against creatures of a different alignment, which is how *protection\nfrom evil* works. The modifier then counts only when the call that reads it passes `versus_differs=True`."
        },
        "save_categories": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Save Categories",
          "type": "array",
          "description": "Narrows a save bonus to the named saving throw categories. A Displacer Cloak, for example, covers\n`\"paralysis\"`, `\"wands\"`, and `\"spells\"` but not the others. Empty means every category."
        },
        "melee_only": {
          "default": false,
          "title": "Melee Only",
          "type": "boolean",
          "description": "True narrows the modifier to melee attacks. That's how the Displacer Cloak's -2 on attackers leaves\nmissile attacks alone. The modifier then counts only when the call that reads it passes `melee=True`."
        },
        "from_item": {
          "default": false,
          "title": "From Item",
          "type": "boolean",
          "description": "True marks the modifier as coming from a magic item rather than a spell. Such a modifier is exempt from\nthe rule that only the largest spell bonus and the largest spell penalty count:\n`modifier_total` adds every item modifier to the capped spell total.\nSet it on the effects of potions and scrolls as well as worn items, because the rule covers magic items in\ngeneral."
        },
        "effect_id": {
          "title": "Effect Id",
          "type": "string",
          "description": "The id of the `ActiveEffect` that granted the modifier and will take\nit back."
        }
      },
      "required": [
        "kind",
        "effect_id"
      ],
      "title": "ActiveModifier",
      "type": "object"
    },
    "Alignment": {
      "description": "The cosmic principle a creature follows: law, neutrality, or chaos.\n\nUse a member by name (`Alignment.LAWFUL`) when you write the value yourself, and call\nthe enum on a string (`Alignment(\"lawful\")`) when the value comes from saved data or\nfrom a player's input. A string that isn't one of the three values raises\n`ValueError`. Each member compares equal to its lowercase string, so\n`Alignment.LAWFUL == \"lawful\"` is true.\n\nosrlib applies no mechanical penalty for acting against alignment. The SRD leaves\nthat to the referee. What osrlib does use is the alignment tongue that comes from the\nvalue, and the alignment comparisons in the rules for some spells and magic items.\n\nCharacters and saved games contain the lowercase values, and they stay fixed within a\n`schema_version`, the version stamp that identifies a serialized model's format.\n\nExamples:\n    ```python\n    from osrlib.core.alignment import Alignment\n\n    assert Alignment(\"lawful\") is Alignment.LAWFUL\n    assert Alignment.CHAOTIC == \"chaotic\"\n    ```",
      "enum": [
        "lawful",
        "neutral",
        "chaotic"
      ],
      "title": "Alignment",
      "type": "string"
    },
    "AmmunitionTemplate": {
      "description": "Ammunition for a missile weapon: arrows, quarrels, sling stones.\n\nBought like gear, in lots: one purchase at the listed price delivers `lot_size`\nunits. Compiled ammunition weighs nothing, because the SRD counts the weight of the\nammunition and its container in the missile weapon's listed weight and gives the\nammunition table no weight column. Ammunition can't be equipped: wield the bow, and\nthe arrows stay in the item list. Sling stones are free, so their compiled cost is 0.",
      "properties": {
        "item_type": {
          "const": "ammunition",
          "default": "ammunition",
          "title": "Item Type",
          "type": "string",
          "description": "Always `\"ammunition\"`."
        },
        "id": {
          "title": "Id",
          "type": "string",
          "description": "The catalog id, for example `\"arrows\"`. Get every id from `load_equipment`, or see\n[the equipment id index](https://mmacy.github.io/osrlib-python/reference/content-ids/equipment/)."
        },
        "name": {
          "title": "Name",
          "type": "string",
          "description": "The display name as the price list prints it, which includes the lot: `\"Arrows (quiver of 20)\"`."
        },
        "cost_gp": {
          "minimum": 0,
          "title": "Cost Gp",
          "type": "integer",
          "description": "The listed price in gold pieces, for one lot. 0 for sling stones."
        },
        "lot_size": {
          "default": 1,
          "minimum": 1,
          "title": "Lot Size",
          "type": "integer",
          "description": "How many units one purchase delivers, for example 20 arrows."
        },
        "weight_coins": {
          "default": 0,
          "minimum": 0,
          "title": "Weight Coins",
          "type": "integer",
          "description": "The weight in coins for one unit. 0 on every compiled template. Ammunition you bundle with an adventure can set a\nweight, and `equipment_weight_coins` counts it per unit."
        },
        "material": {
          "$ref": "#/$defs/Material",
          "default": "standard",
          "description": "What the ammunition is made of, for monsters that only silver or magic can hurt. See\n`Material`."
        },
        "overrides_applied": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Overrides Applied",
          "type": "array",
          "description": "Which fields were corrected when this row was compiled from the SRD text, as dotted paths. Empty when none were.\nosrlib doesn't read it during play."
        }
      },
      "required": [
        "id",
        "name",
        "cost_gp"
      ],
      "title": "AmmunitionTemplate",
      "type": "object"
    },
    "ArmourCategory": {
      "description": "How bulky a suit of body armour is, for the basic encumbrance rates.\n\nUnder basic encumbrance, a character's movement rate depends on the armour they wear\nrather than on the weight they carry.\n`movement_rate_feet` reads the category of the\narmour in the worn slot to pick the rate. No member stands for wearing nothing: an empty\nworn slot means the unarmoured rate. The shield has no category. A character in\nenchanted armour moves at the rate of the mundane armour it's made from, because\nenchantment halves a suit's weight without making it less bulky.\n\nThe values `\"light\"` and `\"heavy\"` appear in the compiled equipment data.",
      "enum": [
        "light",
        "heavy"
      ],
      "title": "ArmourCategory",
      "type": "string"
    },
    "ArmourPolicy": {
      "description": "Which armour and shields a class may use.\n\nRead it from `ClassDefinition.armour`.\n`validate_equip` checks a character's armour and shield\nagainst it. Among the built-in classes, the magic-user wears no armour, the thief wears leather\nonly, and the other classes may wear any armour. Frozen.",
      "properties": {
        "kind": {
          "$ref": "#/$defs/ArmourPolicyKind",
          "description": "Which armour the class may wear. See `ArmourPolicyKind`."
        },
        "shields_allowed": {
          "title": "Shields Allowed",
          "type": "boolean",
          "description": "Whether the class may use a shield. It must be False when `kind` is `\"none\"`."
        }
      },
      "required": [
        "kind",
        "shields_allowed"
      ],
      "title": "ArmourPolicy",
      "type": "object"
    },
    "ArmourPolicyKind": {
      "description": "Which armour a class may wear.\n\nRead it from `ArmourPolicy.kind`.\n`validate_equip` checks it when a character puts armour\non. The values are the strings `\"any\"`, `\"leather_only\"`, and `\"none\"`.",
      "enum": [
        "any",
        "leather_only",
        "none"
      ],
      "title": "ArmourPolicyKind",
      "type": "string"
    },
    "ArmourTemplate": {
      "description": "A suit of body armour or the shield, from the SRD's armour table.\n\nBody armour sets a wearer's armour class outright and a shield adds a bonus to it, so\none of the two field groups is filled and the other is empty: body armour has `ac`,\n`ac_ascending`, and `category`, while the shield has `ac_bonus` alone. Use\n`is_shield` to tell which kind you have\ninstead of testing the fields. Get one from\n`EquipmentCatalog.get`, buy it with\n`purchase`, and put it on with\n`equip`, which routes body armour to the worn slot and the\nshield to the shield slot.\n\nBoth armour class formats are here because the tabletop rules print both: the\ndescending scale, where lower is better and unarmoured is 9, and the ascending scale in\nbrackets, where higher is better and unarmoured is 10. You choose which one to show\nplayers. The rules give the same result either way.",
      "properties": {
        "item_type": {
          "const": "armour",
          "default": "armour",
          "title": "Item Type",
          "type": "string",
          "description": "Always `\"armour\"`."
        },
        "id": {
          "title": "Id",
          "type": "string",
          "description": "The catalog id, for example `\"plate_mail\"`. Get every id from\n`load_equipment`, or see [the equipment id\nindex](https://mmacy.github.io/osrlib-python/reference/content-ids/equipment/)."
        },
        "name": {
          "title": "Name",
          "type": "string",
          "description": "The display name."
        },
        "cost_gp": {
          "minimum": 0,
          "title": "Cost Gp",
          "type": "integer",
          "description": "The listed price in gold pieces."
        },
        "weight_coins": {
          "minimum": 0,
          "title": "Weight Coins",
          "type": "integer",
          "description": "The weight in coins. Enchanted armour weighs half this."
        },
        "ac": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ac",
          "description": "Body armour's armour class on the descending scale. `None` on the shield."
        },
        "ac_ascending": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ac Ascending",
          "description": "The same protection on the ascending scale. `None` on the shield."
        },
        "ac_bonus": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ac Bonus",
          "description": "The shield's bonus to armour class, 1 on the compiled shield. It lowers descending AC and raises ascending AC\nby that much. `None` on body armour."
        },
        "category": {
          "anyOf": [
            {
              "$ref": "#/$defs/ArmourCategory"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "How bulky the suit is, for the basic encumbrance movement rates. See\n`ArmourCategory`. `None` on the shield."
        },
        "overrides_applied": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Overrides Applied",
          "type": "array",
          "description": "Which fields were corrected when this row was compiled from the SRD text, as dotted paths. Empty when none were.\nosrlib doesn't read it during play."
        }
      },
      "required": [
        "id",
        "name",
        "cost_gp",
        "weight_coins"
      ],
      "title": "ArmourTemplate",
      "type": "object"
    },
    "Character": {
      "description": "A player character: the stored state of one character, and the values derived from it.\n\nGet one from `create_character`, or from\n`from_document` when you load a stored\ncharacter. Construct one directly when you create a character step by step with the other\ncreation functions in this module, or when you already have every value, as in a test.\n\nPut characters in a `Party` to explore with them. Pass one to the\nfunctions in `osrlib.core.combat` as an attacker or a target, to the\nfunctions in `osrlib.core.spells` as a caster, and to\n`apply_xp` or `level_up` to\nadvance it. A `MonsterInstance` has the same combat\nattributes, so the combat functions take either.\n\nThe model is mutable and validates on assignment. Setting a field to a value that breaks a rule\nraises a pydantic `ValidationError`, and every field still has the value it had before the\nassignment. Validation is structural only. It checks that the six scores\nare present and in range, that `class_id` is the id of a class in\n`load_classes` or of the definition in\n`custom_class`, that the level is within the\nclass's maximum, and that current hit points don't exceed maximum hit points. It doesn't check\nthat the character was created legally, because a finished character has no record of how it was\ncreated.\n\nNothing derived is stored. THAC0, attack bonus, saving throws, ability modifiers, both armour\nclasses, and the language list are properties recomputed from the stored fields each time you\nread them, so a level change or a swapped piece of armour shows up at once.\n\nExamples:\n    ```python\n    from osrlib.core.alignment import Alignment\n    from osrlib.core.character import CHARACTER_CREATION_STREAM, create_character\n    from osrlib.core.rng import RngStreams\n    from osrlib.core.ruleset import Ruleset\n\n    stream = RngStreams(master_seed=2).get(CHARACTER_CREATION_STREAM)\n    character = create_character(\n        name=\"Rurik\",\n        class_id=\"fighter\",\n        alignment=Alignment.LAWFUL,\n        ruleset=Ruleset(),\n        stream=stream,\n    ).character\n    print(character.level, character.thac0, character.saves.death)\n    # 1 19 12\n    character.current_hp -= 3\n    print(character.current_hp, character.max_hp)\n    # 5 8\n    ```",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id",
          "description": "The character's id within a game, like `\"character-0001\"`, or `None` before a session assigns one.\n\n`GameSession.new` assigns an id from the session's\n`IdAllocator` to each party member whose id is `None`.\n`AddMember` does the same for a character who joins during play. Commands refer\nto a character by this id. An event about a character with no id uses the character's `name` instead."
        },
        "name": {
          "minLength": 1,
          "title": "Name",
          "type": "string",
          "description": "The character's name, for display. It can't be empty."
        },
        "class_id": {
          "title": "Class Id",
          "type": "string",
          "description": "The id of the character's class, like `\"fighter\"`.\n\nFor a class osrlib includes, the id comes from `load_classes` and is listed in\n[the class id index](https://mmacy.github.io/osrlib-python/reference/content-ids/classes/). For a class you wrote,\nit's the `id` of the definition in `custom_class`. Read\n`definition` for the class itself."
        },
        "custom_class": {
          "anyOf": [
            {
              "$ref": "#/$defs/ClassDefinition"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The definition of the character's class when it's a class you wrote, or `None` for a class osrlib includes.\n\nSet it to your `ClassDefinition`, and set `class_id` to the definition's\n`id`. `definition` returns it, so the kernel functions and a\n`GameSession` play the character under your class.\n`create_character` sets it when you pass `custom_class`.\n\nThe model refuses a definition whose `id` isn't `class_id`. It also refuses a definition whose `id` is the id of a\nbuilt-in class, because a class id refers to one class. Give a variant of a built-in class a different id.\n\nThe definition is part of the character, so `to_document`,\n`party_to_document`, and `save_game`\ninclude it, and loading the document gives it back. Your game doesn't supply the class again to load one."
        },
        "race": {
          "pattern": "^[a-z][a-z0-9_]*$",
          "title": "Race",
          "type": "string",
          "description": "The character's race, like `\"human\"` or `\"dwarf\"`, as a lowercase identifier.\n\nCreation copies it from the class's `race`. No rules function reads it.\nWhat a race can do, like a dwarf's infravision, comes from the class's\n`abilities`."
        },
        "level": {
          "minimum": 1,
          "title": "Level",
          "type": "integer",
          "description": "The experience level, 1 through the class's maximum."
        },
        "xp": {
          "minimum": 0,
          "title": "Xp",
          "type": "integer",
          "description": "The character's total experience points.\n\nAward experience with `apply_xp`, which adds to this total and levels the character\nup when it reaches the next level's threshold. Assigning a new total here doesn't change the level."
        },
        "scores": {
          "additionalProperties": {
            "type": "integer"
          },
          "propertyNames": {
            "$ref": "#/$defs/AbilityScore"
          },
          "title": "Scores",
          "type": "object",
          "description": "The six ability scores, each 3 through 18, keyed by `AbilityScore`. All six\nmust be present.\n\nThey're the scores the character rolled, after any adjustment at creation. A STR that an item sets, like the 18 of\ngauntlets of ogre power, doesn't change them. Read\n`effective_strength` for the STR the rules use during play."
        },
        "alignment": {
          "$ref": "#/$defs/Alignment",
          "description": "Lawful, neutral, or chaotic. It sets the secret language in\n`alignment_tongue`."
        },
        "extra_languages": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Extra Languages",
          "type": "array",
          "description": "The language ids chosen at creation because of a high INT. Check the choice with\n`validate_extra_languages` before you store it."
        },
        "max_hp": {
          "minimum": 1,
          "title": "Max Hp",
          "type": "integer",
          "description": "Maximum hit points, at least 1."
        },
        "current_hp": {
          "minimum": 0,
          "title": "Current Hp",
          "type": "integer",
          "description": "Current hit points, from 0 up to `max_hp`.\n\nA character at 0 hit points is out of the fight. Whether a character is dead is the `dead` condition, which\n`kill` applies, not a hit point value."
        },
        "nonregen_damage": {
          "default": 0,
          "minimum": 0,
          "title": "Nonregen Damage",
          "type": "integer",
          "description": "The fire and acid damage that a worn ring of regeneration can't heal, up to `max_hp`.\n\nWhile the character wears the ring, `deal_damage` adds fire and acid damage\nhere. The ring heals the character only up to `max_hp` less this amount. Other healing, like a potion, heals this\ndamage too. So each time the character takes damage while wearing the ring, `deal_damage` first lowers this value\nto the damage the character had before that hit. It's 0 for a character who has never worn the ring."
        },
        "inventory": {
          "$ref": "#/$defs/Inventory",
          "description": "Everything the character carries, wears, and wields, and their coins. See\n`Inventory` and the buying and equipping functions in\n`osrlib.core.items`."
        },
        "carrying_treasure": {
          "default": false,
          "title": "Carrying Treasure",
          "type": "boolean",
          "description": "Whether the character is carrying enough treasure to slow them down, under basic encumbrance.\n\nThe basic encumbrance rules leave the amount to the referee, so osrlib leaves it to you. Set this flag, and\n`movement_rate` drops the character to the next slower rate.\nThe other encumbrance modes ignore it."
        },
        "conditions": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ActiveCondition"
          },
          "title": "Conditions",
          "type": "array",
          "description": "The conditions in effect, like poisoned or paralysed.\n\nApply and clear them with the functions in `osrlib.core.effects`. Test for one with\n`has_condition`."
        },
        "stat_modifiers": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ActiveModifier"
          },
          "title": "Stat Modifiers",
          "type": "array",
          "description": "Timed bonuses and penalties from spells and items. The functions in\n`osrlib.core.effects` apply and remove them."
        },
        "spell_book": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Spell Book",
          "type": "array",
          "description": "The spell ids in an arcane caster's spell book, in the order they were added.\n\nAn arcane caster memorizes spells only from this book. It's empty for divine casters like the cleric, who memorize\nfrom their whole class list, and for classes that cast no spells."
        },
        "memorized_spells": {
          "default": [],
          "items": {
            "$ref": "#/$defs/MemorizedSpell"
          },
          "title": "Memorized Spells",
          "type": "array",
          "description": "The spells the caster has memorized and can cast, as `MemorizedSpell`\nrecords in the order they were memorized.\n\nFill it with `memorize_spells`. Casting spends the first matching copy in\nthe list, and energy drain removes copies from the end. How many spells of each level fit comes from the class's\nprogression row for the current level, so it changes when the level does."
        }
      },
      "required": [
        "name",
        "class_id",
        "race",
        "level",
        "xp",
        "scores",
        "alignment",
        "max_hp",
        "current_hp"
      ],
      "title": "Character",
      "type": "object"
    },
    "ClassAbility": {
      "description": "One thing a class can do, like a dwarf's infravision: a tag the rules functions match, its numbers, and its text.\n\nRead a class's abilities from\n`ClassDefinition.abilities`. The combat,\nmagic, and exploration functions look for the tags they recognize and read the numbers from\n`params`. They ignore a tag they don't recognize. Frozen.\n\nAn ability osrlib doesn't apply has `manual` set. Show its `prose` to the referee, who applies\nit.",
      "properties": {
        "tag": {
          "title": "Tag",
          "type": "string",
          "description": "The identifier the rules functions match, like `\"infravision\"`, `\"detect_secret_doors\"`, or `\"back_stab\"`."
        },
        "name": {
          "title": "Name",
          "type": "string",
          "description": "The ability's name as the SRD prints it, for display."
        },
        "prose": {
          "title": "Prose",
          "type": "string",
          "description": "The SRD's description of the ability, to show a player or the referee."
        },
        "manual": {
          "default": false,
          "title": "Manual",
          "type": "boolean",
          "description": "True when osrlib doesn't apply this ability, and the referee applies it from `prose`."
        },
        "params": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ]
          },
          "default": {},
          "title": "Params",
          "type": "object",
          "description": "The values the rules functions read, like `{\"range_feet\": 60}` for infravision or `{\"chance_in_six\": 2}` for a\ndetection ability. Empty when the ability has none.\n\nA `divine_magic` or `arcane_magic` ability has a `spell_list`, the id of the spell list the class casts from, like\n`\"magic_user\"`. `ClassDefinition` refuses a casting ability without one."
        }
      },
      "required": [
        "tag",
        "name",
        "prose"
      ],
      "title": "ClassAbility",
      "type": "object"
    },
    "ClassDefinition": {
      "description": "A character class, like the fighter or the elf: its rules, and its values at every level.\n\nGet one from `load_classes``().get(class_id)`. For the ids, iterate\n`load_classes().classes` or see [the class id\nindex](https://mmacy.github.io/osrlib-python/reference/content-ids/classes/). A\n`Character` stores only the class id, and\n`Character.definition` returns the definition for it. Pass the\ndefinition to the functions in this module that take one, like `apply_xp`.\n\nA definition is frozen and shared by every character of the class. What changes in play, like\nthe level and the hit points, is stored on the character. The built-in definitions are compiled\nfrom the SRD's class pages. To write a class of your own, build a `ClassDefinition` with\n`model_validate`, which checks it with the same rules as the built-in classes. One of those rules\nis that a `divine_magic` or `arcane_magic` ability has a `spell_list` param, so\n`caster_profile` always finds the list a casting class uses.",
      "properties": {
        "id": {
          "title": "Id",
          "type": "string",
          "description": "The class id, like `\"fighter\"`. A character stores it in `class_id`."
        },
        "name": {
          "title": "Name",
          "type": "string",
          "description": "The class's name as the SRD prints it, like `\"Magic-User\"`, for display."
        },
        "race": {
          "pattern": "^[a-z][a-z0-9_]*$",
          "title": "Race",
          "type": "string",
          "description": "The race of the class's characters, as a lowercase identifier, like `\"human\"` or `\"dwarf\"`.\n\nCreation copies it onto the character. No rules function reads it. What a race can do comes from `abilities`."
        },
        "requirements": {
          "additionalProperties": {
            "type": "integer"
          },
          "default": {},
          "propertyNames": {
            "$ref": "#/$defs/AbilityScore"
          },
          "title": "Requirements",
          "type": "object",
          "description": "The lowest ability score a character needs in each listed ability to take this class.\n\n`validate_class_choice` checks them. Empty for the human classes.\nThe dwarf, the elf, and the halfling each require a 9 in one or two abilities."
        },
        "prime_requisites": {
          "items": {
            "$ref": "#/$defs/AbilityScore"
          },
          "title": "Prime Requisites",
          "type": "array",
          "description": "The abilities the class depends on most. There's one for most classes, and two for the elf and the halfling.\n\nThe ability-score adjustment at creation can raise only these, and can't lower them. The experience modifier in\n`xp_tiers` usually depends on them."
        },
        "xp_tiers": {
          "items": {
            "$ref": "#/$defs/XpTier"
          },
          "title": "Xp Tiers",
          "type": "array",
          "description": "The experience-modifier tiers, highest percentage first.\n`xp_modifier_pct` reads them."
        },
        "hit_die": {
          "title": "Hit Die",
          "type": "integer",
          "description": "The number of sides on the class's hit die. It's 4, 6, or 8 for the built-in classes."
        },
        "max_level": {
          "minimum": 1,
          "title": "Max Level",
          "type": "integer",
          "description": "The highest level a character of this class can reach. It's 14 for the human classes, 12 for the dwarf, 10 for\nthe elf, and 8 for the halfling."
        },
        "armour": {
          "$ref": "#/$defs/ArmourPolicy",
          "description": "Which armour and shields the class may use. See `ArmourPolicy`."
        },
        "weapons": {
          "$ref": "#/$defs/WeaponPolicy",
          "description": "Which weapons the class may wield. See `WeaponPolicy`."
        },
        "languages": {
          "items": {
            "type": "string"
          },
          "title": "Languages",
          "type": "array",
          "description": "The ids of the languages every character of this class speaks, starting with `\"common\"`.\n\nA character's full list, with the alignment tongue and any extra languages, is\n`Character.languages`."
        },
        "may_not_lower": {
          "default": [],
          "items": {
            "$ref": "#/$defs/AbilityScore"
          },
          "title": "May Not Lower",
          "type": "array",
          "description": "Abilities the ability-score adjustment at creation can't lower, besides the prime requisites. The thief's is\nSTR."
        },
        "abilities": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ClassAbility"
          },
          "title": "Abilities",
          "type": "array",
          "description": "What the class can do, as tags the rules functions read.\n\nSee `ClassAbility`."
        },
        "thief_skills": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ThiefSkillRow"
          },
          "title": "Thief Skills",
          "type": "array",
          "description": "The thief's skill chances, one row per level from 1 to `max_level`. Empty for every built-in class but the thief.\nSee `ThiefSkillRow`."
        },
        "level_titles": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Level Titles",
          "type": "array",
          "description": "The title of a character at each level, starting with level 1, like `\"Veteran\"` for a first-level fighter.\n\nThe SRD prints titles only up to name level, so this can be shorter than `progression`. Call\n`level_title` to read one, which returns `None` for a level past the end."
        },
        "progression": {
          "items": {
            "$ref": "#/$defs/ProgressionRow"
          },
          "title": "Progression",
          "type": "array",
          "description": "One progression row for each level from 1 to `max_level`, in order. Read one with\n`row`, which checks the level."
        },
        "overrides_applied": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Overrides Applied",
          "type": "array",
          "description": "The fields osrlib corrected when it compiled this class from the SRD, like `\"xp_tiers\"`. Empty when none were.\n\nRead it when you check osrlib's data against the SRD. No rules function reads it."
        }
      },
      "required": [
        "id",
        "name",
        "race",
        "prime_requisites",
        "xp_tiers",
        "hit_die",
        "max_level",
        "armour",
        "weapons",
        "languages",
        "progression"
      ],
      "title": "ClassDefinition",
      "type": "object"
    },
    "CoinPurse": {
      "description": "The coins a character is carrying, by denomination.\n\nEvery `Inventory` has one. Unlike\n`Coins`, it's mutable, because this is the money that gets\nspent. Call `can_afford` before\nyou charge, and `spend` to charge. Both work in\nwhole gold pieces, the unit the equipment lists price in.\n\nPaying takes the smallest coins first, and change comes back as the fewest coins that\nmake it up. Each coin weighs 1 whatever its metal, so spending small coins first\nlightens the purse. A purse full of copper slows a character down.",
      "properties": {
        "pp": {
          "default": 0,
          "minimum": 0,
          "title": "Pp",
          "type": "integer",
          "description": "Platinum pieces, worth 5 gp each."
        },
        "gp": {
          "default": 0,
          "minimum": 0,
          "title": "Gp",
          "type": "integer",
          "description": "Gold pieces."
        },
        "ep": {
          "default": 0,
          "minimum": 0,
          "title": "Ep",
          "type": "integer",
          "description": "Electrum pieces, worth half a gold piece each."
        },
        "sp": {
          "default": 0,
          "minimum": 0,
          "title": "Sp",
          "type": "integer",
          "description": "Silver pieces, ten to the gold piece."
        },
        "cp": {
          "default": 0,
          "minimum": 0,
          "title": "Cp",
          "type": "integer",
          "description": "Copper pieces, a hundred to the gold piece."
        }
      },
      "title": "CoinPurse",
      "type": "object"
    },
    "CombatFacet": {
      "description": "The combat statistics of a piece of gear that can also be used as a weapon.\n\nTorch, holy water, and burning oil are printed on both the SRD's weapon table and its\ngear list. osrlib compiles each as one gear item whose `combat` field contains this facet,\nso the item has a single id and a single weight. Attack resolution reads the facet's\ndamage, qualities, and ranges as it reads those of a\n`WeaponTemplate`. Class weapon policies don't apply\nto it, so a cleric may throw holy water and a magic-user may swing a torch. That\nexemption is an adaptation, a reading osrlib chooses where the rules are unclear (see\nthe [adaptations register](https://mmacy.github.io/osrlib-python/adaptations/)).",
      "properties": {
        "damage": {
          "title": "Damage",
          "type": "string",
          "description": "The damage dealt, as a dice expression."
        },
        "qualities": {
          "items": {
            "$ref": "#/$defs/WeaponQuality"
          },
          "title": "Qualities",
          "type": "array",
          "description": "What the item can do when used as a weapon. See `WeaponQuality`. Holy water\nand burning oil have the splash quality, which makes them damage the target again the following round."
        },
        "missile_ranges": {
          "anyOf": [
            {
              "$ref": "#/$defs/MissileRanges"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The three range bands, present exactly when `qualities` includes the missile quality."
        }
      },
      "required": [
        "damage",
        "qualities"
      ],
      "title": "CombatFacet",
      "type": "object"
    },
    "Condition": {
      "description": "The closed set of named states a creature can be in, like asleep, charmed, or dead.\n\nCheck whether a creature has a condition with `has_condition`. To put\none on a creature for a while, set it as an `EffectDefinition`'s\n`condition` and attach the definition with `EffectsLedger.attach`.\nThe ledger then takes the condition away when the duration runs out. Use\n`grant_condition` only for a state that doesn't come from a timed effect.\n\nSome members change rolls and actions in `osrlib.core.combat` and\n`osrlib.core.spells`. Others matter only to the crawl procedures in\n`osrlib.crawl` or to your own code. Each member's description lists where osrlib reads it, so\nyou know whether granting it changes a roll or only what your interface shows.\n\nImmunity applies to every member. A monster whose template lists a condition in its defenses'\n`condition_immunities` never takes that condition, whether you call\n`grant_condition` or attach an effect that brings it. So even when no\nother core rule reads a member, immunity limits which monsters a spell can affect.\n\nThe values are the lowercase strings, like `\"asleep\"`, and creatures and saved games contain them. A value\nchanges only with a `schema_version` bump.",
      "enum": [
        "paralysed",
        "asleep",
        "blind",
        "charmed",
        "petrified",
        "diseased",
        "exhausted",
        "lycanthropy_incubation",
        "averted_eyes",
        "poisoned",
        "dead",
        "silenced",
        "entangled",
        "afraid",
        "feebleminded",
        "invisible",
        "turned",
        "confused",
        "weakened"
      ],
      "title": "Condition",
      "type": "string"
    },
    "GearTemplate": {
      "description": "A piece of adventuring gear: a torch, a rope, a backpack, a flask of oil.\n\nEvery item on the equipment list that isn't a weapon, armour, or ammunition is gear. Get\none from `EquipmentCatalog.get` and buy it\nwith `purchase`. Gear sells in lots: one purchase at the\nlisted price delivers `lot_size` units, so buying torches once costs 1 gp and yields\nsix torches in one `ItemInstance`.\n\n`equip` accepts only gear with a `combat` facet: the torch,\nholy water, and burning oil. Gear has no per-item weight in the SRD, so detailed\nencumbrance adds a flat\n`MISC_GEAR_WEIGHT_COINS` once for carrying\nany of it.",
      "properties": {
        "item_type": {
          "const": "gear",
          "default": "gear",
          "title": "Item Type",
          "type": "string",
          "description": "Always `\"gear\"`."
        },
        "id": {
          "title": "Id",
          "type": "string",
          "description": "The catalog id, for example `\"torch\"`. Get every id from `load_equipment`, or see\n[the equipment id index](https://mmacy.github.io/osrlib-python/reference/content-ids/equipment/)."
        },
        "name": {
          "title": "Name",
          "type": "string",
          "description": "The display name as the price list prints it, which includes the lot size for gear sold in lots:\n`\"Torches (6)\"`, `\"Iron spikes (12)\"`."
        },
        "cost_gp": {
          "minimum": 0,
          "title": "Cost Gp",
          "type": "integer",
          "description": "The listed price in gold pieces, for one lot."
        },
        "lot_size": {
          "default": 1,
          "minimum": 1,
          "title": "Lot Size",
          "type": "integer",
          "description": "How many units one purchase at `cost_gp` delivers. 1 for gear sold singly."
        },
        "capacity_coins": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Capacity Coins",
          "description": "How much fits in the container, in coins of weight, where the SRD gives a figure (backpack, small sack, large\nsack). `None` for gear that contains nothing. osrlib doesn't enforce the figure, so if you want container\nlimits, enforce them yourself."
        },
        "combat": {
          "anyOf": [
            {
              "$ref": "#/$defs/CombatFacet"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The combat statistics for the three items that are also weapons. See\n`CombatFacet`. `None` for everything else."
        },
        "params": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "default": {},
          "title": "Params",
          "type": "object",
          "description": "The exploration mechanics the SRD's gear table prints, keyed by name: a torch's `burn_turns` and\n`light_radius_feet`, the tinder box's `light_chance_in_six`, and so on. The dungeon-crawl procedures in\n`osrlib.crawl.exploration` read these."
        },
        "overrides_applied": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Overrides Applied",
          "type": "array",
          "description": "Which fields were corrected when this row was compiled from the SRD text, as dotted paths. Empty when none were.\nosrlib doesn't read it during play."
        }
      },
      "required": [
        "id",
        "name",
        "cost_gp"
      ],
      "title": "GearTemplate",
      "type": "object"
    },
    "HitDice": {
      "description": "A class's hit dice at one level: how many, of what size, and any flat bonus.\n\nRead it off `ProgressionRow.hit_dice`.\n`level_up` and\n`drain_levels` compare the hit dice of two neighbouring\nlevels. When `count` rises from one level to the next, the level gained or lost is worth a\nrolled die. When it doesn't, the level is worth the difference between the two `bonus` values.\nFrozen.\n\nA class stops gaining dice at name level, the level at which a character may build a\nstronghold. After that it gains a flat number of hit points per level. The SRD writes those\nlevels with an asterisk, as in `9d8+2*`, to show that the CON modifier no longer applies.",
      "properties": {
        "count": {
          "minimum": 1,
          "title": "Count",
          "type": "integer",
          "description": "The number of hit dice the class has at this level. At least 1."
        },
        "die": {
          "title": "Die",
          "type": "integer",
          "description": "The number of sides on each die, which is the class's hit die: 4 for the magic-user and thief, 6 for the cleric,\nelf, and halfling, and 8 for the dwarf and fighter."
        },
        "bonus": {
          "default": 0,
          "minimum": 0,
          "title": "Bonus",
          "type": "integer",
          "description": "The flat hit points added to the dice, which is how a character gains hit points past name level. At least 0."
        },
        "con_applies": {
          "default": true,
          "title": "Con Applies",
          "type": "boolean",
          "description": "Whether the CON modifier applies to a die gained at this level.\n\nIt's False at the levels the SRD writes with an asterisk, as in `9d8+2*`. Whether a die is rolled at all is a\nseparate question, which depends on whether `count` rises from the level below."
        }
      },
      "required": [
        "count",
        "die"
      ],
      "title": "HitDice",
      "type": "object"
    },
    "Inventory": {
      "description": "Everything one character carries, including items, coins, valuables, and what is in hand or worn.\n\nEvery `Character` has one. Build it up with\n`purchase` and `equip`, search\nit with `carried_item` and\n`magic_item`, and weigh it with\n`tracked_weight_coins` or\n`movement_rate_feet`. In a running game the\ncommands do all of this and record it in the save.\n\nTo give a character treasure you generated outside a session, append each magic item to\n`items` and each valuable to `valuables`, and add each denomination of the coins to the\nmatching field of `purse`.\n\nAn instance is in exactly one place: equipping moves it out of the item list and into\nits slot, and unequipping moves it back. So iterate\n`all_instances` rather than `items` when\nyou want everything a character has. The item list is in the order items were added,\nand an unequipped item goes back on the end.\n\nosrlib doesn't cap what a character can carry. Weight affects the movement rate instead.\nPast the maximum load, the character can't move. The maximum load is\n`MAX_LOAD_COINS`. Under detailed encumbrance, worn\ngauntlets of ogre power raise it.",
      "properties": {
        "items": {
          "default": [],
          "items": {
            "discriminator": {
              "mapping": {
                "item": "#/$defs/ItemInstance",
                "magic_item": "#/$defs/MagicItemInstance"
              },
              "propertyName": "instance_type"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/ItemInstance"
              },
              {
                "$ref": "#/$defs/MagicItemInstance"
              }
            ]
          },
          "title": "Items",
          "type": "array",
          "description": "What is carried but not in use, in the order it was acquired. See `AnyInstance`.\n    "
        },
        "purse": {
          "$ref": "#/$defs/CoinPurse",
          "default": {
            "pp": 0,
            "gp": 0,
            "ep": 0,
            "sp": 0,
            "cp": 0
          },
          "description": "The coins. See `CoinPurse`."
        },
        "valuables": {
          "default": [],
          "items": {
            "$ref": "#/$defs/ValuableInstance"
          },
          "title": "Valuables",
          "type": "array",
          "description": "Carried gems and jewellery. See `ValuableInstance`."
        },
        "worn_armour": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "item": "#/$defs/ItemInstance",
                  "magic_item": "#/$defs/MagicItemInstance"
                },
                "propertyName": "instance_type"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/ItemInstance"
                },
                {
                  "$ref": "#/$defs/MagicItemInstance"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Worn Armour",
          "description": "The suit of body armour being worn, or `None`."
        },
        "shield": {
          "anyOf": [
            {
              "discriminator": {
                "mapping": {
                  "item": "#/$defs/ItemInstance",
                  "magic_item": "#/$defs/MagicItemInstance"
                },
                "propertyName": "instance_type"
              },
              "oneOf": [
                {
                  "$ref": "#/$defs/ItemInstance"
                },
                {
                  "$ref": "#/$defs/MagicItemInstance"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Shield",
          "description": "The shield being carried, or `None`."
        },
        "wielded": {
          "default": [],
          "items": {
            "discriminator": {
              "mapping": {
                "item": "#/$defs/ItemInstance",
                "magic_item": "#/$defs/MagicItemInstance"
              },
              "propertyName": "instance_type"
            },
            "oneOf": [
              {
                "$ref": "#/$defs/ItemInstance"
              },
              {
                "$ref": "#/$defs/MagicItemInstance"
              }
            ]
          },
          "title": "Wielded",
          "type": "array",
          "description": "Everything equipped that isn't armour, a shield, or a ring: weapons, a torch, a wand, and worn miscellaneous\nmagic items like gauntlets. A two-handed weapon here rules out a shield."
        },
        "rings": {
          "default": [],
          "items": {
            "$ref": "#/$defs/MagicItemInstance"
          },
          "title": "Rings",
          "type": "array",
          "description": "The worn rings, at most `MAX_RINGS_WORN`."
        }
      },
      "title": "Inventory",
      "type": "object"
    },
    "ItemInstance": {
      "description": "A stack of mundane items a character has.\n\n`purchase` makes one. Construct one yourself to give a\ncharacter an item without charging for it, and add it to their\n`Inventory`. Unlike a magic item, a mundane instance has\nno instance id. Its template identifies it, so two stacks of the same item are\ninterchangeable.",
      "properties": {
        "instance_type": {
          "const": "item",
          "default": "item",
          "title": "Instance Type",
          "type": "string",
          "description": "Always `\"item\"`."
        },
        "template": {
          "discriminator": {
            "mapping": {
              "ammunition": "#/$defs/AmmunitionTemplate",
              "armour": "#/$defs/ArmourTemplate",
              "gear": "#/$defs/GearTemplate",
              "weapon": "#/$defs/WeaponTemplate"
            },
            "propertyName": "item_type"
          },
          "oneOf": [
            {
              "$ref": "#/$defs/WeaponTemplate"
            },
            {
              "$ref": "#/$defs/ArmourTemplate"
            },
            {
              "$ref": "#/$defs/GearTemplate"
            },
            {
              "$ref": "#/$defs/AmmunitionTemplate"
            }
          ],
          "title": "Template",
          "description": "The item itself, one of the four equipment templates. See `ItemTemplate`. The\nwhole template is embedded rather than referenced by id, so an instance of an item an adventure bundled stays\nreadable without that adventure."
        },
        "quantity": {
          "default": 1,
          "minimum": 1,
          "title": "Quantity",
          "type": "integer",
          "description": "How many units the stack contains, counting individual items rather than lots: buying one lot of torches gives\nyou one instance of quantity 6."
        }
      },
      "required": [
        "template"
      ],
      "title": "ItemInstance",
      "type": "object"
    },
    "MagicItemInstance": {
      "description": "One magic item a character has, with everything that differs from copy to copy.\n\nTemplates are shared and frozen. This is the copy in play, and it's mutable. Treasure\ngeneration makes them\n(`instantiate_magic_item` and\n`generate_magic_item`), an\n`Inventory` contains them, and\n`magic_item_template` gets you back to the\ntemplate behind one.\n\nAn instance starts unidentified, and a player-facing view shows it as an unknown item\nuntil it's identified. In a session, the engine identifies it the first time a character\nuses it: drinks the potion, swings the sword, or puts on the ring. A referee can also\nidentify it with `IdentifyItem`. The engine reveals a\ncursed item's curse at the same moment. From then on the bearer can't take it off until the *remove curse* spell\nlifts the curse, and `unequip` raises a `ValueError` whose\nmessage includes `items.curse.stuck`.",
      "properties": {
        "instance_type": {
          "const": "magic_item",
          "default": "magic_item",
          "title": "Instance Type",
          "type": "string",
          "description": "Always `\"magic_item\"`. This field distinguishes it from a mundane\n`ItemInstance` when both are stored in one list."
        },
        "instance_id": {
          "title": "Instance Id",
          "type": "string",
          "description": "The id of this copy, for example `\"magic-item-0003\"`, allocated by\n`IdAllocator`. Commands that act on a magic item identify it by this, not by its\ntemplate id."
        },
        "template_id": {
          "title": "Template Id",
          "type": "string",
          "description": "Which item it is. Get its template with\n`magic_item_template`. Every id is in\n`load_magic_items` and in [the magic item id\nindex](https://mmacy.github.io/osrlib-python/reference/content-ids/magic-items/)."
        },
        "charges_remaining": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Charges Remaining",
          "description": "How many charges are left in a rod, staff, or wand, or `None` for an item that has no charges. Keep this out of\nthe player's view: in the tabletop rules a charge count can't be discovered."
        },
        "quantity": {
          "default": 1,
          "minimum": 0,
          "title": "Quantity",
          "type": "integer",
          "description": "How many the stack contains, for enchanted ammunition. A stack at 0 is spent and no longer counts as carried."
        },
        "identified": {
          "default": false,
          "title": "Identified",
          "type": "boolean",
          "description": "True once the party knows what the item is. A player-facing view masks an unidentified item's name and\nproperties."
        },
        "cursed_revealed": {
          "default": false,
          "title": "Cursed Revealed",
          "type": "boolean",
          "description": "True once the engine has revealed the curse. From then on the item can't be unequipped or given away until the\n*remove curse* spell lifts the curse, which sets this back to False."
        },
        "base_item_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Base Item Id",
          "description": "The mundane item underneath an enchanted weapon, arrow, suit of armour, or staff. Look it up with\n`load_equipment` (ids listed in [the equipment id\nindex](https://mmacy.github.io/osrlib-python/reference/content-ids/equipment/)). For generic enchanted armour, this\nis what the *Magic Armour Type* roll chose."
        },
        "sentience": {
          "anyOf": [
            {
              "$ref": "#/$defs/SwordSentience"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The sword's mind, for a sentient sword. See `SwordSentience`. `None` on\neverything else."
        },
        "state": {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              },
              {
                "type": "boolean"
              },
              {
                "items": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ]
                },
                "type": "array"
              }
            ]
          },
          "default": {},
          "title": "State",
          "type": "object",
          "description": "State specific to this copy, keyed by name: the effects a worn item has attached, an energy-drain sword's\nremaining drains, a ring of wishes' remaining wishes, the day a staff of healing last healed each target, the\nspells left on a scroll."
        }
      },
      "required": [
        "instance_id",
        "template_id"
      ],
      "title": "MagicItemInstance",
      "type": "object"
    },
    "Material": {
      "description": "What a weapon or piece of ammunition is made of, where the rules care.\n\nSome monsters are hurt only by silver or magical weapons. The `material` field of\n`WeaponTemplate` and\n`AmmunitionTemplate` marks a mundane weapon as\nsilver, and the damage pipeline in `osrlib.core.combat` reads it\nwhen it checks a target's immunities. The field defaults to `STANDARD`. The compiled\ncatalog uses `SILVER` for the silver dagger and silver-tipped arrows.\n\nThe values `\"standard\"` and `\"silver\"` appear in the compiled equipment data.",
      "enum": [
        "standard",
        "silver"
      ],
      "title": "Material",
      "type": "string"
    },
    "MemorizedSpell": {
      "description": "One spell a caster has ready to cast: which spell, and in which form.\n\nConstruct one for each slot you want filled, and pass them to\n`memorize_spells` or to the\n`PrepareSpells` command. Read them back from a\ncharacter's `memorized_spells`, in the order they were prepared. Which copy goes depends on\nthe order: casting spends the first copy that matches, and\n`forget_excess_memorized`, which\n`drain_levels` calls, removes the last ones first.\n\nA copy has only a spell id and a form. What the spell can do comes from the template you get\nwith `SpellCatalog.get`.\n\nExamples:\n    ```python\n    from osrlib.core.spells import MemorizedSpell\n\n    prepared = [MemorizedSpell(spell_id=\"magic_missile\"), MemorizedSpell(spell_id=\"light_mu\", reversed=True)]\n    assert prepared[1].reversed  # this copy casts *darkness*, not *light*\n    ```",
      "properties": {
        "spell_id": {
          "minLength": 1,
          "title": "Spell Id",
          "type": "string",
          "description": "The spell's id, like `\"magic_missile\"`.\n\nFor the built-in ids, iterate `load_spells``().spells` or see\n[the spell id index](https://mmacy.github.io/osrlib-python/reference/content-ids/spells/)."
        },
        "reversed": {
          "default": false,
          "title": "Reversed",
          "type": "boolean",
          "description": "True when this copy is prepared as the spell's reversed form.\n\nOnly an arcane caster sets it, because in the SRD an arcane caster chooses the form when the\nspell is memorized. A divine caster memorizes the normal form and chooses the form when casting,\nso a divine caster's copies are always False, and\n`memorize_spells` rejects a copy marked True."
        }
      },
      "required": [
        "spell_id"
      ],
      "title": "MemorizedSpell",
      "type": "object"
    },
    "MissileRanges": {
      "description": "A missile weapon's three range bands, near to far.\n\nAttack resolution measures the distance to the target, finds the band it falls in, and\napplies that band's modifier: +1 at short range, nothing at medium, \u22121 at long. Beyond\nthe long band the shot is out of range. A\n`WeaponTemplate` or a\n`CombatFacet` has one of these exactly when it has the\n`MISSILE` quality of `WeaponQuality`. Building either\nwith one and not the other raises a pydantic `ValidationError`. The compiled combat facets\nof holy water and burning oil have ranges and the missile quality. The torch's has neither.",
      "properties": {
        "short": {
          "$ref": "#/$defs/RangeBand",
          "description": "The nearest band, worth +1 to hit."
        },
        "medium": {
          "$ref": "#/$defs/RangeBand",
          "description": "The middle band, with no attack modifier."
        },
        "long": {
          "$ref": "#/$defs/RangeBand",
          "description": "The farthest band, worth \u22121 to hit, and the limit of the weapon's range."
        }
      },
      "required": [
        "short",
        "medium",
        "long"
      ],
      "title": "MissileRanges",
      "type": "object"
    },
    "ProgressionRow": {
      "description": "A class's values at one level: the experience a character needs to reach the level, and what the level grants.\n\nGet one from `ClassDefinition.row`. A character's\nTHAC0, attack bonus, saving throws, and spell slots come from the row for their current level,\nread each time rather than stored. That's why `level_up` and\n`drain_levels` need to change only the level. Frozen.",
      "properties": {
        "level": {
          "minimum": 1,
          "title": "Level",
          "type": "integer",
          "description": "The level this row describes, from 1."
        },
        "xp": {
          "minimum": 0,
          "title": "Xp",
          "type": "integer",
          "description": "The total experience points a character needs to reach this level. It's 0 at level 1, and rises each level."
        },
        "hit_dice": {
          "$ref": "#/$defs/HitDice",
          "description": "The class's hit dice at this level. See `HitDice`."
        },
        "thac0": {
          "maximum": 20,
          "minimum": 2,
          "title": "Thac0",
          "type": "integer",
          "description": "The d20 roll needed to hit armour class 0, for descending armour class."
        },
        "attack_bonus": {
          "minimum": 0,
          "title": "Attack Bonus",
          "type": "integer",
          "description": "The bonus added to an attack roll, for ascending armour class. It describes the same attack as `thac0`."
        },
        "saves": {
          "$ref": "#/$defs/SavingThrows",
          "description": "The saving throw targets at this level. See `SavingThrows`."
        },
        "spell_slots": {
          "default": [],
          "items": {
            "type": "integer"
          },
          "title": "Spell Slots",
          "type": "array",
          "description": "How many spells of each spell level the class can memorize at this level.\n\nThe first entry is for first-level spells, the second for second-level spells, and so on. An entry is 0 when the\nclass can't yet memorize spells of that level, as with a first-level cleric. Empty for a class that casts no spells."
        }
      },
      "required": [
        "level",
        "xp",
        "hit_dice",
        "thac0",
        "attack_bonus",
        "saves"
      ],
      "title": "ProgressionRow",
      "type": "object"
    },
    "RangeBand": {
      "description": "One missile range band in feet, as the SRD prints it (`5'\u201380'`).\n\nThree of these make up a weapon's `MissileRanges`,\nand the band a shot falls into sets its attack modifier. Bands come from the\ncompiled equipment data (`load_equipment`). Construct one\nyourself only when you build a missile weapon template to bundle with an adventure.\nBoth bounds are inclusive. The engine rejects an attack at a distance past the long\nband's maximum with `combat.attack.out_of_range`.",
      "properties": {
        "min_feet": {
          "minimum": 0,
          "title": "Min Feet",
          "type": "integer",
          "description": "The band's nearest distance in feet, inclusive."
        },
        "max_feet": {
          "minimum": 0,
          "title": "Max Feet",
          "type": "integer",
          "description": "The band's farthest distance in feet, inclusive. Never less than `min_feet`: building a band with a reversed pair\nraises a pydantic `ValidationError`."
        }
      },
      "required": [
        "min_feet",
        "max_feet"
      ],
      "title": "RangeBand",
      "type": "object"
    },
    "SavingThrows": {
      "description": "The five saving throw targets, one for each kind of danger.\n\nA save succeeds on a 1d20 roll equal to or higher than the target for the danger, so a lower\ntarget is better. Read a character's current targets from\n`Character.saves` and a monster's from\n`MonsterInstance.saves`.\n`saving_throw` rolls a save against them for you. Frozen.",
      "properties": {
        "death": {
          "maximum": 20,
          "minimum": 2,
          "title": "Death",
          "type": "integer",
          "description": "The target against death rays and poison."
        },
        "wands": {
          "maximum": 20,
          "minimum": 2,
          "title": "Wands",
          "type": "integer",
          "description": "The target against magic wands."
        },
        "paralysis": {
          "maximum": 20,
          "minimum": 2,
          "title": "Paralysis",
          "type": "integer",
          "description": "The target against paralysis and being turned to stone."
        },
        "breath": {
          "maximum": 20,
          "minimum": 2,
          "title": "Breath",
          "type": "integer",
          "description": "The target against a breath attack, like a dragon's."
        },
        "spells": {
          "maximum": 20,
          "minimum": 2,
          "title": "Spells",
          "type": "integer",
          "description": "The target against spells, rods, and staves."
        }
      },
      "required": [
        "death",
        "wands",
        "paralysis",
        "breath",
        "spells"
      ],
      "title": "SavingThrows",
      "type": "object"
    },
    "SwordSentience": {
      "description": "A sentient sword's mind, alignment, and powers.\n\n`instantiate_magic_item` rolls it once when it creates the\nsword, and it doesn't change after that. It's the `sentience` field of the sword's\n`MagicItemInstance`. Most swords have none, and\nthe field is `None` for those. Pass the sword to\n`sword_control_check` to find out whether it\ntakes charge of its wielder.",
      "properties": {
        "intelligence": {
          "maximum": 12,
          "minimum": 7,
          "title": "Intelligence",
          "type": "integer",
          "description": "The sword's intelligence, 7 to 12. It sets how the sword communicates and how many powers it has."
        },
        "ego": {
          "maximum": 12,
          "minimum": 1,
          "title": "Ego",
          "type": "integer",
          "description": "The sword's ego, 1 to 12, or 12 for a sword of special purpose. In a contest of wills, the sword's total starts\nfrom its intelligence plus its ego."
        },
        "communication": {
          "title": "Communication",
          "type": "string",
          "description": "How it makes itself understood: `\"empathy\"` or `\"speech\"`."
        },
        "reading": {
          "title": "Reading",
          "type": "boolean",
          "description": "True when the sword can read."
        },
        "alignment": {
          "title": "Alignment",
          "type": "string",
          "description": "The sword's alignment, as a lowercase name. A bearer of a different alignment takes damage for holding it, which\nthe rules leave to the referee to apply."
        },
        "languages": {
          "default": 0,
          "minimum": 0,
          "title": "Languages",
          "type": "integer",
          "description": "How many languages a speaking sword knows. 0 for an empathic sword."
        },
        "sensory_powers": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Sensory Powers",
          "type": "array",
          "description": "The ids of its sensory powers, the ones that detect things. Look them up with\n`SentientSwordTables.power`."
        },
        "extraordinary_powers": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Extraordinary Powers",
          "type": "array",
          "description": "The ids of its extraordinary powers, the ones that do things. Look them up the same way."
        },
        "special_purpose": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Special Purpose",
          "description": "What the sword was made to do, for example `\"chaotic_creatures\"`, or `None` for a sword with no special purpose.\n    "
        }
      },
      "required": [
        "intelligence",
        "ego",
        "communication",
        "reading",
        "alignment"
      ],
      "title": "SwordSentience",
      "type": "object"
    },
    "ThiefSkillRow": {
      "description": "A thief's skill chances at one level.\n\nRead the row for a thief's level from\n`ClassDefinition.thief_skills`, or let\n`thief_skill_check` find it and roll for you. Frozen.\n\nEvery skill except `hear_noise` is a percentage, rolled on d%, and succeeds on a roll equal to\nor under the chance. `hear_noise` is a chance in 6, rolled on 1d6, so osrlib stores the SRD's\n\"1-2\" as 2. `pick_pockets` is above 100 at high levels. `thief_skill_check` lowers the chance\nto 99, so a theft can always fail.",
      "properties": {
        "level": {
          "minimum": 1,
          "title": "Level",
          "type": "integer",
          "description": "The thief level this row describes."
        },
        "climb_sheer_surfaces": {
          "minimum": 0,
          "title": "Climb Sheer Surfaces",
          "type": "integer",
          "description": "The percent chance to climb a sheer surface. It's 87 at first level."
        },
        "find_remove_treasure_traps": {
          "minimum": 0,
          "title": "Find Remove Treasure Traps",
          "type": "integer",
          "description": "The percent chance to find or remove a trap on a treasure container, like a chest.\n\nSpotting a trap in a room is a different check, made with\n`detection_chance`."
        },
        "hear_noise": {
          "maximum": 6,
          "minimum": 1,
          "title": "Hear Noise",
          "type": "integer",
          "description": "The chance in 6 of hearing noise through a door, rolled on 1d6."
        },
        "hide_in_shadows": {
          "minimum": 0,
          "title": "Hide In Shadows",
          "type": "integer",
          "description": "The percent chance to stay unseen while keeping still in shadow."
        },
        "move_silently": {
          "minimum": 0,
          "title": "Move Silently",
          "type": "integer",
          "description": "The percent chance to move without being heard."
        },
        "open_locks": {
          "minimum": 0,
          "title": "Open Locks",
          "type": "integer",
          "description": "The percent chance to pick a lock. In a session, the engine rejects a\n`PickLock` command unless the thief carries thieves' tools."
        },
        "pick_pockets": {
          "minimum": 0,
          "title": "Pick Pockets",
          "type": "integer",
          "description": "The percent chance to steal something a person is carrying."
        }
      },
      "required": [
        "level",
        "climb_sheer_surfaces",
        "find_remove_treasure_traps",
        "hear_noise",
        "hide_in_shadows",
        "move_silently",
        "open_locks",
        "pick_pockets"
      ],
      "title": "ThiefSkillRow",
      "type": "object"
    },
    "ValuableInstance": {
      "description": "One gem or piece of jewellery a character carries.\n\nTreasure generation rolls the value once, when the piece is created, and it never\nchanges. `generate_treasure` returns these\nalongside the coins. `SellTreasure` sells a piece\nfor exactly `value_gp`, with no haggling or appraisal. The SRD gives no rate at which a\ntown buys treasure, and selling at full value makes a piece's sale price equal to the\nexperience it's worth. If you want haggling or appraisal, add them yourself.",
      "properties": {
        "instance_type": {
          "const": "valuable",
          "default": "valuable",
          "title": "Instance Type",
          "type": "string",
          "description": "Always `\"valuable\"`."
        },
        "instance_id": {
          "title": "Instance Id",
          "type": "string",
          "description": "The id of this piece, for example `\"valuable-0001\"`, allocated by\n`IdAllocator`."
        },
        "kind": {
          "enum": [
            "gem",
            "jewellery"
          ],
          "title": "Kind",
          "type": "string",
          "description": "`\"gem\"` or `\"jewellery\"`."
        },
        "name": {
          "default": "",
          "title": "Name",
          "type": "string",
          "description": "A display name for the piece. Generation sets a plain one. When you place treasure by hand in an adventure, you\ncan give it any name."
        },
        "value_gp": {
          "minimum": 0,
          "title": "Value Gp",
          "type": "integer",
          "description": "What it's worth in gold pieces, and what it pays when sold."
        },
        "weight_coins": {
          "default": 0,
          "minimum": 0,
          "title": "Weight Coins",
          "type": "integer",
          "description": "The weight in coins, taken from the treasure encumbrance rows when the piece was generated. See\n`TreasureWeight`."
        }
      },
      "required": [
        "instance_id",
        "kind",
        "value_gp"
      ],
      "title": "ValuableInstance",
      "type": "object"
    },
    "WeaponPolicy": {
      "description": "Which weapons a class may wield.\n\nRead it from `ClassDefinition.weapons`.\n`validate_equip` checks a weapon against it. It covers\nweapons only. `validate_equip` doesn't check a piece of\ngear used as a weapon, like a torch, against it. Frozen.",
      "properties": {
        "kind": {
          "$ref": "#/$defs/WeaponPolicyKind",
          "description": "Whether `weapon_ids` lists the weapons allowed, the weapons refused, or nothing. See\n`WeaponPolicyKind`."
        },
        "weapon_ids": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Weapon Ids",
          "type": "array",
          "description": "The weapon ids the policy lists, like `(\"long_bow\", \"two_handed_sword\")` for the dwarf.\n\nLook each one up with `load_equipment``().get(item_id)`, or see\n[the equipment id index](https://mmacy.github.io/osrlib-python/reference/content-ids/equipment/). Empty when `kind`\nis `\"any\"`, and not empty otherwise."
        },
        "manual_notes": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Manual Notes",
          "type": "array",
          "description": "Weapon rules from the SRD that osrlib doesn't check, like the dwarf's limit to \"small or normal sized\" weapons.\n\nShow them to the referee, who applies them."
        }
      },
      "required": [
        "kind"
      ],
      "title": "WeaponPolicy",
      "type": "object"
    },
    "WeaponPolicyKind": {
      "description": "Whether a class's weapon list contains the weapons it may use or the weapons it may not.\n\nRead it from `WeaponPolicy.kind`. With `\"any\"` the list\nis empty and every weapon is allowed. With `\"allowed\"` the list contains the only weapons allowed.\nWith `\"forbidden\"` the list contains the only weapons the class may not use. The values are those three strings.",
      "enum": [
        "any",
        "allowed",
        "forbidden"
      ],
      "title": "WeaponPolicyKind",
      "type": "string"
    },
    "WeaponQuality": {
      "description": "What a weapon can do in combat, as the SRD's weapon table prints it.\n\nEvery `WeaponTemplate` and every gear\n`CombatFacet` has a tuple of these, and attack\nresolution in `osrlib.core.combat` reads them: they are what makes\na bow behave differently from a mace. Compiled equipment already has its qualities. You\nset them yourself only when you build a weapon template to bundle with an adventure.\n\nThe lowercase values appear in the compiled equipment data and in saves.",
      "enum": [
        "blunt",
        "brace",
        "charge",
        "melee",
        "missile",
        "reload",
        "slow",
        "splash",
        "two_handed"
      ],
      "title": "WeaponQuality",
      "type": "string"
    },
    "WeaponTemplate": {
      "description": "A mundane weapon, from the SRD's weapon table.\n\nOne of the four kinds of equipment template. Get one from the compiled catalog with\n`EquipmentCatalog.get`, then buy it with\n`purchase`, which creates the\n`ItemInstance` a character carries.\nTemplates are frozen and shared. Construct one yourself only to bundle a weapon of your\nown in an `Adventure`.",
      "properties": {
        "item_type": {
          "const": "weapon",
          "default": "weapon",
          "title": "Item Type",
          "type": "string",
          "description": "Always `\"weapon\"`. This field distinguishes the four template kinds when they are stored or loaded together."
        },
        "id": {
          "title": "Id",
          "type": "string",
          "description": "The catalog id, for example `\"sword\"`. Unique across every equipment list. Get every id from\n`load_equipment`, or see [the equipment id\nindex](https://mmacy.github.io/osrlib-python/reference/content-ids/equipment/)."
        },
        "name": {
          "title": "Name",
          "type": "string",
          "description": "The display name, for example `\"Sword\"`."
        },
        "cost_gp": {
          "minimum": 0,
          "title": "Cost Gp",
          "type": "integer",
          "description": "The listed price in gold pieces, for one weapon."
        },
        "weight_coins": {
          "minimum": 0,
          "title": "Weight Coins",
          "type": "integer",
          "description": "The weight in coins. For a missile weapon this already includes its ammunition and quiver, which is why\nammunition itself weighs nothing."
        },
        "damage": {
          "title": "Damage",
          "type": "string",
          "description": "The damage the weapon deals, as a dice expression, for example `\"1d8\"`. Ignored when the `variable_weapon_damage`\nflag of `Ruleset` is off, and then every weapon deals 1d6."
        },
        "qualities": {
          "items": {
            "$ref": "#/$defs/WeaponQuality"
          },
          "title": "Qualities",
          "type": "array",
          "description": "What the weapon can do. See `WeaponQuality`."
        },
        "missile_ranges": {
          "anyOf": [
            {
              "$ref": "#/$defs/MissileRanges"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The three range bands, present exactly when `qualities` includes the missile quality."
        },
        "material": {
          "$ref": "#/$defs/Material",
          "default": "standard",
          "description": "What it's made of, for monsters that only silver or magic can hurt. Standard unless the weapon is silvered."
        },
        "overrides_applied": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Overrides Applied",
          "type": "array",
          "description": "Which fields were corrected when this row was compiled from the SRD text, as dotted paths. Empty when none were.\nosrlib doesn't read it during play."
        }
      },
      "required": [
        "id",
        "name",
        "cost_gp",
        "weight_coins",
        "damage",
        "qualities"
      ],
      "title": "WeaponTemplate",
      "type": "object"
    },
    "XpTier": {
      "description": "One tier of a class's experience modifier: a percentage, and the minimum scores that earn it.\n\nA class adjusts every experience award up for a character whose prime requisites are high, and\ndown for one whose prime requisites are low. Read a class's tiers from\n`ClassDefinition.xp_tiers`.\n`xp_modifier_pct` checks them in order and returns the\npercentage of the first tier whose minimums the character meets. Frozen.",
      "properties": {
        "modifier_pct": {
          "title": "Modifier Pct",
          "type": "integer",
          "description": "The adjustment as a percentage, like `10` for a tenth more experience or `-20` for a fifth less."
        },
        "minimums": {
          "additionalProperties": {
            "type": "integer"
          },
          "propertyNames": {
            "$ref": "#/$defs/AbilityScore"
          },
          "title": "Minimums",
          "type": "object",
          "description": "The lowest score in each ability that earns this tier, keyed by ability. The character must meet every entry for\nthe tier to apply. There's at least one entry."
        }
      },
      "required": [
        "modifier_pct",
        "minimums"
      ],
      "title": "XpTier",
      "type": "object"
    }
  },
  "description": "Referee: add a character to the party during play.\n\nUse it to bring a new character into a running game: a replacement for a character who\ndied, a prisoner the party set free, or an adventurer the party meets in town. Build the\ncharacter with `create_character`, the way you\nbuild a starting party member, and send it here in `town` or `exploring`.\n\nThe session gives the new member an id and puts them at the back of the marching order, so\nthe front rank doesn't change. To move them, send\n`ReorderParty`, which is legal in the same modes. The\nsession logs the command, so a saved game and a replay both have the new member.\n\nThe new id has the form `character-NNNN` and is unique in the party. It's never the id of a\nmember who left with `RemoveMember`. Read it from the\nevent, and pass it as the `character_id` of later commands. The session adds a copy of\n`character`, not the object you pass. Your object stays as it was, with no id. Read the new\nmember with `GameSession.member`.\n\nThe character must be fresh:\n\n- The character can't have a condition or a stat modifier, `dead` included. Each one comes\n  from an effect in the game that applied it, and this session can't end an effect it\n  doesn't track.\n- The character can't carry a magic item or a valuable. Each has an instance id from the\n  game that created it, which could match an id this session hands out. Mundane gear and\n  coins are fine. Give magic items afterwards with\n  `GrantItem`, which creates them with this session's\n  ids.\n\nThe coins the new member brings earn no experience, because the party didn't find them as\ntreasure. Adding a member makes no draws and takes no time.\n\nThe session refuses the command during an encounter or a battle, because the fight is\nalready set up for the party it started with. It also refuses the command once the session\nhas ended, because a new member would restart play. To replace a party whose members are\nall dead or turned to stone, first send `PlaceParty` to move it to town, which\ntakes the session out of `game_over`. Then add the new character.\n\nModes:\n    `town`, `exploring`\n\nRejections:\n    - `session.command.wrong_mode` - an encounter or a battle is open, or the session\n      has ended.\n    - `party.add.id_assigned` - the character's `id` isn't `None`. The character has an\n      id from another game, or is already a member.\n    - `party.add.under_effects` - the character has a condition, like `dead` or\n      `asleep`, or a stat modifier.\n    - `party.add.carries_instances` - the character carries a magic item or a valuable,\n      equipped or not.\n\n    The session checks in this order and reports the first that fails.\n\nEvents:\n    `MemberAddedEvent` with the new member's id,\n    name, class, and level.",
  "properties": {
    "command_type": {
      "const": "add_member",
      "default": "add_member",
      "title": "Command Type",
      "type": "string",
      "description": "The name that identifies the command class in serialized data. Each command class fixes\nit to a distinct snake_case string, like `\"move_party\"` or `\"open_door\"`, and constructing\nthe class sets it, so you never pass it yourself.\n`parse_command` and the\n`AnyCommand` union use it to rebuild the right class\nfrom a serialized mapping. A class's value never changes between releases."
    },
    "source": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Source",
      "description": "Who or what issued the command on whose behalf: an authored trigger or quest id, or the\nname of one of your game's systems. The engine never reads it, so a command with a\n`source` does exactly what the same command without one does. The session logs and\nreplays it with the command, so the log alone shows why something happened. Leave it\n`None` when there's nothing to record. An empty string fails validation when the command\nis constructed."
    },
    "character": {
      "$ref": "#/$defs/Character",
      "description": "The character who joins. Build it with\n`create_character` and pass its `character`. It\nneeds `id` set to `None`, no conditions or stat modifiers, and no magic items or valuables.\nConstructing the command copies the character. A change you make\nto your object afterwards doesn't reach the command, and the command log records the\ncharacter as you sent it."
    }
  },
  "required": [
    "character"
  ],
  "title": "AddMember",
  "type": "object"
}