DnD_5e.encounter package
Module contents
- class DnD_5e.encounter.Encounter(**kwargs)[source]
Bases:
objectThis class is used for running encounters
- get_copy_of_teams_and_combatants()[source]
Make a copy of the teams (and the combatants within them), so we have a state to reset to :return:
- get_initial_combatants()[source]
- Returns:
the copy of self._combatants that is stored in self._initial_state
- get_current_combatant()[source]
- Returns:
the Combatant who should take a turn now
- Return type:
Combatant
- get_end_condition() bool[source]
Check to see if it is time to end this encounter
- Returns:
False if at least two teams have some alive members, True otherwise
- get_encounter_statnames()[source]
Return the stats (besides the ones for Combatant and Team) that this Encounter tracks. Used by a Simulation to know which stats to keep track of.
TODO: should this be a static method or a class method?
- Returns:
- get_stats() dict[source]
Get various stats about how the Encounter went
- Returns:
a dict containing the stats
- set_logger(logger: str)[source]
Set self._logger to the logger with the name specified in logger
- Parameters:
logger – the name of the Logger to use, or the logging.Logger object itself
- Returns:
None
- add_team(the_team)[source]
Add a given Team to the encounter :param the_team: the
Teamto add :type the_team:Team:return: