DnD_5e.tactics.combatant_tactics package

Module contents

class DnD_5e.tactics.combatant_tactics.CombatantTactic(**kwargs)[source]

Bases: Tactic

Subclass of Tactic used for selecting Combatant s

class DnD_5e.tactics.combatant_tactics.LowestAcTactic(**kwargs)[source]

Bases: MinTactic, CombatantTactic

Selects the Combatant with the lowest AC.

get_value(item, **kwargs)[source]

Get the value for whatever detail of item we are concerned about

Parameters:

item – the option we are looking at

Returns:

the numerical value of whatever detail we are concerned about

class DnD_5e.tactics.combatant_tactics.HighestAcTactic(**kwargs)[source]

Bases: MaxTactic, CombatantTactic

Selects the Combatant with the highest AC

get_value(item, **kwargs)[source]

Get the value for whatever detail of item we are concerned about

Parameters:

item – the option we are looking at

Returns:

the numerical value of whatever detail we are concerned about

class DnD_5e.tactics.combatant_tactics.LowAcTactic(**kwargs)[source]

Bases: ConditionTactic, ThresholdTactic, CombatantTactic

Selects the Combatant with AC below a threshold determined at initialization

calculate_threshold(**kwargs) int[source]

Calculate threshold using keyword arguments.

Parameters:
  • kwargs – passed on from constructor

  • attack (Attack) – the attack to get the threshold from

  • use_max (bool) – indicates whether to use max hit instead of average hit

Returns:

threshold

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item has AC lower than _threshold, False otherwise

class DnD_5e.tactics.combatant_tactics.HighAcTactic(**kwargs)[source]

Bases: ConditionTactic, ThresholdTactic, CombatantTactic

Selects the Combatant with AC above a threshold determined at initialization

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item has AC higher than _threshold, False otherwise

class DnD_5e.tactics.combatant_tactics.BloodiedTactic(**kwargs)[source]

Bases: ConditionTactic, CombatantTactic

Selects the Combatant that is bloodied

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is bloodied, False otherwise

class DnD_5e.tactics.combatant_tactics.LowestHpTactic(**kwargs)[source]

Bases: MinTactic, CombatantTactic

Selects the Combatant with the lowest AC.

get_value(item, **kwargs)[source]

Get the value for whatever detail of item we are concerned about

Parameters:

item – the option we are looking at

Returns:

the numerical value of whatever detail we are concerned about

class DnD_5e.tactics.combatant_tactics.HighestHpTactic(**kwargs)[source]

Bases: MaxTactic, CombatantTactic

Selects the Combatant with the highest AC

get_value(item, **kwargs)[source]

Get the value for whatever detail of item we are concerned about

Parameters:

item – the option we are looking at

Returns:

the numerical value of whatever detail we are concerned about

class DnD_5e.tactics.combatant_tactics.LowHpTactic(**kwargs)[source]

Bases: ConditionTactic, ThresholdTactic, CombatantTactic

Selects the Combatant that has hp lower than a given threshold

calculate_threshold(**kwargs)[source]

Calculate threshold using keyword arguments.

Parameters:
  • kwargs – passed on from constructor

  • attack (Attack) – the attack to get the threshold from

  • use_max (bool) – indicates whether to use max hit instead of average hit

Returns:

threshold

check_condition(item, **kwargs)[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item has hp lower than threshold, False otherwise

class DnD_5e.tactics.combatant_tactics.HighHpTactic(**kwargs)[source]

Bases: ConditionTactic, ThresholdTactic, CombatantTactic

Selects the Combatant that has hp lower than a given threshold

calculate_threshold(**kwargs)[source]

Calculate threshold using keyword arguments.

Parameters:
  • kwargs – passed on from constructor

  • attack (Attack) – the attack to get the threshold from

  • use_max (bool) – indicates whether to use max hit instead of average hit

Returns:

threshold

check_condition(item, **kwargs)[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item has hp lower than threshold, False otherwise

class DnD_5e.tactics.combatant_tactics.MaxHpTactic(**kwargs)[source]

Bases: ConditionTactic, CombatantTactic

Selects the Combatant that is at max hp

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is at max hp, False otherwise

class DnD_5e.tactics.combatant_tactics.HighHpToMaxTactic(**kwargs)[source]

Bases: ConditionTactic, ThresholdTactic, CombatantTactic

Selects the Combatant for whom the difference between max hp and current hp is greater than a threshold determined at initialization

calculate_threshold(**kwargs)[source]

Calculate threshold using keyword arguments.

Parameters:

kwargs – passed on from constructor

Returns:

threshold

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if the difference between item’s max hp and current hp is greater than _threshold, False otherwise

class DnD_5e.tactics.combatant_tactics.IsConsciousTactic(**kwargs)[source]

Bases: ConditionTactic, CombatantTactic

Selects the Combatant that is conscious (i.e., not unconscious or dead)

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is unconscious, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.IsUnconsciousTactic(**kwargs)[source]

Bases: ConditionTactic, CombatantTactic

Selects the Combatant that is unconscious

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is unconscious, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.HasTempHpTactic(**kwargs)[source]

Bases: ConditionTactic, CombatantTactic

Selects the Combatant that has temporary hp

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item has temporary hp, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.NoTempHpTactic(**kwargs)[source]

Bases: ConditionTactic, CombatantTactic

Selects the Combatant that has no temporary hp

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item has no temporary hp, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.VulnerabilityTactic(**kwargs)[source]

Bases: CombatantTactic

get_vulnerability_type() str[source]
Returns:

vulnerability_type

class DnD_5e.tactics.combatant_tactics.HasVulnerabilityTactic(**kwargs)[source]

Bases: VulnerabilityTactic, ConditionTactic

Selects the Combatant that has a vulnerability determined at initialization

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is vulnerable to vulnerability_type, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.HasNoVulnerabilityTactic(**kwargs)[source]

Bases: VulnerabilityTactic, ConditionTactic

Selects the Combatant that does not have a vulnerability determined at initialization

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is not vulnerable to vulnerability_type, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.ResistanceTactic(**kwargs)[source]

Bases: CombatantTactic

get_resistance_type() str[source]
Returns:

resistance_type

class DnD_5e.tactics.combatant_tactics.HasResistanceTactic(**kwargs)[source]

Bases: ResistanceTactic, ConditionTactic

Selects the Combatant that has a resistance determined at initialization

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is resistant to resistance_type, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.HasNoResistanceTactic(**kwargs)[source]

Bases: ResistanceTactic, ConditionTactic

Selects the Combatant that does not have a resistance determined at initialization

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is not resistant to _resistance_type, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.ImmunityTactic(**kwargs)[source]

Bases: CombatantTactic

get_immunity_type() str[source]
Returns:

immunity_type

class DnD_5e.tactics.combatant_tactics.HasImmunityTactic(**kwargs)[source]

Bases: ImmunityTactic, ConditionTactic

Selects the Combatant that has an immunity determined at initialization

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is immune to immunity_type, False otherwise

Raise:

ValueError if item is not a Combatant

class DnD_5e.tactics.combatant_tactics.HasNoImmunityTactic(**kwargs)[source]

Bases: ImmunityTactic, ConditionTactic

Selects the Combatant that does not have an immunity determined at initialization

check_condition(item, **kwargs) bool[source]
Parameters:

item (Combatant) – the Combatant to check

Returns:

True if item is not immune to immunity_type, False otherwise

Raise:

ValueError if item is not a Combatant