예제 #1
0
 def test_using_versatile_two_handed(self):
     attacker = Player('Bob', [10, 10, 10, 10, 10, 10], Human(), Fighter())
     attacker.set_two_hands(weapons[WeaponId.SPEAR])
     d = roll_damage(attacker, None, attacker.get_two_hands(), HitType.HIT,
                     None)
     # kind of lame, not always going to fail, not sure how else to be sure
     # TODO: could be solved by a debugging option to focus dice to roll max then check for 8
     self.assertTrue(1 <= d <= 8)
예제 #2
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))
예제 #3
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))
예제 #4
0
 def test_spear_two_hands(self):
     player = Player('bob', [10, 10, 10, 10, 10, 10], Human(), Fighter())
     player.set_two_hands(weapons[WeaponId.SPEAR])
     self.assertEqual(WeaponId.SPEAR, player.get_two_hands().get_id())
예제 #5
0
 def test_two_hands(self):
     player = Player('bob', [10, 10, 10, 10, 10, 10], Human(), Fighter())
     player.set_right_hand(armors[ArmorId.SHIELD])
     player.set_two_hands(weapons[WeaponId.MAUL])
     self.assertIsNone(player.get_right_hand())
     self.assertEqual(WeaponId.MAUL, player.get_two_hands().get_id())