@ -10,7 +10,10 @@ using namespace olc;
//#define TEST_MAP1 //Toggle to just play around on map 1.
//#define TEST_MAP1 //Toggle to just play around on map 1.
//#define TEST_MAP2 //Toggle on to just play around on map 2.
//#define TEST_MAP2 //Toggle on to just play around on map 2.
# define SKIP_INTRO false
# define SKIP_INTRO true
# define SKIP_CHAPTER1 true
# define SKIP_CHAPTER2 false
# define SKIP_CHAPTER3 false
# define STARTING_MAP "assets / maps / map1"
# define STARTING_MAP "assets / maps / map1"
# define STARTING_STATE CUTSCENE_1
# define STARTING_STATE CUTSCENE_1
@ -90,6 +93,7 @@ namespace gameflag{
COLLECTED_SILICON_1 ,
COLLECTED_SILICON_1 ,
REPAIRED_ROVER_1 ,
REPAIRED_ROVER_1 ,
REST_IN_DOME ,
REST_IN_DOME ,
SLEEP ,
} ;
} ;
}
}
@ -190,7 +194,16 @@ class Object{
this - > spr = spr ;
this - > spr = spr ;
this - > anim = anim ;
this - > anim = anim ;
this - > hasAnim = true ;
this - > hasAnim = true ;
updateAnimationsList . push_back ( anim ) ;
bool matches = false ;
for ( int i = 0 ; i < updateAnimationsList . size ( ) ; i + + ) {
if ( updateAnimationsList [ i ] = = anim ) {
matches = true ;
break ;
}
}
if ( ! matches ) {
updateAnimationsList . push_back ( anim ) ;
}
this - > col = col ;
this - > col = col ;
}
}
Object ( Decal * spr , vi2d spos , vi2d size , Pixel col = WHITE ) {
Object ( Decal * spr , vi2d spos , vi2d size , Pixel col = WHITE ) {
@ -347,6 +360,7 @@ public:
int textInd = 0 ;
int textInd = 0 ;
int cursorX = 0 ;
int cursorX = 0 ;
int transitionTime = 0 ;
int transitionTime = 0 ;
int TIMER = 0 ;
bool fade = false ;
bool fade = false ;
int transparency = 0 ;
int transparency = 0 ;
int frameCount = 0 ;
int frameCount = 0 ;
@ -380,29 +394,30 @@ public:
int oxygenQualityLevel = 34 ;
int oxygenQualityLevel = 34 ;
int plantState = 0b01001010010100010101010010010101 ;
int plantState = 0b01001010010100010101010010010101 ;
SplashScreen splash ;
SplashScreen splash ;
Animation current_playerAnim ;
Animation * current_playerAnim = new Animation ( ) ;
Animation playerAnim ;
Animation * playerAnim = new Animation ( ) ;
Animation playerAnimRight ;
Animation * playerAnimRight = new Animation ( ) ;
Animation playerAnimLeft ;
Animation * playerAnimLeft = new Animation ( ) ;
Animation playerAnimDown ;
Animation * playerAnimDown = new Animation ( ) ;
Animation playerAnimWalkUp ;
Animation * playerAnimWalkUp = new Animation ( ) ;
Animation playerAnimWalkDown ;
Animation * playerAnimWalkDown = new Animation ( ) ;
Animation playerAnimWalkRight ;
Animation * playerAnimWalkRight = new Animation ( ) ;
Animation playerAnimWalkLeft ;
Animation * playerAnimWalkLeft = new Animation ( ) ;
Animation playerAnimPlantUp ;
Animation * playerAnimPlantUp = new Animation ( ) ;
Animation playerAnimPlantDown ;
Animation * playerAnimPlantDown = new Animation ( ) ;
Animation playerAnimPlantRight ;
Animation * playerAnimPlantRight = new Animation ( ) ;
Animation playerAnimPlantLeft ;
Animation * playerAnimPlantLeft = new Animation ( ) ;
Animation POWER_HAILSTORM_ANIMATION ;
Animation * POWER_HAILSTORM_ANIMATION = new Animation ( ) ;
Animation POWER_HURRICANE_ANIMATION ;
Animation * POWER_HURRICANE_ANIMATION = new Animation ( ) ;
Animation POWER_METEOR_SHOWER_ANIMATION ;
Animation * POWER_METEOR_SHOWER_ANIMATION = new Animation ( ) ;
Animation POWER_METEOR_STORM_ANIMATION ;
Animation * POWER_METEOR_STORM_ANIMATION = new Animation ( ) ;
Animation POWER_SNOWSTORM_ANIMATION ;
Animation * POWER_SNOWSTORM_ANIMATION = new Animation ( ) ;
Animation CONSUME_SNACK_ANIMATION ;
Animation * CONSUME_SNACK_ANIMATION = new Animation ( ) ;
Animation CONSUME_MEAL_ANIMATION ;
Animation * CONSUME_MEAL_ANIMATION = new Animation ( ) ;
Animation NADO_ANIMATION ;
Animation * NADO_ANIMATION = new Animation ( ) ;
Animation PETAL_STORM_ANIMATION ;
Animation * PETAL_STORM_ANIMATION = new Animation ( ) ;
Animation SLEEP_ANIMATION ;
Animation * SLEEP_ANIMATION = new Animation ( ) ;
Animation * EMPTY_BED_ANIMATION = new 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 * 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 * 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 ) ) ;
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 ) ) ;
@ -418,22 +433,22 @@ public:
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 * 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 * 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 ) ) ;
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 * 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 * 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 ) ;
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 ) ;
WEATHER_POWER * METEOR_STORM = new WEATHER_POWER ( " Meteor Storm " , " Larger space rocks. 120+60d " , & POWER_METEOR_STORM_ANIMATION , & POWER_METEOR_STORM_ANIMATION , 120 , 60 , 140 , Pixel ( 89 , 4 , 33 , 255 ) , Pixel ( 130 , 56 , 1 , 255 ) , 120 , METEOR_RAIN_EFF ) ;
WEATHER_POWER * METEOR_STORM = new WEATHER_POWER ( " Meteor Storm " , " Larger space rocks. 120+60d " , POWER_METEOR_STORM_ANIMATION , POWER_METEOR_STORM_ANIMATION , 120 , 60 , 140 , Pixel ( 89 , 4 , 33 , 255 ) , Pixel ( 130 , 56 , 1 , 255 ) , 120 , METEOR_RAIN_EFF ) ;
WEATHER_POWER * SNOWSTORM = new WEATHER_POWER ( " Snowstorm " , " Slows down targets and causes rapid temperature drops. 15+10d " , & POWER_SNOWSTORM_ANIMATION , & POWER_SNOWSTORM_ANIMATION , 15 , 10 , 140 , Pixel ( 183 , 196 , 194 , 255 ) , Pixel ( 222 , 255 , 254 , 255 ) , 120 , SNOWSTORM_EFF ) ;
WEATHER_POWER * SNOWSTORM = new WEATHER_POWER ( " Snowstorm " , " Slows down targets and causes rapid temperature drops. 15+10d " , POWER_SNOWSTORM_ANIMATION , POWER_SNOWSTORM_ANIMATION , 15 , 10 , 140 , Pixel ( 183 , 196 , 194 , 255 ) , Pixel ( 222 , 255 , 254 , 255 ) , 120 , SNOWSTORM_EFF ) ;
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 * 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 * 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 * 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 * 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_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_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 * 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 * SUMMON_MINIONS = new WEATHER_POWER ( " Summon Minions " , " " , POWER_HAILSTORM_ANIMATION , POWER_HAILSTORM_ANIMATION , - 75 , 15 , 255 , 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_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 * 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 ) ;
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 ) ;
bool IN_BATTLE_ENCOUNTER = false ;
bool IN_BATTLE_ENCOUNTER = false ;
int BATTLE_ENTRY_TIMER = 0 ;
int BATTLE_ENTRY_TIMER = 0 ;
int EFFECT_TIMER = 0 ;
int EFFECT_TIMER = 0 ;
@ -510,10 +525,24 @@ public:
EnableLayer ( i , true ) ;
EnableLayer ( i , true ) ;
}
}
if ( SKIP_INTRO ) {
if ( SKIP_INTRO | | SKIP_CHAPTER1 | | SKIP_CHAPTER2 | | SKIP_CHAPTER3 ) {
GAME_FLAGS [ gameflag : : TUTORIAL_WALKED_OFF_FARM ] = true ;
GAME_FLAGS [ gameflag : : TUTORIAL_WALKED_OFF_FARM ] = true ;
GAME_FLAGS [ gameflag : : VISIT_BROKEN_ROVER ] = true ;
GAME_FLAGS [ gameflag : : VISIT_BROKEN_ROVER ] = true ;
}
}
if ( SKIP_CHAPTER1 | | SKIP_CHAPTER2 | | SKIP_CHAPTER3 ) {
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 ;
}
if ( SKIP_CHAPTER2 | | SKIP_CHAPTER3 ) {
}
if ( SKIP_CHAPTER3 ) {
}
//ConsoleShow(F1,false);
//ConsoleShow(F1,false);
// Called once at the start, so create things here
// Called once at the start, so create things here
@ -545,96 +574,99 @@ public:
LATER_THAT_NIGHT_DECAL = new Decal ( new Sprite ( " assets/LaterThatNight.png " ) ) ;
LATER_THAT_NIGHT_DECAL = new Decal ( new Sprite ( " assets/LaterThatNight.png " ) ) ;
SLEEP_DECAL = new Decal ( new Sprite ( " assets/sleep.png " ) ) ;
SLEEP_DECAL = new Decal ( new Sprite ( " assets/sleep.png " ) ) ;
current_playerAnim . spr = PLAYER_DECAL ;
current_playerAnim - > spr = PLAYER_DECAL ;
playerAnim . spr = PLAYER_DECAL ;
playerAnim - > spr = PLAYER_DECAL ;
playerAnimRight . spr = PLAYER_DECAL ;
playerAnimRight - > spr = PLAYER_DECAL ;
playerAnimLeft . spr = PLAYER_DECAL ;
playerAnimLeft - > spr = PLAYER_DECAL ;
playerAnimLeft . flipped = true ;
playerAnimLeft - > flipped = true ;
playerAnimDown . spr = PLAYER_DECAL ;
playerAnimDown - > spr = PLAYER_DECAL ;
playerAnimWalkUp . spr = PLAYER_DECAL ;
playerAnimWalkUp - > spr = PLAYER_DECAL ;
playerAnimWalkDown . spr = PLAYER_DECAL ;
playerAnimWalkDown - > spr = PLAYER_DECAL ;
playerAnimWalkRight . spr = PLAYER_DECAL ;
playerAnimWalkRight - > spr = PLAYER_DECAL ;
playerAnimWalkLeft . spr = PLAYER_DECAL ;
playerAnimWalkLeft - > spr = PLAYER_DECAL ;
playerAnimWalkLeft . flipped = true ;
playerAnimWalkLeft - > flipped = true ;
playerAnimPlantUp . spr = PLAYER_DECAL ;
playerAnimPlantUp - > spr = PLAYER_DECAL ;
playerAnimPlantDown . spr = PLAYER_DECAL ;
playerAnimPlantDown - > spr = PLAYER_DECAL ;
playerAnimPlantRight . spr = PLAYER_DECAL ;
playerAnimPlantRight - > spr = PLAYER_DECAL ;
playerAnimPlantLeft . spr = PLAYER_DECAL ;
playerAnimPlantLeft - > spr = PLAYER_DECAL ;
playerAnimPlantLeft . flipped = true ;
playerAnimPlantLeft - > flipped = true ;
playerAnim . frames . push_back ( { 64 , 0 } ) ;
playerAnim - > frames . push_back ( { 64 , 0 } ) ;
playerAnimRight . frames . push_back ( { 32 , 0 } ) ;
playerAnimRight - > frames . push_back ( { 32 , 0 } ) ;
playerAnimLeft . frames . push_back ( { 32 , 0 } ) ;
playerAnimLeft - > frames . push_back ( { 32 , 0 } ) ;
playerAnimDown . frames . push_back ( { 0 , 0 } ) ;
playerAnimDown - > frames . push_back ( { 0 , 0 } ) ;
playerAnimWalkUp . frames . push_back ( { 0 , 96 } ) ;
playerAnimWalkUp - > frames . push_back ( { 0 , 96 } ) ;
playerAnimWalkUp . frames . push_back ( { 32 , 96 } ) ;
playerAnimWalkUp - > frames . push_back ( { 32 , 96 } ) ;
playerAnimWalkUp . frames . push_back ( { 64 , 96 } ) ;
playerAnimWalkUp - > frames . push_back ( { 64 , 96 } ) ;
playerAnimWalkRight . frames . push_back ( { 0 , 64 } ) ;
playerAnimWalkRight - > frames . push_back ( { 0 , 64 } ) ;
playerAnimWalkLeft . frames . push_back ( { 0 , 64 } ) ;
playerAnimWalkLeft - > frames . push_back ( { 0 , 64 } ) ;
playerAnimWalkRight . frames . push_back ( { 32 , 64 } ) ;
playerAnimWalkRight - > frames . push_back ( { 32 , 64 } ) ;
playerAnimWalkLeft . frames . push_back ( { 32 , 64 } ) ;
playerAnimWalkLeft - > frames . push_back ( { 32 , 64 } ) ;
playerAnimWalkRight . frames . push_back ( { 64 , 64 } ) ;
playerAnimWalkRight - > frames . push_back ( { 64 , 64 } ) ;
playerAnimWalkLeft . frames . push_back ( { 64 , 64 } ) ;
playerAnimWalkLeft - > frames . push_back ( { 64 , 64 } ) ;
playerAnimWalkDown . frames . push_back ( { 0 , 32 } ) ;
playerAnimWalkDown - > frames . push_back ( { 0 , 32 } ) ;
playerAnimWalkDown . frames . push_back ( { 32 , 32 } ) ;
playerAnimWalkDown - > frames . push_back ( { 32 , 32 } ) ;
playerAnimWalkDown . frames . push_back ( { 64 , 32 } ) ;
playerAnimWalkDown - > frames . push_back ( { 64 , 32 } ) ;
playerAnimPlantUp . frames . push_back ( { 64 , 128 } ) ;
playerAnimPlantUp - > frames . push_back ( { 64 , 128 } ) ;
playerAnimPlantRight . frames . push_back ( { 32 , 128 } ) ;
playerAnimPlantRight - > frames . push_back ( { 32 , 128 } ) ;
playerAnimPlantLeft . frames . push_back ( { 32 , 128 } ) ;
playerAnimPlantLeft - > frames . push_back ( { 32 , 128 } ) ;
playerAnimPlantDown . frames . push_back ( { 0 , 128 } ) ;
playerAnimPlantDown - > frames . push_back ( { 0 , 128 } ) ;
current_playerAnim = playerAnimWalkDown ;
current_playerAnim = playerAnimWalkDown ;
const int nodeAnimationSkipFrames = 12 ;
const int nodeAnimationSkipFrames = 12 ;
POWER_HAILSTORM_ANIMATION . spr = POWER_HAILSTORM_DECAL ;
POWER_HAILSTORM_ANIMATION - > spr = POWER_HAILSTORM_DECAL ;
POWER_HAILSTORM_ANIMATION . frames . push_back ( { 0 , 0 } ) ;
POWER_HAILSTORM_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
POWER_HAILSTORM_ANIMATION . frames . push_back ( { 32 , 0 } ) ;
POWER_HAILSTORM_ANIMATION - > frames . push_back ( { 32 , 0 } ) ;
POWER_HAILSTORM_ANIMATION . frames . push_back ( { 64 , 0 } ) ;
POWER_HAILSTORM_ANIMATION - > frames . push_back ( { 64 , 0 } ) ;
POWER_HAILSTORM_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
POWER_HAILSTORM_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
POWER_HURRICANE_ANIMATION . spr = POWER_HURRICANE_DECAL ;
POWER_HURRICANE_ANIMATION - > spr = POWER_HURRICANE_DECAL ;
POWER_HURRICANE_ANIMATION . frames . push_back ( { 0 , 0 } ) ;
POWER_HURRICANE_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
POWER_HURRICANE_ANIMATION . frames . push_back ( { 32 , 0 } ) ;
POWER_HURRICANE_ANIMATION - > frames . push_back ( { 32 , 0 } ) ;
POWER_HURRICANE_ANIMATION . frames . push_back ( { 64 , 0 } ) ;
POWER_HURRICANE_ANIMATION - > frames . push_back ( { 64 , 0 } ) ;
POWER_HURRICANE_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
POWER_HURRICANE_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
POWER_METEOR_SHOWER_ANIMATION . spr = POWER_METEOR_SHOWER_DECAL ;
POWER_METEOR_SHOWER_ANIMATION - > spr = POWER_METEOR_SHOWER_DECAL ;
POWER_METEOR_SHOWER_ANIMATION . frames . push_back ( { 0 , 0 } ) ;
POWER_METEOR_SHOWER_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
POWER_METEOR_SHOWER_ANIMATION . frames . push_back ( { 32 , 0 } ) ;
POWER_METEOR_SHOWER_ANIMATION - > frames . push_back ( { 32 , 0 } ) ;
POWER_METEOR_SHOWER_ANIMATION . frames . push_back ( { 64 , 0 } ) ;
POWER_METEOR_SHOWER_ANIMATION - > frames . push_back ( { 64 , 0 } ) ;
POWER_METEOR_SHOWER_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
POWER_METEOR_SHOWER_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
POWER_METEOR_STORM_ANIMATION . spr = POWER_METEOR_STORM_DECAL ;
POWER_METEOR_STORM_ANIMATION - > spr = POWER_METEOR_STORM_DECAL ;
POWER_METEOR_STORM_ANIMATION . frames . push_back ( { 0 , 0 } ) ;
POWER_METEOR_STORM_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
POWER_METEOR_STORM_ANIMATION . frames . push_back ( { 32 , 0 } ) ;
POWER_METEOR_STORM_ANIMATION - > frames . push_back ( { 32 , 0 } ) ;
POWER_METEOR_STORM_ANIMATION . frames . push_back ( { 64 , 0 } ) ;
POWER_METEOR_STORM_ANIMATION - > frames . push_back ( { 64 , 0 } ) ;
POWER_METEOR_STORM_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
POWER_METEOR_STORM_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
POWER_SNOWSTORM_ANIMATION . spr = POWER_SNOWSTORM_DECAL ;
POWER_SNOWSTORM_ANIMATION - > spr = POWER_SNOWSTORM_DECAL ;
POWER_SNOWSTORM_ANIMATION . frames . push_back ( { 0 , 0 } ) ;
POWER_SNOWSTORM_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
POWER_SNOWSTORM_ANIMATION . frames . push_back ( { 32 , 0 } ) ;
POWER_SNOWSTORM_ANIMATION - > frames . push_back ( { 32 , 0 } ) ;
POWER_SNOWSTORM_ANIMATION . frames . push_back ( { 64 , 0 } ) ;
POWER_SNOWSTORM_ANIMATION - > frames . push_back ( { 64 , 0 } ) ;
POWER_SNOWSTORM_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
POWER_SNOWSTORM_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
CONSUME_SNACK_ANIMATION . spr = CONSUME_SNACK_DECAL ;
CONSUME_SNACK_ANIMATION - > spr = CONSUME_SNACK_DECAL ;
CONSUME_SNACK_ANIMATION . frames . push_back ( { 0 , 0 } ) ;
CONSUME_SNACK_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
CONSUME_SNACK_ANIMATION . frames . push_back ( { 32 , 0 } ) ;
CONSUME_SNACK_ANIMATION - > frames . push_back ( { 32 , 0 } ) ;
CONSUME_SNACK_ANIMATION . frames . push_back ( { 64 , 0 } ) ;
CONSUME_SNACK_ANIMATION - > frames . push_back ( { 64 , 0 } ) ;
CONSUME_SNACK_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
CONSUME_SNACK_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
CONSUME_MEAL_ANIMATION . spr = CONSUME_MEAL_DECAL ;
CONSUME_MEAL_ANIMATION - > spr = CONSUME_MEAL_DECAL ;
CONSUME_MEAL_ANIMATION . frames . push_back ( { 0 , 0 } ) ;
CONSUME_MEAL_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
CONSUME_MEAL_ANIMATION . frames . push_back ( { 32 , 0 } ) ;
CONSUME_MEAL_ANIMATION - > frames . push_back ( { 32 , 0 } ) ;
CONSUME_MEAL_ANIMATION . frames . push_back ( { 64 , 0 } ) ;
CONSUME_MEAL_ANIMATION - > frames . push_back ( { 64 , 0 } ) ;
CONSUME_MEAL_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
CONSUME_MEAL_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
NADO_ANIMATION . spr = NADO_DECAL ;
NADO_ANIMATION - > spr = NADO_DECAL ;
for ( int i = 0 ; i < 8 ; i + + ) {
for ( int i = 0 ; i < 8 ; i + + ) {
NADO_ANIMATION . frames . push_back ( { i * 32 , 0 } ) ;
NADO_ANIMATION - > frames . push_back ( { i * 32 , 0 } ) ;
}
}
CONSUME_MEAL_ANIMATION . skip_frames = 3 ;
CONSUME_MEAL_ANIMATION - > skip_frames = 3 ;
PETAL_STORM_ANIMATION . spr = PETAL_STORM_DECAL ;
PETAL_STORM_ANIMATION - > spr = PETAL_STORM_DECAL ;
for ( int i = 0 ; i < 3 ; i + + ) {
for ( int i = 0 ; i < 3 ; i + + ) {
PETAL_STORM_ANIMATION . frames . push_back ( { i * 32 , 0 } ) ;
PETAL_STORM_ANIMATION - > frames . push_back ( { i * 32 , 0 } ) ;
}
}
PETAL_STORM_ANIMATION . skip_frames = nodeAnimationSkipFrames ;
PETAL_STORM_ANIMATION - > skip_frames = nodeAnimationSkipFrames ;
SLEEP_ANIMATION . spr = SLEEP_DECAL ;
SLEEP_ANIMATION - > spr = SLEEP_DECAL ;
for ( int i = 0 ; i < 3 ; i + + ) {
for ( int i = 0 ; i < 3 ; i + + ) {
PETAL_STORM_ANIMATION . frames . push_back ( { i * 32 + 32 , 0 } ) ;
PETAL_STORM_ANIMATION - > frames . push_back ( { i * 32 + 32 , 0 } ) ;
}
}
SLEEP_ANIMATION . skip_frames = 5 ;
SLEEP_ANIMATION - > skip_frames = 5 ;
EMPTY_BED_ANIMATION - > spr = SLEEP_DECAL ;
EMPTY_BED_ANIMATION - > frames . push_back ( { 0 , 0 } ) ;
EMPTY_BED_ANIMATION - > skip_frames = 0 ;
HAILSTORM - > playerOwnCount = 3 ;
HAILSTORM - > playerOwnCount = 3 ;
HURRICANE - > playerOwnCount = 1 ;
HURRICANE - > playerOwnCount = 1 ;
@ -667,9 +699,9 @@ public:
ENCOUNTER_SPIDEY_1 . y = 47 ;
ENCOUNTER_SPIDEY_1 . y = 47 ;
ENCOUNTERS . push_back ( ENCOUNTER_SPIDEY_1 ) ;
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_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 " , 1 , 5 , 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 " , 0 , 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 . entities . push_back ( new Entity ( X_X_DECAL , " X Minion " , 4 , 2 , 80 , 80 , MOVESET_XMINION , { 0.4 , 0.4 } ) ) ;
ENCOUNTER_X_X . x = 38 ;
ENCOUNTER_X_X . x = 38 ;
ENCOUNTER_X_X . y = 35 ;
ENCOUNTER_X_X . y = 35 ;
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
@ -677,15 +709,15 @@ public:
BASE_OBJECTS [ " DOME " ] = new ObjectLoadInfo ( DOME_DECAL ) ;
BASE_OBJECTS [ " DOME " ] = new ObjectLoadInfo ( DOME_DECAL ) ;
BASE_OBJECTS [ " PLANT " ] = new ObjectLoadInfo ( PLANT_DECAL ) ;
BASE_OBJECTS [ " PLANT " ] = new ObjectLoadInfo ( PLANT_DECAL ) ;
BASE_OBJECTS [ " EXIT " ] = new ObjectLoadInfo ( NULL ) ;
BASE_OBJECTS [ " EXIT " ] = new ObjectLoadInfo ( NULL ) ;
BASE_OBJECTS [ " HAILSTORM_NODE " ] = new ObjectLoadInfo ( POWER_HAILSTORM_DECAL , & POWER_HAILSTORM_ANIMATION ) ;
BASE_OBJECTS [ " HAILSTORM_NODE " ] = new ObjectLoadInfo ( POWER_HAILSTORM_DECAL , POWER_HAILSTORM_ANIMATION ) ;
BASE_OBJECTS [ " HURRICANE_NODE " ] = new ObjectLoadInfo ( POWER_HURRICANE_DECAL , & POWER_HURRICANE_ANIMATION ) ;
BASE_OBJECTS [ " HURRICANE_NODE " ] = new ObjectLoadInfo ( POWER_HURRICANE_DECAL , POWER_HURRICANE_ANIMATION ) ;
BASE_OBJECTS [ " METEORSHOWER_NODE " ] = new ObjectLoadInfo ( POWER_METEOR_SHOWER_DECAL , & POWER_METEOR_SHOWER_ANIMATION ) ;
BASE_OBJECTS [ " METEORSHOWER_NODE " ] = new ObjectLoadInfo ( POWER_METEOR_SHOWER_DECAL , POWER_METEOR_SHOWER_ANIMATION ) ;
BASE_OBJECTS [ " METEORSTORM_NODE " ] = new ObjectLoadInfo ( POWER_METEOR_STORM_DECAL , & POWER_METEOR_STORM_ANIMATION ) ;
BASE_OBJECTS [ " METEORSTORM_NODE " ] = new ObjectLoadInfo ( POWER_METEOR_STORM_DECAL , POWER_METEOR_STORM_ANIMATION ) ;
BASE_OBJECTS [ " SNOWSTORM_NODE " ] = new ObjectLoadInfo ( POWER_SNOWSTORM_DECAL , & POWER_SNOWSTORM_ANIMATION ) ;
BASE_OBJECTS [ " SNOWSTORM_NODE " ] = new ObjectLoadInfo ( POWER_SNOWSTORM_DECAL , POWER_SNOWSTORM_ANIMATION ) ;
BASE_OBJECTS [ " PETALSTORM_NODE " ] = new ObjectLoadInfo ( PETAL_STORM_DECAL , & PETAL_STORM_ANIMATION ) ;
BASE_OBJECTS [ " PETALSTORM_NODE " ] = new ObjectLoadInfo ( PETAL_STORM_DECAL , PETAL_STORM_ANIMATION ) ;
BASE_OBJECTS [ " COMPUTER " ] = new ObjectLoadInfo ( COMPUTER_DECAL ) ;
BASE_OBJECTS [ " COMPUTER " ] = new ObjectLoadInfo ( COMPUTER_DECAL ) ;
BASE_OBJECTS [ " BROKEN_ROVER " ] = new ObjectLoadInfo ( BROKEN_ROVER_DECAL ) ;
BASE_OBJECTS [ " BROKEN_ROVER " ] = new ObjectLoadInfo ( BROKEN_ROVER_DECAL ) ;
BASE_OBJECTS [ " NADO " ] = new ObjectLoadInfo ( NADO_DECAL , & NADO_ANIMATION , Pixel ( 153 , 137 , 75 , 230 ) ) ;
BASE_OBJECTS [ " NADO " ] = new ObjectLoadInfo ( NADO_DECAL , NADO_ANIMATION , Pixel ( 153 , 137 , 75 , 230 ) ) ;
BASE_OBJECTS [ " SILICON_PIECE " ] = new ObjectLoadInfo ( SILICON_ROCK_DECAL ) ;
BASE_OBJECTS [ " SILICON_PIECE " ] = new ObjectLoadInfo ( SILICON_ROCK_DECAL ) ;
Zone * SILICON_DEPOSIT_ZONE = new Zone ( { 109 , 7 } , { 26 , 9 } , { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 3 , 3 } , { - 30 , - 3 } , { 30 , 3 } , Pixel ( 133 , 98 , 66 , 180 ) , Pixel ( 220 , 120 , 90 , 230 ) , 300 , Pixel ( 87 , 78 , 69 , 64 ) ) ;
Zone * SILICON_DEPOSIT_ZONE = new Zone ( { 109 , 7 } , { 26 , 9 } , { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 3 , 3 } , { - 30 , - 3 } , { 30 , 3 } , Pixel ( 133 , 98 , 66 , 180 ) , Pixel ( 220 , 120 , 90 , 230 ) , 300 , Pixel ( 87 , 78 , 69 , 64 ) ) ;
@ -1030,6 +1062,7 @@ public:
void updateGame ( ) {
void updateGame ( ) {
frameCount + + ;
frameCount + + ;
TIMER + + ;
if ( CURRENT_CUTSCENE ! = cutscene : : NONE ) {
if ( CURRENT_CUTSCENE ! = cutscene : : NONE ) {
CUTSCENE_TIMER + + ;
CUTSCENE_TIMER + + ;
}
}
@ -1052,8 +1085,8 @@ public:
}
}
}
}
}
}
if ( frameCount % current_playerAnim . skip_frames = = 0 ) {
if ( frameCount % current_playerAnim - > skip_frames = = 0 ) {
current_playerAnim . frame = ( current_playerAnim . frame + 1 ) % current_playerAnim . frames . size ( ) ;
current_playerAnim - > frame = ( current_playerAnim - > frame + 1 ) % current_playerAnim - > frames . size ( ) ;
}
}
for ( auto anim : updateAnimationsList ) {
for ( auto anim : updateAnimationsList ) {
if ( frameCount % anim - > skip_frames = = 0 ) {
if ( frameCount % anim - > skip_frames = = 0 ) {
@ -1209,7 +1242,13 @@ public:
} else
} else
if ( obj - > name . compare ( " DOME " ) = = 0 & & collidesWithPlayer ( obj ) ) {
if ( obj - > name . compare ( " DOME " ) = = 0 & & collidesWithPlayer ( obj ) ) {
fadeOut ( ) ;
fadeOut ( ) ;
PlayCutscene ( cutscene : : TRANSITION_CUTSCENE_2 ) ;
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 ) ;
}
}
}
}
}
}
}
@ -1773,9 +1812,9 @@ public:
meterYOffset + = ( 2 + 48 * 0.4 ) ;
meterYOffset + = ( 2 + 48 * 0.4 ) ;
}
}
SetDrawTarget ( 2 ) ;
SetDrawTarget ( 2 ) ;
DrawPartialDecal ( { ( float ) ( WIDTH / 2 - 16 + ( current_playerAnim . flipped ? 32 : 0 ) ) , ( float ) ( HEIGHT / 2 - 16 ) } , current_playerAnim . spr , current_playerAnim . getCurrentFrame ( ) , { 32 , 32 } , { ( float ) ( current_playerAnim . flipped ? - 1 : 1 ) , 1 } ) ;
DrawPartialDecal ( { ( float ) ( WIDTH / 2 - 16 + ( current_playerAnim - > flipped ? 32 : 0 ) ) , ( float ) ( HEIGHT / 2 - 16 ) } , current_playerAnim - > spr , current_playerAnim - > getCurrentFrame ( ) , { 32 , 32 } , { ( float ) ( current_playerAnim - > flipped ? - 1 : 1 ) , 1 } ) ;
if ( IN_BATTLE_ENCOUNTER & & BATTLE_ENTRY_TIMER < 45 ) {
if ( IN_BATTLE_ENCOUNTER & & BATTLE_ENTRY_TIMER < 45 ) {
DrawStringDecal ( { ( float ) ( WIDTH / 2 - 16 + ( current_playerAnim . flipped ? 32 : 0 ) + 8 ) , ( float ) ( HEIGHT / 2 - 16 - sin ( frameCount * 12 / 60.0 ) * 4 - 12 ) } , " !! " , RED ) ;
DrawStringDecal ( { ( float ) ( WIDTH / 2 - 16 + ( current_playerAnim - > flipped ? 32 : 0 ) + 8 ) , ( float ) ( HEIGHT / 2 - 16 - sin ( frameCount * 12 / 60.0 ) * 4 - 12 ) } , " !! " , RED ) ;
}
}
}
}
} break ;
} break ;
@ -1919,15 +1958,15 @@ public:
for ( auto & ent : enc . entities ) {
for ( auto & ent : enc . entities ) {
if ( BATTLE_STATE = = battle : : PLAYER_TARGET_SELECTION & & PLAYER_SELECTED_TARGET > = 0 & & CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > hp > 0 & & CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > x = = ent - > x & & CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > y = = ent - > y ) {
if ( BATTLE_STATE = = battle : : PLAYER_TARGET_SELECTION & & PLAYER_SELECTED_TARGET > = 0 & & CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > hp > 0 & & CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > x = = ent - > x & & CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > y = = ent - > y ) {
DrawDecal ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 } , TARGETING_CIRCLE , { ( float ) ( ent - > spr - > sprite - > width / 32 ) , ( float ) ( ent - > spr - > sprite - > height / 32 ) } , { 255 , 210 , 0 , 255 } ) ;
DrawDecal ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 } , TARGETING_CIRCLE , { ( float ) ( ent - > spr - > sprite - > width / 32 ) , ( float ) ( ent - > spr - > sprite - > height / 32 ) } , { 255 , 210 , 0 , 255 } ) ;
DrawDecal ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 } , ent - > spr , { 1 , 1 } , { ( uint8_t ) ( ( 0.5 * ( float ) sin ( frameCount * 4 / 60.0 ) + 0.5 ) * 80 + 175 ) , ( uint8_t ) ( ( 0.5 * ( float ) sin ( frameCount * 4 / 60.0 ) + 0.5 ) * 80 + 175 ) , ( uint8_t ) ( ( 0.5 * ( float ) sin ( frameCount * 4 / 60.0 ) + 0.5 ) * 80 + 175 ) , 255 } ) ;
DrawDecal ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 } , ent - > spr , ent - > sprScale , { ( uint8_t ) ( ( 0.5 * ( float ) sin ( frameCount * 4 / 60.0 ) + 0.5 ) * 80 + 175 ) , ( uint8_t ) ( ( 0.5 * ( float ) sin ( frameCount * 4 / 60.0 ) + 0.5 ) * 80 + 175 ) , ( uint8_t ) ( ( 0.5 * ( float ) sin ( frameCount * 4 / 60.0 ) + 0.5 ) * 80 + 175 ) , 255 } ) ;
targetX = ent - > x ; targetY = ent - > y ;
targetX = ent - > x ; targetY = ent - > y ;
} else {
} else {
if ( ent - > hp > 0 ) {
if ( ent - > hp > 0 ) { //Outside battles.
DrawDecal ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 } , ent - > spr ) ;
DrawDecal ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 } , ent - > spr , ent - > sprScale ) ;
}
}
}
}
if ( ent - > hp > 0 ) {
if ( ent - > hp > 0 ) {
DrawHealthbar ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 + ent - > spr - > sprite - > height + 2 } , ent - > spr - > sprite - > width , ( float ) ent - > hp / ent - > maxhp , BLACK ) ;
DrawHealthbar ( { ( enc . x + ent - > x - PLAYER_COORDS [ 0 ] ) * 32 + WIDTH / 2 , ( enc . y + ent - > y - PLAYER_COORDS [ 1 ] ) * 32 + HEIGHT / 2 + ent - > spr - > sprite - > height * ent - > sprScale . y + 2 } , ent - > spr - > sprite - > width * ent - > sprScale . x , ( float ) ent - > hp / ent - > maxhp , BLACK ) ;
}
}
}
}
if ( targetX ! = - 1 & & targetY ! = - 1 ) {
if ( targetX ! = - 1 & & targetY ! = - 1 ) {
@ -2124,9 +2163,9 @@ public:
}
}
}
}
void changeAnimation ( Animation anim ) {
void changeAnimation ( Animation * anim ) {
current_playerAnim = anim ;
current_playerAnim = anim ;
current_playerAnim . frame = 0 ;
current_playerAnim - > frame = 0 ;
}
}
bool collidesWithPlayer ( Object * obj ) {
bool collidesWithPlayer ( Object * obj ) {
@ -2315,37 +2354,41 @@ public:
BATTLE_STATE = battle : : ENEMY_SELECTION ;
BATTLE_STATE = battle : : ENEMY_SELECTION ;
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
if ( CURRENT_ENCOUNTER . entities [ i ] - > hp > 0 ) {
if ( CURRENT_ENCOUNTER . entities [ i ] - > hp > 0 ) {
CURRENT_ENCOUNTER . entities [ i ] - > selectedMove = CURRENT_ENCOUNTER . entities [ i ] - > moveSet [ rand ( ) % CURRENT_ENCOUNTER . entities [ i ] - > moveSet . size ( ) ] ;
if ( CURRENT_ENCOUNTER . entities [ i ] - > fixedTurnOrder ) {
CURRENT_ENCOUNTER . entities [ i ] - > turnComplete = false ;
CURRENT_ENCOUNTER . entities [ i ] - > selectedMove = CURRENT_ENCOUNTER . entities [ i ] - > moveSet [ CURRENT_ENCOUNTER . entities [ i ] - > fixedTurnOrderInd + + ] ;
if ( CURRENT_ENCOUNTER . entities [ i ] - > selectedMove - > name . compare ( " Seed Storm " ) = = 0 ) {
if ( CURRENT_ENCOUNTER . entities [ i ] - > fixedTurnOrderInd > = CURRENT_ENCOUNTER . entities [ i ] - > moveSet . size ( ) ) {
std : : cout < < " Entity " < < i < < " selected Seed Storm. \n " ;
CURRENT_ENCOUNTER . entities [ i ] - > fixedTurnOrderInd = 0 ;
}
} else {
CURRENT_ENCOUNTER . entities [ i ] - > selectedMove = CURRENT_ENCOUNTER . entities [ i ] - > moveSet [ rand ( ) % CURRENT_ENCOUNTER . entities [ i ] - > moveSet . size ( ) ] ;
}
}
CURRENT_ENCOUNTER . entities [ i ] - > turnComplete = false ;
}
}
}
}
PLAYER_TURN_COMPLETE = false ;
PLAYER_TURN_COMPLETE = false ;
BATTLE_STATE = battle : : MOVE_RESOLUTION ;
BATTLE_STATE = battle : : MOVE_RESOLUTION ;
//Seed Storm has prio.
//Seed Storm has prio.
if ( ! PLAYER_TURN_COMPLETE & & BATTLE_CARD_SELECTION - > name . compare ( " Seed Storm " ) = = 0 ) {
if ( ! PLAYER_TURN_COMPLETE & & isPriorityMove ( BATTLE_CARD_SELECTION ) ) {
turnOrder . push ( - 1 ) ;
turnOrder . push ( - 1 ) ;
PLAYER_TURN_COMPLETE = true ;
PLAYER_TURN_COMPLETE = true ;
}
}
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
if ( CURRENT_ENCOUNTER . entities [ i ] - > hp > 0 & & ! CURRENT_ENCOUNTER . entities [ i ] - > turnComplete & &
if ( CURRENT_ENCOUNTER . entities [ i ] - > hp > 0 & & ! CURRENT_ENCOUNTER . entities [ i ] - > turnComplete & &
CURRENT_ENCOUNTER . entities [ i ] - > selectedMove - > name . compare ( " Seed Storm " ) = = 0 ) {
isPriorityMove ( CURRENT_ENCOUNTER . entities [ i ] - > selectedMove ) ) {
turnOrder . push ( i ) ;
turnOrder . push ( i ) ;
CURRENT_ENCOUNTER . entities [ i ] - > turnComplete = true ;
CURRENT_ENCOUNTER . entities [ i ] - > turnComplete = true ;
std : : cout < < " Entity " < < i < < " added prio for Seed Storm. \n " ;
std : : cout < < " Entity " < < i < < " added prio for Seed Storm. \n " ;
}
}
}
}
//Healing has half prio for the player.
//Healing has half prio for the player.
if ( rand ( ) % 2 = = 0 & & ! PLAYER_TURN_COMPLETE & & ( BATTLE_CARD_SELECTION - > name . compare ( " Meal " ) = = 0 | | BATTLE_CARD_SELECTION - > name . compare ( " Snack " ) = = 0 ) ) {
if ( rand ( ) % 2 = = 0 & & ! PLAYER_TURN_COMPLETE & & isFoodMove ( BATTLE_CARD_SELECTION ) ) {
turnOrder . push ( - 1 ) ;
turnOrder . push ( - 1 ) ;
PLAYER_TURN_COMPLETE = true ;
PLAYER_TURN_COMPLETE = true ;
}
}
//Otherwise, every enemy has a chance to go before the player unless they are slowed, then they always go after.
//Otherwise, every enemy has a chance to go before the player unless they are slowed, then they always go after.
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
Entity * ent = CURRENT_ENCOUNTER . entities [ i ] ;
Entity * ent = CURRENT_ENCOUNTER . entities [ i ] ;
if ( rand ( ) % 2 = = 0 & & ! PLAYER_TURN_COMPLETE & & ( BATTLE_CARD_SELECTION - > name . compare ( " Meal " ) = = 0 | | BATTLE_CARD_SELECTION - > name . compare ( " Snack " ) = = 0 ) ) {
if ( rand ( ) % 2 = = 0 & & ! PLAYER_TURN_COMPLETE & & isFoodMove ( BATTLE_CARD_SELECTION ) ) {
turnOrder . push ( - 1 ) ;
turnOrder . push ( - 1 ) ;
PLAYER_TURN_COMPLETE = true ;
PLAYER_TURN_COMPLETE = true ;
}
}
@ -2576,6 +2619,18 @@ public:
textInd = 0 ;
textInd = 0 ;
CONSOLE_REF_TEXT = text ;
CONSOLE_REF_TEXT = text ;
}
}
bool isPriorityMove ( WEATHER_POWER * power ) {
return
power - > name . compare ( " Seed Storm " ) = = 0 | |
power - > name . compare ( " Seed of Life " ) = = 0 ;
}
bool isFoodMove ( WEATHER_POWER * power ) {
return
power - > name . compare ( " Meal " ) = = 0 | |
power - > name . compare ( " Snack " ) = = 0 ;
}
} ;
} ;