diff --git a/SeasonsOfLoneliness.cpp b/SeasonsOfLoneliness.cpp index 53e7b55..ce7665f 100644 --- a/SeasonsOfLoneliness.cpp +++ b/SeasonsOfLoneliness.cpp @@ -55,6 +55,7 @@ namespace cutscene{ WALK_TO_COMPUTER, INPUT_USERNAME, GO_OUTSIDE, + WALK_TO_ROVER }; } @@ -264,6 +265,18 @@ class Encounter{ std::vector turnOrder; }; +class Zone{ + public: + vi2d pos; //In tile coordinates. + vi2d size; //In tile coordinates. + ParticleEffect*eff; + Zone(vi2d pos,vi2d size,vf2d effectPos,vf2d effectSize,vf2d pos_low,vf2d pos_high,vf2d size_low,vf2d size_high,vf2d spd_low,vf2d spd_high,olc::Pixel col_low,olc::Pixel col_high,int amt,olc::Pixel foregroundColor) { + this->pos=pos; + this->size=size; + this->eff=new ParticleEffect(effectPos,effectSize,pos_low,pos_high,size_low,size_high,spd_low,spd_high,col_low,col_high,amt,foregroundColor); + } +}; + namespace effect { class Pixel{ public: @@ -410,13 +423,14 @@ public: int TERMINAL_SELECTED_CHAR=0; std::string TERMINAL_INPUT=""; std::string PLAYER_NAME="..."; + std::vectorZONES; Decal*DOME_DECAL,*FOOD_METER_DECAL,*OXYGEN_METER_DECAL,*PLANT_DECAL, *PLAYER_DECAL, *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; + *CONSUME_SNACK_DECAL,*CONSUME_MEAL_DECAL,*COMPUTER_DECAL,*BROKEN_ROVER_DECAL; std::map BASE_OBJECTS; std::vector ENCOUNTERS; Encounter ENCOUNTER_SPIDEY_1; @@ -458,6 +472,7 @@ public: TARGETING_RANGE_CIRCLE=new Decal(new Sprite("assets/targetRange.png")); HEALTHBAR_DECAL=new Decal(new Sprite("assets/healthbar.png")); COMPUTER_DECAL=new Decal(new Sprite("assets/computerSystem.png")); + BROKEN_ROVER_DECAL=new Decal(new Sprite("assets/brokenROVER.png")); current_playerAnim.spr=PLAYER_DECAL; playerAnim.spr=PLAYER_DECAL; @@ -559,6 +574,11 @@ 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["COMPUTER"]=new ObjectLoadInfo(COMPUTER_DECAL); + BASE_OBJECTS["BROKEN_ROVER"]=new ObjectLoadInfo(BROKEN_ROVER_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)); + + ZONES.push_back(SILICON_DEPOSIT_ZONE); for (int i=0;i=z->pos.x&&PLAYER_COORDS[0]<=z->pos.x+z->size.x&& + PLAYER_COORDS[1]>=z->pos.y&&PLAYER_COORDS[1]<=z->pos.y+z->size.y) { + if (PIXEL_EFFECT_TRANSPARENCY==0) { + applyPixelEffect(z->eff,{PLAYER_COORDS[0],PLAYER_COORDS[1]},0.9); + } + zoneEffectActive=true; + } + } + if (!zoneEffectActive&&PIXEL_EFFECT_TRANSPARENCY>0) { + clearPixelEffect(); + } for (int i=0;iname.compare("HAILSTORM_NODE")==0&&collidesWithPlayer(obj)) { @@ -1030,6 +1061,7 @@ public: int TARGET_COORDS_Y=CURRENT_ENCOUNTER.y+HEIGHT/32/2; if (PLAYER_COORDS[0]==TARGET_COORDS_X&&PLAYER_COORDS[1]==TARGET_COORDS_Y) { BATTLE_STATE = battle::PLAYER_SELECTION; + clearPixelEffect(); EFFECT_TIMER = 0; } else if (PLAYER_COORDS[0]!=TARGET_COORDS_X) { @@ -1065,15 +1097,15 @@ public: PIXEL_EFFECT_TRANSPARENCY=0; if (BATTLE_CURRENT_TURN_ENTITY==-1) { if (PLAYER_SELECTED_TARGET==-2) { - applyPixelEffect(BATTLE_CARD_SELECTION,{PLAYER_COORDS[0],PLAYER_COORDS[1]}); + applyPixelEffect(BATTLE_CARD_SELECTION,{PLAYER_COORDS[0],PLAYER_COORDS[1]},0); } else { - applyPixelEffect(BATTLE_CARD_SELECTION,{CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->x,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->y}); + applyPixelEffect(BATTLE_CARD_SELECTION,{CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->x,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->y},0); } } else { if (CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->selectedMove->damage<0) { - applyPixelEffect(CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->selectedMove,{CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->x,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->y}); + applyPixelEffect(CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->selectedMove,{CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->x,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->y},0); } else { - applyPixelEffect(CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->selectedMove,{PLAYER_COORDS[0],PLAYER_COORDS[1]}); + applyPixelEffect(CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->selectedMove,{PLAYER_COORDS[0],PLAYER_COORDS[1]},0); } } } @@ -2008,7 +2040,27 @@ public: CUTSCENE_DISPLAYED_CARD=POWER; } - void applyPixelEffect(WEATHER_POWER*power,vf2d pos) { + void applyPixelEffect(ParticleEffect*effect,vf2d pos,float startingTransparency) { + SetDrawTarget(nullptr); + Clear(BLANK); + SetDrawTarget(1); + applyPixelEffect( + {(pos.x-PLAYER_COORDS[0])*32+WIDTH/2-16-effect->effectSize.x/2,(pos.y-PLAYER_COORDS[1])*32+HEIGHT/2-16-effect->effectSize.y/2}, + effect->effectSize, + effect->pos_low, + effect->pos_high, + effect->size_low, + effect->size_high, + effect->spd_low, + effect->spd_high, + effect->col_low, + effect->col_high, + effect->amt, + effect->foregroundColor,startingTransparency + ); + } + + void applyPixelEffect(WEATHER_POWER*power,vf2d pos,float startingTransparency) { SetDrawTarget(nullptr); Clear(BLANK); SetDrawTarget(1); @@ -2024,11 +2076,11 @@ public: power->effect->col_low, power->effect->col_high, power->effect->amt, - power->effect->foregroundColor + power->effect->foregroundColor,startingTransparency ); } - void applyPixelEffect(vf2d effectPos,vf2d effectSize,vf2d pos_low,vf2d pos_high,vf2d size_low,vf2d size_high,vf2d spd_low,vf2d spd_high,olc::Pixel col_low,olc::Pixel col_high,int amt,olc::Pixel foregroundColor) { + void applyPixelEffect(vf2d effectPos,vf2d effectSize,vf2d pos_low,vf2d pos_high,vf2d size_low,vf2d size_high,vf2d spd_low,vf2d spd_high,olc::Pixel col_low,olc::Pixel col_high,int amt,olc::Pixel foregroundColor,float startingTransparency) { for (int i=0;ipos={range(pos_low.x,pos_high.x),range(pos_low.y,pos_high.y)}; pixels[i]->size={range(size_low.x,size_high.x),range(size_low.y,size_high.y)}; @@ -2044,6 +2096,7 @@ public: PIXEL_POS=effectPos; PIXEL_SIZE=effectSize; PIXEL_LIMIT=amt; + PIXEL_EFFECT_TRANSPARENCY=startingTransparency; } void clearPixelEffect() { diff --git a/assets/brokenROVER.png b/assets/brokenROVER.png new file mode 100644 index 0000000..31468ae Binary files /dev/null and b/assets/brokenROVER.png differ diff --git a/assets/maps/map1 b/assets/maps/map1 index 6d30e09..1ab5354 100644 --- a/assets/maps/map1 +++ b/assets/maps/map1 @@ -2,34 +2,34 @@ 78 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500000000005000550000500000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000005000550000000000000050000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000500005055000050000550005050000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005500550000050000500050050000550005000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000055555555555555555555555555000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000055555555555555555555555555550000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005000000000555555555555555555555500000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000505000555555555555555555555505055000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055000500005555555555555555555000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000500555555555555550000050000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000555555550000500500000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000505505000000555555550055000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000555555550500550000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050500000000500005050000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055000000000000500050000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000050000500500000550000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000550000000000000005500000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000550000000000005550000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000550000000000000000000000005500000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005500000000000000000050000055500000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000055500000000000000000000000050000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 @@ -84,4 +84,5 @@ 14;69;METEORSHOWER_NODE 202;33;METEORSTORM_NODE 167;44;SNOWSTORM_NODE -20;10;HURRICANE_NODE \ No newline at end of file +20;10;HURRICANE_NODE +33;35;BROKEN_ROVER \ No newline at end of file diff --git a/data.h b/data.h index f3b1b8d..9cd2b93 100644 --- a/data.h +++ b/data.h @@ -55,6 +55,9 @@ What a great harvest!)",//11 R"( CompU-16770 Authenticated. Record successfully logged.)",//12 +R"( +R.O.V.E.R. 2001 + < No response... >)",//13 };