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

Limit spell lists #22

Closed tassaron closed 1 year ago

tassaron commented 1 year ago

This closes #18

Character.spells_known.maximum is the maximum number of spells a character can know. Same for spells_prepared and cantrips_known. If you try to exceed the spell list, you get a ValueError. Only exception is if you add spells while the character is serialized -- I think it makes sense to allow this as a workaround.