Ejemplo n.º 1
0
def test_fight_from_distance():
    actor = Actor(0)
    enemy = Actor(1)
    enemy.health_points = enemy.unit_max()
    actor.location[0] = 50
    actor.location[1] = 40
    enemy.location[0] = 50
    enemy.location[1] = 50
    weapon_range = 10
    weapon = 25
    assert actor.fight_from_distance(enemy, weapon_range, weapon) == 25
    weapon_range = 1
    assert actor.fight_from_distance(enemy, weapon_range, weapon) == 0
Ejemplo n.º 2
0
 def fight(self, enemy) -> int:
     damage = Actor.fight_from_distance(self, enemy, self.range,
                                        self.bow_strength)
     return damage
Ejemplo n.º 3
0
 def fight(self, enemy) -> int:
     damage = Actor.fight_from_distance(self, enemy, self.intelligence,
                                        self.magic)
     return damage