diff --git a/C++ProjectTemplate b/C++ProjectTemplate index a429506..7bad684 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/SeasonI.code-workspace b/SeasonI.code-workspace index 500c8b2..be0404f 100644 --- a/SeasonI.code-workspace +++ b/SeasonI.code-workspace @@ -5,6 +5,9 @@ }, { "path": "../Seasons-Of-Loneliness" + }, + { + "path": "../EarthboundBattleSim" } ], "settings": { diff --git a/assets/rollingcounter.png b/assets/rollingcounter.png new file mode 100644 index 0000000..3f6f1d3 Binary files /dev/null and b/assets/rollingcounter.png differ diff --git a/main.cpp b/main.cpp index 3867ec7..b401f35 100644 --- a/main.cpp +++ b/main.cpp @@ -19,6 +19,11 @@ #define TILEMAP_EDITOR_DRAW_MULT 0.4375 #define TILEMAP_EDITOR_TILESIZE (32*TILEMAP_EDITOR_DRAW_MULT) #define PARTY_TRAIL_LENGTH 48 +#define CAMERA_WAIT_TIME 60 + +#define ㅎ +#define ㅍ +#define 아 #define AddAsyncCutsceneAction(AsyncClass) \ if (!((AsyncClass*)CurrentCutscene->GetAction())->InQueue()) { \ @@ -261,6 +266,9 @@ class Entity{ int HP=0; int targetHP=0; int maxHP=0; + int PP=0; + int targetPP=0; + int maxPP=0; std::arrayresistances={0,0,0,0}; int speed=0; int baseAtk=0; @@ -271,23 +279,17 @@ class Entity{ Object* obj; std::vector moveSet; //Used for initializing players. - Entity(int HP,int maxHP,int baseAtk,std::arrayresistances,int speed,std::vectormoveSet,int damageReduction=0,bool smart=false,bool dumb=false) { - Entity(nullptr,HP,maxHP,baseAtk,resistances,speed,moveSet,damageReduction,smart,dumb); + Entity(int HP,int maxHP,int PP,int maxPP,int baseAtk,std::arrayresistances,int speed,std::vectormoveSet,int damageReduction=0,bool smart=false,bool dumb=false) { + Entity(nullptr,HP,maxHP,PP,maxPP,baseAtk,resistances,speed,moveSet,damageReduction,smart,dumb); } //Use this for initializing enemies as it lets you specify an object. - Entity(Object*obj,int HP,int maxHP,int baseAtk,std::arrayresistances,int speed,std::vectormoveSet,int damageReduction=0,bool smart=false,bool dumb=false) { - this->obj=obj; - this->HP=this->targetHP=HP; - this->maxHP=maxHP; + Entity(Object*obj,int HP,int maxHP,int PP,int maxPP,int baseAtk,std::arrayresistances,int speed,std::vectormoveSet,int damageReduction=0,bool smart=false,bool dumb=false) + :obj(obj),HP(HP),maxHP(maxHP),PP(PP),maxPP(maxPP),baseAtk(baseAtk),speed(speed),moveSet(moveSet),damageReduction(damageReduction),smart(smart),dumb(dumb){ for (int i=0;i<4;i++) { this->resistances[i]=resistances[i]; } - this->speed=speed; - this->moveSet=moveSet; - this->smart=smart; - this->dumb=dumb; - this->baseAtk=baseAtk; - this->damageReduction=damageReduction; + this->targetHP=HP; + this->targetPP=PP; } }; @@ -384,6 +386,9 @@ public: Encounter*EDITING_ENCOUNTER=nullptr; Encounter*BATTLE_ENCOUNTER=nullptr; int BATTLE_STATE=BattleState::MOVE_CAMERA; + int CAMERA_WAIT_TIMER=0; + int player_rollhp_counter[4][3] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; + int player_rollpp_counter[4][3] = {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}; bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things. @@ -523,10 +528,24 @@ goes on a very long time, I hope you can understand this is only for testing pur if (BATTLE_ENCOUNTER!=nullptr) { switch (BATTLE_STATE) { case BattleState::MOVE_CAMERA:{ - MoveCameraTowardsPoint(BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD); + bool allDone=true; + if (!MoveCameraTowardsPoint(BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD)) { + allDone=false; + } for (int i=0;iplayerPos[i]+BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD); + if (!MoveObjectTowardsPoint(PARTY_MEMBER_OBJ[i],BATTLE_ENCOUNTER->playerPos[i]+BATTLE_ENCOUNTER->pos,PriorityDirection::BOTH,BATTLE_CAMERA_MOVESPD)) { + allDone=false; + } } + if (allDone) { + CAMERA_WAIT_TIMER++; + if (CAMERA_WAIT_TIMER>=CAMERA_WAIT_TIME) { + BATTLE_STATE=BattleState::WAIT; + } + } + } + case BattleState::WAIT:{ + }break; } } @@ -1429,7 +1448,7 @@ goes on a very long time, I hope you can understand this is only for testing pur void SetupPartyMemberStats() { for (int i=0;i<7;i++) { - PARTY_MEMBER_STATS[i]=new Entity(120,120,8,{0,0,0,0},4,{MOVELIST[BattleMoveName::TESTMOVE1]}); + PARTY_MEMBER_STATS[i]=new Entity(120,120,30,30,8,{0,0,0,0},4,{MOVELIST[BattleMoveName::TESTMOVE1]}); } } @@ -1620,21 +1639,21 @@ goes on a very long time, I hope you can understand this is only for testing pur std::vector{ new Entity(new Object( NPC1_4,"Test Obj",{+20,+48},ANIMATIONS["player.png"]), - 70,70,14,std::array{0,0,0,0},0,std::vector{ + ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array{0,0,0,0},0,std::vector{ MOVELIST[BattleMoveName::TESTMOVE1], MOVELIST[BattleMoveName::TESTMOVE2], MOVELIST[BattleMoveName::TESTMOVE3], }), new Entity(new Object( NPC1_4,"Test Obj 2",{+40,+64},ANIMATIONS["player.png"]), - 70,70,14,std::array{0,0,0,0},0,std::vector{ + ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array{0,0,0,0},0,std::vector{ MOVELIST[BattleMoveName::TESTMOVE1], MOVELIST[BattleMoveName::TESTMOVE2], MOVELIST[BattleMoveName::TESTMOVE3], }), new Entity(new Object( NPC1_4,"Test Obj 3",{+60,+24},ANIMATIONS["player.png"]), - 70,70,14,std::array{0,0,0,0},0,std::vector{ + ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array{0,0,0,0},0,std::vector{ MOVELIST[BattleMoveName::TESTMOVE1], MOVELIST[BattleMoveName::TESTMOVE2], MOVELIST[BattleMoveName::TESTMOVE3], @@ -1645,21 +1664,21 @@ goes on a very long time, I hope you can understand this is only for testing pur std::vector{ new Entity(new Object( NPC1_4,"Test Obj",{20,48},ANIMATIONS["player.png"],{2,2},GREEN), - 70,70,14,std::array{0,0,0,0},0,std::vector{ + ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array{0,0,0,0},0,std::vector{ MOVELIST[BattleMoveName::TESTMOVE1], MOVELIST[BattleMoveName::TESTMOVE2], MOVELIST[BattleMoveName::TESTMOVE3], }), new Entity(new Object( NPC1_4,"Test Obj 2",{40,64},ANIMATIONS["player.png"],{2,2},GREEN), - 70,70,14,std::array{0,0,0,0},0,std::vector{ + ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array{0,0,0,0},0,std::vector{ MOVELIST[BattleMoveName::TESTMOVE1], MOVELIST[BattleMoveName::TESTMOVE2], MOVELIST[BattleMoveName::TESTMOVE3], }), new Entity(new Object( NPC1_4,"Test Obj 3",{60,24},ANIMATIONS["player.png"],{2,2},GREEN), - 70,70,14,std::array{0,0,0,0},0,std::vector{ + ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array{0,0,0,0},0,std::vector{ MOVELIST[BattleMoveName::TESTMOVE1], MOVELIST[BattleMoveName::TESTMOVE2], MOVELIST[BattleMoveName::TESTMOVE3], @@ -1670,7 +1689,7 @@ goes on a very long time, I hope you can understand this is only for testing pur std::vector{ new Entity(new Object( NPC1_4,"Test Obj",{20,48},ANIMATIONS["player.png"],{1,1},MAGENTA), - 70,70,14,std::array{0,0,0,0},0,std::vector{ + ㅎ 70,ㅎ 70,ㅍ 10,ㅍ 10,아 14,std::array{0,0,0,0},0,std::vector{ MOVELIST[BattleMoveName::TESTMOVE1], MOVELIST[BattleMoveName::TESTMOVE2], MOVELIST[BattleMoveName::TESTMOVE3], @@ -1898,7 +1917,7 @@ goes on a very long time, I hope you can understand this is only for testing pur for (int i=0;iobjs.size();i++) { Entity*ent=ENCOUNTER_LIST[id]->objs[i]; Object*newObj=new Object(ent->obj->id,ent->obj->name,ent->obj->GetPos(),ent->obj->spr,ent->obj->GetScale(),ent->obj->color,ent->obj->animationSpd,ent->obj->temp); - ents.push_back(new Entity(newObj,ent->HP,ent->maxHP,ent->baseAtk,ent->resistances,ent->speed,ent->moveSet,ent->damageReduction,ent->smart,ent->dumb)); + ents.push_back(new Entity(newObj,ent->HP,ent->maxHP,ent->PP,ent->maxPP,ent->baseAtk,ent->resistances,ent->speed,ent->moveSet,ent->damageReduction,ent->smart,ent->dumb)); } Encounter*data=new Encounter(id,pos,ENCOUNTER_LIST[id]->playerPos,ents,chance); data->chance=chance;