@ -42,6 +42,8 @@ enum GAMESTATE{
GAME_OVER ,
COLLECTED_SILICON ,
CUTSCENE_4 , //First rover repaired.
CUTSCENE_4_DONE ,
LATER_THAT_NIGHT ,
} ;
namespace cutscene {
@ -87,6 +89,7 @@ namespace gameflag{
VISIT_BROKEN_ROVER ,
COLLECTED_SILICON_1 ,
REPAIRED_ROVER_1 ,
REST_IN_DOME ,
} ;
}
@ -271,7 +274,10 @@ class Entity{
bool turnComplete = false ;
bool slowed = false ;
int damageFrame = 0 ;
Entity ( Decal * spr , std : : string name , int x , int y , int hp , int maxhp , std : : vector < WEATHER_POWER * > moveset ) {
int fixedTurnOrderInd = 0 ;
bool fixedTurnOrder = false ; //If this is turned on, the selected move will increment in order of the move set (and loop accordingly.)
vf2d sprScale ;
Entity ( Decal * spr , std : : string name , int x , int y , int hp , int maxhp , std : : vector < WEATHER_POWER * > moveset , vf2d sprScale = { 1 , 1 } , bool fixedMoveset = false ) {
this - > spr = spr ;
this - > name = name ;
this - > x = x ;
@ -280,6 +286,8 @@ class Entity{
this - > hp = hp ;
this - > maxhp = maxhp ;
this - > moveSet = moveset ;
this - > fixedTurnOrder = fixedMoveset ;
this - > sprScale = sprScale ;
}
} ;
@ -394,6 +402,7 @@ public:
Animation CONSUME_MEAL_ANIMATION ;
Animation NADO_ANIMATION ;
Animation PETAL_STORM_ANIMATION ;
Animation SLEEP_ANIMATION ;
ParticleEffect * HAILSTORM_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 4 , 4 } , { - 2 , 0.5 } , { - 0.5 , 2 } , Pixel ( 143 , 242 , 255 , 255 ) , Pixel ( 255 , 255 , 255 , 255 ) , 300 , Pixel ( 220 , 226 , 227 , 0 ) ) ;
ParticleEffect * HURRICANE_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 2 , 2 } , { - 4 , 1 } , { - 1 , 4 } , Pixel ( 225 , 248 , 252 , 64 ) , Pixel ( 255 , 255 , 255 , 128 ) , 300 , Pixel ( 220 , 226 , 227 , 0 ) ) ;
ParticleEffect * METEOR_RAIN_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 3 , 3 } , { 6 , 6 } , { - 1 , 0.2 } , { - 0.2 , 1 } , Pixel ( 46 , 31 , 31 , 255 ) , Pixel ( 43 , 31 , 46 , 255 ) , 50 , Pixel ( 30 , 10 , 36 , 0 ) ) ;
@ -404,6 +413,11 @@ public:
ParticleEffect * AVALANCHE_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 8 , 8 } , { - 4 , 2 } , { 4 , 4 } , Pixel ( 143 , 242 , 255 , 255 ) , Pixel ( 255 , 255 , 255 , 255 ) , 300 , Pixel ( 220 , 226 , 227 , 0 ) ) ;
ParticleEffect * CONSUME_SNACK_EFF = new ParticleEffect ( { 0 , 0 } , { 64 , 64 } , { 64 , 64 } , { 64 , 64 } , { 1 , 1 } , { 2 , 2 } , { - 0.1 , - 0.5 } , { 0.1 , - 0.05 } , Pixel ( 255 , 255 , 255 , 130 ) , Pixel ( 255 , 255 , 255 , 210 ) , 30 , Pixel ( 147 , 161 , 90 , 0 ) ) ; //Used for CONSUME_MEAL too.
ParticleEffect * PETAL_STORM_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 3 , 3 } , { - 4 , 0.6 } , { 4 , 2 } , Pixel ( 127 , 27 , 130 , 130 ) , Pixel ( 227 , 218 , 227 , 240 ) , 160 , Pixel ( 147 , 161 , 90 , 0 ) ) ;
ParticleEffect * LIGHT_STORM_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , HEIGHT / 2 } , { 2 , HEIGHT } , { 0 , 4 } , { 0 , 25 } , Pixel ( 214 , 233 , 255 , 130 ) , Pixel ( 255 , 255 , 255 , 255 ) , 30 , Pixel ( 0 , 0 , 0 , 32 ) ) ;
ParticleEffect * SEED_BULLET_EFF = new ParticleEffect ( { 0 , 0 } , { 64 , 64 } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 3 , 3 } , { - 5 , - 5 } , { 5 , 5 } , Pixel ( 138 , 255 , 153 , 200 ) , Pixel ( 193 , 245 , 200 , 210 ) , 40 , Pixel ( 70 , 158 , 62 , 0 ) ) ;
ParticleEffect * SEED_PELLET_EFF = new ParticleEffect ( { 0 , 0 } , { 64 , 64 } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 1 , 1 } , { - 3 , - 3 } , { 3 , 3 } , Pixel ( 138 , 255 , 153 , 200 ) , Pixel ( 193 , 245 , 200 , 210 ) , 10 , Pixel ( 70 , 158 , 62 , 0 ) ) ;
ParticleEffect * SUMMON_MINION_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 4 , 4 } , { 12 , 12 } , { 0 , - 6 } , { 0 , - 20 } , Pixel ( 223 , 242 , 0 , 130 ) , Pixel ( 223 , 255 , 114 , 210 ) , 50 , Pixel ( 70 , 158 , 62 , 0 ) ) ;
ParticleEffect * SEED_OF_LIFE_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 2 , 2 } , { 2 , 2 } , { - 1 , - 2 } , { 1 , - 0.2 } , Pixel ( 65 , 98 , 66 , 210 ) , Pixel ( 65 , 117 , 60 , 255 ) , 140 , Pixel ( 70 , 158 , 62 , 0 ) ) ;
WEATHER_POWER * HAILSTORM = new WEATHER_POWER ( " Hailstorm " , " Causes a flurry of hard cold rocks to be unleashed in target area. 60+30d " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , 60 , 30 , 160 , Pixel ( 72 , 160 , 212 , 255 ) , Pixel ( 93 , 161 , 163 , 255 ) , 120 , HAILSTORM_EFF ) ;
WEATHER_POWER * HURRICANE = new WEATHER_POWER ( " Hurricane " , " Causes heavy winds, scattering seeds, heavy rain. 20+10d " , & POWER_HURRICANE_ANIMATION , & POWER_HURRICANE_ANIMATION , 20 , 10 , 200 , Pixel ( 99 , 148 , 132 , 255 ) , Pixel ( 121 , 132 , 140 , 255 ) , 120 , HURRICANE_EFF ) ;
WEATHER_POWER * METEOR_RAIN = new WEATHER_POWER ( " Meteor Rain " , " Causes space rocks to fall on target area. 50+50d " , & POWER_METEOR_SHOWER_ANIMATION , & POWER_METEOR_SHOWER_ANIMATION , 50 , 50 , 96 , Pixel ( 96 , 86 , 153 , 255 ) , Pixel ( 170 , 103 , 201 , 255 ) , 120 , METEOR_STORM_EFF ) ;
@ -412,6 +426,11 @@ public:
WEATHER_POWER * SANDSTORM = new WEATHER_POWER ( " Sandstorm " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , 5 , 10 , 64 , Pixel ( 93 , 161 , 163 , 255 ) , Pixel ( 72 , 160 , 212 , 255 ) , 120 , SANDSTORM_EFF ) ;
WEATHER_POWER * SEED_STORM = new WEATHER_POWER ( " Seed Storm " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , - 10 , 15 , 30 , Pixel ( 93 , 161 , 163 , 255 ) , Pixel ( 72 , 160 , 212 , 255 ) , 120 , SEED_STORM_EFF ) ;
WEATHER_POWER * AVALANCHE = new WEATHER_POWER ( " Avalanche " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , 15 , 10 , 200 , Pixel ( 93 , 161 , 163 , 255 ) , Pixel ( 72 , 160 , 212 , 255 ) , 120 , AVALANCHE_EFF ) ;
WEATHER_POWER * LIGHT_STORM = new WEATHER_POWER ( " Light Storm " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , 15 , 10 , 64 , Pixel ( 171 , 151 , 53 , 255 ) , Pixel ( 237 , 237 , 237 , 255 ) , 120 , LIGHT_STORM_EFF ) ;
WEATHER_POWER * SEED_BULLET = new WEATHER_POWER ( " Seed Bullet " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , 10 , 15 , 30 , Pixel ( 57 , 92 , 63 , 255 ) , Pixel ( 95 , 232 , 119 , 255 ) , 120 , SEED_BULLET_EFF ) ;
WEATHER_POWER * SEED_PELLET = new WEATHER_POWER ( " Seed Pellet " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , 5 , 10 , 30 , Pixel ( 57 , 92 , 63 , 255 ) , Pixel ( 95 , 232 , 119 , 255 ) , 120 , SEED_PELLET_EFF ) ;
WEATHER_POWER * SEED_OF_LIFE = new WEATHER_POWER ( " Seed of Life " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , - 10 , 15 , 96 , Pixel ( 93 , 161 , 163 , 255 ) , Pixel ( 72 , 160 , 212 , 255 ) , 120 , SEED_OF_LIFE_EFF ) ;
WEATHER_POWER * SUMMON_MINIONS = new WEATHER_POWER ( " Summon Minions " , " " , & POWER_HAILSTORM_ANIMATION , & POWER_HAILSTORM_ANIMATION , - 75 , 15 , 30 , Pixel ( 57 , 92 , 63 , 255 ) , Pixel ( 95 , 232 , 119 , 255 ) , 120 , SUMMON_MINION_EFF ) ;
WEATHER_POWER * CONSUME_SNACK = new WEATHER_POWER ( " Snack " , " Restores 33% health for 5 turns. If battle ends before effect ends, food is not consumed. " , & CONSUME_SNACK_ANIMATION , & CONSUME_SNACK_ANIMATION , - 1001 , 1 , 200 , Pixel ( 147 , 173 , 66 , 255 ) , Pixel ( 255 , 188 , 3 , 255 ) , 120 , CONSUME_SNACK_EFF ) ;
WEATHER_POWER * CONSUME_MEAL = new WEATHER_POWER ( " Meal " , " Restores all health. Increases Maximum Health by 5. " , & CONSUME_MEAL_ANIMATION , & CONSUME_MEAL_ANIMATION , - 1002 , 1 , 200 , Pixel ( 147 , 173 , 66 , 255 ) , Pixel ( 255 , 188 , 3 , 255 ) , 120 , CONSUME_SNACK_EFF ) ;
WEATHER_POWER * PETAL_STORM = new WEATHER_POWER ( " Petal Storm " , " Places seeds, causes minor healing. 20+20d " , & PETAL_STORM_ANIMATION , & PETAL_STORM_ANIMATION , 20 , 20 , 110 , Pixel ( 189 , 132 , 189 , 255 ) , Pixel ( 235 , 75 , 235 , 255 ) , 120 , PETAL_STORM_EFF ) ;
@ -447,8 +466,7 @@ public:
int PIXEL_LIMIT = 0 ;
vf2d PIXEL_POS ;
vf2d PIXEL_SIZE ;
std : : vector < WEATHER_POWER * > MOVESET_SPIDEY ;
float PIXEL_EFFECT_TRANSPARENCY = 0.5 ;
float PIXEL_EFFECT_TRANSPARENCY = 0 ;
int CUTSCENE_OBJ_COUNT = 0 ;
int TERMINAL_SELECTED_CHAR = 0 ;
std : : string TERMINAL_INPUT = " " ;
@ -457,6 +475,7 @@ public:
std : : vector < vi2d > COLLECTED_ITEMS ;
Zone * ACTIVE_ZONE = nullptr ;
std : : vector < vi2d > REPAIRED_ROVERS ;
std : : string CONSOLE_REF_TEXT ;
Decal * DOME_DECAL , * FOOD_METER_DECAL , * OXYGEN_METER_DECAL , * PLANT_DECAL ,
@ -464,11 +483,17 @@ public:
* WEATHERNODE_EFFECT_DECAL , * POWER_HAILSTORM_DECAL , * POWER_HURRICANE_DECAL , * POWER_METEOR_SHOWER_DECAL , * POWER_METEOR_STORM_DECAL , * POWER_SNOWSTORM_DECAL ,
* SPIDEY_DECAL , * TARGETING_CIRCLE , * TARGETING_RANGE_CIRCLE , * HEALTHBAR_DECAL ,
* CONSUME_SNACK_DECAL , * CONSUME_MEAL_DECAL , * COMPUTER_DECAL , * BROKEN_ROVER_DECAL ,
* NADO_DECAL , * SILICON_ROCK_DECAL , * PETAL_STORM_DECAL , * ROVER_DECAL ;
* NADO_DECAL , * SILICON_ROCK_DECAL , * PETAL_STORM_DECAL , * ROVER_DECAL , * X_X_DECAL ,
* LATER_THAT_NIGHT_DECAL , * SLEEP_DECAL ;
std : : map < std : : string , ObjectLoadInfo * > BASE_OBJECTS ;
std : : vector < Encounter > ENCOUNTERS ;
Encounter ENCOUNTER_SPIDEY_1 ;
Encounter ENCOUNTER_X_X ;
Encounter CURRENT_ENCOUNTER ;
std : : vector < WEATHER_POWER * > MOVESET_SPIDEY ;
std : : vector < WEATHER_POWER * > MOVESET_X_X ;
std : : vector < WEATHER_POWER * > MOVESET_XMINION ;
std : : queue < int > turnOrder ;
# define MAX_PIXELS 500
@ -516,6 +541,9 @@ public:
SILICON_ROCK_DECAL = new Decal ( new Sprite ( " assets/siliconPiece.png " ) ) ;
PETAL_STORM_DECAL = new Decal ( new Sprite ( " assets/petalstorm_icon.png " ) ) ;
ROVER_DECAL = new Decal ( new Sprite ( " assets/ROVER.png " ) ) ;
X_X_DECAL = new Decal ( new Sprite ( " assets/X_X.png " ) ) ;
LATER_THAT_NIGHT_DECAL = new Decal ( new Sprite ( " assets/LaterThatNight.png " ) ) ;
SLEEP_DECAL = new Decal ( new Sprite ( " assets/sleep.png " ) ) ;
current_playerAnim . spr = PLAYER_DECAL ;
playerAnim . spr = PLAYER_DECAL ;
@ -602,6 +630,11 @@ public:
PETAL_STORM_ANIMATION . frames . push_back ( { i * 32 , 0 } ) ;
}
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 . skip_frames = 5 ;
HAILSTORM - > playerOwnCount = 3 ;
HURRICANE - > playerOwnCount = 1 ;
@ -611,12 +644,35 @@ public:
MOVESET_SPIDEY . push_back ( SEED_STORM ) ;
MOVESET_SPIDEY . push_back ( AVALANCHE ) ;
MOVESET_X_X . push_back ( LIGHT_STORM ) ;
MOVESET_X_X . push_back ( SEED_BULLET ) ;
MOVESET_X_X . push_back ( SEED_OF_LIFE ) ;
MOVESET_X_X . push_back ( SEED_BULLET ) ;
MOVESET_X_X . push_back ( SEED_BULLET ) ;
MOVESET_X_X . push_back ( SEED_BULLET ) ;
MOVESET_X_X . push_back ( SUMMON_MINIONS ) ;
MOVESET_X_X . push_back ( SEED_OF_LIFE ) ;
MOVESET_X_X . push_back ( SEED_BULLET ) ;
MOVESET_X_X . push_back ( SEED_BULLET ) ;
MOVESET_X_X . push_back ( SEED_PELLET ) ;
MOVESET_XMINION . push_back ( SEED_PELLET ) ;
MOVESET_XMINION . push_back ( SEED_PELLET ) ;
MOVESET_XMINION . push_back ( SEED_STORM ) ;
ENCOUNTER_SPIDEY_1 . entities . push_back ( new Entity ( SPIDEY_DECAL , " Spidey " , 2 , 3 , 80 , 80 , MOVESET_SPIDEY ) ) ;
ENCOUNTER_SPIDEY_1 . entities . push_back ( new Entity ( SPIDEY_DECAL , " Spidey " , 4 , 4 , 80 , 80 , MOVESET_SPIDEY ) ) ;
ENCOUNTER_SPIDEY_1 . entities . push_back ( new Entity ( SPIDEY_DECAL , " Spidey " , 6 , 2 , 80 , 80 , MOVESET_SPIDEY ) ) ;
ENCOUNTER_SPIDEY_1 . x = 79 ;
ENCOUNTER_SPIDEY_1 . y = 47 ;
ENCOUNTERS . push_back ( ENCOUNTER_SPIDEY_1 ) ;
ENCOUNTER_X_X . entities . push_back ( new Entity ( X_X_DECAL , " X_X " , 3 , 3 , 590 , 590 , MOVESET_X_X , { 1 , 1 } , true ) ) ;
ENCOUNTER_X_X . entities . push_back ( new Entity ( X_X_DECAL , " X Minion " , 4 , 4 , 80 , 80 , MOVESET_XMINION , { 0.4 , 0.4 } ) ) ;
ENCOUNTER_X_X . entities . push_back ( new Entity ( X_X_DECAL , " X Minion " , 6 , 2 , 80 , 80 , MOVESET_XMINION , { 0.4 , 0.4 } ) ) ;
ENCOUNTER_X_X . entities . push_back ( new Entity ( X_X_DECAL , " X Minion " , 6 , 2 , 80 , 80 , MOVESET_XMINION , { 0.4 , 0.4 } ) ) ;
ENCOUNTER_X_X . x = 38 ;
ENCOUNTER_X_X . y = 35 ;
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
BASE_OBJECTS [ " DOME " ] = new ObjectLoadInfo ( DOME_DECAL ) ;
BASE_OBJECTS [ " PLANT " ] = new ObjectLoadInfo ( PLANT_DECAL ) ;
@ -661,12 +717,13 @@ public:
}
switch ( GAME_STATE ) {
case CUTSCENE_1 : {
if ( textInd > = STORY_TEXT1 . length ( ) ) {
if ( textInd > = CONSOLE_REF_TEXT . length ( ) ) {
fadeOut ( ) ;
}
} break ;
case CUTSCENE_4 : {
if ( textInd > = STORY_TEXT1 . length ( ) ) {
if ( textInd > = CONSOLE_REF_TEXT . length ( ) ) {
GAME_STATE = CUTSCENE_4_DONE ;
fadeOut ( ) ;
}
} break ;
@ -871,8 +928,11 @@ public:
GAME_STATE = GAMEWORLD ;
} break ;
case CUTSCENE_4 : {
fadeIn ( ) ;
} break ;
case CUTSCENE_4_DONE : {
GAME_STATE = GAMEWORLD ;
PlayCutscene ( cutscene : : GET_SOME_REST ) ;
PlayCutscene ( cutscene : : GET_SOME_REST ) ;
fadeIn ( ) ;
} break ;
}
@ -898,6 +958,11 @@ public:
TeleportToMapFileCoords ( 13 , 122 ) ;
fadeIn ( ) ;
} break ;
case cutscene : : REPAIR_ROVER_1 : {
ResetTerminal ( STORY_TEXT3 ) ;
GAME_STATE = CUTSCENE_4 ;
fadeIn ( ) ;
} break ;
case cutscene : : END_VOLCANIC_AREA_CUTSCENE : {
PLAYER_COORDS [ 0 ] = 33 ;
PLAYER_COORDS [ 1 ] = 34 ;
@ -916,9 +981,6 @@ public:
DisplayMessageBox ( 10 ) ;
EndCutscene ( ) ;
} break ;
case cutscene : : GET_SOME_REST : {
DisplayMessageBox ( 18 ) ;
} break ;
}
}
@ -938,8 +1000,7 @@ public:
PLAYER_COORDS [ 1 ] = 35 + ( 64 / 2 / 32 ) ;
} break ;
case cutscene : : PAUSE_TO_CUTSCENE_3 : {
CUTSCENE_CONSOLE_TEXT . clear ( ) ;
textInd = 0 ;
ResetTerminal ( STORY_TEXT2 ) ;
} break ;
case cutscene : : CUTSCENE_4 : {
LoadMap ( " assets/maps/map2 " ) ;
@ -957,6 +1018,9 @@ public:
case cutscene : : REPAIR_ROVER_1 : {
CUTSCENE_OBJS [ 0 ] = CreateObject ( { PLAYER_COORDS [ 0 ] , PLAYER_COORDS [ 1 ] } , PLAYER_DECAL , { 64 , 0 } , { 32 , 32 } , true ) ;
} break ;
case cutscene : : GET_SOME_REST : {
DisplayMessageBox ( 18 ) ;
} break ;
}
for ( int i = 0 ; i < 8 ; i + + ) {
CUTSCENE_FLAGS [ i ] = false ;
@ -1188,7 +1252,7 @@ public:
}
}
if ( IN_BATTLE_ENCOUNTER ) {
if ( IN_BATTLE_ENCOUNTER & & ! messageBoxVisible ) {
BATTLE_ENTRY_TIMER + + ;
switch ( BATTLE_STATE ) {
case battle : : WAITING_FOR_CAMERA : {
@ -1511,6 +1575,8 @@ public:
for ( int i = 0 ; i < OBJECTS . size ( ) ; i + + ) {
if ( OBJECTS [ i ] - > x = = 33 & & OBJECTS [ i ] - > y = = 35 ) {
OBJECTS [ i ] - > spr = ROVER_DECAL ;
CUTSCENE_FLAGS [ 4 ] = true ;
break ;
}
}
} else
@ -1519,7 +1585,8 @@ public:
CUTSCENE_FLAGS [ 2 ] = true ;
} else
if ( ! CUTSCENE_FLAGS [ 3 ] & & CUTSCENE_TIMER > 120 ) {
GAME_STATE = CUTSCENE_4 ;
fadeOut ( ) ;
CUTSCENE_FLAGS [ 3 ] = true ;
}
}
} break ;
@ -1540,21 +1607,20 @@ public:
case CUTSCENE_1 :
case CUTSCENE_3 :
case CUTSCENE_4 : {
std : : string refText ;
switch ( GAME_STATE ) {
case CUTSCENE_1 : {
refText = STORY_TEXT1 ;
CONSOLE_REF_TEXT = STORY_TEXT1 ;
} break ;
case CUTSCENE_3 : {
refText = STORY_TEXT2 ;
CONSOLE_REF_TEXT = STORY_TEXT2 ;
} break ;
case CUTSCENE_4 : {
refText = STORY_TEXT3 ;
CONSOLE_REF_TEXT = STORY_TEXT3 ;
} break ;
}
if ( GAME_STATE = = CUTSCENE_3 & & frameCount % 4 ! = 0 ) { break ; }
if ( textInd < refText . length ( ) ) {
char c = refText [ textInd + + ] ;
if ( textInd < CONSOLE_REF_TEXT . length ( ) ) {
char c = CONSOLE_REF_TEXT [ textInd + + ] ;
CUTSCENE_CONSOLE_TEXT + = c ;
if ( c ! = ' \n ' ) {
cursorX + + ;
@ -1571,7 +1637,7 @@ public:
CUTSCENE_CONSOLE_TEXT + = ' \n ' ;
cursorX = 0 ;
while ( tempIndex < textInd ) {
CUTSCENE_CONSOLE_TEXT + = refText [ tempIndex + + ] ;
CUTSCENE_CONSOLE_TEXT + = CONSOLE_REF_TEXT [ tempIndex + + ] ;
cursorX + + ;
}
}
@ -1666,7 +1732,7 @@ public:
PlayCutscene ( cutscene : : WALK_TO_COMPUTER ) ;
CUTSCENE_OBJS [ 0 ] = CreateObject ( { PLAYER_COORDS [ 0 ] , PLAYER_COORDS [ 1 ] } , PLAYER_DECAL , { 32 , 0 } , { 32 , 32 } , true ) ;
} else
if ( ! GAME_FLAGS [ gameflag : : REPAIRED_ROVER_1 ] & & PLAYER_COORDS [ 0 ] > = 31 & & PLAYER_COORDS [ 0 ] < = 35 & & PLAYER_COORDS [ 1 ] > = 33 & & PLAYER_COORDS [ 1 ] < = 37 ) {
if ( ! GAME_FLAGS [ gameflag : : REPAIRED_ROVER_1 ] & & GAME_FLAGS [ gameflag : : COLLECTED_SILICON_1 ] & & PLAYER_COORDS [ 0 ] > = 31 & & PLAYER_COORDS [ 0 ] < = 35 & & PLAYER_COORDS [ 1 ] > = 33 & & PLAYER_COORDS [ 1 ] < = 37 ) {
GAME_FLAGS [ gameflag : : REPAIRED_ROVER_1 ] = true ;
PlayCutscene ( cutscene : : REPAIR_ROVER_1 ) ;
}
@ -1674,7 +1740,8 @@ public:
void drawGame ( ) {
switch ( GAME_STATE ) {
case CUTSCENE_1 : {
case CUTSCENE_1 :
case CUTSCENE_4 : {
DrawStringDecal ( { 16 , 16 } , CUTSCENE_CONSOLE_TEXT , GREEN , { 1 , 1 } ) ;
if ( textInd < STORY_TEXT1 . length ( ) ) {
FillRectDecal ( { ( float ) ( 16 + ( cursorX ) * 8 % ( WIDTH - 32 ) ) , ( float ) ( 8 + GetTextSize ( CUTSCENE_CONSOLE_TEXT ) . y + ( ( cursorX = = 28 ) ? 8 : 0 ) ) } , { 4 , 8 } , GREEN ) ;
@ -1724,6 +1791,9 @@ 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 : {
DrawDecal ( { WIDTH / 2 - LATER_THAT_NIGHT_DECAL - > sprite - > width / 2 , HEIGHT / 2 - LATER_THAT_NIGHT_DECAL - > sprite - > height / 2 } , LATER_THAT_NIGHT_DECAL ) ;
} break ;
}
switch ( BATTLE_STATE ) {
case battle : : PLAYER_SELECTION : {
@ -2500,6 +2570,12 @@ public:
}
return reachedPosition ;
}
void ResetTerminal ( std : : string text ) {
CUTSCENE_CONSOLE_TEXT . clear ( ) ;
textInd = 0 ;
CONSOLE_REF_TEXT = text ;
}
} ;