Beispiel #1
0
 def test_fs_defence_no_armor(self):
     attacker = Player('Bob', [10, 10, 17, 17, 17, 17], Human(), Fighter())
     target = Player('Other Bob', [10, 10, 17, 17, 17, 17], Human(), Fighter())
     target.add_fighting_style(Trait.FIGHTING_STYLE_DEFENCE)
     set_values([8])
     with patch('game_engine.dice._random_int', side_effect=value):
         self.assertEqual(roll_to_hit(attacker, target, weapons[WeaponId.DAGGER], None), HitType.HIT)
Beispiel #2
0
 def test_fs_archery(self):
     attacker = Player('Bob', [10, 10, 17, 17, 17, 17], Human(), Fighter())
     attacker.add_fighting_style(Trait.FIGHTING_STYLE_ARCHERY)
     target = Goblin()
     set_values([11])
     with patch('game_engine.dice._random_int', side_effect=value):
         self.assertEqual(roll_to_hit(attacker, target, weapons[WeaponId.SHORTBOW], None), HitType.HIT)
Beispiel #3
0
 def test_fs_greatweapon(self):
     attacker = Player('Bob', [10, 10, 10, 10, 10, 10], Human(), Fighter())
     attacker.set_two_hands(weapons[WeaponId.LONGSWORD])
     attacker.add_fighting_style(Trait.FIGHTING_STYLE_GREAT_WEAPON_FIGHTING)
     set_values([1, 10])
     with patch('game_engine.dice._random_int', side_effect=value):
         self.assertEqual(
             10,
             roll_damage(attacker, None, attacker.get_two_hands(),
                         HitType.HIT, None))
Beispiel #4
0
 def test_fs_dueling_two_handed(self):
     attacker = Player('Bob', [10, 10, 10, 10, 10, 10], Human(), Fighter())
     attacker.set_two_hands(weapons[WeaponId.SPEAR])
     attacker.add_fighting_style(Trait.FIGHTING_STYLE_DUELING)
     set_values([6])
     with patch('game_engine.dice._random_int', side_effect=value):
         self.assertEqual(
             6,
             roll_damage(attacker, None, attacker.get_two_hands(),
                         HitType.HIT, None))