diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index fc909df9..2580a977 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -524,5 +524,21 @@ namespace EnchantTests } Assert::AreEqual(0.f,player->GetAutoAttackTimer(),L"The auto attack timer should have been reset at some point."); } + TEST_METHOD(StealthyRetreatCheck){ + game->ChangePlayerClass(RANGER); + player=game->GetPlayer(); + testKey->bHeld=true; //Force the key to be held down for testing purposes. + player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput); + Assert::AreEqual("Ranger.Right Click Ability.RetreatTime"_F,player->GetIframeTime(),L"Ranger's retreat iframe time is normal."); + player->_SetIframes(0.f); + player->GetRightClickAbility().cooldown=0.f; + player->SetState(State::NORMAL); + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + nullRing.lock()->EnchantItem("Stealthy Retreat"); + player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput); + Assert::AreEqual("Ranger.Right Click Ability.RetreatTime"_F+"Stealthy Retreat"_ENC["INVULNERABILITY INCREASE"],player->GetIframeTime(),L"Ranger's retreat iframe time is much greater."); + + } }; } \ No newline at end of file diff --git a/Adventures in Lestoria/Ranger.cpp b/Adventures in Lestoria/Ranger.cpp index d762ea04..24342558 100644 --- a/Adventures in Lestoria/Ranger.cpp +++ b/Adventures in Lestoria/Ranger.cpp @@ -87,7 +87,14 @@ void Ranger::InitializeClassAbilities(){ float velocity=(0.5f*-p->friction*p->RETREAT_TIME*p->RETREAT_TIME-p->RETREAT_DISTANCE)/-p->RETREAT_TIME; //Derived from kinetic motion formula. p->SetVelocity(mouseDir.vector().norm()*velocity); p->retreatTimer=p->RETREAT_TIME; - p->ApplyIframes(p->RETREAT_TIME); + + float finalIframeTime{p->RETREAT_TIME}; + if(p->HasEnchant("Stealthy Retreat")){ + finalIframeTime+="Stealthy Retreat"_ENC["INVULNERABILITY INCREASE"]; + game->ShowDamageVignetteOverlay("Item Enchants.Class Enchants.Ranger.Stealthy Retreat.VIGNETTE COLOR"_Pixel); + } + + p->ApplyIframes(finalIframeTime); p->ghostPositions.push_back(p->GetPos()+vf2d{0,-p->GetZ()}); p->ghostFrameTimer=p->RETREAT_GHOST_FRAME_DELAY; p->ghostRemoveTimer=p->RETREAT_GHOST_FRAMES*p->RETREAT_GHOST_FRAME_DELAY; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index c59adc0f..c5ce78e1 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 10801 +#define VERSION_BUILD 10803 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt index e9080ec9..58f31321 100644 --- a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt +++ b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt @@ -89,6 +89,7 @@ Item Enchants Affects = Right Click Ability INVULNERABILITY INCREASE = 2.0s + VIGNETTE COLOR = 0r, 0g, 64b, 255a # Stat, Lowest, Highest Value # Stat Modifier[0] = ..., 0, 0 diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 8dc37bc0..9d677d72 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ