diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index 7f9664bb..30614e3d 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -1028,5 +1028,30 @@ namespace EnchantTests game->OnUserUpdate(8.f); Assert::AreEqual(1.5f,player->GetAttackRange(),L"Attack range of Warrior is normal again."); } + TEST_METHOD(ImprovedGroundSlamNoEnchantCheck){ + testKey->bHeld=true; //Force the key to be held down for testing purposes. + player->CheckAndPerformAbility(player->GetAbility2(),testKeyboardInput); + Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])}; + game->OnUserUpdate(0.f); + game->SetElapsedTime(1.f); + game->OnUserUpdate(1.f); + game->OnUserUpdate(0.f); + Assert::AreEqual(975,newMonster.GetHealth(),L"Monsters take normal damage from Ground Slam."); + } + TEST_METHOD(ImprovedGroundSlamEnchantCheck){ + testKey->bHeld=true; //Force the key to be held down for testing purposes. + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + std::weak_ptrleatherArmor{Inventory::AddItem("Leather Armor"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + Inventory::EquipItem(leatherArmor,EquipSlot::ARMOR); + nullRing.lock()->EnchantItem("Improved Ground Slam"); + player->CheckAndPerformAbility(player->GetAbility2(),testKeyboardInput); + Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])}; + game->OnUserUpdate(0.f); + game->SetElapsedTime(1.f); + game->OnUserUpdate(1.f); + game->OnUserUpdate(0.f); + Assert::AreEqual(973,newMonster.GetHealth(),L"Monsters take extra damage from defense from Improved Ground Slam."); + } }; } diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 07883859..60b7be0d 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -465,7 +465,15 @@ void Player::Update(float fElapsedTime){ spin_angle=0; z=0; float numb=4; - const HurtList&hitEnemies=game->Hurt(pos,"Warrior.Ability 2.Range"_F/100*12,int(GetAttack()*"Warrior.Ability 2.DamageMult"_F),OnUpperLevel(),0,HurtType::MONSTER,HurtFlag::PLAYER_ABILITY); + float groundSlamVisualRange{"Warrior.Ability 2.Range"_F/300*1.33f}; + float groundSlamRange{"Warrior.Ability 2.Range"_F/100*12}; + int groundSlamDamage{int(GetAttack()*"Warrior.Ability 2.DamageMult"_F)}; + if(HasEnchant("Improved Ground Slam")){ + groundSlamVisualRange+=groundSlamVisualRange*"Improved Ground Slam"_ENC["GROUND SLAM RADIUS INCREASE"]/100.f; + groundSlamRange+=groundSlamRange*"Improved Ground Slam"_ENC["GROUND SLAM RADIUS INCREASE"]/100.f; + groundSlamDamage+=GetDefense()*"Improved Ground Slam"_ENC["DEFENSE DAMAGE"]/100.f; + } + const HurtList&hitEnemies=game->Hurt(pos,groundSlamRange,groundSlamDamage,OnUpperLevel(),0,HurtType::MONSTER,HurtFlag::PLAYER_ABILITY); #pragma region Knockback effect for(auto&[targetPtr,wasHurt]:hitEnemies){ if(!std::holds_alternative(targetPtr))ERR("WARNING! A hurt request list was expecting only monster pointers, but got another type instead! THIS SHOULD NOT BE HAPPENING!"); @@ -483,7 +491,7 @@ void Player::Update(float fElapsedTime){ monsterPtr->Knockback(vf2d{knockbackAmt,knockbackDir}.cart()); } #pragma endregion - game->AddEffect(std::make_unique(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-front.png",upperLevel,"Warrior.Ability 2.Range"_F/300*1.33f,"Warrior.Ability 2.EffectFadetime"_F),std::make_unique(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-back.png",upperLevel,"Warrior.Ability 2.Range"_F/300*1.33f,"Warrior.Ability 2.EffectFadetime"_F)); + game->AddEffect(std::make_unique(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-front.png",upperLevel,groundSlamVisualRange,"Warrior.Ability 2.EffectFadetime"_F),std::make_unique(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-back.png",upperLevel,groundSlamVisualRange,"Warrior.Ability 2.EffectFadetime"_F)); SoundEffect::PlaySFX("Warrior Ground Slam",SoundEffect::CENTERED); } if(lastAnimationFlip>0){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 1fbf020d..807e5e2a 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 11048 +#define VERSION_BUILD 11050 #define stringify(a) stringify_(a) #define stringify_(a) #a