DnD_5e.combatant.spellcaster module
- class DnD_5e.combatant.spellcaster.SpellCaster(**kwargs)[source]
Bases:
CombatantA Combatant that can cast spells
- current_eq(other) bool[source]
Compare self and other to determine if they are identical based on the attributes checked in equals and also these attributes:
spell_slots- Parameters:
other (SpellCaster) – the SpellCaster to compare
- Returns:
True if self is identical to other, False otherwise
- Return type:
- get_full_spell_slots() dict[source]
- Returns:
full/maximum spell slots
- Return type:
dict mapping int to int
- get_level_spell_slots(level: int) int[source]
Determine the number of spell slots available for a given level
- Parameters:
level (integer from 1 to 9 (inclusive)) – the spell level to look at
- Returns:
the number of available spell slots
- Return type:
- Raise:
ValueError if level is invalid
- can_cast(spell: Spell) bool[source]
Determine if self can cast the given Spell. Note: does not check spell slots.
- Parameters:
spell (py:class:Spell) – the Spell self is trying to cast
- Returns:
True if self can cast spell, False otherwise
- Return type:
- add_spell(spell: Spell)[source]
Add a given spell
- Parameters:
spell (Spell) – the Spell to add
- Returns:
None
- Raise:
ValueError if spell is not a Spell