diff --git a/Adventures in Lestoria Tests/EnchantTests.cpp b/Adventures in Lestoria Tests/EnchantTests.cpp index 062b7fc1..64c38838 100644 --- a/Adventures in Lestoria Tests/EnchantTests.cpp +++ b/Adventures in Lestoria Tests/EnchantTests.cpp @@ -906,5 +906,20 @@ namespace EnchantTests game->OnUserUpdate(0.f); //Wait for mark lock-on Assert::AreEqual(20.f,newMonster.GetBuffs(BuffType::TRAPPER_MARK)[0].duration,L"Mark duration is increased greatly."); } + TEST_METHOD(TrapCollectorNoEnchantCheck){ + game->ChangePlayerClass(TRAPPER); + player=game->GetPlayer(); + Assert::AreEqual(uint8_t(1),Trapper::ability2.MAX_CHARGES,L"Normally Bear Trap only has one charge."); + Assert::AreEqual(uint8_t(1),Trapper::ability3.MAX_CHARGES,L"Normally Explosive Trap only has one charge."); + } + TEST_METHOD(TrapCollectorEnchantCheck){ + game->ChangePlayerClass(TRAPPER); + player=game->GetPlayer(); + std::weak_ptrnullRing{Inventory::AddItem("Null Ring"s)}; + Inventory::EquipItem(nullRing,EquipSlot::RING1); + nullRing.lock()->EnchantItem("Trap Collector"); + 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."); + } }; } \ No newline at end of file diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index d871bb95..6e1a7c22 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1463,6 +1463,13 @@ void Player::RecalculateEquipStats(){ } } + if(GetClass()&TRAPPER){ + if(HasEnchant("Trap Collector")){ + GetAbility2().MAX_CHARGES="Trap Collector"_ENC["CHARGE COUNT"]; + GetAbility3().MAX_CHARGES="Trap Collector"_ENC["CHARGE COUNT"]; + } + } + for(const std::reference_wrapper&a:GetAbilities()){ if(a.get().itemAbility)continue; if(a.get().charges