diff --git a/Adventures in Lestoria Tests/PlayerTests.cpp b/Adventures in Lestoria Tests/PlayerTests.cpp index 70e6a7f9..d6c1bacb 100644 --- a/Adventures in Lestoria Tests/PlayerTests.cpp +++ b/Adventures in Lestoria Tests/PlayerTests.cpp @@ -42,6 +42,8 @@ All rights reserved. using namespace Microsoft::VisualStudio::CppUnitTestFramework; using namespace olc::utils; +INCLUDE_GFX + namespace PlayerTests { TEST_CLASS(PlayerTest) @@ -61,6 +63,7 @@ namespace PlayerTests sig::Animation::InitializeAnimations(); testGame->InitializeDefaultKeybinds(); testGame->InitializePlayer(); + sig::Animation::SetupPlayerAnimations(); Menu::InitializeMenus(); Tutorial::Initialize(); Stats::InitializeDamageReductionTable(); @@ -69,6 +72,8 @@ namespace PlayerTests testKeyboardInput.AddKeybind(Input{InputType::KEY,0}); testKey=&testGame->pKeyboardState[0]; testGame->olc_UpdateKeyFocus(true); //Force the game to be "focused" for tests. Required if we want keyboard inputs to work. + Menu::themes.SetInitialized(); + GFX.SetInitialized(); } TEST_METHOD(PlayerAlive){ @@ -130,5 +135,13 @@ namespace PlayerTests player->CheckAndPerformAbility(player->GetAbility3(),testKeyboardInput); Assert::AreEqual(player->GetMaxMana(),player->GetMana()); } + TEST_METHOD(RangerCastDoesNotConsumeManaImmediately){ + testGame->ChangePlayerClass(RANGER); + player=testGame->GetPlayer(); //The player pointer has been reassigned... + //Ability 2 is Charged Shot, which is a cast. Mana should not be consumed for a spell that begins as a cast. + testKey->bHeld=true; //Force the key to be held down for testing purposes. + player->CheckAndPerformAbility(player->GetAbility2(),testKeyboardInput); + Assert::AreEqual(player->GetMaxMana(),player->GetMana()); + } }; } diff --git a/Adventures in Lestoria/Effect.cpp b/Adventures in Lestoria/Effect.cpp index 0a6c567d..daeca148 100644 --- a/Adventures in Lestoria/Effect.cpp +++ b/Adventures in Lestoria/Effect.cpp @@ -45,12 +45,12 @@ INCLUDE_game Effect::Effect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,float size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending) :Effect::Effect(pos,lifetime,imgFile,upperLevel,vf2d{size,size},fadeout,spd,col,rotation,rotationSpd,additiveBlending){ - this->animation.AddState(imgFile,ANIMATION_DATA[imgFile]); + this->animation.AddState(imgFile,ANIMATION_DATA.at(imgFile)); } Effect::Effect(vf2d pos,float lifetime,std::string imgFile,bool upperLevel,vf2d size,float fadeout,vf2d spd,Pixel col,float rotation,float rotationSpd,bool additiveBlending) :pos(pos),lifetime(lifetime),upperLevel(upperLevel),size(size),fadeout(fadeout),original_fadeoutTime(fadeout),spd(spd),col(col),rotation(rotation),rotationSpd(rotationSpd),additiveBlending(additiveBlending){ - this->animation.AddState(imgFile,ANIMATION_DATA[imgFile]); + this->animation.AddState(imgFile,ANIMATION_DATA.at(imgFile)); } bool Effect::Update(float fElapsedTime){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index c5c82e63..5016c2f6 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 9837 +#define VERSION_BUILD 9840 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 4b4be76f..4d4b6002 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ