DnD_5e.team package

Module contents

class DnD_5e.team.Team(**kwargs)[source]

Bases: object

A container class for Combatant s, to be used by Encounter

get_name() str[source]
Returns:

self._name

Return type:

str

set_name(name: str)[source]
get_combatants() list[source]
Returns:

self._combatants

Return type:

list of Combatant s

get_enemy_tactic()[source]
Returns:

self._enemy_tactic

Return type:

Tactic

has_member(member: Combatant) bool[source]
Parameters:

member (Combatant) – the member who may or may not be on the team

Returns:

True if member is in the list of combatants, False otherwise

get_stats()[source]

Calculate and return num_conscious, num_unconscious, num_dead :return:

has_all_with_condition(condition: str)[source]
Returns:

True if all combatants have the given condition, False otherwise

has_any_with_condition(condition: str)[source]
Returns:

True if at least one combatant has the given condition, False otherwise

has_some_not_all_with_condition(condition: str)[source]
Returns:

True if some combatants have the condition and other combatants don’t, False otherwise

has_all_unconscious() bool[source]
Returns:

True if all combatants are unconscious, False otherwise

has_all_dead() bool[source]
Returns:

True if all combatants are dead, False otherwise

has_all_alive() bool[source]
Returns:

True if all combatants are alive, False otherwise

has_all_conscious() bool[source]
Returns:

True if all combatants are conscious, False otherwise

has_any_unconscious() bool[source]
Returns:

True if at least 1 combatant is unconscious, False otherwise

has_any_dead() bool[source]
Returns:

True if at least 1 combatant is dead, False otherwise

has_some_alive() bool[source]
Returns:

True if at least 1 combatant is alive, False otherwise

has_some_not_all_unconscious()[source]
Returns:

True if some but not all combatants are unconscious

has_some_not_all_dead()[source]
Returns:

True if some but not all combatants are dead

has_any_conscious() bool[source]
Returns:

True if at least 1 combatant is conscious, False otherwise

add_combatant(new_combatant: Combatant)[source]

Add the specified Combatant to the list of combatants. Does not check to see if new_combatant is already on the team

Parameters:

new_combatant (Combatant) – the Combatant to add

Returns:

None

Raise:

ValueError if input is invalid

remove_combatant(old_combatant: Combatant)[source]

Remove the specified Combatant from the list of combatants. Checks first to see if old_combatant is on the team

Parameters:

old_combatant (Combatant) – the Combatant to remove

Returns:

None