DnD_5e.attack_class.spell_attacks module
- class DnD_5e.attack_class.spell_attacks.Spell(**kwargs)[source]
Bases:
AttackThis class represents spells
- get_casting_time() int[source]
- Returns:
amount of time it takes cast self, in rounds
- Return type:
a positive integer for the number of rounds, or one of these strings: “1 action”, “1 bonus action”, “1 reaction”
- get_components() list[source]
- Returns:
the components needed to cast self
- Return type:
list of strings
- make_attack(source, target, adv: int = 0, level: int | None = None) int[source]
First, try to spend the appropriate spell slot. Then, call the superclass method.
- Parameters:
- Returns:
the damage taken (if the attack misses, damage taken is None)
- Return type:
non-negative integer or None
- Raise:
ValueError if source can’t send attacks or target can’t take attacks
- class DnD_5e.attack_class.spell_attacks.SavingThrowSpell(**kwargs)[source]
Bases:
Spell,SavingThrowAttackSpells that require the target to make a saving throw
- class DnD_5e.attack_class.spell_attacks.HealingSpell(**kwargs)[source]
Bases:
SpellSpells that heal (i.e., add hit points) instead of dealing damage; damage is used as healing
- make_attack(source, target, adv: int = 0, level=None) int[source]
Spend the appropriate spell slot, then roll damage and heal the target for that amount
- Parameters:
source (Combatant) – the Combatant that is sending the healing
target (Combatant) – the Combatant that source is healing
adv (one of these integers: -1, 0, 1) – advantage, disadvantage, or neither on the attack roll (NOT USED FOR THIS METHOD)
level (integer between 1 and 9 (inclusive)) – the level the spell is being cast at
- Returns:
the points the target is healed for
- Return type:
non-negative integer
- Raise:
ValueError if input is invalid