def test_using_versatile_one_handed(self): attacker = Player('Bob', [10, 10, 10, 10, 10, 10], Human(), Fighter()) attacker.set_right_hand(weapons[WeaponId.SPEAR]) d = roll_damage(attacker, None, attacker.get_right_hand(), 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 6 self.assertTrue(1 <= d <= 6)
def test_fs_dueling_shield(self): attacker = Player('Bob', [10, 10, 10, 10, 10, 10], Human(), Fighter()) attacker.set_right_hand(weapons[WeaponId.SPEAR]) attacker.set_left_hand(armors[ArmorId.SHIELD]) attacker.add_fighting_style(Trait.FIGHTING_STYLE_DUELING) set_values([6]) with patch('game_engine.dice._random_int', side_effect=value): self.assertEqual( 8, roll_damage(attacker, None, attacker.get_right_hand(), HitType.HIT, None))
def test_spear_one_hand(self): player = Player('bob', [10, 10, 10, 10, 10, 10], Human(), Fighter()) player.set_right_hand(weapons[WeaponId.SPEAR]) self.assertEqual(WeaponId.SPEAR, player.get_right_hand().get_id())
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())