diff --git a/SeasonsOfLoneliness.cpp b/SeasonsOfLoneliness.cpp index a566d9b..9240f15 100644 --- a/SeasonsOfLoneliness.cpp +++ b/SeasonsOfLoneliness.cpp @@ -307,6 +307,7 @@ class WEATHER_POWER{ bool growSeeds=false; //If set to true, will trigger a growth of all seeds. bool burnTrees=false; //If set to true, will trigger a burning of trees. float treeBurnChance=1; //% chance of trees getting burned by this attack. + float treeSeedChance=0; //% chance of trees producing seeds from this attack. WEATHER_POWER(std::string name,std::string desc,Animation*icon,Animation*effect,int dmg,int dmgRoll,int range,Pixel bgcol,Pixel textcol,int effectTime,ParticleEffect*parteff) { this->description=desc; this->name=name; @@ -472,6 +473,8 @@ public: Animation*EMPTY_BED_ANIMATION=new Animation(); Animation*POWER_FLASHFLOOD_ANIMATION=new Animation(); Animation*POWER_SUNNYDAY_ANIMATION=new Animation(); + Animation*POWER_FIRESTORM_ANIMATION=new Animation(); + Animation*POWER_SOLARFLARE_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*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)); @@ -495,6 +498,7 @@ public: ParticleEffect*GUST_EFF = new ParticleEffect({0,0},{64,64},{0,0},{64,64},{1,2},{3,20},{-6,1},{6,6},Pixel(168, 155, 146,196),Pixel(196, 194, 192,220),20,Pixel(255, 0, 0,0)); ParticleEffect*FLASH_FLOOD_EFF = new ParticleEffect({0,0},{WIDTH,HEIGHT},{0,0},{WIDTH,HEIGHT},{1,1},{2,2},{-4,1},{-1,4},Pixel(8, 54, 204,64),Pixel(255,255,255,128),500,Pixel(220, 226, 227,0)); ParticleEffect*SUNNYDAY_EFF = new ParticleEffect({0,0},{WIDTH,HEIGHT},{0,0},{WIDTH,HEIGHT},{1,1},{4,4},{0,-2},{0,-6},Pixel(209, 207, 113,130),Pixel(255, 255, 255,210),50,Pixel(70, 158, 62,0)); + ParticleEffect*SOLARFLARE_EFF = new ParticleEffect({0,0},{128,128},{0,0},{128,128},{2,HEIGHT/2},{4,HEIGHT},{0,4},{0,25},Pixel(217, 36, 0,130),Pixel(217, 94, 0,255),40,Pixel(166, 51, 28,64)); WEATHER_POWER*HAILSTORM = new WEATHER_POWER("Hailstorm","Causes a flurry of hard cold rocks to be unleashed in target area. 60+1d30",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+1d10",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 fiery space rocks to fall on target area. 50+1d50",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); @@ -517,11 +521,13 @@ public: WEATHER_POWER*TORNADO = new WEATHER_POWER("Tornado","",POWER_HURRICANE_ANIMATION,POWER_HURRICANE_ANIMATION,30,10,150,Pixel(99, 148, 132,255),Pixel(121, 132, 140,255),120,TORNADO_EFF); WEATHER_POWER*GUST = new WEATHER_POWER("Gust","",POWER_HURRICANE_ANIMATION,POWER_HURRICANE_ANIMATION,15,10,150,Pixel(99, 148, 132,255),Pixel(121, 132, 140,255),120,GUST_EFF); WEATHER_POWER*FLASH_FLOOD = new WEATHER_POWER("Flash Flood","Causes massive seed growth and heavy damage. 30+1d20",POWER_FLASHFLOOD_ANIMATION,POWER_FLASHFLOOD_ANIMATION,30,20,200,Pixel(27, 41, 87,255),Pixel(138, 161, 237,255),120,FLASH_FLOOD_EFF); - WEATHER_POWER*SUNNY_DAY = new WEATHER_POWER("Sunny Day","Fertilize soil, multiplying seed growth and causing trees to drop seeds. 10+1d10",POWER_SUNNYDAY_ANIMATION,POWER_SUNNYDAY_ANIMATION,10,10,200,Pixel(27, 41, 87,255),Pixel(138, 161, 237,255),120,SUNNYDAY_EFF); + WEATHER_POWER*SUNNY_DAY = new WEATHER_POWER("Sunny Day","Fertilize soil, multiplying seed growth and causing trees to drop seeds. 10+1d10",POWER_SUNNYDAY_ANIMATION,POWER_SUNNYDAY_ANIMATION,10,10,200,Pixel(179, 164, 71,255),Pixel(222, 198, 44,255),120,SUNNYDAY_EFF); + WEATHER_POWER*FIRESTORM = new WEATHER_POWER("Fire Storm","Cause devastating fires, destroying everything in sight. 65+1d40",POWER_FIRESTORM_ANIMATION,POWER_FIRESTORM_ANIMATION,65,40,145,Pixel(176, 95, 44,255),Pixel(237, 100, 14,255),120,FIRESTORM_EFF); + WEATHER_POWER*SOLAR_FLARE = new WEATHER_POWER("Solar Flare","A concentrated sunbeam of death. Burns down all trees. 175+1d40",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,10,10,200,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,SOLARFLARE_EFF); bool IN_BATTLE_ENCOUNTER = false; int BATTLE_ENTRY_TIMER = 0; int EFFECT_TIMER = 0; - #define WEATHER_POWER_COUNT 8 //Number of powers that are in the game. Update storage array accordingly. + #define WEATHER_POWER_COUNT 12 //Number of powers that are in the game. Update storage array accordingly. WEATHER_POWER*WEATHER_POWERS[WEATHER_POWER_COUNT] = { HAILSTORM, PETAL_STORM, @@ -529,6 +535,10 @@ public: METEOR_RAIN, METEOR_STORM, SNOWSTORM, + FLASH_FLOOD, + SUNNY_DAY, + FIRESTORM, + SOLAR_FLARE, CONSUME_SNACK, CONSUME_MEAL}; battle::BATTLESTATE BATTLE_STATE=battle::NONE; @@ -575,7 +585,7 @@ public: *CONSUME_SNACK_DECAL,*CONSUME_MEAL_DECAL,*COMPUTER_DECAL,*BROKEN_ROVER_DECAL, *NADO_DECAL,*SILICON_ROCK_DECAL,*PETAL_STORM_DECAL,*ROVER_DECAL,*X_X_DECAL, *LATER_THAT_NIGHT_DECAL,*SLEEP_DECAL,*SEED_DECAL,*TREE_DECAL,*X_X_UNCHARGED_DECAL, - *SANDWORM_DECAL,*SNAKE_DECAL,*MOTH_DECAL,*FLASH_FLOOD_DECAL; + *SANDWORM_DECAL,*SNAKE_DECAL,*MOTH_DECAL,*FLASH_FLOOD_DECAL,*SUNNY_DAY_DECAL,*FIRESTORM_DECAL,*SOLARFLARE_DECAL; std::map BASE_OBJECTS; std::vector ENCOUNTERS; Encounter ENCOUNTER_SPIDEY_1; @@ -676,6 +686,8 @@ public: SNAKE_DECAL=new Decal(new Sprite("assets/snake.png")); FLASH_FLOOD_DECAL=new Decal(new Sprite("assets/flashflood_icon.png")); SUNNY_DAY_DECAL=new Decal(new Sprite("assets/sunny_day.png")); + FIRESTORM_DECAL=new Decal(new Sprite("assets/firestorm.png")); + SOLARFLARE_DECAL=new Decal(new Sprite("assets/solarflare.png")); current_playerAnim->spr=PLAYER_DECAL; playerAnim->spr=PLAYER_DECAL; @@ -782,6 +794,16 @@ public: POWER_SUNNYDAY_ANIMATION->frames.push_back({i*32,0}); } POWER_SUNNYDAY_ANIMATION->skip_frames=nodeAnimationSkipFrames; + POWER_FIRESTORM_ANIMATION->spr=FIRESTORM_DECAL; + for (int i=0;i<3;i++) { + POWER_FIRESTORM_ANIMATION->frames.push_back({i*32,0}); + } + POWER_FIRESTORM_ANIMATION->skip_frames=nodeAnimationSkipFrames; + POWER_SOLARFLARE_ANIMATION->spr=SOLARFLARE_DECAL; + for (int i=0;i<3;i++) { + POWER_SOLARFLARE_ANIMATION->frames.push_back({i*32,0}); + } + POWER_SOLARFLARE_ANIMATION->skip_frames=nodeAnimationSkipFrames; HAILSTORM->playerOwnCount=3; HURRICANE->playerOwnCount=1; @@ -793,6 +815,14 @@ public: METEOR_STORM->burnTrees=true; METEOR_RAIN->burnTrees=true; METEOR_RAIN->treeBurnChance=0.5; + SUNNY_DAY->seedProduction=1; + SUNNY_DAY->seedScatter=1.5; + SUNNY_DAY->treeSeedChance=0.75; + FLASH_FLOOD->seedProduction=6; + SOLAR_FLARE->treeBurnChance=1; + SOLAR_FLARE->burnTrees=true; + FIRESTORM->treeBurnChance=1; + FIRESTORM->burnTrees=true; MOVESET_SPIDEY.push_back(SANDSTORM); MOVESET_SPIDEY.push_back(SEED_STORM); @@ -857,6 +887,10 @@ public: 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["SUNNYDAY_NODE"]=new ObjectLoadInfo(SUNNY_DAY_DECAL,POWER_SUNNYDAY_ANIMATION); + BASE_OBJECTS["FLASHFLOOD_NODE"]=new ObjectLoadInfo(FLASH_FLOOD_DECAL,POWER_FLASHFLOOD_ANIMATION); + BASE_OBJECTS["FIRESTORM_NODE"]=new ObjectLoadInfo(FIRESTORM_DECAL,POWER_FIRESTORM_ANIMATION); + BASE_OBJECTS["SOLARFLARE_NODE"]=new ObjectLoadInfo(SOLARFLARE_DECAL,POWER_SOLARFLARE_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)); @@ -1459,6 +1493,26 @@ public: performCropUpdate(8); displayPowerInfo(PETAL_STORM); } else + if (obj->name.compare("SUNNYDAY_NODE")==0&&collidesWithPlayer(obj)) { + int amountGained=rand()%4+2; + SUNNY_DAY->playerOwnCount+=amountGained; + std::cout<<"Increased SUNNYDAY power inventory count by "<x,(int)obj->y}); + OBJECTS.erase(OBJECTS.begin()+i--); + delete obj; + performCropUpdate(8); + displayPowerInfo(SUNNY_DAY); + } else + if (obj->name.compare("FLASHFLOOD_NODE")==0&&collidesWithPlayer(obj)) { + int amountGained=rand()%4+2; + FLASH_FLOOD->playerOwnCount+=amountGained; + std::cout<<"Increased FLASHFLOOD power inventory count by "<x,(int)obj->y}); + OBJECTS.erase(OBJECTS.begin()+i--); + delete obj; + performCropUpdate(8); + displayPowerInfo(FLASH_FLOOD); + } else if (obj->name.compare("SILICON_PIECE")==0&&collidesWithPlayer(obj)) { GAME_STATE=COLLECTED_SILICON; DisplayMessageBox(14); @@ -1663,6 +1717,11 @@ public: } else if (EFFECT_TIMER==ref->effectTime/2){ addSeeds(ref->seedProduction); + for (int i=0;itreeSeedChance>range(0,1)) { + addSeeds(1); + } + } int newSeedCount=SEEDS.size()*ref->seedScatter; while (SEEDS.size()