diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index 30614e3d..3118a786 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -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_ptrnullRing{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."); + } }; } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 807e5e2a..482191da 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 11050 +#define VERSION_BUILD 11051 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/Warrior.cpp b/Adventures in Lestoria/Warrior.cpp index 8ae2bc1e..bb12c092 100644 --- a/Adventures in Lestoria/Warrior.cpp +++ b/Adventures in Lestoria/Warrior.cpp @@ -109,7 +109,8 @@ void Warrior::InitializeClassAbilities(){ rightClickAbility.cooldown=rightClickAbility.COOLDOWN_TIME; p->SetState(State::BLOCK); p->blockTimer="Warrior.Right Click Ability.Duration"_F; - p->AddBuff(BuffType::BLOCK_SLOWDOWN,"Warrior.Right Click Ability.Duration"_F,"Warrior.Right Click Ability.SlowAmt"_F); + if(p->HasEnchant("Heavy Guard"))p->blockTimer*="Heavy Guard"_ENC["BLOCK DURATION MULT"]; + p->AddBuff(BuffType::BLOCK_SLOWDOWN,p->blockTimer,"Warrior.Right Click Ability.SlowAmt"_F); return true; } return false;