Lingering Scent enchant implemented.

mac-build
sigonasr2 4 months ago
parent 33ce153bc8
commit f717abfa54
  1. 28
      Adventures in Lestoria Tests/EnchantTests.cpp
  2. 4
      Adventures in Lestoria/BearTrap.cpp
  3. 2
      Adventures in Lestoria/Version.h
  4. 2
      Adventures in Lestoria/assets/config/items/ItemEnchants.txt

@ -43,6 +43,7 @@ All rights reserved.
#include "ItemDrop.h" #include "ItemDrop.h"
#include "DamageNumber.h" #include "DamageNumber.h"
#include <ranges> #include <ranges>
#include "BulletTypes.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework; using namespace Microsoft::VisualStudio::CppUnitTestFramework;
using namespace olc::utils; using namespace olc::utils;
@ -921,5 +922,32 @@ namespace EnchantTests
Assert::AreEqual(uint8_t(2),Trapper::ability2.MAX_CHARGES,L"Trap Collector enchant increases Bear Trap charges to two."); Assert::AreEqual(uint8_t(2),Trapper::ability2.MAX_CHARGES,L"Trap Collector enchant increases Bear Trap charges to two.");
Assert::AreEqual(uint8_t(2),Trapper::ability3.MAX_CHARGES,L"Trap Collector enchant increases Explosive Trap charges to two."); Assert::AreEqual(uint8_t(2),Trapper::ability3.MAX_CHARGES,L"Trap Collector enchant increases Explosive Trap charges to two.");
} }
TEST_METHOD(LingeringScentNoEnchantCheck){
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"])};
player->CheckAndPerformAbility(player->GetAbility2(),testKeyboardInput);
game->SetElapsedTime(0.5f);
game->OnUserUpdate(0.5f);
BearTrap trap{*(BearTrap*)BULLET_LIST.back().get()};
trap.MonsterHit(newMonster,1); //Simulate 1 mark stack on the monster to trigger the bleed.
Assert::AreEqual("Trapper.Ability 2.Marked Target Bleed"_f[1],newMonster.GetBuffs(BuffType::OVER_TIME)[0].duration,L"Bleed duration should be 10 seconds by default.");
}
TEST_METHOD(LingeringScentEnchantCheck){
testKey->bHeld=true; //Force the key to be held down for testing purposes.
game->ChangePlayerClass(TRAPPER);
player=game->GetPlayer();
std::weak_ptr<Item>nullRing{Inventory::AddItem("Null Ring"s)};
Inventory::EquipItem(nullRing,EquipSlot::RING1);
nullRing.lock()->EnchantItem("Lingering Scent");
Monster&newMonster{game->SpawnMonster({},MONSTER_DATA["TestName"])};
player->CheckAndPerformAbility(player->GetAbility2(),testKeyboardInput);
game->SetElapsedTime(0.5f);
game->OnUserUpdate(0.5f);
BearTrap trap{*(BearTrap*)BULLET_LIST.back().get()};
trap.MonsterHit(newMonster,1); //Simulate 1 mark stack on the monster to trigger the bleed.
Assert::AreEqual("Trapper.Ability 2.Marked Target Bleed"_f[1]+"Lingering Scent"_ENC["BLEED EXTRA DURATION"],newMonster.GetBuffs(BuffType::OVER_TIME)[0].duration,L"Bleed duration should be 10 seconds by default.");
}
}; };
} }

@ -63,9 +63,11 @@ BulletDestroyState BearTrap::MonsterHit(Monster&monster,const uint8_t markStacks
animation.ChangeState(internal_animState,"bear_trap.png"); animation.ChangeState(internal_animState,"bear_trap.png");
const float bleedDamage{"Trapper.Ability 2.Marked Target Bleed"_f[0]/100.f*game->GetPlayer()->GetAttack()}; const float bleedDamage{"Trapper.Ability 2.Marked Target Bleed"_f[0]/100.f*game->GetPlayer()->GetAttack()};
const float bleedDuration{"Trapper.Ability 2.Marked Target Bleed"_f[1]}; float bleedDuration{"Trapper.Ability 2.Marked Target Bleed"_f[1]};
const float timeBetweenTicks{"Trapper.Ability 2.Marked Target Bleed"_f[2]}; const float timeBetweenTicks{"Trapper.Ability 2.Marked Target Bleed"_f[2]};
if(game->GetPlayer()->HasEnchant("Lingering Scent"))bleedDuration+="Lingering Scent"_ENC["BLEED EXTRA DURATION"];
if(markStacksBeforeHit>0){ if(markStacksBeforeHit>0){
const uint8_t resetStackCount{uint8_t("Trapper.Ability 2.Marked Target Stack Count Reset"_I+1U)}; //Add an additional stack because we know the target hit is about to lose one stack. const uint8_t resetStackCount{uint8_t("Trapper.Ability 2.Marked Target Stack Count Reset"_I+1U)}; //Add an additional stack because we know the target hit is about to lose one stack.
const uint8_t numberOfStacksToReplenish{uint8_t(resetStackCount-monster.GetMarkStacks())}; const uint8_t numberOfStacksToReplenish{uint8_t(resetStackCount-monster.GetMarkStacks())};

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 3 #define VERSION_PATCH 3
#define VERSION_BUILD 11021 #define VERSION_BUILD 11022
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -276,7 +276,7 @@ Item Enchants
} }
Lingering Scent Lingering Scent
{ {
Description = "Bleed lasts for {BLEED EXTRA DURATION} seconds longer." Description = "Bear Trap's bleed effect lasts for {BLEED EXTRA DURATION} seconds longer."
Affects = Ability 2 Affects = Ability 2
BLEED EXTRA DURATION = 10s BLEED EXTRA DURATION = 10s

Loading…
Cancel
Save