diff --git a/SeasonsOfLoneliness.cpp b/SeasonsOfLoneliness.cpp index 37d0e36..2bedb02 100644 --- a/SeasonsOfLoneliness.cpp +++ b/SeasonsOfLoneliness.cpp @@ -9,6 +9,7 @@ using namespace olc; //#define TEST_MAP1 //Toggle to just play around on map 1. #define TEST_MAP2 //Toggle on to just play around on map 2. +#define SKIP_INTRO true #define STARTING_MAP "assets/maps/map1" #define STARTING_STATE CUTSCENE_1 @@ -475,6 +476,11 @@ public: EnableLayer(i,true); } + if (SKIP_INTRO) { + GAME_FLAGS[gameflag::TUTORIAL_WALKED_OFF_FARM]=true; + GAME_FLAGS[gameflag::VISIT_BROKEN_ROVER]=true; + } + //ConsoleShow(F1,false); // Called once at the start, so create things here TILES=new Decal(new Sprite("assets/tiles.png")); @@ -581,6 +587,11 @@ public: NADO_ANIMATION.frames.push_back({i*32,0}); } 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; HURRICANE->playerOwnCount=1; @@ -605,6 +616,7 @@ public: 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["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["BROKEN_ROVER"]=new ObjectLoadInfo(BROKEN_ROVER_DECAL); BASE_OBJECTS["NADO"]=new ObjectLoadInfo(NADO_DECAL,&NADO_ANIMATION,Pixel(153, 137, 75,230)); @@ -1082,6 +1094,16 @@ public: performCropUpdate(8); displayPowerInfo(SNOWSTORM); } 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 "<x,obj->y}); + OBJECTS.erase(OBJECTS.begin()+i--); + delete obj; + performCropUpdate(8); + displayPowerInfo(PETAL_STORM); + } else if (obj->name.compare("EXIT")==0&&collidesWithPlayer(obj)) { fadeOut(); PlayCutscene(cutscene::TRANSITION_CUTSCENE); @@ -1196,6 +1218,15 @@ public: 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); + 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 (BATTLE_CURRENT_TURN_ENTITY==-1) { 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) { 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 "<name<<" for PlayerForce:"<