tassaron/dnd-character

Spell lists could have limited sizes

tassaron opened this issue · 2 comments

The library could provide some assistance by limiting the size of the spell lists.

  • self._spells_known should not exceed self.spell_slots["spells_known"]
  • self._cantrips_known should not exceed self.spell_slots["cantrips_known"]
  • Add function to get max size of spells_prepared (I think it's class level + spellcasting ability modifier)
  • self._spells_prepared should not exceed this size from aforementioned function

What is the intended function of self.spell_slots["spells_known"] and self.spell_slots["cantrips_known"]?
It seems redundant if we have self._spells_known and self._cantrips_known. I think spell slot calculation/tracking should be a relatively independent feature from known spells/cantrips.

Those two values are the maximum numbers of spells and cantrips that the player character can learn. They should be renamed to have maximum_ before the names perhaps, so it's easier to understand.

The spell_slots property on Character is a direct copy of a dict from the JSON from the SRD API, so it is a bit weird. Maybe we should change the names of all the keys in this dict.