|
|
|
@ -18,7 +18,7 @@ using namespace olc; |
|
|
|
|
#define SKIP_SILICON2 true |
|
|
|
|
#define SKIP_CHAPTER2 true |
|
|
|
|
#define SKIP_STORYBOOK true |
|
|
|
|
#define SKIP_CHAPTER3 false |
|
|
|
|
#define SKIP_CHAPTER3 true |
|
|
|
|
|
|
|
|
|
#define STARTING_MAP MAP_1 |
|
|
|
|
#define STARTING_STATE CUTSCENE_3 |
|
|
|
@ -58,6 +58,7 @@ enum GAMESTATE{ |
|
|
|
|
CUTSCENE_5, //Third rover repaired.
|
|
|
|
|
DISPLAY_BOOK, |
|
|
|
|
DISPLAY_BOOK2, |
|
|
|
|
CUTSCENE_6, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
namespace cutscene{ |
|
|
|
@ -92,7 +93,9 @@ namespace cutscene{ |
|
|
|
|
STORY_REVIEW2, |
|
|
|
|
FINAL_REVIEW, |
|
|
|
|
CHECK_COORDS_4, |
|
|
|
|
PREPARE_SEQUENCE, |
|
|
|
|
LAUNCHPAD_OPEN, |
|
|
|
|
LAUNCHPAD_PREPARE, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -133,6 +136,8 @@ namespace gameflag{ |
|
|
|
|
NEXT_COORDS2, |
|
|
|
|
CHECK_ROVER_4, |
|
|
|
|
LITTLESNAKES_KILLED, |
|
|
|
|
COLLECTED_SILICON_4, |
|
|
|
|
CHECK_ROVER_5, |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -723,7 +728,9 @@ public: |
|
|
|
|
GAME_FLAGS[gameflag::CHECK_ROVER_2]=true; |
|
|
|
|
} |
|
|
|
|
if (SKIP_CHAPTER3) { |
|
|
|
|
|
|
|
|
|
GAME_FLAGS[gameflag::CHECK_ROVER_4]=true; |
|
|
|
|
GAME_FLAGS[gameflag::LITTLESNAKES_KILLED]=true; |
|
|
|
|
GAME_FLAGS[gameflag::COLLECTED_SILICON_4]=true; |
|
|
|
|
} |
|
|
|
|
if (SKIP_CHAPTER2||SKIP_BOSS) { |
|
|
|
|
GAME_FLAGS[gameflag::SLEEP]=true; |
|
|
|
@ -1126,6 +1133,11 @@ public: |
|
|
|
|
fadeOut(); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case CUTSCENE_6:{ |
|
|
|
|
if (textInd>=CONSOLE_REF_TEXT.length()) { |
|
|
|
|
fadeOut(); |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1397,6 +1409,11 @@ public: |
|
|
|
|
GAME_STATE=GAMEWORLD; |
|
|
|
|
DisplayMessageBox(36); |
|
|
|
|
}break; |
|
|
|
|
case CUTSCENE_6:{ |
|
|
|
|
PlayCutscene(cutscene::LAUNCHPAD_OPEN); |
|
|
|
|
fadeIn(); |
|
|
|
|
GAME_STATE=GAMEWORLD; |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
switch (CURRENT_CUTSCENE) { |
|
|
|
|
case cutscene::TRANSITION_CUTSCENE:{ |
|
|
|
@ -1507,6 +1524,12 @@ public: |
|
|
|
|
StartCutscene(cutscene::FINAL_REVIEW); |
|
|
|
|
fadeIn(); |
|
|
|
|
}break; |
|
|
|
|
case cutscene::PREPARE_SEQUENCE:{ |
|
|
|
|
GAME_STATE=CUTSCENE_6; |
|
|
|
|
ResetTerminal(STORY_TEXT7); |
|
|
|
|
fadeIn(); |
|
|
|
|
EndCutscene(); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2618,6 +2641,44 @@ public: |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case cutscene::PREPARE_SEQUENCE:{ |
|
|
|
|
if (!messageBoxVisible) { |
|
|
|
|
if (!CUTSCENE_FLAGS[0]) { |
|
|
|
|
CUTSCENE_FLAGS[0]=true; |
|
|
|
|
fadeOut(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case cutscene::LAUNCHPAD_OPEN:{ |
|
|
|
|
if (MoveCameraTowardsPoint({30,35})) { |
|
|
|
|
if (frameCount%16==0) { |
|
|
|
|
PLAYER_COORDS[0]+=0.25; |
|
|
|
|
} else
|
|
|
|
|
if (frameCount%16==4) { |
|
|
|
|
PLAYER_COORDS[0]+=0.25; |
|
|
|
|
} else
|
|
|
|
|
if (frameCount%16==8) { |
|
|
|
|
PLAYER_COORDS[0]-=0.25; |
|
|
|
|
} else
|
|
|
|
|
if (frameCount%16==12) { |
|
|
|
|
PLAYER_COORDS[0]-=0.25; |
|
|
|
|
} |
|
|
|
|
if (CUTSCENE_TIMER>60*8) { |
|
|
|
|
PlayCutscene(cutscene::LAUNCHPAD_PREPARE); |
|
|
|
|
CUTSCENE_OBJS[1]=CreateObject({30,35},LAUNCHPAD_DECAL); |
|
|
|
|
CUTSCENE_OBJS[2]=CreateObject({30,35},LAUNCHPAD_HALF1_DECAL); |
|
|
|
|
CUTSCENE_OBJS[3]=CreateObject({30,35},LAUNCHPAD_HALF2_DECAL); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
case cutscene::LAUNCHPAD_PREPARE:{ |
|
|
|
|
bool result1,result2; |
|
|
|
|
result1=MoveObjectTowardsPoint({29.5,35.28},CUTSCENE_OBJS[2],BOTH,0.001); |
|
|
|
|
result2=MoveObjectTowardsPoint({30.5,34.78},CUTSCENE_OBJS[3],BOTH,0.001); |
|
|
|
|
if (result1&&result2) { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (GAME_STATE==CUTSCENE_3&&!SOUND_IS_PLAYING) { |
|
|
|
@ -2631,6 +2692,7 @@ public: |
|
|
|
|
case CUTSCENE_3: |
|
|
|
|
case CUTSCENE_4: |
|
|
|
|
case CUTSCENE_5: |
|
|
|
|
case CUTSCENE_6: |
|
|
|
|
case GAME_OVER_TERMINAL:{ |
|
|
|
|
if (GAME_STATE==CUTSCENE_3&&frameCount%4!=0) {break;} |
|
|
|
|
if (textInd<CONSOLE_REF_TEXT.length()) { |
|
|
|
@ -2679,6 +2741,12 @@ public: |
|
|
|
|
}break; |
|
|
|
|
case COLLECTED_SILICON:{ |
|
|
|
|
if (!messageBoxVisible) { |
|
|
|
|
if (CURRENT_MAP==MAP_5) { |
|
|
|
|
if (!GAME_FLAGS[gameflag::COLLECTED_SILICON_4]) { |
|
|
|
|
GAME_FLAGS[gameflag::COLLECTED_SILICON_4]=true; |
|
|
|
|
GAME_STATE=GAMEWORLD; |
|
|
|
|
} |
|
|
|
|
} else |
|
|
|
|
if (CURRENT_MAP==MAP_4) { |
|
|
|
|
if (!GAME_FLAGS[gameflag::COLLECTED_SILICON_3]) { |
|
|
|
|
GAME_FLAGS[gameflag::COLLECTED_SILICON_3]=true; |
|
|
|
@ -2797,6 +2865,12 @@ public: |
|
|
|
|
DisplayMessageBox(46); |
|
|
|
|
StartCutscene(cutscene::CHECK_COORDS_4); |
|
|
|
|
CUTSCENE_OBJS[0]=CreateObject({PLAYER_COORDS[0],PLAYER_COORDS[1]},PLAYER_DECAL,playerAnim,true); |
|
|
|
|
} else |
|
|
|
|
if (!GAME_FLAGS[gameflag::CHECK_ROVER_5]&&GAME_FLAGS[gameflag::COLLECTED_SILICON_4]&&PLAYER_COORDS[0]>=31&&PLAYER_COORDS[0]<=35&&PLAYER_COORDS[1]>=33&&PLAYER_COORDS[1]<=37) { |
|
|
|
|
GAME_FLAGS[gameflag::CHECK_ROVER_5]=true; |
|
|
|
|
DisplayMessageBox(49); |
|
|
|
|
StartCutscene(cutscene::PREPARE_SEQUENCE); |
|
|
|
|
CUTSCENE_OBJS[0]=CreateObject({PLAYER_COORDS[0],PLAYER_COORDS[1]},PLAYER_DECAL,playerAnim,true); |
|
|
|
|
} |
|
|
|
|
if(WALK_STEPS++>60&&!IN_BATTLE_ENCOUNTER) { |
|
|
|
|
PLAYER_HP=std::clamp(PLAYER_HP+1,0,PLAYER_MAXHP); |
|
|
|
@ -2810,6 +2884,7 @@ public: |
|
|
|
|
case CUTSCENE_1: |
|
|
|
|
case CUTSCENE_4: |
|
|
|
|
case CUTSCENE_5: |
|
|
|
|
case CUTSCENE_6: |
|
|
|
|
case GAME_OVER_TERMINAL:{ |
|
|
|
|
DrawStringDecal({16,16},CUTSCENE_CONSOLE_TEXT,GREEN,{1,1}); |
|
|
|
|
if (textInd<CONSOLE_REF_TEXT.length()) { |
|
|
|
@ -2975,6 +3050,13 @@ public: |
|
|
|
|
case cutscene::IN_BED:{ |
|
|
|
|
FillRectDecal({0,0},{WIDTH,HEIGHT},Pixel(0,0,0,192)); |
|
|
|
|
}break; |
|
|
|
|
case cutscene::LAUNCHPAD_OPEN:{ |
|
|
|
|
DrawDecal({(30-PLAYER_COORDS[0])*32+WIDTH/2,(35-PLAYER_COORDS[1])*32+HEIGHT/2+(6-6*((CUTSCENE_TIMER/240.0)))},LAUNCHPAD_CLOSED_DECAL,{1,1},Pixel(255,255,255,(CUTSCENE_TIMER/480.0)*255)); |
|
|
|
|
}break; |
|
|
|
|
case cutscene::LAUNCHPAD_PREPARE:{ |
|
|
|
|
int bottomCutoff = (int)(std::clamp(CUTSCENE_TIMER,0,600)/600.0*64); |
|
|
|
|
DrawPartialDecal({(30-PLAYER_COORDS[0])*32+WIDTH/2,(36.5-PLAYER_COORDS[1])*32+HEIGHT/2-bottomCutoff},{64,bottomCutoff},Y_Y_DECAL,{0,0},{64,bottomCutoff},Pixel(std::clamp(CUTSCENE_TIMER,0,600)/600.0*255,std::clamp(CUTSCENE_TIMER,0,600)/600.0*255,std::clamp(CUTSCENE_TIMER,0,600)/600.0*255,255)); |
|
|
|
|
}break; |
|
|
|
|
} |
|
|
|
|
FillRectDecal({0,0},{WIDTH,HEIGHT},Pixel(0,0,0,transparency)); |
|
|
|
|
//FillRectDecal({WIDTH/2-2,HEIGHT/2-2},{4,4},WHITE);
|
|
|
|
|