DnD_5e.character_classes.sorcerer module

class DnD_5e.character_classes.sorcerer.Sorcerer(**kwargs)[source]

Bases: SpellCaster, Character

Sorcerer character class

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: sorcery points

Parameters:

other (Sorcerer) – the Sorcerer to compare

Returns:

True if self is identical to other, False otherwise

Return type:

bool

get_sorcery_points() int[source]
Returns:

sorcery points

Return type:

non-negative integer

get_full_sorcery_points() int[source]
Returns:

full sorcery points

Return type:

non-negative integer

get_metamagic() set[source]
Returns:

metamagic

Return type:

set of strings

has_metamagic(item: str) bool[source]

Determine whether self has a given metamagic

Parameters:

item (str) – the metamagic to check for

Returns:

True if self has the metamagic item, False otherwise

Return type:

bool

spend_sorcery_points(points: int) int[source]

Spend a given number of sorcery points

Parameters:

points (non-negative integer) – the number of sorcery points to spend

Returns:

the number of sorcery points spent

Return type:

positive integer

Raise:

ValueError if points is invalid or self doesn’t have enough sorcery points

reset_sorcery_points()[source]

Reset sorcery points

Returns:

None

spell_slot_to_sorcery_points(level: int)[source]

Convert a spell slot to sorcery points

Parameters:

level (integer between 1 and 9 (inclusive)) – the level of the spell slot being used

Returns:

None

Raise:

ValueError if level is invalid

sorcery_points_to_spell_slot(level: int) int[source]

Convert sorcery points to a spell slot

Parameters:

level (integer between 1 and 5 (inclusive)) – the level of spell slot to gain

Returns:

the number of sorcery points spent

Return type:

positive integer

:raise ValueError if level is invalid

add_metamagic(item: str)[source]

Add the given metamagic

Parameters:

item (one of these strings: "careful", "distant", "empowered", "extended", "heightened", "quickened", "subtle", "twinned") – the metamagic to add

Returns:

None

Raise:

ValueError if item is invalid