Esempio n. 1
0
 def test_goblin_attack_player(self):
     attacker = Goblin()
     target = Player('Bob', [10, 10, 10, 10, 10, 10], Human(), Fighter())
     target.set_armor(armors[ArmorId.CHAIN_SHIRT])
     target.set_left_hand(armors[ArmorId.SHIELD])
     set_values([11])
     with patch('game_engine.dice._random_int', side_effect=value):
         self.assertEqual(roll_to_hit(attacker, target, attacker.get_actions()[0], None), HitType.HIT)
Esempio n. 2
0
 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))
Esempio n. 3
0
 def test_replace(self):
     player = Player('bob', [10, 10, 10, 10, 10, 10], Human(), Rogue())
     player.set_right_hand(weapons[WeaponId.RAPIER])
     player.set_left_hand(armors[ArmorId.SHIELD])
     player.set_left_hand(weapons[WeaponId.DAGGER])
     self.assertEqual(WeaponId.DAGGER, player.get_left_hand().get_id())
Esempio n. 4
0
 def test_left_shield(self):
     player = Player('bob', [10, 10, 10, 10, 10, 10], Human(), Rogue())
     player.set_left_hand(armors[ArmorId.SHIELD])
     self.assertEqual(ArmorType.SHIELD, player.get_shield().get_type())