Drought bugs fixed

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent 6a05a3e323
commit a450f960e3
  1. 25
      SeasonsOfLoneliness.cpp
  2. BIN
      Seasons_of_Loneliness

@ -525,7 +525,7 @@ public:
WEATHER_POWER*PETAL_STORM = new WEATHER_POWER("Petal Storm","Places seeds, causes minor healing. 20+1d20",PETAL_STORM_ANIMATION,PETAL_STORM_ANIMATION,20,20,110,Pixel(189, 132, 189,255),Pixel(235, 75, 235,255),120,PETAL_STORM_EFF);
WEATHER_POWER*ACID_RAIN = new WEATHER_POWER("Acid Rain","",POWER_HURRICANE_ANIMATION,POWER_HURRICANE_ANIMATION,20,10,150,Pixel(99, 148, 132,255),Pixel(121, 132, 140,255),120,ACID_RAIN_EFF);
WEATHER_POWER*DROUGHT = new WEATHER_POWER("Drought","Halves healing effects for the next turn.",POWER_HURRICANE_ANIMATION,POWER_HURRICANE_ANIMATION,8,3,150,Pixel(99, 148, 132,255),Pixel(121, 132, 140,255),120,DROUGHT_EFF);
WEATHER_POWER*HEAT_WAVE = new WEATHER_POWER("Heat Wave","",POWER_HURRICANE_ANIMATION,POWER_HURRICANE_ANIMATION,25,10,150,Pixel(99, 148, 132,255),Pixel(121, 132, 140,255),120,HEAT_WAVE_EFF);
WEATHER_POWER*HEAT_WAVE = new WEATHER_POWER("Heat Wave","",POWER_HURRICANE_ANIMATION,POWER_HURRICANE_ANIMATION,20,12,150,Pixel(99, 148, 132,255),Pixel(121, 132, 140,255),120,HEAT_WAVE_EFF);
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);
@ -897,7 +897,6 @@ public:
ENCOUNTER_X_X.playerX=3;
ENCOUNTER_X_X.playerY=2;
ENCOUNTER_X_X.map=MAP_1;
ENCOUNTER_SANDWORM_1.entities.push_back(new Entity(SANDWORM_DECAL,"Sandworm",2,1,165,165,MOVESET_SANDWORM));
ENCOUNTER_SANDWORM_1.entities.push_back(new Entity(SANDWORM_DECAL,"Sandworm",3,4,165,165,MOVESET_SANDWORM));
ENCOUNTER_SANDWORM_1.entities.push_back(new Entity(SANDWORM_DECAL,"Sandworm",6,3,165,165,MOVESET_SANDWORM));
ENCOUNTER_SANDWORM_1.x=20-4;
@ -1768,7 +1767,7 @@ public:
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)*(BATTLE_DROUGHT_ACTIVE?0.5:1);
int healRoll=(int)(healPower+rand()%ref->damageRoll*sign(healPower)*(BATTLE_DROUGHT_ACTIVE?0.5:1));
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
effectRadius({(int)BATTLE_PLAYER_COORDS.x,(int)BATTLE_PLAYER_COORDS.y},ref,-healRoll,true);
} else {
@ -1829,9 +1828,10 @@ public:
BATTLE_REASON_CODE=reasoncode::TREE_BURN;
BATTLE_STATE=battle::WAIT_TURN_ANIMATION2;
} else
if (ref==DROUGHT) {
if (ref==DROUGHT&&!BATTLE_DROUGHT_ACTIVE) {
BATTLE_REASON_CODE=reasoncode::DROUGHT;
BATTLE_STATE=battle::WAIT_TURN_ANIMATION2;
BATTLE_DROUGHT_ACTIVE=true;
} else {
BATTLE_REASON_CODE=-1;
BATTLE_STATE=battle::DAMAGE_RESOLUTION;
@ -1857,7 +1857,8 @@ public:
if (EFFECT_TIMER==60) {
switch (BATTLE_REASON_CODE) {
case reasoncode::SEED_GROWTH:{
int healAmt=-10*SEEDS.size()*(BATTLE_DROUGHT_ACTIVE?0.5:1);
int healAmt=(int)(-10*(int)(SEEDS.size())*(BATTLE_DROUGHT_ACTIVE?0.5:1));
std::cout<<"Heal Amt: "<<healAmt<<"\n";
CreateDisplayNumber(healAmt,BATTLE_PLAYER_COORDS.x,BATTLE_PLAYER_COORDS.y,frameCount);
PLAYER_HP=std::clamp(PLAYER_HP+healAmt*-1,0,PLAYER_MAXHP);
addTrees(SEEDS.size());
@ -1914,6 +1915,10 @@ public:
DisplayMessageBox(23);
break;
}
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
BATTLE_DROUGHT_ACTIVE=false;
std::cout<<"Drought turned off.\n";
}
BATTLE_STATE=battle::PLAYER_SELECTION;
PLAYER_SELECTED_TARGET=-1;
}
@ -2210,8 +2215,7 @@ public:
if (!CUTSCENE_FLAGS[0]) {
CUTSCENE_FLAGS[0]=true;
CUTSCENE_OBJS[1]=CreateObject({PLAYER_COORDS[0]-2,PLAYER_COORDS[1]-3},SANDWORM_DECAL,true);
CUTSCENE_OBJS[2]=CreateObject({PLAYER_COORDS[0]-3,PLAYER_COORDS[1]+1},SANDWORM_DECAL,true);
CUTSCENE_OBJS[3]=CreateObject({PLAYER_COORDS[0]+0,PLAYER_COORDS[1]-1},SANDWORM_DECAL,true);
CUTSCENE_OBJS[3]=CreateObject({PLAYER_COORDS[0]+3,PLAYER_COORDS[1]-1},SANDWORM_DECAL,true);
DisplayMessageBox(30);
} else {
EndCutscene();
@ -2384,6 +2388,9 @@ public:
StartCutscene(cutscene::CHECK_COORDS);
CUTSCENE_OBJS[0]=CreateObject({PLAYER_COORDS[0],PLAYER_COORDS[1]},PLAYER_DECAL,playerAnim,true);
}
if(rand()%60==0) {
PLAYER_HP=std::clamp(PLAYER_HP+1,0,PLAYER_MAXHP);
}
}
void drawGame(){
@ -2942,7 +2949,7 @@ public:
} else
if (power->damage==-1001) {
FOOD_REGEN_TURNS=4;
finalDamage=-PLAYER_MAXHP*0.33*(BATTLE_DROUGHT_ACTIVE?0.5:1);
finalDamage=(int)(-PLAYER_MAXHP*0.33*(BATTLE_DROUGHT_ACTIVE?0.5:1));
foodCount--;
}
PLAYER_HP=std::clamp(PLAYER_HP-finalDamage,0,PLAYER_MAXHP);
@ -3116,7 +3123,7 @@ public:
for (int i=0;i<amt;i++) {
pixels[i]->pos={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)};
std::cout<<std::to_string(pixels[i]->size.x)<<","<<std::to_string(pixels[i]->size.y)<<"\n";
//std::cout<<std::to_string(pixels[i]->size.x)<<","<<std::to_string(pixels[i]->size.y)<<"\n";
pixels[i]->spd={range(spd_low.x,spd_high.x),range(spd_low.y,spd_high.y)};
pixels[i]->r=range(col_low.r,col_high.r);
pixels[i]->g=range(col_low.g,col_high.g);

Binary file not shown.
Loading…
Cancel
Save