diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index 5a0d4ba6..d0593dea 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -842,5 +842,38 @@ namespace EnchantTests player->ReduceAutoAttackTimer(INFINITE); player->AutoAttack(); } + TEST_METHOD(EnfeebledTargetNoEnchantCheck){ + testKey->bHeld=true; //Force the key to be held down for testing purposes. + game->ChangePlayerClass(TRAPPER); + player=game->GetPlayer(); + Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])}; + game->SetElapsedTime(0.01f); + game->OnUserUpdate(0.01f); + player->_ForceCastSpell(player->GetAbility1()); + game->SetElapsedTime("Trapper.Ability 1.Precast Time"_F); + game->OnUserUpdate("Trapper.Ability 1.Precast Time"_F); + game->SetElapsedTime(0.6f); //Wait for mark lock-on + game->OnUserUpdate(0.6f); //Wait for mark lock-on + Assert::AreEqual(2.f,newMonster.GetMoveSpdMult(),L"Move Spd Multiplier should not be reduced by 30%"); + Assert::AreEqual(10,newMonster.GetAttack(),L"Monster Attack damage should not be reduced."); + } + TEST_METHOD(EnfeebledTargetEnchantCheck){ + testKey->bHeld=true; //Force the key to be held down for testing purposes. + game->ChangePlayerClass(TRAPPER); + player=game->GetPlayer(); + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + nullRing.lock()->EnchantItem("Enfeebled Target"); + Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])}; + game->SetElapsedTime(0.01f); + game->OnUserUpdate(0.01f); + player->_ForceCastSpell(player->GetAbility1()); + game->SetElapsedTime("Trapper.Ability 1.Precast Time"_F); + game->OnUserUpdate("Trapper.Ability 1.Precast Time"_F); + game->SetElapsedTime(0.6f); //Wait for mark lock-on + game->OnUserUpdate(0.6f); //Wait for mark lock-on + Assert::AreEqual(1.4f,newMonster.GetMoveSpdMult(),L"Move Spd Multiplier should be reduced by 30%"); + Assert::AreEqual(8,newMonster.GetAttack(),L"Monster Attack damage should be reduced."); + } }; } \ No newline at end of file diff --git a/Adventures in Lestoria Tests/MonsterTests.cpp b/Adventures in Lestoria Tests/MonsterTests.cpp index 9785fdd2..1fccf69a 100644 --- a/Adventures in Lestoria Tests/MonsterTests.cpp +++ b/Adventures in Lestoria Tests/MonsterTests.cpp @@ -396,7 +396,7 @@ namespace MonsterTests testMonster.Hurt(10,testMonster.OnUpperLevel(),testMonster.GetZ(),HurtFlag::DOT); Assert::AreEqual(10,testMonster.GetHealth(),L"A DOT should go through all sources of iframes."); Assert::AreEqual(2,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr&damageNumber){ - if(damageNumber->type==DamageNumberType::DOT)return count+1; + if(damageNumber->GetType()==DamageNumberType::DOT)return count+1; else return count; }) ,L"There should be 2 damage numbers of type DOT."); diff --git a/Adventures in Lestoria Tests/PlayerTests.cpp b/Adventures in Lestoria Tests/PlayerTests.cpp index 5240e1f9..190d1689 100644 --- a/Adventures in Lestoria Tests/PlayerTests.cpp +++ b/Adventures in Lestoria Tests/PlayerTests.cpp @@ -610,7 +610,7 @@ namespace PlayerTests player->Hurt(20,player->OnUpperLevel(),player->GetZ(),HurtFlag::DOT); Assert::AreEqual(80,player->GetHealth(),L"Player should take 20 damage through a DOT."); Assert::AreEqual(1,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr&damageNumber){ - if(damageNumber->type==DamageNumberType::DOT)return count+1; + if(damageNumber->GetType()==DamageNumberType::DOT)return count+1; else return count; }) ,L"There should be a damage number of type DOT."); @@ -619,7 +619,7 @@ namespace PlayerTests player->Hurt(20,player->OnUpperLevel(),player->GetZ(),HurtFlag::DOT); Assert::AreEqual(80,player->GetHealth(),L"Player should take 20 damage through a DOT even when iframes are on."); //HP Recovery/4s set effect has restored the health of the player to 100. So it should go back down to 80. Assert::AreEqual(2,std::accumulate(DAMAGENUMBER_LIST.begin(),DAMAGENUMBER_LIST.end(),0,[](int count,const std::shared_ptr&damageNumber){ - if(damageNumber->type==DamageNumberType::DOT)return count+1; + if(damageNumber->GetType()==DamageNumberType::DOT)return count+1; else return count; }) ,L"There should be 2 damage numbers of type DOT."); diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index fe7703f5..9a4bf7b6 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -4421,6 +4421,10 @@ void AiL::GlobalGameUpdates(){ const auto&[monster,stackCount,time]=lockOnTargets.front(); if(!monster.expired()){ monster.lock()->AddBuff(BuffType::TRAPPER_MARK,time,stackCount); + if(game->GetPlayer()->HasEnchant("Enfeebled Target")){ + monster.lock()->AddBuff(BuffType::SLOWDOWN,time,"Enfeebled Target"_ENC["SLOW PCT"]/100.f); + monster.lock()->AddBuff(BuffType::STAT_UP,time,-"Enfeebled Target"_ENC["DAMAGE REDUCTION PCT"]/100.f,{"Attack %"}); + } SoundEffect::PlaySFX("Lock On",monster.lock()->GetPos()); lastLockOnTargetTime=0.2f; } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 58a3a2b8..e770e8a4 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 11014 +#define VERSION_BUILD 11017 #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 7412356d..5c786666 100644 --- a/Adventures in Lestoria/assets/config/items/ItemEnchants.txt +++ b/Adventures in Lestoria/assets/config/items/ItemEnchants.txt @@ -248,7 +248,7 @@ Item Enchants Description = "Marked targets are slowed by {SLOW PCT}% and deal {DAMAGE REDUCTION PCT}% less damage." Affects = Ability 1 - SLOT PCT = 30% + SLOW PCT = 30% DAMAGE REDUCTION PCT = 20% # Stat, Lowest, Highest Value diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 7bad2270..43402916 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ