@ -484,7 +484,7 @@ public:
WEATHER_POWER * LIGHT_STORM = new WEATHER_POWER ( " Light Storm " , " " , POWER_HAILSTORM_ANIMATION , POWER_HAILSTORM_ANIMATION , 50 , 9 , 64 , Pixel ( 171 , 151 , 53 , 255 ) , Pixel ( 237 , 237 , 237 , 255 ) , 120 , LIGHT_STORM_EFF ) ;
WEATHER_POWER * SEED_BULLET = new WEATHER_POWER ( " Seed Bullet " , " " , POWER_HAILSTORM_ANIMATION , POWER_HAILSTORM_ANIMATION , 10 , 15 , 30 , Pixel ( 57 , 92 , 63 , 255 ) , Pixel ( 95 , 232 , 119 , 255 ) , 120 , SEED_BULLET_EFF ) ;
WEATHER_POWER * SEED_PELLET = new WEATHER_POWER ( " Seed Pellet " , " " , POWER_HAILSTORM_ANIMATION , POWER_HAILSTORM_ANIMATION , 5 , 10 , 30 , Pixel ( 57 , 92 , 63 , 255 ) , Pixel ( 95 , 232 , 119 , 255 ) , 120 , SEED_PELLET_EFF ) ;
WEATHER_POWER * SEED_OF_LIFE = new WEATHER_POWER ( " Seed of Life " , " " , POWER_HAILSTORM_ANIMATION , POWER_HAILSTORM_ANIMATION , - 10 , 15 , 96 , Pixel ( 93 , 161 , 163 , 255 ) , Pixel ( 72 , 160 , 212 , 255 ) , 120 , SEED_OF_LIFE_EFF ) ;
WEATHER_POWER * SEED_OF_LIFE = new WEATHER_POWER ( " Seed of Life " , " " , POWER_HAILSTORM_ANIMATION , POWER_HAILSTORM_ANIMATION , - 10 , 15 , 5 , Pixel ( 93 , 161 , 163 , 255 ) , Pixel ( 72 , 160 , 212 , 255 ) , 120 , SEED_OF_LIFE_EFF ) ;
WEATHER_POWER * SUMMON_MINIONS = new WEATHER_POWER ( " Summon Minions " , " " , POWER_HAILSTORM_ANIMATION , POWER_HAILSTORM_ANIMATION , - 75 , 15 , 255 , Pixel ( 57 , 92 , 63 , 255 ) , Pixel ( 95 , 232 , 119 , 255 ) , 120 , SUMMON_MINION_EFF ) ;
WEATHER_POWER * CONSUME_SNACK = new WEATHER_POWER ( " Snack " , " Restores 33% health for 5 turns. If battle ends before effect ends, food is not consumed. " , CONSUME_SNACK_ANIMATION , CONSUME_SNACK_ANIMATION , - 1001 , 1 , 200 , Pixel ( 147 , 173 , 66 , 255 ) , Pixel ( 255 , 188 , 3 , 255 ) , 120 , CONSUME_SNACK_EFF ) ;
WEATHER_POWER * CONSUME_MEAL = new WEATHER_POWER ( " Meal " , " Restores all health. Increases Maximum Health by 5. " , CONSUME_MEAL_ANIMATION , CONSUME_MEAL_ANIMATION , - 1002 , 1 , 200 , Pixel ( 147 , 173 , 66 , 255 ) , Pixel ( 255 , 188 , 3 , 255 ) , 120 , CONSUME_SNACK_EFF ) ;
@ -1520,7 +1520,7 @@ public:
PIXEL_EFFECT_TRANSPARENCY = 0 ;
if ( BATTLE_CURRENT_TURN_ENTITY = = - 1 ) {
if ( PLAYER_SELECTED_TARGET = = - 2 ) {
applyPixelEffect ( BATTLE_CARD_SELECTION , { CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerX , CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerY } , 0 ) ;
applyPixelEffect ( BATTLE_CARD_SELECTION , { CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerX , CURRENT_ENCOUNTER . y + CURRENT_ENCOUNTER . playerY } , 0 ) ;
} else {
applyPixelEffect ( BATTLE_CARD_SELECTION , { ( float ) ( CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > x ) , ( float ) ( CURRENT_ENCOUNTER . y + CURRENT_ENCOUNTER . entities [ PLAYER_SELECTED_TARGET ] - > y ) } , 0 ) ;
}
@ -1528,7 +1528,7 @@ public:
if ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > selectedMove - > damage < 0 ) {
applyPixelEffect ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > selectedMove , { ( float ) CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > x , ( float ) CURRENT_ENCOUNTER . y + CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > y } , 0 ) ;
} else {
applyPixelEffect ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > selectedMove , { CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerX , CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerY } , 0 ) ;
applyPixelEffect ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > selectedMove , { CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerX , CURRENT_ENCOUNTER . y + CURRENT_ENCOUNTER . playerY } , 0 ) ;
}
}
}
@ -1561,16 +1561,16 @@ public:
if ( FOOD_REGEN_TURNS > 0 ) {
FOOD_REGEN_TURNS - - ;
PLAYER_HP = std : : clamp ( PLAYER_HP + ( int ) ( PLAYER_MAXHP * 0.33 ) , 0 , PLAYER_MAXHP ) ;
DisplayNumber * numb = CreateDisplayNumber ( ( int ) ( - PLAYER_MAXHP * 0.33 ) , CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerX , CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerY , frameCount ) ;
BATTLE_DISPLAY_NUMBERS . push_back ( numb ) ;
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 . x + CURRENT_ENCOUNTER . playerY } , ref , true ) ;
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 ] - > y + CURRENT_ENCOUNTER . y } , ref , true ) ;
}
} else {
effectRadius ( { CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerX , CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerY } , ref , false ) ;
effectRadius ( { CURRENT_ENCOUNTER . x + CURRENT_ENCOUNTER . playerX , CURRENT_ENCOUNTER . y + CURRENT_ENCOUNTER . playerY } , ref , false ) ;
}
} else
if ( EFFECT_TIMER = = ref - > effectTime / 2 ) {
@ -2629,16 +2629,14 @@ public:
foodCount - - ;
}
PLAYER_HP = std : : clamp ( PLAYER_HP - finalDamage , 0 , PLAYER_MAXHP ) ;
DisplayNumber * numb = CreateDisplayNumber ( finalDamage , PLAYER_COORDS [ 0 ] , PLAYER_COORDS [ 1 ] , frameCount ) ;
BATTLE_DISPLAY_NUMBERS . push_back ( numb ) ;
CreateDisplayNumber ( finalDamage , PLAYER_COORDS [ 0 ] , PLAYER_COORDS [ 1 ] , frameCount ) ;
} else {
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
finalDamage = power - > damage + rand ( ) % power - > damageRoll * sign ( power - > damage ) ;
Entity * ent = CURRENT_ENCOUNTER . entities [ i ] ;
if ( distancetoCoords ( { ( float ) ( ( ent - > x + CURRENT_ENCOUNTER . x ) * 32 ) , ( float ) ( ( ent - > y + CURRENT_ENCOUNTER . y ) * 32 ) } , coords * 32 ) < = power - > range ) {
ent - > hp = std : : clamp ( ent - > hp - finalDamage , 0 , ent - > maxhp ) ;
DisplayNumber * numb = CreateDisplayNumber ( finalDamage , ent - > x + CURRENT_ENCOUNTER . x + ent - > spr - > sprite - > width * ent - > sprScale . x / 2 , ent - > y + CURRENT_ENCOUNTER . y + ent - > spr - > sprite - > height * ent - > sprScale . y / 2 , frameCount ) ;
BATTLE_DISPLAY_NUMBERS . push_back ( numb ) ;
CreateDisplayNumber ( finalDamage , ent - > x + CURRENT_ENCOUNTER . x + ent - > spr - > sprite - > width * ent - > sprScale . x / 2 / 32 , ent - > y + CURRENT_ENCOUNTER . y + ent - > spr - > sprite - > height * ent - > sprScale . y / 2 / 32 , frameCount ) ;
ent - > damageFrame = frameCount ;
}
}
@ -2652,15 +2650,13 @@ public:
std : : cout < < " Distance was " < < distancetoCoords ( { ( float ) ( ( ent - > x + CURRENT_ENCOUNTER . x ) * 32 ) , ( float ) ( ( ent - > y + CURRENT_ENCOUNTER . y ) * 32 ) } , coords * 32 ) < < " \n " ;
if ( ent - > hp > 0 & & distancetoCoords ( { ( float ) ( ( ent - > x + CURRENT_ENCOUNTER . x ) * 32 ) , ( float ) ( ( ent - > y + CURRENT_ENCOUNTER . y ) * 32 ) } , coords * 32 ) < = power - > range ) {
ent - > hp = std : : clamp ( ent - > hp - finalDamage , 0 , ent - > maxhp ) ;
DisplayNumber * numb = CreateDisplayNumber ( finalDamage , ent - > x + CURRENT_ENCOUNTER . x + ent - > spr - > sprite - > width * ent - > sprScale . x / 2 , ent - > y + CURRENT_ENCOUNTER . y + ent - > spr - > sprite - > height * ent - > sprScale . y / 2 , frameCount ) ;
BATTLE_DISPLAY_NUMBERS . push_back ( numb ) ;
CreateDisplayNumber ( finalDamage , ent - > x + CURRENT_ENCOUNTER . x + ent - > spr - > sprite - > width * ent - > sprScale . x / 2 / 32 , ent - > y + CURRENT_ENCOUNTER . y + ent - > spr - > sprite - > height * ent - > sprScale . y / 2 / 32 , frameCount ) ;
ent - > damageFrame = frameCount ;
}
}
} else {
PLAYER_HP = std : : clamp ( PLAYER_HP - finalDamage , 0 , PLAYER_MAXHP ) ;
DisplayNumber * numb = CreateDisplayNumber ( finalDamage , PLAYER_COORDS [ 0 ] , PLAYER_COORDS [ 1 ] , frameCount ) ;
BATTLE_DISPLAY_NUMBERS . push_back ( numb ) ;
CreateDisplayNumber ( finalDamage , PLAYER_COORDS [ 0 ] , PLAYER_COORDS [ 1 ] , frameCount ) ;
}
}
}
@ -3002,7 +2998,9 @@ public:
}
DisplayNumber * CreateDisplayNumber ( int numb , float x , float y , int frameCount ) {
return new DisplayNumber ( numb , x + range ( - 0.5 , 0.5 ) , y + range ( - 0.5 , 0.5 ) , frameCount ) ;
DisplayNumber * number = new DisplayNumber ( numb , x + range ( - 0.3 , 0.3 ) , y + range ( - 0.1 , 0 ) , frameCount ) ;
BATTLE_DISPLAY_NUMBERS . push_back ( number ) ;
return number ;
}
} ;