|
|
@ -9,6 +9,7 @@ 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 true |
|
|
|
|
|
|
|
|
|
|
|
#define STARTING_MAP "assets/maps/map1" |
|
|
|
#define STARTING_MAP "assets/maps/map1" |
|
|
|
#define STARTING_STATE CUTSCENE_1 |
|
|
|
#define STARTING_STATE CUTSCENE_1 |
|
|
@ -475,6 +476,11 @@ public: |
|
|
|
EnableLayer(i,true); |
|
|
|
EnableLayer(i,true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (SKIP_INTRO) { |
|
|
|
|
|
|
|
GAME_FLAGS[gameflag::TUTORIAL_WALKED_OFF_FARM]=true; |
|
|
|
|
|
|
|
GAME_FLAGS[gameflag::VISIT_BROKEN_ROVER]=true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//ConsoleShow(F1,false);
|
|
|
|
//ConsoleShow(F1,false);
|
|
|
|
// Called once at the start, so create things here
|
|
|
|
// Called once at the start, so create things here
|
|
|
|
TILES=new Decal(new Sprite("assets/tiles.png")); |
|
|
|
TILES=new Decal(new Sprite("assets/tiles.png")); |
|
|
@ -581,6 +587,11 @@ public: |
|
|
|
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; |
|
|
|
|
|
|
|
for (int i=0;i<3;i++) { |
|
|
|
|
|
|
|
PETAL_STORM_ANIMATION.frames.push_back({i*32,0}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
PETAL_STORM_ANIMATION.skip_frames=nodeAnimationSkipFrames; |
|
|
|
|
|
|
|
|
|
|
|
HAILSTORM->playerOwnCount=3; |
|
|
|
HAILSTORM->playerOwnCount=3; |
|
|
|
HURRICANE->playerOwnCount=1; |
|
|
|
HURRICANE->playerOwnCount=1; |
|
|
@ -605,6 +616,7 @@ public: |
|
|
|
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["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)); |
|
|
@ -1082,6 +1094,16 @@ public: |
|
|
|
performCropUpdate(8); |
|
|
|
performCropUpdate(8); |
|
|
|
displayPowerInfo(SNOWSTORM); |
|
|
|
displayPowerInfo(SNOWSTORM); |
|
|
|
} else |
|
|
|
} else |
|
|
|
|
|
|
|
if (obj->name.compare("PETALSTORM_NODE")==0&&collidesWithPlayer(obj)) { |
|
|
|
|
|
|
|
int amountGained=rand()%4+2; |
|
|
|
|
|
|
|
PETAL_STORM->playerOwnCount+=amountGained; |
|
|
|
|
|
|
|
std::cout<<"Increased PETALSTORM power inventory count by "<<amountGained<<".\n"; |
|
|
|
|
|
|
|
COLLECTED_ITEMS.push_back({obj->x,obj->y}); |
|
|
|
|
|
|
|
OBJECTS.erase(OBJECTS.begin()+i--); |
|
|
|
|
|
|
|
delete obj; |
|
|
|
|
|
|
|
performCropUpdate(8); |
|
|
|
|
|
|
|
displayPowerInfo(PETAL_STORM); |
|
|
|
|
|
|
|
} else |
|
|
|
if (obj->name.compare("EXIT")==0&&collidesWithPlayer(obj)) { |
|
|
|
if (obj->name.compare("EXIT")==0&&collidesWithPlayer(obj)) { |
|
|
|
fadeOut(); |
|
|
|
fadeOut(); |
|
|
|
PlayCutscene(cutscene::TRANSITION_CUTSCENE); |
|
|
|
PlayCutscene(cutscene::TRANSITION_CUTSCENE); |
|
|
@ -1196,6 +1218,15 @@ public: |
|
|
|
ref=CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->selectedMove; |
|
|
|
ref=CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->selectedMove; |
|
|
|
} |
|
|
|
} |
|
|
|
PIXEL_EFFECT_TRANSPARENCY=(0.5*cos(((M_PI/(30.0*(ref->effectTime/120.0)))/2)*EFFECT_TIMER-M_PI)+0.5); |
|
|
|
PIXEL_EFFECT_TRANSPARENCY=(0.5*cos(((M_PI/(30.0*(ref->effectTime/120.0)))/2)*EFFECT_TIMER-M_PI)+0.5); |
|
|
|
|
|
|
|
if (EFFECT_TIMER==30&&ref->name.compare("Petal Storm")==0) { |
|
|
|
|
|
|
|
int healPower=30; |
|
|
|
|
|
|
|
int healRoll=healPower+rand()%ref->damageRoll*sign(healPower); |
|
|
|
|
|
|
|
if (BATTLE_CURRENT_TURN_ENTITY==-1) { |
|
|
|
|
|
|
|
effectRadius({(int)PLAYER_COORDS[0],(int)PLAYER_COORDS[1]},ref,-healPower,true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
effectRadius({CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->x+CURRENT_ENCOUNTER.x,CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->y+CURRENT_ENCOUNTER.y},ref,-healPower,false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (EFFECT_TIMER==30&&ref->name.compare("Seed Storm")==0) { |
|
|
|
if (EFFECT_TIMER==30&&ref->name.compare("Seed Storm")==0) { |
|
|
|
if (BATTLE_CURRENT_TURN_ENTITY==-1) { |
|
|
|
if (BATTLE_CURRENT_TURN_ENTITY==-1) { |
|
|
|
effectRadius({(int)PLAYER_COORDS[0],(int)PLAYER_COORDS[1]},ref,true); |
|
|
|
effectRadius({(int)PLAYER_COORDS[0],(int)PLAYER_COORDS[1]},ref,true); |
|
|
@ -2024,6 +2055,10 @@ public: |
|
|
|
|
|
|
|
|
|
|
|
void effectRadius(vi2d coords,WEATHER_POWER*power,bool playerForce) { |
|
|
|
void effectRadius(vi2d coords,WEATHER_POWER*power,bool playerForce) { |
|
|
|
int finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage); |
|
|
|
int finalDamage=power->damage+rand()%power->damageRoll*sign(power->damage); |
|
|
|
|
|
|
|
effectRadius(coords,power,finalDamage,playerForce); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void effectRadius(vi2d coords,WEATHER_POWER*power,int finalDamage,bool playerForce) { |
|
|
|
std::cout<<"Emitting effect radius for "<<power->name<<" for PlayerForce:"<<playerForce<<"\n"; |
|
|
|
std::cout<<"Emitting effect radius for "<<power->name<<" for PlayerForce:"<<playerForce<<"\n"; |
|
|
|
if (finalDamage<0) { |
|
|
|
if (finalDamage<0) { |
|
|
|
//This is a healing effect.
|
|
|
|
//This is a healing effect.
|
|
|
|