Ejemplo n.º 1
0
 def test_blood_fangs_base_healing(self):
     error = "Blood Fangs didn't recover 10% health baseline"
     elemental = CombatElementalBuilder().build()
     action = ElementalAction(actor=elemental,
                              ability=BloodFangs(),
                              combat=self.get_mocked_combat())
     action._refresh_target()
     action.execute()
     self.assertEqual(0.1, action.total_healing / elemental.max_hp, error)
Ejemplo n.º 2
0
 def test_blood_fangs_scaled_healing(self):
     error = "Blood Fangs didn't scale with missing health"
     elemental = CombatElementalBuilder().build()
     elemental.receive_damage(20, Mock())
     action = ElementalAction(actor=elemental,
                              ability=BloodFangs(),
                              combat=self.get_mocked_combat())
     action._refresh_target()
     action.execute()
     self.assertGreater(action.total_healing / elemental.max_hp, 0.1, error)
Ejemplo n.º 3
0
 def test_mana_consumption(self):
     error = "Mana-consuming ability didn't consume mana"
     elemental = CombatElementalBuilder().build()
     previous_mana = elemental.current_mana
     action = ElementalAction(actor=elemental,
                              ability=RazorFangs(),
                              combat=self.get_mocked_combat())
     action._refresh_target()
     action.execute()
     self.assertLess(elemental.current_mana, previous_mana, error)
Ejemplo n.º 4
0
 def test_defend_charge(self):
     error = "Defend didn't use a defend charge"
     elemental = CombatElementalBuilder().build()
     previous_charges = elemental.defend_charges
     action = ElementalAction(actor=elemental,
                              ability=Defend(),
                              combat=self.get_mocked_combat())
     action._refresh_target()
     action.execute()
     self.assertEqual(elemental.defend_charges, (previous_charges - 1),
                      error)
Ejemplo n.º 5
0
 def test_blood_fangs_healing(self):
     error = "Blood Fangs didn't heal the actor"
     elemental = CombatElementalBuilder().build()
     elemental.receive_damage(10, Mock())
     hp_before = elemental.current_hp
     action = ElementalAction(actor=elemental,
                              ability=BloodFangs(),
                              combat=self.get_mocked_combat())
     action._refresh_target()
     action.execute()
     hp_after = elemental.current_hp
     self.assertGreater(hp_after, hp_before, error)
Ejemplo n.º 6
0
 def test_enrage(self):
     error = "Enrage didn't increase damage output"
     elemental = CombatElementalBuilder().build()
     combat = get_mocked_combat()
     combat.get_target = MagicMock(
         return_value=CombatElementalBuilder().build())
     before_buff = ElementalAction(elemental, Claw(), combat)
     before_buff._refresh_target()
     before_buff.execute()
     elemental.add_status_effect(EnrageEffect())
     elemental.end_turn()
     after_buff = ElementalAction(elemental, Claw(), combat)
     after_buff._refresh_target()
     after_buff.execute()
     self.assertGreater(after_buff.final_damage, before_buff.final_damage,
                        error)