DnD_5e.tactics.attack_tactics package

Module contents

class DnD_5e.tactics.attack_tactics.AttackTactic(**kwargs)[source]

Bases: Tactic

Subclass of Tactic used for selecting Attack s

class DnD_5e.tactics.attack_tactics.DamageTypeTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack that has the given damage type

get_damage_type() str[source]
Returns:

damage_type

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

item

Returns:

class DnD_5e.tactics.attack_tactics.DamageVulnerabilityTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack that has a damage type that the target is vulnerable to

check_condition(item, **kwargs) bool[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.DamageNoImmuneTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack such that none of that attack’s damage is a type that the target is immune to

check_condition(item, **kwargs) bool[source]
Parameters:
  • item (Attack) – the Attack to look at

  • kwargs

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.DamageNoResistanceTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack such that none of that attack’s damage is a type that the target is resistant to

check_condition(item, **kwargs) bool[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.LowRangeTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack that has nonzero range lower than the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighRangeTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack that has range higher than the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.LowMeleeRangeTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack that has nonzero melee range lower than the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighMeleeRangeTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack that has range higher than the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HasAdvTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack that has advantage

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HasDisAdvTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack that has disadvantage. I don’t know why you would do this, but now you can.

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HasNoDisadvTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack that does not have disadvantage

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighestMaxHitTactic(**kwargs)[source]

Bases: MaxTactic, AttackTactic

Select the Attack with the highest maximum to-hit value (e.g., with an attack modifier of 10)

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighMaxHitTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with a maximum to-hit value higher than the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.MaxHitACTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with a maximum to-hit value greater than or equal to the target’s AC

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.HighestAvgHitTactic(**kwargs)[source]

Bases: MaxTactic, AttackTactic

Select the Attack with the highest average to-hit value

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighAvgHitTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with an average to-hit value higher than threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.AvgHitACHighTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with an average to-hit value greater than or equal to the target’s AC

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.HighestMaxDamageTactic(**kwargs)[source]

Bases: MaxTactic, AttackTactic

Select the Attack with the highest maximum damage

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighMaxDamageTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with maximum damage above the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.MaxDamageHPHighTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with a maximum damage value greater than or equal to the target’s current hp

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.LowMaxDamageTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with maximum damage below the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.MaxDamageHPLowTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with a maximum damage value lower than the target’s current hp

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.HighestMinDamageTactic(**kwargs)[source]

Bases: MaxTactic, AttackTactic

Select the Attack with the highest minimum damage

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighMinDamageTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with minimum damage above the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.MinDamageHPHighTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with a minimum damage value greater than or equal to the target’s current hp

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.LowMinDamageTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with minimum damage below the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.MinDamageHPLowTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with a maximum damage value lower than or the target’s current hp

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.HighestAvgDamageTactic(**kwargs)[source]

Bases: MaxTactic, AttackTactic

Select the Attack with the highest average damage

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

item

Returns:

class DnD_5e.tactics.attack_tactics.HighAvgDamageTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with average damage above the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.AvgDamageHPHighTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with a maximum damage value greater than or equal to the target’s current hp

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.LowAvgDamageTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with average damage below the threshold

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

item

Returns:

class DnD_5e.tactics.attack_tactics.AvgDamageHPLowTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with an average damage value lower than the target’s current hp

check_condition(item, **kwargs)[source]
Parameters:
  • item (Attack) – the Attack to look at

  • target (Combatant) – the Combatant the attack will be made against

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.DprMaxTactic(**kwargs)[source]

Bases: MaxTactic, AttackTactic

Select the Attack with the highest dpr for the target (dpr is probability to hit * average damage)

get_value(item, **kwargs)[source]

Get the dpr for this Attack for the given target

Parameters:
  • item (Attack) – the Attack we are looking at

  • target (Combatant) – the Combatant we are trying to hit

Returns:

class DnD_5e.tactics.attack_tactics.DprHighTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with dpr (probability to hit the target * average damage) higher than threshold

calculate_threshold(**kwargs) float[source]

Calculate threshold using keyword arguments.

Parameters:

kwargs – passed on from constructor

Returns:

threshold

validate_threshold()[source]
Returns:

Raise:

ValueError if threshold is invalid

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

Check whether the given Attack has a dpr (probability to hit the target’s ac * average damage) higher than threshold

Parameters:

item (Attack) – the Attack we are looking at

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.DprHpHighTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with dpr (probability to hit the target * average damage) higher than the target’s current hp

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

Check whether the given Attack has a dpr (probability to hit the target’s ac * average damage) greater than or equal to the target’s current hp

Parameters:

item (Attack) – the Attack we are looking at

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.DprLowTactic(**kwargs)[source]

Bases: ThresholdTactic, ConditionTactic, AttackTactic

Select the Attack with dpr (probability to hit the target * average damage) lower than threshold

calculate_threshold(**kwargs) float[source]

Calculate threshold using keyword arguments.

Parameters:

kwargs – passed on from constructor

Returns:

threshold

validate_threshold()[source]
Returns:

Raise:

ValueError if threshold is invalid

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

Check whether the given Attack has a dpr (probability to hit the target’s ac * average damage) higher than threshold

Parameters:

item (Attack) – the Attack we are looking at

Returns:

True if the condition is met, False otherwise

class DnD_5e.tactics.attack_tactics.DprHpLowTactic(**kwargs)[source]

Bases: ConditionTactic, AttackTactic

Select the Attack with dpr (probability to hit the target * average damage) lower than the target’s current hp

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

Check whether the given Attack has a dpr (probability to hit the target’s ac * average damage) lower than the target’s current hp

Parameters:

item (Attack) – the Attack we are looking at

Returns:

True if the condition is met, False otherwise