|
|
|
@ -1136,5 +1136,30 @@ namespace EnchantTests |
|
|
|
|
game->OnUserUpdate(5.f); |
|
|
|
|
Assert::IsTrue(newMonster.CanMove(),L"Monster should no longer be stunned."); |
|
|
|
|
} |
|
|
|
|
TEST_METHOD(SonicUpgradeNoEnchantCheck){ |
|
|
|
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
|
|
|
|
Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])}; |
|
|
|
|
Assert::AreEqual("Warrior.Ability 3.Cooldown"_F,player->GetAbility3().GetCooldownTime(),L"Player's Sonic Slash cooldown time is normal."); |
|
|
|
|
Assert::AreEqual("Warrior.Ability 3.Mana Cost"_I,player->GetAbility3().manaCost,L"Player's Sonic Slash mana cost is normal."); |
|
|
|
|
testGame->OnUserUpdate(0.f); |
|
|
|
|
player->CheckAndPerformAbility(player->GetAbility3(),testKeyboardInput); |
|
|
|
|
testGame->SetElapsedTime(0.5f); |
|
|
|
|
testGame->OnUserUpdate(0.5f); |
|
|
|
|
Assert::AreEqual(920,newMonster.GetHealth(),L"Monster has taken the normal amount of 80 health."); |
|
|
|
|
} |
|
|
|
|
TEST_METHOD(SonicUpgradeEnchantCheck){ |
|
|
|
|
testKey->bHeld=true; //Force the key to be held down for testing purposes.
|
|
|
|
|
Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])}; |
|
|
|
|
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)}; |
|
|
|
|
Inventory::EquipItem(nullRing,EquipSlot::RING1); |
|
|
|
|
nullRing.lock()->EnchantItem("Sonic Upgrade"); |
|
|
|
|
Assert::AreEqual("Warrior.Ability 3.Cooldown"_F*0.85f,player->GetAbility3().GetCooldownTime(),L"Player's Sonic Slash cooldown time is normal."); |
|
|
|
|
Assert::AreEqual(int("Warrior.Ability 3.Mana Cost"_I*0.85f),player->GetAbility3().manaCost,L"Player's Sonic Slash mana cost is normal."); |
|
|
|
|
testGame->OnUserUpdate(0.f); |
|
|
|
|
player->CheckAndPerformAbility(player->GetAbility3(),testKeyboardInput); |
|
|
|
|
testGame->SetElapsedTime(0.5f); |
|
|
|
|
testGame->OnUserUpdate(0.5f); |
|
|
|
|
Assert::AreEqual(910,newMonster.GetHealth(),L"Monster now takes 90 health with the Sonic Upgrade (10% of player's Max HP)."); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|