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:
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user