Implemented Trap Collector Enchant.

mac-build
sigonasr2 6 months ago
parent 6002f69dfa
commit 33ce153bc8
  1. 15
      Adventures in Lestoria Tests/EnchantTests.cpp
  2. 7
      Adventures in Lestoria/Player.cpp
  3. 2
      Adventures in Lestoria/Version.h

@ -906,5 +906,20 @@ namespace EnchantTests
game->OnUserUpdate(0.f); //Wait for mark lock-on 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."); 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_ptr<Item>nullRing{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.");
}
}; };
} }

@ -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<Ability>&a:GetAbilities()){ for(const std::reference_wrapper<Ability>&a:GetAbilities()){
if(a.get().itemAbility)continue; if(a.get().itemAbility)continue;
if(a.get().charges<a.get().MAX_CHARGES&&a.get().cooldown==0.f)a.get().cooldown=a.get().GetCooldownTime(); if(a.get().charges<a.get().MAX_CHARGES&&a.get().cooldown==0.f)a.get().cooldown=a.get().GetCooldownTime();

@ -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 11020 #define VERSION_BUILD 11021
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Loading…
Cancel
Save