Targets already in the air should not be knocked back. Fix image loading dependencies internally within the engine so they work even during unit testing. Rearrange some item initializing functions to occur after the GFX map is reset so all graphics are loaded properly. Release Build 9835.

This commit is contained in:
2024-06-25 02:46:27 -05:00
parent d6d02cc986
commit d8c2c615dc
14 changed files with 53 additions and 33 deletions
@@ -61,7 +61,7 @@ namespace MonsterTests
//Makes MONSTER_DATA["TestName"] available.
void SetupTestMonster(){
testGame.reset(new AiL());
testGame->EnableTestingMode();
testGame->olc_SetTestingMode(true);
ItemAttribute::Initialize();
ItemInfo::InitializeItems();
testGame->InitializePlayer();
+16 -4
View File
@@ -53,12 +53,16 @@ namespace PlayerTests
HWButton*testKey;
TEST_METHOD_INITIALIZE(PlayerInitialize){
testGame.reset(new AiL());
testGame->EnableTestingMode();
testGame->InitializeClasses();
testGame->InitializeDefaultKeybinds();
Tutorial::Initialize();
testGame->olc_SetTestingMode(true);
ItemAttribute::Initialize();
ItemInfo::InitializeItems();
testGame->InitializeGraphics();
testGame->InitializeClasses();
sig::Animation::InitializeAnimations();
testGame->InitializeDefaultKeybinds();
testGame->InitializePlayer();
Menu::InitializeMenus();
Tutorial::Initialize();
Stats::InitializeDamageReductionTable();
player=testGame->GetPlayer();
//Setup key "0" as a test input
@@ -118,5 +122,13 @@ namespace PlayerTests
player->GetRightClickAbility().action(player,player->GetPos());
Assert::AreEqual(int(State::BLOCK),int(player->GetState()));
}
TEST_METHOD(WizardCastDoesNotConsumeManaImmediately){
testGame->ChangePlayerClass(WIZARD);
player=testGame->GetPlayer(); //The player pointer has been reassigned...
//Ability 3 is Meteor, 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->GetAbility3(),testKeyboardInput);
Assert::AreEqual(player->GetMaxMana(),player->GetMana());
}
};
}