|
|
@ -451,7 +451,7 @@ public: |
|
|
|
std::string MAP_NAME = ""; |
|
|
|
std::string MAP_NAME = ""; |
|
|
|
std::string CUTSCENE_CONSOLE_TEXT = ""; |
|
|
|
std::string CUTSCENE_CONSOLE_TEXT = ""; |
|
|
|
bool GAME_FLAGS[128]={}; |
|
|
|
bool GAME_FLAGS[128]={}; |
|
|
|
int**MAP=NULL; |
|
|
|
int**MAP=(int**)malloc(sizeof(int**)*0); |
|
|
|
int MAP_WIDTH=-1; |
|
|
|
int MAP_WIDTH=-1; |
|
|
|
int MAP_HEIGHT=-1; |
|
|
|
int MAP_HEIGHT=-1; |
|
|
|
Decal*TILES; |
|
|
|
Decal*TILES; |
|
|
@ -961,14 +961,14 @@ public: |
|
|
|
ENCOUNTER_SANDWORM_1.playerY=3.5; |
|
|
|
ENCOUNTER_SANDWORM_1.playerY=3.5; |
|
|
|
ENCOUNTER_SANDWORM_1.map=MAP_3; |
|
|
|
ENCOUNTER_SANDWORM_1.map=MAP_3; |
|
|
|
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
|
|
|
|
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
|
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Megamoth",3.5,3.25,745,745,MOVESET_MEGAMOTH,{2,2})); |
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Megamoth",3.5,1.75,745,745,MOVESET_MEGAMOTH,{2,2})); |
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",2,3,120,120,MOVESET_MOTH)); |
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",2,1,120,120,MOVESET_MOTH)); |
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",6,3,120,120,MOVESET_MOTH)); |
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",6,1,120,120,MOVESET_MOTH)); |
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",4,6.5,120,120,MOVESET_MOTH)); |
|
|
|
ENCOUNTER_MEGAMOTH.entities.push_back(new Entity(MOTH_DECAL,"Moth",4,4,120,120,MOVESET_MOTH)); |
|
|
|
ENCOUNTER_MEGAMOTH.x=195-4; |
|
|
|
ENCOUNTER_MEGAMOTH.x=195-4; |
|
|
|
ENCOUNTER_MEGAMOTH.y=56-3.5; |
|
|
|
ENCOUNTER_MEGAMOTH.y=56-3.5; |
|
|
|
ENCOUNTER_MEGAMOTH.playerX=4; |
|
|
|
ENCOUNTER_MEGAMOTH.playerX=4; |
|
|
|
ENCOUNTER_MEGAMOTH.playerY=3.5; |
|
|
|
ENCOUNTER_MEGAMOTH.playerY=0.5; |
|
|
|
ENCOUNTER_MEGAMOTH.map=MAP_4; |
|
|
|
ENCOUNTER_MEGAMOTH.map=MAP_4; |
|
|
|
ENCOUNTERS.push_back(ENCOUNTER_MEGAMOTH); |
|
|
|
ENCOUNTERS.push_back(ENCOUNTER_MEGAMOTH); |
|
|
|
|
|
|
|
|
|
|
@ -2540,7 +2540,7 @@ public: |
|
|
|
StartCutscene(cutscene::CHECK_COORDS_2); |
|
|
|
StartCutscene(cutscene::CHECK_COORDS_2); |
|
|
|
CUTSCENE_OBJS[0]=CreateObject({PLAYER_COORDS[0],PLAYER_COORDS[1]},PLAYER_DECAL,playerAnim,true); |
|
|
|
CUTSCENE_OBJS[0]=CreateObject({PLAYER_COORDS[0],PLAYER_COORDS[1]},PLAYER_DECAL,playerAnim,true); |
|
|
|
} |
|
|
|
} |
|
|
|
if(WALK_STEPS++>60&&!IN_BATTLE_ENCOUNTER) { |
|
|
|
if(WALK_STEPS++>60&&!IN_BATTLE_ENCOUNTER&&playerCanMove()) { |
|
|
|
PLAYER_HP=std::clamp(PLAYER_HP+1,0,PLAYER_MAXHP); |
|
|
|
PLAYER_HP=std::clamp(PLAYER_HP+1,0,PLAYER_MAXHP); |
|
|
|
updatePlayerState(); |
|
|
|
updatePlayerState(); |
|
|
|
WALK_STEPS=0; |
|
|
|
WALK_STEPS=0; |
|
|
@ -2893,14 +2893,12 @@ public: |
|
|
|
std::ifstream f("assets/maps/"+map->filename); |
|
|
|
std::ifstream f("assets/maps/"+map->filename); |
|
|
|
std::string data; |
|
|
|
std::string data; |
|
|
|
CURRENT_MAP=map; |
|
|
|
CURRENT_MAP=map; |
|
|
|
MAP_WIDTH=MAP_HEIGHT=-1; |
|
|
|
if (MAP!=nullptr) { |
|
|
|
if (MAP!=NULL) { |
|
|
|
|
|
|
|
for (int y=0;y<MAP_HEIGHT;y++) { |
|
|
|
for (int y=0;y<MAP_HEIGHT;y++) { |
|
|
|
free(MAP[y]); |
|
|
|
free(MAP[y]); |
|
|
|
} |
|
|
|
} |
|
|
|
free(MAP); |
|
|
|
|
|
|
|
MAP=NULL; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
MAP_WIDTH=MAP_HEIGHT=-1; |
|
|
|
for (int i=0;i<OBJECTS.size();i++) { |
|
|
|
for (int i=0;i<OBJECTS.size();i++) { |
|
|
|
delete OBJECTS[i]; |
|
|
|
delete OBJECTS[i]; |
|
|
|
} |
|
|
|
} |
|
|
@ -2919,9 +2917,7 @@ public: |
|
|
|
stream>>MAP_HEIGHT; |
|
|
|
stream>>MAP_HEIGHT; |
|
|
|
} else
|
|
|
|
} else
|
|
|
|
if (y<MAP_HEIGHT) { |
|
|
|
if (y<MAP_HEIGHT) { |
|
|
|
if (MAP==NULL) { |
|
|
|
MAP=(int**)realloc(MAP,sizeof(int**)*MAP_HEIGHT); |
|
|
|
MAP=(int**)malloc(sizeof(int**)*MAP_HEIGHT); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
MAP[y]=(int*)malloc(sizeof(int*)*MAP_WIDTH); |
|
|
|
MAP[y]=(int*)malloc(sizeof(int*)*MAP_WIDTH); |
|
|
|
for (int i=0;i<data.length();i++) { |
|
|
|
for (int i=0;i<data.length();i++) { |
|
|
|
MAP[y][i]=data[i]-'0'; |
|
|
|
MAP[y][i]=data[i]-'0'; |
|
|
|