diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index de788711..d94718e8 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -624,5 +624,27 @@ namespace EnchantTests testMonster.Hurt(10,testMonster.OnUpperLevel(),testMonster.GetZ(),HurtFlag::PLAYER_ABILITY); Assert::AreEqual(6,testMonster.GetHealth(),L"Monster should have taken 14 hitpoints of damage with the backstab bonus successfully applied."); } + TEST_METHOD(TumbleCheck){ + testKey->bHeld=true; //Force the key to be held down for testing purposes. + game->ChangePlayerClass(THIEF); + player=game->GetPlayer(); + player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput); + + const float originalIframeTime{"Thief.Right Click Ability.Iframe Time"_F}; + + Assert::AreEqual(originalIframeTime,player->GetIframeTime(),L"Iframe time should be normal."); + + const float originalMovespdIntensity{"Thief.Right Click Ability.Movespeed Buff"_f[0]/100.f}; + + Assert::AreEqual(originalMovespdIntensity,player->GetBuffs(BuffType::SPEEDBOOST)[0].intensity,L"Player should have a movespeed buff of the regular intensity."); + player->RemoveAllBuffs(); + player->GetRightClickAbility().charges=1; + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + nullRing.lock()->EnchantItem("Tumble"); + player->CheckAndPerformAbility(player->GetRightClickAbility(),testKeyboardInput); + Assert::AreEqual(originalIframeTime+"Thief.Right Click Ability.Iframe Time"_F*"Tumble"_ENC["BOOST PERCENTAGE"]/100.f,player->GetIframeTime(),L"Iframe time should be longer."); + Assert::AreEqual(originalMovespdIntensity+originalMovespdIntensity*"Tumble"_ENC["BOOST PERCENTAGE"]/100.f,player->GetBuffs(BuffType::SPEEDBOOST)[0].intensity,L"Player should have a movespeed buff with greater intensity."); + } }; } \ No newline at end of file diff --git a/Adventures in Lestoria/Thief.cpp b/Adventures in Lestoria/Thief.cpp index 305f7bb3..7be05b0d 100644 --- a/Adventures in Lestoria/Thief.cpp +++ b/Adventures in Lestoria/Thief.cpp @@ -109,11 +109,26 @@ void Thief::InitializeClassAbilities(){ [](Player*p,vf2d pos={}){ p->SetState(State::ROLL); p->rolling_timer="Thief.Right Click Ability.Roll Time"_F; - p->AddBuff(BuffType::SPEEDBOOST,"Thief.Right Click Ability.Movespeed Buff"_f[1],"Thief.Right Click Ability.Movespeed Buff"_f[0]/100.f); + + const float originalRollIntensity{"Thief.Right Click Ability.Movespeed Buff"_f[0]/100.f}; + float rollIntensity{originalRollIntensity}; + if(p->HasEnchant("Tumble"))rollIntensity+=originalRollIntensity*("Tumble"_ENC["BOOST PERCENTAGE"]/100.f); + + p->AddBuff(BuffType::SPEEDBOOST,"Thief.Right Click Ability.Movespeed Buff"_f[1],rollIntensity); geom2d::line mouseDir{p->GetPos(),p->GetWorldAimingLocation(Player::USE_WALK_DIR,Player::INVERTED)}; - float velocity=(0.5f*-p->friction*"Thief.Right Click Ability.Roll Time"_F*"Thief.Right Click Ability.Roll Time"_F-std::clamp(mouseDir.length(),24.f,24.f*"Thief.Right Click Ability.Max Roll Range"_F/100))/-"Thief.Right Click Ability.Roll Time"_F; //Derived from kinetic motion formula. + + const float originalRollRange{"Thief.Right Click Ability.Max Roll Range"_F/100}; + float rollRange{originalRollRange}; + if(p->HasEnchant("Tumble"))rollRange+=originalRollRange*("Tumble"_ENC["BOOST PERCENTAGE"]/100.f); + + float velocity=(0.5f*-p->friction*"Thief.Right Click Ability.Roll Time"_F*"Thief.Right Click Ability.Roll Time"_F-std::clamp(mouseDir.length(),24.f,24.f*rollRange))/-"Thief.Right Click Ability.Roll Time"_F; //Derived from kinetic motion formula. p->SetVelocity(mouseDir.vector().norm()*velocity); - p->ApplyIframes("Thief.Right Click Ability.Iframe Time"_F); + + const float originalIframeTime{"Thief.Right Click Ability.Iframe Time"_F}; + float iframeTime{originalIframeTime}; + if(p->HasEnchant("Tumble"))iframeTime+=originalIframeTime*"Tumble"_ENC["BOOST PERCENTAGE"]/100.f; + + p->ApplyIframes(iframeTime); p->footstepTimer=0.f; return true; }; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 40769f13..53109fa6 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 10944 +#define VERSION_BUILD 10947 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 21b0fcb0..954231a7 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ