Add Adrenaline Rush unit test.

mac-build
sigonasr2 4 months ago
parent 0e03cb0f67
commit 7f4b949627
  1. 11
      Adventures in Lestoria Tests/PlayerTests.cpp
  2. 4
      Adventures in Lestoria/AdventuresInLestoria.cpp
  3. 2
      Adventures in Lestoria/Version.h
  4. BIN
      x64/Release/Adventures in Lestoria.exe

@ -568,5 +568,16 @@ namespace PlayerTests
game->OnUserUpdate(0.5f); //Wait 0.5 more seconds. The player should be healed now.
Assert::AreEqual(player->GetMaxHealth(),player->GetHealth(),L"After waiting for 1 second, the player should be at full health.");
}
TEST_METHOD(AdrenalineRushSkillBuffTest){
testGame->ChangePlayerClass(THIEF);
player=testGame->GetPlayer(); //The player pointer has been reassigned...
Assert::AreEqual(1.f,player->GetMoveSpdMult(),L"Move Speed Multiplier is set to x1.0 by default.");
Assert::AreEqual(0.f,player->GetAttackRecoveryRateReduction(),L"Attack rate cooldown starts with being reduced by 0 seconds.");
testKey->bHeld=true; //Force the key to be held down for testing purposes.
player->CheckAndPerformAbility(player->GetAbility3(),testKeyboardInput);
Assert::IsTrue(player->GetBuffs(BuffType::ADRENALINE_RUSH).size()>0,L"After using Adrenaline Rush, player has the Adrenaline Rush buff.");
Assert::AreEqual(1.1f,player->GetMoveSpdMult(),L"Move Speed Multiplier increased by 10% to x1.1");
Assert::AreEqual(0.105f,player->GetAttackRecoveryRateReduction(),L"Attack Recovery Rate reduced by 30%, or 0.105s");
}
};
}

@ -1990,11 +1990,11 @@ void AiL::RenderHud(){
switch(dn->type){
case HEALTH_LOSS:{
std::string text=std::to_string(dn->damage);
DrawDamageNumber(NumberScalesWithDamage,text,{DARK_RED,{0,0,0,0}},{RED,VERY_DARK_GREY});
DrawDamageNumber(NumberScalesWithDamage,text,{DARK_RED,VERY_DARK_RED},{RED,VERY_DARK_GREY});
}break;
case HEALTH_GAIN:{
std::string text="+"+std::to_string(dn->damage);
DrawDamageNumber(NormalNumber,text,{DARK_GREEN,{0,0,0,0}},{GREEN,VERY_DARK_GREY});
DrawDamageNumber(NormalNumber,text,{DARK_GREEN,VERY_DARK_GREEN},{GREEN,VERY_DARK_GREY});
}break;
case MANA_GAIN:{
std::string text="+"+std::to_string(dn->damage);

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

Loading…
Cancel
Save