DnD_5e.tactics package
Subpackages
- DnD_5e.tactics.attack_tactics package
- Module contents
AttackTacticDamageTypeTacticDamageVulnerabilityTacticDamageNoImmuneTacticDamageNoResistanceTacticLowRangeTacticHighRangeTacticLowMeleeRangeTacticHighMeleeRangeTacticHasAdvTacticHasDisAdvTacticHasNoDisadvTacticHighestMaxHitTacticHighMaxHitTacticMaxHitACTacticHighestAvgHitTacticHighAvgHitTacticAvgHitACHighTacticHighestMaxDamageTacticHighMaxDamageTacticMaxDamageHPHighTacticLowMaxDamageTacticMaxDamageHPLowTacticHighestMinDamageTacticHighMinDamageTacticMinDamageHPHighTacticLowMinDamageTacticMinDamageHPLowTacticHighestAvgDamageTacticHighAvgDamageTacticAvgDamageHPHighTacticLowAvgDamageTacticAvgDamageHPLowTacticDprMaxTacticDprHighTacticDprHpHighTacticDprLowTacticDprHpLowTactic
- Module contents
- DnD_5e.tactics.combatant_tactics package
- Module contents
CombatantTacticLowestAcTacticHighestAcTacticLowAcTacticHighAcTacticBloodiedTacticLowestHpTacticHighestHpTacticLowHpTacticHighHpTacticMaxHpTacticHighHpToMaxTacticIsConsciousTacticIsUnconsciousTacticHasTempHpTacticNoTempHpTacticVulnerabilityTacticHasVulnerabilityTacticHasNoVulnerabilityTacticResistanceTacticHasResistanceTacticHasNoResistanceTacticImmunityTacticHasImmunityTacticHasNoImmunityTactic
- Module contents
Module contents
- class DnD_5e.tactics.Tactic(**kwargs)[source]
Bases:
objectA base class for classes that choose an item based on an algorithm stored in method run_tactic
- extend_tiebreakers(tact)[source]
Add the tiebreakers of the given Tactic to the end of the tiebreakers list
- run_tactic(choices: list, **kwargs) list[source]
Use the class’s algorithm to select an option from a list. This is the default implementation and it chooses an option at random. This method should be overridden in subclassses.
- Parameters:
choices (list) – the options to choose from
- Returns:
a list of the chosen items.
List may be empty, it may be identical to choices, or it may contain some (but not all) of the options in choices.
- make_choice(choices: list, **kwargs)[source]
Return exactly one option from choices. The process is this: Try
run_tactic(). If only one option is returned, you are done. Else, try running tiebreakers (in order) until you arrive at one option. If you still don’t have exactly one option, choose a random option from whatever is left.- Parameters:
choices (list) – the options to choose from
**kwargs –
keyword arguments to be passed on to
run_tactic()
- Returns:
the chosen element
- class DnD_5e.tactics.ThresholdTactic(**kwargs)[source]
Bases:
TacticA tactic that has a threshold of some kind (e.g., ac higher than a given number)
- class DnD_5e.tactics.ConditionTactic(**kwargs)[source]
Bases:
TacticTactics that select items that meet a certain condition
- class DnD_5e.tactics.MinTactic(**kwargs)[source]
Bases:
TacticSelect the item(s) that have the lowest value in the given field
- class DnD_5e.tactics.MaxTactic(**kwargs)[source]
Bases:
TacticSelect the item(s) that have the highest value in the given field