Apply properties to abilities so they work right.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent f639902c1b
commit 827367beca
  1. 46
      SeasonsOfLoneliness.cpp
  2. BIN
      Seasons_of_Loneliness
  3. 3
      data.h

@ -132,6 +132,7 @@ namespace gameflag{
STORY_REVIEW,
NEXT_COORDS2,
CHECK_ROVER_4,
LITTLESNAKES_KILLED,
};
}
@ -444,6 +445,7 @@ class PlayerState{
int foodCount;
std::vector<int> weatherPowerCounts;
float x,y;
bool gameFlags[128]={};
};
class SeasonsOfLoneliness : public PixelGameEngine
@ -552,7 +554,7 @@ public:
ParticleEffect*POLLINATION_EFF = new ParticleEffect({0,0},{WIDTH,HEIGHT},{0,0},{WIDTH,HEIGHT},{4,4},{12,12},{-20,-6},{0,-20},Pixel(130, 245, 2,130),Pixel(250, 246, 2,210),50,Pixel(199, 199, 52,64));
ParticleEffect*GLARE_EFF = new ParticleEffect({0,0},{WIDTH,HEIGHT},{0,0},{WIDTH,HEIGHT},{4,4},{12,12},{-20,-6},{0,-20},Pixel(130, 245, 2,130),Pixel(250, 246, 2,210),0,Pixel(255, 255, 255,64));
ParticleEffect*PETRIFY_EFF = new ParticleEffect({0,0},{64,64},{0,0},{64,64},{2,2},{4,4},{-1,-3},{1,-8},Pixel(166, 147, 143,200),Pixel(199, 194, 193,210),30,Pixel(199, 199, 52,0));
ParticleEffect*MEGA_FANG_EFF = new ParticleEffect({0,0},{64,64},{0,0},{64,64},{1,1},{3,3},{-5,-5},{5,5},Pixel(255,255,255,200),Pixel(255,255,255,210),40,Pixel(70, 158, 62,0));
ParticleEffect*MEGAFANG_EFF = new ParticleEffect({0,0},{64,64},{0,0},{64,64},{1,1},{3,3},{-5,-5},{5,5},Pixel(255,255,255,200),Pixel(255,255,255,210),40,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+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);
@ -581,9 +583,9 @@ public:
WEATHER_POWER*HIDE = new WEATHER_POWER("Hide","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,175,40,32,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,HIDE_EFF);
WEATHER_POWER*HYPERZAP = new WEATHER_POWER("Hyper Zap","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,175,40,32,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,HYPERZAP_EFF);
WEATHER_POWER*POLLINATION = new WEATHER_POWER("Pollination","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,-110,10,255,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,POLLINATION_EFF);
WEATHER_POWER*GLARE = new WEATHER_POWER("Glare","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,-110,10,255,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,GLARE_EFF);
WEATHER_POWER*PETRIFY = new WEATHER_POWER("Petrify","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,-110,10,255,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,PETRIFY_EFF);
WEATHER_POWER*MEGA_FANG = new WEATHER_POWER("Mega Fang","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,-110,10,255,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,MEGAFANG_EFF);
WEATHER_POWER*GLARE = new WEATHER_POWER("Glare","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,1,10,255,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,GLARE_EFF);
WEATHER_POWER*PETRIFY = new WEATHER_POWER("Petrify","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,1,10,255,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,PETRIFY_EFF);
WEATHER_POWER*MEGA_FANG = new WEATHER_POWER("Mega Fang","",POWER_SOLARFLARE_ANIMATION,POWER_SOLARFLARE_ANIMATION,1,10,255,Pixel(176, 53, 37,255),Pixel(217, 98, 0,255),120,MEGAFANG_EFF);
bool IN_BATTLE_ENCOUNTER = false;
int BATTLE_ENTRY_TIMER = 0;
@ -800,6 +802,7 @@ public:
LAUNCHPAD_HALF2_DECAL=new Decal(new Sprite("assets/launchpad_half2.png"));
LAUNCHPAD_DECAL=new Decal(new Sprite("assets/launchpad_back.png"));
Y_Y_DECAL=new Decal(new Sprite("assets/Y.Y.png"));
PETRIFY_DECAL=new Decal(new Sprite("assets/petrify.png"));
playerAnim->spr=PLAYER_DECAL;
playerAnimRight->spr=PLAYER_DECAL;
@ -937,6 +940,9 @@ public:
SNOWSTORM->appliesSlow=true;
HIDE->appliesHide=true;
HYPERZAP->appliesSpeed=true;
PETRIFY->appliesPetrification=true;
MEGA_FANG->dealsPctDmg=true;
MEGA_FANG->pctDmg=0.49;
LIGHT_STORM->lowPriority=true;
@ -1033,7 +1039,7 @@ public:
ENCOUNTERS.push_back(ENCOUNTER_MEGAMOTH);
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",1,1,225,225,MOVESET_SNAKE));
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",3,2,0,225,MOVESET_SNAKE));
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Sidewinder",4,3,0,225,MOVESET_SIDEWINDER,{2,2},true));
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Sidewinder",4,3,0,1065,MOVESET_SIDEWINDER,{2,2},true));
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",5,3,225,225,MOVESET_SNAKE));
ENCOUNTER_SNAKEPACK.entities.push_back(new Entity(SNAKE_DECAL,"Snake",6,1,0,225,MOVESET_SNAKE));
ENCOUNTER_SNAKEPACK.x=11-4;
@ -1929,6 +1935,11 @@ public:
case battle::PLAYER_SELECTION:{
if (PETRIFY_TURNS>0) {
setupBattleTurns();
if (FOOD_REGEN_TURNS>0) {
FOOD_REGEN_TURNS--;
PLAYER_HP=std::clamp(PLAYER_HP+(int)((PLAYER_MAXHP*0.33)*(BATTLE_DROUGHT_ACTIVE?0.5:1)),0,PLAYER_MAXHP);
CreateDisplayNumber((int)(-PLAYER_MAXHP*0.33),CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY,frameCount);
}
}
if (!GAME_FLAGS[gameflag::TUTORIAL1_X_X]&&GAME_FLAGS[gameflag::ANALYSIS_X_X]) {
GAME_FLAGS[gameflag::TUTORIAL1_X_X]=true;
@ -2165,6 +2176,23 @@ public:
}
}
if (allDead) {
bool snakeFight=false;
if (!GAME_FLAGS[gameflag::LITTLESNAKES_KILLED]) {
for (int i=0;i<CURRENT_ENCOUNTER.entities.size();i++) {
if (CURRENT_ENCOUNTER.entities[i]->name.compare("Sidewinder")==0) {
snakeFight=true;
break;
}
}
if (snakeFight) {
GAME_FLAGS[gameflag::LITTLESNAKES_KILLED]=true;
CURRENT_ENCOUNTER.entities[1]->hp=CURRENT_ENCOUNTER.entities[1]->maxhp;
CURRENT_ENCOUNTER.entities[2]->hp=CURRENT_ENCOUNTER.entities[2]->maxhp;
CURRENT_ENCOUNTER.entities[4]->hp=CURRENT_ENCOUNTER.entities[4]->maxhp;
DisplayMessageBox(48);
break;
}
}
IN_BATTLE_ENCOUNTER=false;
ENCOUNTERS.erase(ENCOUNTERS.begin()+CURRENT_ENCOUNTER_IND);
resetBattleState();
@ -3234,6 +3262,7 @@ public:
}
bool collidesWithPlayer(Object*obj) {
if (!IN_BATTLE_ENCOUNTER) {
if (obj->hasAnim) {
return PLAYER_COORDS[0]>=obj->x&&PLAYER_COORDS[0]<=obj->x+obj->anim->width/32.0&&
PLAYER_COORDS[1]>=obj->y&&PLAYER_COORDS[1]<=obj->y+obj->anim->height/32.0;
@ -3247,6 +3276,7 @@ public:
}
}
}
}
bool collidesWithPlayer(Encounter obj) {
return PLAYER_COORDS[0]>=obj.x&&PLAYER_COORDS[0]<=obj.x+WIDTH/32&&
@ -3747,6 +3777,9 @@ public:
for (int i=0;i<WEATHER_POWER_COUNT;i++) {
PREV_PLAYERSTATE->weatherPowerCounts[i]=WEATHER_POWERS[i]->playerOwnCount;
}
for (int i=0;i<128;i++) {
PREV_PLAYERSTATE->gameFlags[i]=GAME_FLAGS[i];
}
}
void LoadPreviousPlayerState() {
@ -3758,6 +3791,9 @@ public:
for (int i=0;i<WEATHER_POWER_COUNT;i++) {
WEATHER_POWERS[i]->playerOwnCount=PREV_PLAYERSTATE->weatherPowerCounts[i];
}
for (int i=0;i<128;i++) {
GAME_FLAGS[i]=PREV_PLAYERSTATE->gameFlags[i];
}
}
void resetBattleState(){

Binary file not shown.

@ -191,6 +191,9 @@ SIGNS INDICATE TRACES OF SILICON LOCATION ::: NORTH)",//46
R"(
$PLAYER
This is it. Once I collect this one we can finally get a powerful enough signal (Finally!))",//47
R"(
$PLAYER
What? Of course there's more of them.)",//48
};

Loading…
Cancel
Save