game->OnUserUpdate(1.f);//It's a cast, so wait one second as the ability gets used. This also reduces cooldowns by a second...
Assert::AreEqual(player->GetRightClickAbility().GetCooldownTime()-1.f,player->GetRightClickAbility().cooldown,L"Right-click ability remains unaffected by other abilities.");
Assert::AreEqual(player->GetAbility1().GetCooldownTime()-4.f,player->GetAbility1().cooldown,L"All other abilities have cooldowns reduced by 1.5 seconds.");
Assert::AreEqual(player->GetAbility2().GetCooldownTime()-2.5f,player->GetAbility2().cooldown,L"All other abilities have cooldowns reduced by 1.5 seconds.");
Assert::AreEqual(player->GetAbility3().GetCooldownTime()-1.f,player->GetAbility3().cooldown,L"Same ability used should not be affected.");
Assert::AreEqual(player->GetAbility4().GetCooldownTime(),player->GetAbility4().cooldown,L"All other abilities have cooldowns reduced by 1.5 seconds.");
Assert::AreEqual(player->GetRightClickAbility().GetCooldownTime(),player->GetRightClickAbility().cooldown,L"Right-click ability remains unaffected by other abilities.");
Assert::AreEqual(player->GetAbility1().GetCooldownTime()-3.f,player->GetAbility1().cooldown,L"All other abilities have cooldowns reduced by 1.5 seconds.");
Assert::AreEqual(player->GetAbility2().GetCooldownTime()-1.5f,player->GetAbility2().cooldown,L"All other abilities have cooldowns reduced by 1.5 seconds.");
Assert::AreEqual(player->GetAbility3().GetCooldownTime(),player->GetAbility3().cooldown,L"Same ability used should not be affected.");
Assert::AreEqual(player->GetAbility4().GetCooldownTime()-4.5f,player->GetAbility4().cooldown,L"All other abilities have cooldowns reduced by 1.5 seconds.");
player->SetState(State::NORMAL);
player->RestoreMana(100);
player->GetAbility4().charges=1;//Reset the cooldown so it can be used.
player->GetAbility4().cooldown=0.f;//Reset the cooldown so it can be used.
Assert::AreEqual(player->GetRightClickAbility().GetCooldownTime()-1.f,player->GetRightClickAbility().cooldown,L"Right-click ability remains unaffected by other abilities.");
Assert::AreEqual(player->GetAbility1().GetCooldownTime()-4.f,player->GetAbility1().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
Assert::AreEqual(player->GetAbility2().GetCooldownTime()-2.5f,player->GetAbility2().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
Assert::AreEqual(player->GetAbility3().GetCooldownTime()-1.f,player->GetAbility3().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
Assert::AreEqual(player->GetRightClickAbility().GetCooldownTime(),player->GetRightClickAbility().cooldown,L"Right-click ability remains unaffected by other abilities.");
Assert::AreEqual(player->GetAbility1().GetCooldownTime()-3.f,player->GetAbility1().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
Assert::AreEqual(player->GetAbility2().GetCooldownTime()-1.5f,player->GetAbility2().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
Assert::AreEqual(player->GetAbility3().GetCooldownTime(),player->GetAbility3().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
Assert::AreEqual(player->GetAbility4().GetCooldownTime(),player->GetAbility4().cooldown,L"Ability 4 isn't setup for anything and returns as unused, causing cooldowns to remain the same.");
healthCounter.Initialize(&player->hp,"Interface.HUD Health Tick Rate"_F,"Interface.HUD Health Display Color"_Pixel,"Interface.HUD Heal Damage Color"_Pixel,"Interface.HUD Take Damage Color"_Pixel,"Interface.HUD Health Change Time"_F);
manaCounter.Initialize(&player->mana,"Interface.HUD Mana Tick Rate"_F,"Interface.HUD Mana Display Color"_Pixel,"Interface.HUD Restore Mana Color"_Pixel,"Interface.HUD Reduce Mana Color"_Pixel,"Interface.HUD Mana Change Time"_F);
}elseERR(std::format("WARNING! The shield type {} does not have a corresponding entry! All shields when generated should have made one! THIS SHOULD NOT BE HAPPENING!",int(shieldType)));
if(shield.capacity()>SHIELD_CAPACITY)ERR(std::format("WARNING! Shield capacity limit has been reached! If you need more than {} shields, please expand the SHIELD_CAPACITY property of player!",SHIELD_CAPACITY));
AddTimer(shieldType,Timer{std::format("Shield Type {}",int(shieldType)),shieldTimer,[newShield,this](){std::erase_if(shield,[&newShield](conststd::pair<PlayerTimerType,ShieldAmount>&shieldData){returnshieldData.first==newShield.first;});}});