diff --git a/C++ProjectTemplate b/C++ProjectTemplate index 6472f09..cc90544 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/SeasonI.h b/SeasonI.h index dbbc78f..6434ed8 100644 --- a/SeasonI.h +++ b/SeasonI.h @@ -3,12 +3,23 @@ #include "pixelGameEngine.h" #include "splash.h" #include "soundwaveEngine.h" +#include "defines.h" #include "flags.h" -#include "map.h" #include "cutscene.h" using namespace olc; + +class Map; +enum class ItemName; +class Object; +enum class ActionType; +class Entity; +class Effect; +namespace Battle{ + class Move; +} + class SeasonI:public PixelGameEngine{ public: SeasonI(){sAppName="Season I: Winters of Loneliness";} @@ -112,4 +123,5 @@ class SeasonI:public PixelGameEngine{ void GetAnyKeyPress(olc::Key keypress)override; bool Collision(vd2d pos); }; +extern SeasonI*GAME; #endif \ No newline at end of file diff --git a/defines.h b/defines.h index 8580b54..d18a9f3 100644 --- a/defines.h +++ b/defines.h @@ -49,6 +49,5 @@ enum class Property{ REVIVE }; -extern PixelGameEngine*GAME; extern vd2d cameraPos; #endif \ No newline at end of file diff --git a/entity.h b/entity.h index 6f65a63..7e432b9 100644 --- a/entity.h +++ b/entity.h @@ -3,6 +3,7 @@ #include "pixelGameEngine.h" #include "object.h" +#include extern std::vectorPARTY_INVENTORY; @@ -34,6 +35,7 @@ class Entity{ bool smart=false; bool dumb=false; }; + public: struct stats_t{ private: int HP=0; @@ -67,6 +69,18 @@ class Entity{ this->smart=stats.smart; this->dumb=stats.dumb; }; + bool operator==(const stats_t&t)const{ + return HP==t.HP&& + maxHP==t.maxHP&& + PP==t.PP&& + maxPP==t.maxPP&& + baseAtk==t.baseAtk&& + speed==t.speed&& + resistances==t.resistances&& + damageReduction==t.damageReduction&& + smart==t.smart&& + dumb==t.dumb; + } //Get the HP that the rolling counter is moving towards. int GetTargetHP() { return targetHP; diff --git a/main.cpp b/main.cpp index f2a320a..10cf115 100644 --- a/main.cpp +++ b/main.cpp @@ -2,12 +2,6 @@ #include "item.h" #include "layers.h" #include -#define OLC_PGE_APPLICATION -#include "pixelGameEngine.h" -#define OLC_PGEX_SPLASHSCREEN -#include "splash.h" -#define OLC_SOUNDWAVE -#include "defines.h" #include "soundwaveEngine.h" #include "tiles.h" #include "references.h" @@ -19,14 +13,25 @@ #include "particle.h" #include "effect.h" #include "battleproperty.h" +#include "map.h" #include "SeasonI.h" -//#include "test/test.h" + +#include "test/test.h" + +#ifndef TEST_SUITE +#define OLC_PGE_APPLICATION +#include "pixelGameEngine.h" +#define OLC_PGEX_SPLASHSCREEN +#include "splash.h" +#define OLC_SOUNDWAVE +#include "defines.h" +#endif using namespace olc; std::vector OBJECTS; const vd2d NO_NEIGHBOR = {-999,-999}; -PixelGameEngine*GAME; +SeasonI*GAME; vd2d cameraPos={0,0}; @@ -209,6 +214,7 @@ FireFountainEffect*FIREFOUNTAIN_EFFECT=nullptr; Effect*CURRENT_EFFECT=nullptr; +#ifndef TEST_SUITE bool SeasonI::OnUserCreate(){ srand(time(NULL)); GAME=this; @@ -318,6 +324,7 @@ This is a test message that lets us trigger straight from a cutscene! Cool!)"), return true; } +#endif void SeasonI::SetupMoveList() { MOVELIST[BattleMoveName::TESTMOVE1]=new Battle::Move{"Test Move 1","An attack",baseDmg:30,randomDmg:5,range:1,channelTime:0,friendly:false}; @@ -1094,6 +1101,7 @@ void SeasonI::LoadEncounter(Map*map,vd2d pos,int chance,int id,bool successful) } } +#ifndef TEST_SUITE bool SeasonI::OnUserUpdate(float fElapsedTime) { elapsedTime+=fElapsedTime; @@ -1121,6 +1129,8 @@ bool SeasonI::OnUserUpdate(float fElapsedTime) drawGame(); return true; } +#endif + void SeasonI::updateGame(){ frameCount++; for (auto obj:OBJECTS) { diff --git a/object.h b/object.h index 040db4a..e234df6 100644 --- a/object.h +++ b/object.h @@ -7,6 +7,8 @@ #include "layers.h" #include "item.h" #include "states.h" +#include "SeasonI.h" + using namespace olc; struct Interaction{ diff --git a/test/test.cpp b/test/test.cpp index 8db097d..c453b1d 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -20,6 +20,33 @@ #include "../effect.h" #include "../battleproperty.h" #include "test.h" +#include "../SeasonI.h" + +extern std::array PARTY_MEMBER_STATS; +extern std::mapMOVELIST; + +int testCount=0; + +void Test(std::string name,bool success) { + testCount++; + std::cout<<"Test ("<stats==defaults); + return true; +} + +bool SeasonI::OnUserUpdate(float fElapsedTime) +{ + return true; +} int main() { SeasonI demo;