diff --git a/.gitignore b/.gitignore index 0ae42b62..6d79d265 100644 --- a/.gitignore +++ b/.gitignore @@ -402,4 +402,22 @@ test.cpp /x64/Release/AdventuresInLestoria_web.zip packkey.cpp desktop.ini -.tmp.driveupload \ No newline at end of file +.tmp.driveupload +/Adventures in Lestoria Tests/Adventures in Lestoria.lib +/Adventures in Lestoria Tests/discord-files +/Adventures in Lestoria Tests/discord_game_sdk.dll +/Adventures in Lestoria Tests/discord_game_sdk.dll.lib +/Adventures in Lestoria Tests/freetype +/Adventures in Lestoria Tests/freetype.dll +/Adventures in Lestoria Tests/freetype.lib +/Adventures in Lestoria Tests/ft2build.h +/Adventures in Lestoria Tests/pch.h +/Adventures in Lestoria Tests/steam +/Adventures in Lestoria Tests/steam_api64.dll +/Adventures in Lestoria Tests/steam_api64.lib +/Adventures in Lestoria Tests/x64/Library (Debug) +/x64/Library (Debug) +/x64/Library +/x64/Adventures in Lestoria.idb +/x64/Adventures in Lestoria.lib +/Adventures in Lestoria Tests/x64/Library (Release) diff --git a/Adventures in Lestoria Tests/Adventures in Lestoria Tests.cpp b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.cpp new file mode 100644 index 00000000..3147aeb9 --- /dev/null +++ b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.cpp @@ -0,0 +1,131 @@ +#include "CppUnitTest.h" +#include "olcUTIL_Geometry2D.h" +#include "AdventuresInLestoria.h" +#include "config.h" +#include "ItemDrop.h" + +using namespace Microsoft::VisualStudio::CppUnitTestFramework; +using namespace olc::utils; + +INCLUDE_MONSTER_DATA +INCLUDE_game + +TEST_MODULE_INITIALIZE(AiLTestSuite) +{ + debugLogger.open("debug.log"); +} + +namespace MonsterTests +{ + TEST_CLASS(MonsterTest) + { + public: + std::unique_ptrtestGame; + #pragma region Setup Functions + //Makes MONSTER_DATA["TestName"] available. + void SetupTestMonster(){ + testGame.reset(new AiL()); + testGame->EnableTestingMode(); + ItemAttribute::Initialize(); + ItemInfo::InitializeItems(); + testGame->InitializePlayer(); + Stats::InitializeDamageReductionTable(); + MonsterData testMonsterData{"TestName","Test Monster",30,10,5,{MonsterDropData{"Health Potion",100.f,1,1}}}; + MONSTER_DATA["TestName"]=testMonsterData; + } + void SetupMockMap(){ + game->MAP_DATA["CAMPAIGN_1_1"]; + } + #pragma endregion + + TEST_METHOD_INITIALIZE(MonsterInitialize){ + SetupTestMonster(); + SetupMockMap(); + } + ~MonsterTest(){ + testGame.release(); + } + TEST_METHOD(DisplayNameCheck){ + Assert::AreEqual("Test Monster",MONSTER_DATA["TestName"].GetDisplayName().c_str()); + } + TEST_METHOD(InternalNameCheck){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + Assert::AreEqual("TestName",testMonster.GetName().c_str()); + } + TEST_METHOD(HealthCheck){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + Assert::AreEqual(testMonster.GetHealth(),testMonster.GetMaxHealth()); + Assert::AreEqual(testMonster.GetHealth(),30); + } + TEST_METHOD(Deal5Damage) + { + Monster testMonster{{},MONSTER_DATA["TestName"]}; + testMonster.Hurt(5,testMonster.OnUpperLevel(),testMonster.GetZ()); + Assert::AreEqual(testMonster.GetHealth(),testMonster.GetMaxHealth()-5); + } + TEST_METHOD(IFrameShouldResultInNoDamage){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + testMonster.ApplyIframes(0.5f); + testMonster.Hurt(5,testMonster.OnUpperLevel(),testMonster.GetZ()); + Assert::AreEqual(testMonster.GetHealth(),testMonster.GetMaxHealth()); + } + TEST_METHOD(BeingInTheAirShouldAvoidAttacksFromTheGround){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + testMonster.SetZ(2.f); + testMonster.Hurt(5,testMonster.OnUpperLevel(),0.f); + Assert::AreEqual(testMonster.GetHealth(),testMonster.GetMaxHealth()); + } + TEST_METHOD(MonstersDeal10Damage_NoDamageReduction) + { + Monster testMonster{{},MONSTER_DATA["TestName"]}; + Monster testMonster2{{},MONSTER_DATA["TestName"]}; + game->GetPlayer()->Hurt(testMonster.GetAttack(),testMonster.OnUpperLevel(),testMonster.GetZ()); + testMonster2.Hurt(testMonster.GetAttack(),testMonster.OnUpperLevel(),testMonster.GetZ()); + Assert::AreEqual(game->GetPlayer()->GetMaxHealth()-10,game->GetPlayer()->GetHealth()); + Assert::AreEqual(testMonster2.GetMaxHealth()-10,testMonster2.GetHealth()); + } + TEST_METHOD(DoubleAttackPctModifierWorks){ + Monster buffMonster{{},MONSTER_DATA["TestName"]}; + buffMonster.AddBuff(BuffType::STAT_UP,5,100._Pct,{ItemAttribute::Get("Attack %")}); + + Monster testMonster2{{},MONSTER_DATA["TestName"]}; + game->GetPlayer()->Hurt(buffMonster.GetAttack(),buffMonster.OnUpperLevel(),buffMonster.GetZ()); + testMonster2.Hurt(buffMonster.GetAttack(),buffMonster.OnUpperLevel(),buffMonster.GetZ()); + Assert::AreEqual(game->GetPlayer()->GetMaxHealth()-20,game->GetPlayer()->GetHealth()); + Assert::AreEqual(testMonster2.GetMaxHealth()-20,testMonster2.GetHealth()); + } + TEST_METHOD(AttackUpModifierWorks){ + Monster buffMonster{{},MONSTER_DATA["TestName"]}; + buffMonster.AddBuff(BuffType::STAT_UP,5,5.f,{ItemAttribute::Get("Attack")}); + + Monster testMonster2{{},MONSTER_DATA["TestName"]}; + game->GetPlayer()->Hurt(buffMonster.GetAttack(),buffMonster.OnUpperLevel(),buffMonster.GetZ()); + testMonster2.Hurt(buffMonster.GetAttack(),buffMonster.OnUpperLevel(),buffMonster.GetZ()); + Assert::AreEqual(game->GetPlayer()->GetMaxHealth()-15,game->GetPlayer()->GetHealth()); + Assert::AreEqual(testMonster2.GetMaxHealth()-15,testMonster2.GetHealth()); + } + TEST_METHOD(MonsterIsConsideredDeadAt0Health){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + testMonster.Hurt(testMonster.GetMaxHealth(),testMonster.OnUpperLevel(),testMonster.GetZ()); + Assert::AreEqual(true,testMonster.IsDead()); + } + TEST_METHOD(ItemDropSpawnsWhenMonsterIsKilled){ + Monster testMonster{{},MONSTER_DATA["TestName"]}; + testMonster.Hurt(testMonster.GetMaxHealth(),testMonster.OnUpperLevel(),testMonster.GetZ()); + Assert::AreEqual(size_t(1),ItemDrop::GetDrops().size()); + } + }; +} + +namespace GeometryTests +{ + TEST_CLASS(GeometryTest) + { + public: + + TEST_METHOD(CircleOverlapTest) + { + Assert::IsTrue(geom2d::overlaps(geom2d::circle{vf2d{},10},vf2d{5,5})); + } + }; +} diff --git a/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj new file mode 100644 index 00000000..31fa287c --- /dev/null +++ b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj @@ -0,0 +1,453 @@ + + + + + Debug + Win32 + + + Library (Debug) + Win32 + + + Library (Debug) + x64 + + + Library (Release) + Win32 + + + Library (Release) + x64 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + {11969B7B-3D50-4825-9584-AF01D15B88E0} + Win32Proj + AdventuresinLestoriaTests + 10.0 + NativeUnitTestProject + + + + DynamicLibrary + true + v143 + Unicode + false + + + DynamicLibrary + true + v143 + Unicode + false + + + DynamicLibrary + false + v143 + true + Unicode + false + + + DynamicLibrary + false + v143 + true + Unicode + false + + + DynamicLibrary + true + v143 + Unicode + false + + + DynamicLibrary + true + v143 + Unicode + false + + + DynamicLibrary + false + v143 + true + Unicode + false + + + DynamicLibrary + false + v143 + true + Unicode + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + true + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria;$(IncludePath) + + + true + + + true + + + false + + + false + + + false + + + false + $(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria;$(IncludePath) + + + + NotUsing + Level3 + true + $(VCInstallDir)UnitTest\include;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;%(AdditionalIncludeDirectories) + _DEBUG;%(PreprocessorDefinitions) + true + pch.h + stdcpp20 + + + Windows + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria Tests;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);Adventures in Lestoria.lib;%(AdditionalDependencies) + + + + + NotUsing + Level3 + true + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + _DEBUG;%(PreprocessorDefinitions) + true + + + stdcpp20 + + + Windows + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + true + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + true + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;%(PreprocessorDefinitions) + true + pch.h + + + Windows + true + true + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Use + Level3 + true + true + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + NDEBUG;%(PreprocessorDefinitions) + true + pch.h + stdcpp20 + + + Windows + true + true + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + NotUsing + Level3 + true + true + true + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + NDEBUG;%(PreprocessorDefinitions) + true + + + stdcpp20 + + + Windows + true + true + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria Tests;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);Adventures in Lestoria.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {8e3067af-cfe7-4b11-bc6b-b867c32753d7} + + + + + + + + + \ No newline at end of file diff --git a/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj.filters b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj.filters new file mode 100644 index 00000000..c0ac2d70 --- /dev/null +++ b/Adventures in Lestoria Tests/Adventures in Lestoria Tests.vcxproj.filters @@ -0,0 +1,437 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {7c17cf40-e313-440d-8b28-a46736e838c7} + + + {a858da34-e037-467f-9f95-8066221a9657} + + + {2ad4b357-0b91-4282-b869-a9600baebfe2} + + + {0a314412-8a4b-44ff-ab46-ac039bd0e494} + + + {d9d0ec7d-b067-4f75-ad65-f7e5147f8539} + + + + + Source Files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + Source Files\discord-files + + + + + Header Files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\discord-files + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files\steam + + + Header Files + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype + + + Header Files\freetype\config + + + Header Files\freetype\config + + + Header Files\freetype\config + + + Header Files\freetype\config + + + Header Files\freetype\config + + + Header Files\freetype\config + + + Header Files\freetype\config + + + Header Files\freetype\config + + + + + Header Files\steam + + + \ No newline at end of file diff --git a/Adventures in Lestoria.sln b/Adventures in Lestoria.sln index a3c1d4c8..332002fd 100644 --- a/Adventures in Lestoria.sln +++ b/Adventures in Lestoria.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 17.5.33516.290 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Adventures in Lestoria", "Adventures in Lestoria\Adventures in Lestoria.vcxproj", "{8E3067AF-CFE7-4B11-BC6B-B867C32753D7}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Adventures in Lestoria Tests", "Adventures in Lestoria Tests\Adventures in Lestoria Tests.vcxproj", "{11969B7B-3D50-4825-9584-AF01D15B88E0}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -13,8 +15,14 @@ Global Emscripten Debug|x86 = Emscripten Debug|x86 Emscripten|x64 = Emscripten|x64 Emscripten|x86 = Emscripten|x86 + Library (Debug)|x64 = Library (Debug)|x64 + Library (Debug)|x86 = Library (Debug)|x86 + Library (Release)|x64 = Library (Release)|x64 + Library (Release)|x86 = Library (Release)|x86 Release Desktop|x64 = Release Desktop|x64 Release Desktop|x86 = Release Desktop|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Debug|x64.ActiveCfg = Debug|x64 @@ -29,10 +37,50 @@ Global {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Emscripten|x64.Build.0 = Emscripten|x64 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Emscripten|x86.ActiveCfg = Emscripten|Win32 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Emscripten|x86.Build.0 = Emscripten|Win32 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Debug)|x64.ActiveCfg = Library (Debug)|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Debug)|x64.Build.0 = Library (Debug)|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Debug)|x86.ActiveCfg = Library (Debug)|Win32 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Debug)|x86.Build.0 = Library (Debug)|Win32 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Release)|x64.ActiveCfg = Library (Release)|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Release)|x64.Build.0 = Library (Release)|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Release)|x86.ActiveCfg = Library (Release)|Win32 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Library (Release)|x86.Build.0 = Library (Release)|Win32 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release Desktop|x64.ActiveCfg = Release Desktop|x64 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release Desktop|x64.Build.0 = Release Desktop|x64 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release Desktop|x86.ActiveCfg = Release Desktop|Win32 {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release Desktop|x86.Build.0 = Release Desktop|Win32 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x64.ActiveCfg = Release Desktop|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x64.Build.0 = Release Desktop|x64 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.ActiveCfg = Release Desktop|Win32 + {8E3067AF-CFE7-4B11-BC6B-B867C32753D7}.Release|x86.Build.0 = Release Desktop|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Debug|x64.ActiveCfg = Debug|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Debug|x64.Build.0 = Debug|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Debug|x86.ActiveCfg = Debug|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Debug|x86.Build.0 = Debug|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten Debug|x64.ActiveCfg = Debug|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten Debug|x64.Build.0 = Debug|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten Debug|x86.ActiveCfg = Debug|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten Debug|x86.Build.0 = Debug|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten|x64.ActiveCfg = Debug|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten|x64.Build.0 = Debug|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten|x86.ActiveCfg = Debug|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Emscripten|x86.Build.0 = Debug|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Debug)|x64.ActiveCfg = Library (Debug)|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Debug)|x64.Build.0 = Library (Debug)|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Debug)|x86.ActiveCfg = Library (Debug)|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Debug)|x86.Build.0 = Library (Debug)|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Release)|x64.ActiveCfg = Library (Release)|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Release)|x64.Build.0 = Library (Release)|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Release)|x86.ActiveCfg = Library (Release)|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Library (Release)|x86.Build.0 = Library (Release)|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release Desktop|x64.ActiveCfg = Release|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release Desktop|x64.Build.0 = Release|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release Desktop|x86.ActiveCfg = Release|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release Desktop|x86.Build.0 = Release|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release|x64.ActiveCfg = Release|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release|x64.Build.0 = Release|x64 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release|x86.ActiveCfg = Release|Win32 + {11969B7B-3D50-4825-9584-AF01D15B88E0}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Adventures in Lestoria/Adventures in Lestoria.vcxproj b/Adventures in Lestoria/Adventures in Lestoria.vcxproj index 8aa0308a..8a6df8c8 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.vcxproj +++ b/Adventures in Lestoria/Adventures in Lestoria.vcxproj @@ -21,6 +21,22 @@ Emscripten x64 + + Library (Debug) + Win32 + + + Library (Debug) + x64 + + + Library (Release) + Win32 + + + Library (Release) + x64 + Release Desktop Win32 @@ -49,6 +65,12 @@ v143 Unicode + + Application + true + v143 + Unicode + Application false @@ -56,12 +78,25 @@ true Unicode + + Application + false + v143 + true + Unicode + Application true v143 Unicode + + StaticLibrary + true + v143 + Unicode + Application false @@ -69,6 +104,13 @@ true Unicode + + StaticLibrary + false + v143 + true + Unicode + v143 @@ -89,28 +131,55 @@ + + + + + + + + + + + + $(SolutionDir)$(PlatformTarget)\Release + + $(SolutionDir)$(PlatformTarget)\Release + $(SolutionDir)$(PlatformTarget)\Release + + $(SolutionDir)$(PlatformTarget)\$(Configuration)\ + $(IncludePath) - + $(IncludePath) + + $(VCInstallDir)Auxiliary\VS\UnitTest\include;$(IncludePath) + $(VCInstallDir)Auxiliary\VS\UnitTest\lib;$(LibraryPath) + + + $(VCInstallDir)Auxiliary\VS\UnitTest\include;$(IncludePath) + $(VCInstallDir)Auxiliary\VS\UnitTest\lib;$(LibraryPath) + $(SolutionDir)$(Platform)\$(Configuration)\ + Level3 @@ -132,6 +201,27 @@ powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\Documents\include;%(AdditionalIncludeDirectories) + /MP8 %(AdditionalOptions) + 4099;5030;4715;4172;4834 + + + Console + true + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria;%(AdditionalLibraryDirectories) + discord_game_sdk.dll.lib;freetype.lib;$(CoreLibraryDependencies);%(AdditionalDependencies); + + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + + TurnOffAllWarnings @@ -155,6 +245,29 @@ powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + + + TurnOffAllWarnings + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + /MP8 %(AdditionalOptions) + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\Documents\include;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files + + + Console + true + true + true + discord_game_sdk.dll.lib;freetype.lib;$(CoreLibraryDependencies);%(AdditionalDependencies);discord_game_sdk.dll.lib + + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + + Level3 @@ -180,6 +293,34 @@ + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include + /MP20 %(AdditionalOptions) + 4099;5030;4715;4172;4834 + + + Console + true + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria;%(AdditionalLibraryDirectories) + discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);%(AdditionalDependencies); + + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + + + + + + + discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);%(AdditionalDependencies); + + TurnOffAllWarnings @@ -211,6 +352,40 @@ + + + TurnOffAllWarnings + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpp20 + /MP20 %(AdditionalOptions) + C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\steam;C:\Users\sigon\source\repos\AdventuresInLestoria\Adventures in Lestoria\discord-files;C:\Users\sigon\OneDrive\Documents\include + + + Windows + true + true + true + discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);%(AdditionalDependencies);discord_game_sdk.dll.lib + + + powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File update_version.ps1 "./version.h" + + + + + + + + + + + discord_game_sdk.dll.lib;freetype.lib;steam_api64.lib;$(CoreLibraryDependencies);%(AdditionalDependencies); + + Console diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 79919d04..c5e51ae7 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -158,6 +158,15 @@ InputGroup AiL::KEY_TOGGLE_MAP; float AiL::SIZE_CHANGE_SPEED=1; AiL::AiL(){ + GFX.Reset(); + DATA.Reset(); + InitializeGameConfigurations(); + sAppName="GAME_NAME"_S; + game=this; + gameStarted=time(NULL); +} + +void AiL::InitializeGameConfigurations(){ utils::datafile::Read(DATA,"assets/config/configuration.txt"); std::filesystem::create_directories("save_file_path"_S); @@ -243,10 +252,6 @@ AiL::AiL(){ utils::datafile::Read(DATA,MINIMAP_CONFIG); utils::datafile::DEBUG_ACCESS_OPTIONS="debug_access_options"_I; - - sAppName = "GAME_NAME"_S; - game=this; - gameStarted=time(NULL); } bool AiL::OnUserCreate(){ @@ -271,7 +276,7 @@ bool AiL::OnUserCreate(){ sig::Animation::InitializeAnimations(); - player=std::make_unique(); + InitializePlayer(); InitializePlayerLevelCap(); @@ -4385,4 +4390,16 @@ const vf2d&AiL::GetWindSpeed()const{ void AiL::UsingSteamAPI(const bool usingSteam){ steamAPIEnabled=usingSteam; +} + +void AiL::InitializePlayer(){ + player=std::make_unique(); +} + +void AiL::EnableTestingMode(){ + testingMode=true; +} + +const bool AiL::TestingModeEnabled()const{ + return testingMode; } \ No newline at end of file diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index 6129f75d..819c29d0 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -58,6 +58,7 @@ All rights reserved. #include "UndefKeys.h" #include "Minimap.h" #include "Overlay.h" +#include class SteamKeyboardCallbackHandler; class SteamStatsReceivedHandler; @@ -211,6 +212,7 @@ private: std::optionalbossIndicatorPos{}; bool steamAPIEnabled{true}; Overlay hudOverlay{"pixel.png",BLANK}; + bool testingMode{false}; public: AiL(); bool OnUserCreate() override; @@ -358,6 +360,10 @@ public: void SetWindSpeed(vf2d newWindSpd); const vf2d&GetWindSpeed()const; const HurtList HurtMonsterType(vf2d pos,float radius,int damage,bool upperLevel,float z,const std::string_view monsterName)const; + void InitializeGameConfigurations(); + void InitializePlayer(); + void EnableTestingMode(); + const bool TestingModeEnabled()const; struct TileGroupData{ vi2d tilePos; diff --git a/Adventures in Lestoria/AttributableStat.h b/Adventures in Lestoria/AttributableStat.h index 4a6285fc..9f0039f1 100644 --- a/Adventures in Lestoria/AttributableStat.h +++ b/Adventures in Lestoria/AttributableStat.h @@ -56,7 +56,6 @@ class ItemAttribute{ bool showDecimal=false; std::string modifies=""; std::optional>target; - static void Initialize(); public: inline static safemapattributes; ItemAttribute(std::string_view originalName,std::string_view name,bool isPct,bool showDecimal,std::string_view modifies=""sv); @@ -70,6 +69,7 @@ public: friend float&operator+=(float&lhs,const ItemAttribute&rhs); friend float&operator-=(float&lhs,const ItemAttribute&rhs); const bool operator==(const ItemAttribute&rhs)const; + static void Initialize(); }; struct Stats; diff --git a/Adventures in Lestoria/GameSettings.cpp b/Adventures in Lestoria/GameSettings.cpp index e8f9e6b2..70d5477c 100644 --- a/Adventures in Lestoria/GameSettings.cpp +++ b/Adventures in Lestoria/GameSettings.cpp @@ -85,7 +85,7 @@ const bool GameSettings::VSyncEnabled(){ return vsync; } const bool GameSettings::AutoPauseEnabled(){ - return autopause; + return !game->TestingModeEnabled()&&autopause; } void GameSettings::SetMaxHealthDisplay(bool maxHealthDisplayed){ diff --git a/Adventures in Lestoria/Item.cpp b/Adventures in Lestoria/Item.cpp index 065afae0..759cda57 100644 --- a/Adventures in Lestoria/Item.cpp +++ b/Adventures in Lestoria/Item.cpp @@ -81,6 +81,24 @@ ItemInfo::ItemInfo() :customProps({nullptr,nullptr}),img(nullptr){} void ItemInfo::InitializeItems(){ + Stats::NO_MAX_HIGHLIGHT={}; + ItemSortRules::secondarySort.clear(); + ItemSortRules::primarySort.clear(); + ItemInfo::craftableConsumables.clear(); + Stats::maxDamageReductionTable.Reset(); + ItemInfo::nameToEquipSlot.clear(); + Inventory::equipment.clear(); + ItemSet::sets.clear(); + ItemOverlay::items.clear(); + Inventory::loadoutItemsUsed={}; + Inventory::sortedInv.clear(); + Inventory::blacksmithInventory.clear(); + + ITEM_CONVERSIONS.Reset(); + ITEM_DATA.Reset(); + ITEM_CATEGORIES.Reset(); + ITEM_CONVERSIONS.Reset(); + for(const std::string&data:DATA.GetProperty("Item.Equipment Sort Order Primary").GetValues()){ ItemSortRules::primarySort.push_back(data); } @@ -1087,6 +1105,7 @@ const bool ItemInfo::UseDuringCast()const{ } void Stats::InitializeDamageReductionTable(){ + maxDamageReductionTable.Reset(); float totalReduction=0; maxDamageReductionTable[0]=0; for(int i=1;i<=1000;i++){ diff --git a/Adventures in Lestoria/Item.h b/Adventures in Lestoria/Item.h index 66673a37..ffeb2a41 100644 --- a/Adventures in Lestoria/Item.h +++ b/Adventures in Lestoria/Item.h @@ -370,6 +370,7 @@ public: }; class ItemOverlay{ + friend class ItemInfo; ItemInfo it; float timer=0; float xOffset=0; diff --git a/Adventures in Lestoria/ItemDrop.cpp b/Adventures in Lestoria/ItemDrop.cpp index e9b598dd..f6363d04 100644 --- a/Adventures in Lestoria/ItemDrop.cpp +++ b/Adventures in Lestoria/ItemDrop.cpp @@ -162,4 +162,8 @@ void ItemDrop::SpawnItem(const ItemInfo*item,vf2d pos,bool isUpper){ const ItemInfo*ItemDrop::GetItem()const{ return item; +} + +const std::vector&ItemDrop::GetDrops(){ + return ItemDrop::drops; } \ No newline at end of file diff --git a/Adventures in Lestoria/ItemDrop.h b/Adventures in Lestoria/ItemDrop.h index 732e29f8..b68d3938 100644 --- a/Adventures in Lestoria/ItemDrop.h +++ b/Adventures in Lestoria/ItemDrop.h @@ -58,6 +58,7 @@ public: bool OnUpperLevel(); void Draw()const; static void UpdateDrops(float fElapsedTime); + static const std::vector&GetDrops(); float GetZ()const; static void SpawnItem(const ItemInfo*item,vf2d pos,bool isUpper); const ItemInfo*GetItem()const; diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 497f3c49..df9f7e25 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -68,7 +68,7 @@ safemap>STRATEGY_DAT std::unordered_mapMonsterData::imgs; Monster::Monster(vf2d pos,MonsterData data,bool upperLevel,bool bossMob): - pos(pos),spawnPos(pos),hp(data.GetHealth()),size(data.GetSizeMult()),targetSize(data.GetSizeMult()),strategy(data.GetAIStrategy()),name(data.GetDisplayName()),upperLevel(upperLevel),isBoss(bossMob),facingDirection(Direction::SOUTH),lifetime(GetTotalLifetime()){ + pos(pos),spawnPos(pos),hp(data.GetHealth()),size(data.GetSizeMult()),targetSize(data.GetSizeMult()),strategy(data.GetAIStrategy()),name(data.GetInternalName()),upperLevel(upperLevel),isBoss(bossMob),facingDirection(Direction::SOUTH),lifetime(GetTotalLifetime()){ for(const std::string&anim:data.GetAnimations()){ animation.AddState(anim,ANIMATION_DATA[std::format("{}_{}",name,anim)]); } @@ -124,6 +124,7 @@ void Monster::PerformJumpAnimation(const Direction facingDir){ PerformJumpAnimation(); } void Monster::PerformJumpAnimation(){ + if(!animation.HasState(MONSTER_DATA.at(name).GetJumpAnimation(facingDirection)))return; animation.ChangeState(internal_animState,MONSTER_DATA.at(name).GetJumpAnimation(facingDirection)); } @@ -132,6 +133,7 @@ void Monster::PerformShootAnimation(const Direction facingDir){ PerformShootAnimation(); } void Monster::PerformShootAnimation(){ + if(!animation.HasState(MONSTER_DATA.at(name).GetShootAnimation(facingDirection)))return; animation.ChangeState(internal_animState,MONSTER_DATA.at(name).GetShootAnimation(facingDirection)); } @@ -140,6 +142,7 @@ void Monster::PerformIdleAnimation(const Direction facingDir){ PerformIdleAnimation(); } void Monster::PerformIdleAnimation(){ + if(!animation.HasState(MONSTER_DATA.at(name).GetIdleAnimation(facingDirection)))return; animation.ChangeState(internal_animState,MONSTER_DATA.at(name).GetIdleAnimation(facingDirection)); } @@ -716,6 +719,10 @@ void Monster::AddBuff(BuffType type,float duration,float intensity){ buffList.push_back(Buff{type,duration,intensity}); } +void Monster::AddBuff(BuffType type,float duration,float intensity,std::setattr){ + buffList.push_back(Buff{type,duration,intensity,attr}); +} + void Monster::RemoveBuff(BuffType type){ std::erase_if(buffList,[&](const Buff&buff){return buff.type==type;}); } @@ -831,7 +838,7 @@ std::mapMonster::SpawnDrops(){ } void Monster::OnDeath(){ - animation.ChangeState(internal_animState,GetDeathAnimationName()); + if(animation.HasState(MONSTER_DATA.at(name).GetDefaultDeathAnimation()))animation.ChangeState(internal_animState,GetDeathAnimationName()); if(GetSizeT(Attribute::LOOPING_SOUND_ID)!=std::numeric_limits::max()){//Just make sure on death any looping sound effect has been discarded proper. SoundEffect::StopLoopingSFX(GetSizeT(Attribute::LOOPING_SOUND_ID)); @@ -1138,4 +1145,4 @@ const bool Monster::IsSolid()const{ void Monster::_DealTrueDamage(const uint32_t damageAmt){ _Hurt(damageAmt,OnUpperLevel(),GetZ(),TrueDamageFlag::IGNORE_DAMAGE_RULES); -} \ No newline at end of file +} diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index 6a3e67d9..626d74f9 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -132,6 +132,7 @@ public: bool StartPathfinding(float pathingTime); void PathAroundBehavior(float fElapsedTime); void AddBuff(BuffType type,float duration,float intensity); + void AddBuff(BuffType type,float duration,float intensity,std::setattr); std::vectorGetBuffs(BuffType buff)const; //Removes all buffs of a given type. void RemoveBuff(BuffType type); @@ -239,6 +240,7 @@ private: float lastPathfindingCooldown=0.f; std::functionstrategyDeathFunc{}; void SetStrategyDeathFunction(std::functionfunc); + //If you are trying to change a Get() stat, use the STAT_UP buff (and the optional argument) to supply an attribute you want to apply. ItemAttribute&Get(std::string_view attr); //Returns false if the monster could not be moved to the requested location due to collision. //If monsterInvoked is true, this means the monster was the one that instantiated this input, and it's not an extra movement done via collision. diff --git a/Adventures in Lestoria/MonsterData.cpp b/Adventures in Lestoria/MonsterData.cpp index 22885df6..57b578b4 100644 --- a/Adventures in Lestoria/MonsterData.cpp +++ b/Adventures in Lestoria/MonsterData.cpp @@ -356,6 +356,9 @@ int MonsterData::GetCollisionDmg(){ const std::string&MonsterData::GetAIStrategy()const{ return strategy; } +const std::string&MonsterData::GetInternalName()const{ + return name; +} const std::string&MonsterData::GetDisplayName()const{ return displayName; } diff --git a/Adventures in Lestoria/MonsterData.h b/Adventures in Lestoria/MonsterData.h index 720f0333..b6ba4621 100644 --- a/Adventures in Lestoria/MonsterData.h +++ b/Adventures in Lestoria/MonsterData.h @@ -48,8 +48,10 @@ struct MonsterDropData{ float dropChance; int minQty=1; int maxQty=1; + //Drop Chance is between 0-100 (NOT a percentage (Like 1.0f does not mean 100% here)!!) MonsterDropData(std::string itemName,float dropChance,int minQty=1,int maxQty=1) :item(ITEM_DATA.at(itemName)),dropChance(dropChance),minQty(minQty),maxQty(maxQty){} + //Drop Chance is between 0-100 (NOT a percentage (Like 1.0f does not mean 100% here)!!) MonsterDropData(const ItemInfo&item,float dropChance,int minQty=1,int maxQty=1) :item(item),dropChance(dropChance),minQty(minQty),maxQty(maxQty){} MonsterDropData(const MonsterDropData&ref)=default; @@ -85,6 +87,7 @@ public: return animations; } const std::vector&GetDropData(); + const std::string&GetInternalName()const; const std::string&GetDisplayName()const; static void InitializeMonsterData(); static void InitializeNPCData(); diff --git a/Adventures in Lestoria/SoundEffect.cpp b/Adventures in Lestoria/SoundEffect.cpp index 4676f654..e5d6a2c6 100644 --- a/Adventures in Lestoria/SoundEffect.cpp +++ b/Adventures in Lestoria/SoundEffect.cpp @@ -87,7 +87,7 @@ void SoundEffect::Initialize(){ } void SoundEffect::PlaySFX(const std::string_view eventName,const vf2d&pos){ - if(eventName.length()==0)return; + if(game->TestingModeEnabled()||eventName.length()==0)return; const SoundEffect&sfx=GetRandomSFXFromFile(eventName); if(GameState::STATE==GameState::states[States::MAIN_MENU]&&sfx.combatSound)return; //Do not play combat sounds on the main menu. diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 0151f473..5190bd49 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 9715 +#define VERSION_BUILD 9787 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/olcUTIL_Animate2D.h b/Adventures in Lestoria/olcUTIL_Animate2D.h index abfb8004..6d0b689b 100644 --- a/Adventures in Lestoria/olcUTIL_Animate2D.h +++ b/Adventures in Lestoria/olcUTIL_Animate2D.h @@ -275,6 +275,9 @@ namespace olc::utils::Animate2D m_vSequences.emplace_back(sequence); m_mapStateIndices[sStateName] = m_vSequences.size() - 1; } + inline bool HasState(const StatesEnum&sStateName){ + return m_mapStateIndices.count(sStateName); + } private: std::vector m_vSequences; diff --git a/Adventures in Lestoria/olcUTIL_DataFile.h b/Adventures in Lestoria/olcUTIL_DataFile.h index e4b4fddf..f29e167a 100644 --- a/Adventures in Lestoria/olcUTIL_DataFile.h +++ b/Adventures in Lestoria/olcUTIL_DataFile.h @@ -484,6 +484,16 @@ namespace olc::utils } public: + inline void Reset(){ + INITIAL_SETUP_COMPLETE=false; + DEBUG_ACCESS_OPTIONS=false; + m_mapObjects.clear(); + m_vecObjects.clear(); + m_vContent.clear(); + lastAccessedProperty=""; + BLANK=""; + m_bIsComment=false; + } inline datafile& operator[](const std::string& name) { // Check if this "node"'s map already contains an object with this name... diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 492173ca..0f3298eb 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ