def weapon_attack(self, target_ac): """ Single weapon attack. :param target_ac: AC of target creature. :return: Damage caused by attack. """ probability = calculate_accuracy(target_ac, self.to_hit_modifier) average_damage = calculate_average_damage(8) + self.damage_modifier return probability * average_damage
def sharpshooter_attack_favoured(self, target_ac): """ Single sharpshooter attack. :param target_ac: AC of target creature. :return: Damage caused by attack. """ probability = calculate_accuracy(target_ac, self.to_hit_modifier - 5) average_damage = calculate_average_damage(8) + self.damage_modifier + 10 + self.favoured_bonus return probability * average_damage
def booming_blade(self, target_ac): """ Booming blade cantrip. :param target_ac: AC of target creature. :return: Damage caused by attack. """ probability = calculate_accuracy(target_ac, self.to_hit_modifier) average_damage = (calculate_average_damage(8) * 4) + self.damage_modifier return probability * average_damage