|
|
|
@ -1053,5 +1053,26 @@ namespace EnchantTests |
|
|
|
|
game->OnUserUpdate(0.f); |
|
|
|
|
Assert::AreEqual(973,newMonster.GetHealth(),L"Monsters take extra damage from defense from Improved Ground Slam."); |
|
|
|
|
} |
|
|
|
|
TEST_METHOD(HeavyGuardNoEnchantCheck){ |
|
|
|
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
|
|
|
|
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput); |
|
|
|
|
player->Hurt(5,player->OnUpperLevel(),player->GetZ()); |
|
|
|
|
Assert::AreEqual(100,player->GetHealth(),L"Player does not take damage while blocking."); |
|
|
|
|
game->SetElapsedTime(4.f); |
|
|
|
|
game->OnUserUpdate(4.f); |
|
|
|
|
player->Hurt(5,player->OnUpperLevel(),player->GetZ()); |
|
|
|
|
Assert::AreEqual(95,player->GetHealth(),L"Player takes normal damage once block expires."); |
|
|
|
|
} |
|
|
|
|
TEST_METHOD(HeavyGuardEnchantCheck){ |
|
|
|
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
|
|
|
|
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)}; |
|
|
|
|
Inventory::EquipItem(nullRing,EquipSlot::RING1); |
|
|
|
|
nullRing.lock()->EnchantItem("Heavy Guard"); |
|
|
|
|
player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput); |
|
|
|
|
game->SetElapsedTime(5.f); |
|
|
|
|
game->OnUserUpdate(5.f); |
|
|
|
|
player->Hurt(5,player->OnUpperLevel(),player->GetZ()); |
|
|
|
|
Assert::AreEqual(100,player->GetHealth(),L"Player should still be blocking at this time with Heavy Guard."); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|