diff --git a/SeasonsOfLoneliness.cpp b/SeasonsOfLoneliness.cpp index d7e84e4..8e793ab 100644 --- a/SeasonsOfLoneliness.cpp +++ b/SeasonsOfLoneliness.cpp @@ -46,7 +46,8 @@ enum GAMESTATE{ COLLECTED_SILICON, CUTSCENE_4, //First rover repaired. CUTSCENE_4_DONE, - LATER_THAT_NIGHT, + LATER_THAT_NIGHTFADEIN, + LATER_THAT_NIGHTFADEOUT, }; namespace cutscene{ @@ -69,6 +70,8 @@ namespace cutscene{ END_VOLCANIC_AREA_CUTSCENE, REPAIR_ROVER_1, GET_SOME_REST, + IN_BED, + SHAKE, }; } @@ -160,7 +163,16 @@ class ObjectLoadInfo{ this->spr=spr; this->anim=anim; this->hasanim=true; - updateAnimationsList.push_back(anim); + bool matches=false; + for (int i=0;icol=col; } ObjectLoadInfo(Decal*spr,vi2d spos,vi2d size,Pixel col=WHITE) { @@ -533,9 +545,7 @@ public: GAME_FLAGS[gameflag::COLLECTED_SILICON_1]=true; GAME_FLAGS[gameflag::REPAIRED_ROVER_1]=true; GAME_FLAGS[gameflag::REST_IN_DOME]=true; - GAME_FLAGS[gameflag::SLEEP]=true; - GAME_STATE=LATER_THAT_NIGHT; - TIMER=0; + GAME_STATE=GAMEWORLD; } if (SKIP_CHAPTER2||SKIP_CHAPTER3) { @@ -661,12 +671,14 @@ public: PETAL_STORM_ANIMATION->skip_frames=nodeAnimationSkipFrames; SLEEP_ANIMATION->spr=SLEEP_DECAL; for (int i=0;i<3;i++) { - PETAL_STORM_ANIMATION->frames.push_back({i*32+32,0}); + SLEEP_ANIMATION->frames.push_back({i*32+32,0}); } - SLEEP_ANIMATION->skip_frames=5; + SLEEP_ANIMATION->skip_frames=15; + SLEEP_ANIMATION->height=64; EMPTY_BED_ANIMATION->spr=SLEEP_DECAL; EMPTY_BED_ANIMATION->frames.push_back({0,0}); - EMPTY_BED_ANIMATION->skip_frames=0; + EMPTY_BED_ANIMATION->skip_frames=1; + EMPTY_BED_ANIMATION->height=64; HAILSTORM->playerOwnCount=3; HURRICANE->playerOwnCount=1; @@ -967,6 +979,14 @@ public: PlayCutscene(cutscene::GET_SOME_REST); fadeIn(); }break; + case LATER_THAT_NIGHTFADEIN:{ + fadeIn(); + }break; + case LATER_THAT_NIGHTFADEOUT:{ + fadeIn(); + GAME_STATE=GAMEWORLD; + PlayCutscene(cutscene::IN_BED); + }break; } switch (CURRENT_CUTSCENE) { case cutscene::TRANSITION_CUTSCENE:{ @@ -985,6 +1005,12 @@ public: TeleportToMapFileCoords(8,17); fadeIn(); EndCutscene(); + if (GAME_FLAGS[gameflag::REST_IN_DOME]&&!GAME_FLAGS[gameflag::SLEEP]) { + GAME_FLAGS[gameflag::SLEEP]=true; + //20,2 + GAME_STATE=LATER_THAT_NIGHTFADEIN; + fadeOutCompleted(); + } }break; case cutscene::DISPLAY_VOLCANIC_AREA:{ TeleportToMapFileCoords(13,122); @@ -1005,6 +1031,12 @@ public: } void fadeInCompleted() { + switch (GAME_STATE) { + case LATER_THAT_NIGHTFADEIN:{ + fadeOut(); + GAME_STATE=LATER_THAT_NIGHTFADEOUT; + }break; + } switch (CURRENT_CUTSCENE) { case cutscene::DISPLAY_VOLCANIC_AREA:{ CUTSCENE_FLAGS[0]=true; @@ -1053,6 +1085,9 @@ public: case cutscene::GET_SOME_REST:{ DisplayMessageBox(18); }break; + case cutscene::IN_BED:{ + CUTSCENE_OBJS[0]=CreateObject({20,2},SLEEP_DECAL,SLEEP_ANIMATION,true); + }break; } for (int i=0;i<8;i++) { CUTSCENE_FLAGS[i]=false; @@ -1242,13 +1277,7 @@ public: } else if (obj->name.compare("DOME")==0&&collidesWithPlayer(obj)) { fadeOut(); - if (GAME_FLAGS[gameflag::REST_IN_DOME]&&!GAME_FLAGS[gameflag::SLEEP]) { - GAME_FLAGS[gameflag::SLEEP]=true; - //20,2 - CUTSCENE_OBJS[0]=CreateObject({20,2},SLEEP_DECAL,SLEEP_ANIMATION,true); - } else { - PlayCutscene(cutscene::TRANSITION_CUTSCENE_2); - } + PlayCutscene(cutscene::TRANSITION_CUTSCENE_2); } } } @@ -1640,6 +1669,29 @@ public: } } }break; + case cutscene::IN_BED:{ + if (!CUTSCENE_FLAGS[0]&&MoveCameraTowardsPoint({CUTSCENE_OBJS[0]->x,CUTSCENE_OBJS[0]->y})) { + CUTSCENE_FLAGS[0]=true; + CUTSCENE_TIMER=0; + } else + if (CUTSCENE_FLAGS[0]&&!CUTSCENE_FLAGS[1]&&CUTSCENE_TIMER>60*4) { + StartCutscene(cutscene::SHAKE); + } + }break; + case cutscene::SHAKE:{ + if (frameCount%4==0) { + PLAYER_COORDS[1]+=0.25; + } else + if (frameCount%4==1) { + PLAYER_COORDS[1]+=0.25; + } else + if (frameCount%4==2) { + PLAYER_COORDS[1]-=0.25; + } else + if (frameCount%4==3) { + PLAYER_COORDS[1]-=0.25; + } + }break; } switch (GAME_STATE) { @@ -1830,7 +1882,8 @@ public: GradientFillRectDecal({0,HEIGHT/2},{WIDTH/2,HEIGHT/2},{100, 10, 255,ALPHA_SCREEN1},{100, 10, 255,ALPHA_SCREEN1},{100, 10, 255,ALPHA_SCREEN1},{100, 10, 255,ALPHA_SCREEN2}); GradientFillRectDecal({WIDTH/2,HEIGHT/2},{WIDTH/2,HEIGHT/2},{100, 10, 255,ALPHA_SCREEN2},{100, 10, 255,ALPHA_SCREEN1},{100, 10, 255,ALPHA_SCREEN1},{100, 10, 255,ALPHA_SCREEN1}); }break; - case LATER_THAT_NIGHT:{ + case LATER_THAT_NIGHTFADEIN: + case LATER_THAT_NIGHTFADEOUT:{ DrawDecal({WIDTH/2-LATER_THAT_NIGHT_DECAL->sprite->width/2,HEIGHT/2-LATER_THAT_NIGHT_DECAL->sprite->height/2},LATER_THAT_NIGHT_DECAL); }break; } @@ -1906,6 +1959,9 @@ public: FillRectDecal({0,0},{WIDTH,HEIGHT},Pixel(0,0,0,128)); DrawTerminal(); }break; + case cutscene::IN_BED:{ + FillRectDecal({0,0},{WIDTH,HEIGHT},Pixel(0,0,0,192)); + }break; } FillRectDecal({0,0},{WIDTH,HEIGHT},Pixel(0,0,0,transparency)); //FillRectDecal({WIDTH/2-2,HEIGHT/2-2},{4,4},WHITE); diff --git a/Seasons_of_Loneliness b/Seasons_of_Loneliness index 246b0b7..1639b62 100755 Binary files a/Seasons_of_Loneliness and b/Seasons_of_Loneliness differ