Implement buff moves

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent ed9174c134
commit 78979b4eca
  1. 44
      SeasonsOfLoneliness.cpp

@ -881,6 +881,8 @@ public:
FIRESTORM->treeBurnChance=1;
FIRESTORM->burnTrees=true;
SNOWSTORM->appliesSlow=true;
HIDE->appliesHide=true;
HYPERZAP->appliesSpeed=true;
LIGHT_STORM->lowPriority=true;
@ -1866,24 +1868,26 @@ public:
}
} else
if (EFFECT_TIMER==ref->effectTime-10){
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
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 (PLAYER_SELECTED_TARGET==-2) {
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,true);
if (!isBuffMove(ref)) {
if (BATTLE_CURRENT_TURN_ENTITY==-1) {
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 (PLAYER_SELECTED_TARGET==-2) {
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,true);
} else {
effectRadius({CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->x+CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr->sprite->width*CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->sprScale.x/2/32,CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->y+CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr->sprite->height*CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->sprScale.y/2/32},ref,true); }
} else {
effectRadius({CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->x+CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr->sprite->width*CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->sprScale.x/2/32,CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->y+CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->spr->sprite->height*CURRENT_ENCOUNTER.entities[PLAYER_SELECTED_TARGET]->sprScale.y/2/32},ref,true); }
} else {
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,false);
if (ref==LIGHT_STORM&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr=X_X_UNCHARGED_DECAL;
} else
if (ref==SEED_PELLET&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr=X_X_DECAL;
effectRadius({CURRENT_ENCOUNTER.x+CURRENT_ENCOUNTER.playerX,CURRENT_ENCOUNTER.y+CURRENT_ENCOUNTER.playerY},ref,false);
if (ref==LIGHT_STORM&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr=X_X_UNCHARGED_DECAL;
} else
if (ref==SEED_PELLET&&CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->name.compare("X_X")==0) {
CURRENT_ENCOUNTER.entities[BATTLE_CURRENT_TURN_ENTITY]->spr=X_X_DECAL;
}
}
}
} else
@ -3423,6 +3427,12 @@ public:
power->name.compare("Petal Storm")==0;
}
bool isBuffMove(WEATHER_POWER*power) { //ONLY Buff moves with no damaging/healing effects go in here.
return
power->name.compare("Hide")==0||
power->name.compare("Hyper Zap")==0;
}
bool isFoodMove(WEATHER_POWER*power) {
return
power->name.compare("Meal")==0||

Loading…
Cancel
Save