diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index eb90f4c7..476377e3 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -229,5 +229,16 @@ namespace EnchantTests Assert::AreEqual(0.0875f,player->GetAttackRecoveryRateReduction(),L"Lethal Tempo buff should cap at 5 stacks."); Assert::AreEqual(size_t(1),player->GetBuffs(BuffType::LETHAL_TEMPO).size(),L"Lethal Tempo buff is active."); } + TEST_METHOD(SecondWindCheck){ + Assert::AreEqual(0.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is 0% at the start."); + player->Hurt(90,player->OnUpperLevel(),player->GetZ()); + Assert::AreEqual(0.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is still 0% without Second Wind."); + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + nullRing.lock()->EnchantItem("Second Wind"); + Assert::AreEqual(1.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is now 1% with low health with Second Wind."); + player->Heal(11); + Assert::AreEqual(0.0_Pct,player->GetHPRecoveryPct(),L"HP Recovery Pct is now 0% since Second Wind should no longer activate above 20% health."); + } }; } \ No newline at end of file diff --git a/Adventures in Lestoria.sln b/Adventures in Lestoria.sln index 7fd217ba..da969708 100644 --- a/Adventures in Lestoria.sln +++ b/Adventures in Lestoria.sln @@ -43,8 +43,8 @@ Global {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x64.Build.0 = Release Desktop|x64 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.ActiveCfg = Release Desktop|Win32 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.Build.0 = Release Desktop|Win32 - {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.ActiveCfg = Unit Testing|x64 - {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.Build.0 = Unit Testing|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.ActiveCfg = Release Desktop|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x64.Build.0 = Release Desktop|x64 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x86.ActiveCfg = Unit Testing|Win32 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Unit Testing|x86.Build.0 = Unit Testing|Win32 {11969B7B-3D50-4825-9584-AF01D15B88E0}.Debug|x64.ActiveCfg = Unit Testing|x64 diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 3cc1b274..8c2bd866 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1460,6 +1460,7 @@ const float Player::GetCritDmgPct()const{ const float Player::GetHPRecoveryPct()const{ float modHPRecoveryPct=0; modHPRecoveryPct+=GetEquipStat("HP Recovery %")/100; + if(HasEnchant("Second Wind")&&GetHealthRatio()<="Second Wind"_ENC["HP BELOW THRESHOLD"]/100.f)modHPRecoveryPct+="Second Wind"_ENC["HP RECOVERY PCT"]/100.f; return modHPRecoveryPct; } const float Player::GetHP6RecoveryPct()const{ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 15092f8b..4f0e20a8 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 10635 +#define VERSION_BUILD 10646 #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 b077e68f..2aa9b0cf 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ