tassaron / dnd-character

library for making Dungeons & Dragons 5e characters as serializable data
https://pypi.org/project/dnd-character/
Eclipse Public License 2.0
45 stars 17 forks source link

Can't put spells in spellbooks #20

Open tassaron opened 1 year ago

tassaron commented 1 year ago

Wizards need to store their spells inside spellbooks, which do exist as an item already.

Since all items have a "contents" field, I guess we could store spells in there. However that field is currently used for storing references to other equipment inside of "pack" items like the burglar's pack, so maybe not.

>>> from dnd_character.equipment import Item
>>> from pprint import pprint
>>> pprint(Item('spellbook'))
_Item(uid='5876bcc2fef0460fad6bb8527bacee52',
      contents=[],
      cost={'quantity': 50, 'unit': 'gp'},
      desc=['Essential for wizards, a spellbook is a leather-bound tome with '
            '100 blank vellum pages suitable for recording spells.'],
      index='spellbook',
      name='Spellbook',
      properties=[],
      special=[],
      url='/api/equipment/spellbook',
      weight=3,
      quantity=1,
      stealth_disadvantage=False,
      str_minimum=0,
      equipment_category={'index': 'adventuring-gear',
                          'name': 'Adventuring Gear',
                          'url': '/api/equipment-categories/adventuring-gear'},
      gear_category={'index': 'standard-gear',
                     'name': 'Standard Gear',
                     'url': '/api/equipment-categories/standard-gear'}
)
stevebelew commented 1 year ago

I'm close to a solution for this.