@ -321,6 +321,8 @@ class WEATHER_POWER{
float treeSeedChance = 0 ; //% chance of trees producing seeds from this attack.
float treeSeedChance = 0 ; //% chance of trees producing seeds from this attack.
bool lowPriority = false ; //Will always go last if set to true.
bool lowPriority = false ; //Will always go last if set to true.
bool appliesSlow = false ; //If true, will apply slow to enemies hit.
bool appliesSlow = false ; //If true, will apply slow to enemies hit.
bool appliesSpeed = false ; //If true, will apply speed on use.
bool appliesHide = false ; //If true, will apply hiding on use.
WEATHER_POWER ( std : : string name , std : : string desc , Animation * icon , Animation * effect , int dmg , int dmgRoll , int range , Pixel bgcol , Pixel textcol , int effectTime , ParticleEffect * parteff ) {
WEATHER_POWER ( std : : string name , std : : string desc , Animation * icon , Animation * effect , int dmg , int dmgRoll , int range , Pixel bgcol , Pixel textcol , int effectTime , ParticleEffect * parteff ) {
this - > description = desc ;
this - > description = desc ;
this - > name = name ;
this - > name = name ;
@ -349,11 +351,15 @@ class Entity{
WEATHER_POWER * selectedMove ;
WEATHER_POWER * selectedMove ;
std : : vector < WEATHER_POWER * > moveSet ;
std : : vector < WEATHER_POWER * > moveSet ;
bool turnComplete = false ;
bool turnComplete = false ;
bool slowed = false ; //Slowed entities have a low priority.
char speed = 0 ; //Slowed entities have a low priority. -1=Slowed, 1=Fast (high Prio), 0=Normal Priority
int damageFrame = 0 ;
int damageFrame = 0 ;
int fixedTurnOrderInd = 0 ;
int fixedTurnOrderInd = 0 ;
bool fixedTurnOrder = false ; //If this is turned on, the selected move will increment in order of the move set (and loop accordingly.)
bool fixedTurnOrder = false ; //If this is turned on, the selected move will increment in order of the move set (and loop accordingly.)
vf2d sprScale ;
vf2d sprScale ;
int lastSlowVal = 0 ; //Keeps track of last slow val. Don't take away a buff if it's different, as it was just applied.
bool lastHiddenVal = false ; //Keeps track of last hidden val. Don't take away a buff if it's different, as it was just applied.
bool hidden = false ; //If hidden, this enemy will take 0 damage.
int shield = 0 ; //If shield is greater than 0, the shield must be depleted first before health can be dealt.
Entity ( Decal * spr , std : : string name , float x , float y , int hp , int maxhp , std : : vector < WEATHER_POWER * > moveset , vf2d sprScale = { 1 , 1 } , bool fixedMoveset = false ) {
Entity ( Decal * spr , std : : string name , float x , float y , int hp , int maxhp , std : : vector < WEATHER_POWER * > moveset , vf2d sprScale = { 1 , 1 } , bool fixedMoveset = false ) {
this - > spr = spr ;
this - > spr = spr ;
this - > name = name ;
this - > name = name ;
@ -521,6 +527,9 @@ public:
ParticleEffect * FLASH_FLOOD_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 2 , 2 } , { - 4 , 1 } , { - 1 , 4 } , Pixel ( 8 , 54 , 204 , 64 ) , Pixel ( 255 , 255 , 255 , 128 ) , 500 , Pixel ( 220 , 226 , 227 , 0 ) ) ;
ParticleEffect * FLASH_FLOOD_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 2 , 2 } , { - 4 , 1 } , { - 1 , 4 } , Pixel ( 8 , 54 , 204 , 64 ) , Pixel ( 255 , 255 , 255 , 128 ) , 500 , Pixel ( 220 , 226 , 227 , 0 ) ) ;
ParticleEffect * SUNNYDAY_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 4 , 4 } , { 0 , - 2 } , { 0 , - 6 } , Pixel ( 209 , 207 , 113 , 130 ) , Pixel ( 255 , 255 , 255 , 210 ) , 50 , Pixel ( 70 , 158 , 62 , 0 ) ) ;
ParticleEffect * SUNNYDAY_EFF = new ParticleEffect ( { 0 , 0 } , { WIDTH , HEIGHT } , { 0 , 0 } , { WIDTH , HEIGHT } , { 1 , 1 } , { 4 , 4 } , { 0 , - 2 } , { 0 , - 6 } , Pixel ( 209 , 207 , 113 , 130 ) , Pixel ( 255 , 255 , 255 , 210 ) , 50 , Pixel ( 70 , 158 , 62 , 0 ) ) ;
ParticleEffect * SOLARFLARE_EFF = new ParticleEffect ( { 0 , 0 } , { 128 , 128 } , { 0 , 0 } , { 128 , 128 } , { 2 , HEIGHT / 2 } , { 4 , HEIGHT } , { 0 , 4 } , { 0 , 25 } , Pixel ( 217 , 36 , 0 , 130 ) , Pixel ( 217 , 94 , 0 , 255 ) , 40 , Pixel ( 166 , 51 , 28 , 64 ) ) ;
ParticleEffect * SOLARFLARE_EFF = new ParticleEffect ( { 0 , 0 } , { 128 , 128 } , { 0 , 0 } , { 128 , 128 } , { 2 , HEIGHT / 2 } , { 4 , HEIGHT } , { 0 , 4 } , { 0 , 25 } , Pixel ( 217 , 36 , 0 , 130 ) , Pixel ( 217 , 94 , 0 , 255 ) , 40 , Pixel ( 166 , 51 , 28 , 64 ) ) ;
ParticleEffect * HIDE_EFF = new ParticleEffect ( { 0 , 0 } , { 64 , 64 } , { 0 , 0 } , { 64 , 64 } , { 32 , 32 } , { 32 , 32 } , { - 1 , - 1 } , { 1 , 1 } , Pixel ( 0 , 0 , 0 , 25 ) , Pixel ( 0 , 0 , 0 , 75 ) , 5 , Pixel ( 166 , 51 , 28 , 0 ) ) ;
ParticleEffect * HYPERZAP_EFF = new ParticleEffect ( { 0 , 0 } , { 64 , 64 } , { 0 , 0 } , { 64 , 64 } , { 1 , 1 } , { 6 , 6 } , { 0 , - 2 } , { 0 , - 10 } , Pixel ( 232 , 2 , 230 , 130 ) , Pixel ( 250 , 81 , 247 , 210 ) , 30 , Pixel ( 70 , 158 , 62 , 0 ) ) ;
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 ) ) ;
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 * 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 * 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 ) ;
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 ) ;
@ -546,6 +555,10 @@ public:
WEATHER_POWER * SUNNY_DAY = new WEATHER_POWER ( " Sunny Day " , " Fertilize soil, multiplying seed growth and causing trees to drop seeds. 10+1d10 " , POWER_SUNNYDAY_ANIMATION , POWER_SUNNYDAY_ANIMATION , 10 , 10 , 200 , Pixel ( 179 , 164 , 71 , 255 ) , Pixel ( 222 , 198 , 44 , 255 ) , 120 , SUNNYDAY_EFF ) ;
WEATHER_POWER * SUNNY_DAY = new WEATHER_POWER ( " Sunny Day " , " Fertilize soil, multiplying seed growth and causing trees to drop seeds. 10+1d10 " , POWER_SUNNYDAY_ANIMATION , POWER_SUNNYDAY_ANIMATION , 10 , 10 , 200 , Pixel ( 179 , 164 , 71 , 255 ) , Pixel ( 222 , 198 , 44 , 255 ) , 120 , SUNNYDAY_EFF ) ;
WEATHER_POWER * FIRESTORM = new WEATHER_POWER ( " Fire Storm " , " Cause devastating fires, destroying everything in sight. 65+1d40 " , POWER_FIRESTORM_ANIMATION , POWER_FIRESTORM_ANIMATION , 65 , 40 , 145 , Pixel ( 176 , 95 , 44 , 255 ) , Pixel ( 237 , 100 , 14 , 255 ) , 120 , FIRESTORM_EFF ) ;
WEATHER_POWER * FIRESTORM = new WEATHER_POWER ( " Fire Storm " , " Cause devastating fires, destroying everything in sight. 65+1d40 " , POWER_FIRESTORM_ANIMATION , POWER_FIRESTORM_ANIMATION , 65 , 40 , 145 , Pixel ( 176 , 95 , 44 , 255 ) , Pixel ( 237 , 100 , 14 , 255 ) , 120 , FIRESTORM_EFF ) ;
WEATHER_POWER * SOLAR_FLARE = new WEATHER_POWER ( " Solar Flare " , " A concentrated sunbeam of death. Burns down all trees. 175+1d40 " , POWER_SOLARFLARE_ANIMATION , POWER_SOLARFLARE_ANIMATION , 175 , 40 , 32 , Pixel ( 176 , 53 , 37 , 255 ) , Pixel ( 217 , 98 , 0 , 255 ) , 120 , SOLARFLARE_EFF ) ;
WEATHER_POWER * SOLAR_FLARE = new WEATHER_POWER ( " Solar Flare " , " A concentrated sunbeam of death. Burns down all trees. 175+1d40 " , POWER_SOLARFLARE_ANIMATION , POWER_SOLARFLARE_ANIMATION , 175 , 40 , 32 , Pixel ( 176 , 53 , 37 , 255 ) , Pixel ( 217 , 98 , 0 , 255 ) , 120 , SOLARFLARE_EFF ) ;
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 ) ;
bool IN_BATTLE_ENCOUNTER = false ;
bool IN_BATTLE_ENCOUNTER = false ;
int BATTLE_ENTRY_TIMER = 0 ;
int BATTLE_ENTRY_TIMER = 0 ;
int EFFECT_TIMER = 0 ;
int EFFECT_TIMER = 0 ;
@ -611,12 +624,13 @@ public:
* NADO_DECAL , * SILICON_ROCK_DECAL , * PETAL_STORM_DECAL , * ROVER_DECAL , * X_X_DECAL ,
* NADO_DECAL , * SILICON_ROCK_DECAL , * PETAL_STORM_DECAL , * ROVER_DECAL , * X_X_DECAL ,
* LATER_THAT_NIGHT_DECAL , * SLEEP_DECAL , * SEED_DECAL , * TREE_DECAL , * X_X_UNCHARGED_DECAL ,
* LATER_THAT_NIGHT_DECAL , * SLEEP_DECAL , * SEED_DECAL , * TREE_DECAL , * X_X_UNCHARGED_DECAL ,
* SANDWORM_DECAL , * SNAKE_DECAL , * MOTH_DECAL , * FLASH_FLOOD_DECAL , * SUNNY_DAY_DECAL , * FIRESTORM_DECAL , * SOLARFLARE_DECAL ,
* SANDWORM_DECAL , * SNAKE_DECAL , * MOTH_DECAL , * FLASH_FLOOD_DECAL , * SUNNY_DAY_DECAL , * FIRESTORM_DECAL , * SOLARFLARE_DECAL ,
* HP_REGEN_DECAL , * SLOWED_DECAL ;
* HP_REGEN_DECAL , * SLOWED_DECAL , * SPEED_DECAL , * HIDDEN_DECAL ;
std : : map < std : : string , ObjectLoadInfo * > BASE_OBJECTS ;
std : : map < std : : string , ObjectLoadInfo * > BASE_OBJECTS ;
std : : vector < Encounter > ENCOUNTERS ;
std : : vector < Encounter > ENCOUNTERS ;
Encounter ENCOUNTER_SPIDEY_1 ;
Encounter ENCOUNTER_SPIDEY_1 ;
Encounter ENCOUNTER_X_X ;
Encounter ENCOUNTER_X_X ;
Encounter ENCOUNTER_SANDWORM_1 ;
Encounter ENCOUNTER_SANDWORM_1 ;
Encounter ENCOUNTER_MEGAMOTH ;
Encounter CURRENT_ENCOUNTER ;
Encounter CURRENT_ENCOUNTER ;
std : : vector < WEATHER_POWER * > MOVESET_SPIDEY ;
std : : vector < WEATHER_POWER * > MOVESET_SPIDEY ;
std : : vector < WEATHER_POWER * > MOVESET_SANDWORM ;
std : : vector < WEATHER_POWER * > MOVESET_SANDWORM ;
@ -624,6 +638,7 @@ public:
std : : vector < WEATHER_POWER * > MOVESET_MOTH ;
std : : vector < WEATHER_POWER * > MOVESET_MOTH ;
std : : vector < WEATHER_POWER * > MOVESET_X_X ;
std : : vector < WEATHER_POWER * > MOVESET_X_X ;
std : : vector < WEATHER_POWER * > MOVESET_XMINION ;
std : : vector < WEATHER_POWER * > MOVESET_XMINION ;
std : : vector < WEATHER_POWER * > MOVESET_MEGAMOTH ;
std : : vector < Seed * > SEEDS ;
std : : vector < Seed * > SEEDS ;
std : : vector < Seed * > TREES ;
std : : vector < Seed * > TREES ;
bool SOUND_IS_MUTED = false ;
bool SOUND_IS_MUTED = false ;
@ -727,6 +742,8 @@ public:
SOLARFLARE_DECAL = new Decal ( new Sprite ( " assets/solarflare.png " ) ) ;
SOLARFLARE_DECAL = new Decal ( new Sprite ( " assets/solarflare.png " ) ) ;
HP_REGEN_DECAL = new Decal ( new Sprite ( " assets/hpregen.png " ) ) ;
HP_REGEN_DECAL = new Decal ( new Sprite ( " assets/hpregen.png " ) ) ;
SLOWED_DECAL = new Decal ( new Sprite ( " assets/slowed.png " ) ) ;
SLOWED_DECAL = new Decal ( new Sprite ( " assets/slowed.png " ) ) ;
SPEED_DECAL = new Decal ( new Sprite ( " assets/speedup.png " ) ) ;
HIDDEN_DECAL = new Decal ( new Sprite ( " assets/hidden.png " ) ) ;
current_playerAnim - > spr = PLAYER_DECAL ;
current_playerAnim - > spr = PLAYER_DECAL ;
playerAnim - > spr = PLAYER_DECAL ;
playerAnim - > spr = PLAYER_DECAL ;
@ -875,6 +892,14 @@ public:
MOVESET_MOTH . push_back ( GUST ) ;
MOVESET_MOTH . push_back ( GUST ) ;
MOVESET_MOTH . push_back ( TORNADO ) ;
MOVESET_MOTH . push_back ( TORNADO ) ;
MOVESET_MEGAMOTH . push_back ( TORNADO ) ;
MOVESET_MEGAMOTH . push_back ( TORNADO ) ;
MOVESET_MEGAMOTH . push_back ( TORNADO ) ;
MOVESET_MEGAMOTH . push_back ( TORNADO ) ;
MOVESET_MEGAMOTH . push_back ( HIDE ) ;
MOVESET_MEGAMOTH . push_back ( HYPERZAP ) ;
MOVESET_MEGAMOTH . push_back ( POLLINATION ) ;
MOVESET_SANDWORM . push_back ( SANDSTORM ) ;
MOVESET_SANDWORM . push_back ( SANDSTORM ) ;
MOVESET_SANDWORM . push_back ( HEAT_WAVE ) ;
MOVESET_SANDWORM . push_back ( HEAT_WAVE ) ;
MOVESET_SANDWORM . push_back ( DROUGHT ) ;
MOVESET_SANDWORM . push_back ( DROUGHT ) ;
@ -927,6 +952,15 @@ public:
ENCOUNTER_SANDWORM_1 . playerY = 3.5 ;
ENCOUNTER_SANDWORM_1 . playerY = 3.5 ;
ENCOUNTER_SANDWORM_1 . map = MAP_3 ;
ENCOUNTER_SANDWORM_1 . map = MAP_3 ;
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
//ENCOUNTERS.push_back(ENCOUNTER_X_X); //Activate at beginning of Chapter 2.
ENCOUNTER_MEGAMOTH . entities . push_back ( new Entity ( MOTH_DECAL , " Megamoth " , 3.5 , 3.25 , 745 , 745 , MOVESET_MEGAMOTH , { 2 , 2 } ) ) ;
ENCOUNTER_MEGAMOTH . entities . push_back ( new Entity ( MOTH_DECAL , " Moth " , 2 , 3 , 120 , 120 , MOVESET_MOTH ) ) ;
ENCOUNTER_MEGAMOTH . entities . push_back ( new Entity ( MOTH_DECAL , " Moth " , 6 , 3 , 120 , 120 , MOVESET_MOTH ) ) ;
ENCOUNTER_MEGAMOTH . entities . push_back ( new Entity ( MOTH_DECAL , " Moth " , 4 , 6.5 , 120 , 120 , MOVESET_MOTH ) ) ;
ENCOUNTER_MEGAMOTH . x = 195 - 4 ;
ENCOUNTER_MEGAMOTH . y = 56 - 3.5 ;
ENCOUNTER_MEGAMOTH . playerX = 4 ;
ENCOUNTER_MEGAMOTH . playerY = 3.5 ;
ENCOUNTER_MEGAMOTH . map = MAP_4 ;
BASE_OBJECTS [ " DOME " ] = new ObjectLoadInfo ( DOME_DECAL ) ;
BASE_OBJECTS [ " DOME " ] = new ObjectLoadInfo ( DOME_DECAL ) ;
BASE_OBJECTS [ " PLANT " ] = new ObjectLoadInfo ( PLANT_DECAL ) ;
BASE_OBJECTS [ " PLANT " ] = new ObjectLoadInfo ( PLANT_DECAL ) ;
@ -1868,12 +1902,26 @@ public:
if ( ref - > appliesSlow ) {
if ( ref - > appliesSlow ) {
if ( BATTLE_CURRENT_TURN_ENTITY = = - 1 ) {
if ( BATTLE_CURRENT_TURN_ENTITY = = - 1 ) {
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
CURRENT_ENCOUNTER . entities [ i ] - > slowed = true ;
CURRENT_ENCOUNTER . entities [ i ] - > speed = std : : clamp ( CURRENT_ENCOUNTER . entities [ i ] - > speed - 1 , - 1 , 1 ) ;
}
}
} else {
} else {
//Not implemented for enemies.
//Not implemented for enemies.
}
}
}
}
if ( ref - > appliesSpeed ) {
if ( BATTLE_CURRENT_TURN_ENTITY = = - 1 ) {
//Not implemented for the player.
} else {
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > speed = std : : clamp ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > speed + 1 , - 1 , 1 ) ;
}
}
if ( ref - > appliesHide ) {
if ( BATTLE_CURRENT_TURN_ENTITY = = - 1 ) {
//Not implemented for the player.
} else {
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > hidden = true ;
}
}
if ( EFFECT_TIMER > ref - > effectTime ) {
if ( EFFECT_TIMER > ref - > effectTime ) {
EFFECT_TIMER = 0 ;
EFFECT_TIMER = 0 ;
clearPixelEffect ( ) ;
clearPixelEffect ( ) ;
@ -1982,9 +2030,16 @@ public:
BATTLE_DROUGHT_ACTIVE = false ;
BATTLE_DROUGHT_ACTIVE = false ;
std : : cout < < " Drought turned off. \n " ;
std : : cout < < " Drought turned off. \n " ;
} else {
} else {
if ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > slowed & & rand ( ) % 3 = = 0 ) {
if ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > lastSlowVal = = CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > speed & &
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > slowed = false ;
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > speed ! = 0 & & rand ( ) % 3 = = 0 ) {
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > speed = 0 ;
}
if ( CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > lastHiddenVal = = CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > hidden & &
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > hidden & & rand ( ) % 3 = = 0 ) {
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > hidden = 0 ;
}
}
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > lastSlowVal = CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > speed ;
CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > lastHiddenVal = CURRENT_ENCOUNTER . entities [ BATTLE_CURRENT_TURN_ENTITY ] - > hidden ;
}
}
BATTLE_CURRENT_TURN_ENTITY = turnOrder . front ( ) ;
BATTLE_CURRENT_TURN_ENTITY = turnOrder . front ( ) ;
turnOrder . pop ( ) ;
turnOrder . pop ( ) ;
@ -3116,10 +3171,9 @@ public:
}
}
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
for ( int i = 0 ; i < CURRENT_ENCOUNTER . entities . size ( ) ; i + + ) {
if ( CURRENT_ENCOUNTER . entities [ i ] - > hp > 0 & & ! CURRENT_ENCOUNTER . entities [ i ] - > turnComplete & &
if ( CURRENT_ENCOUNTER . entities [ i ] - > hp > 0 & & ! CURRENT_ENCOUNTER . entities [ i ] - > turnComplete & &
isPriorityMove ( CURRENT_ENCOUNTER . entities [ i ] - > selectedMove ) & & ! CURRENT_ENCOUNTER . entities [ i ] - > slowed ) {
( ( isPriorityMove ( CURRENT_ENCOUNTER . entities [ i ] - > selectedMove ) & & CURRENT_ENCOUNTER . entities [ i ] - > speed > = 0 ) | | CURRENT_ENCOUNTER . entities [ i ] - > speed = = 1 ) ) {
turnOrder . push ( i ) ;
turnOrder . push ( i ) ;
CURRENT_ENCOUNTER . entities [ i ] - > turnComplete = true ;
CURRENT_ENCOUNTER . entities [ i ] - > turnComplete = true ;
std : : cout < < " Entity " < < i < < " added prio for Seed Storm. \n " ;
}
}
}
}
//Healing has half prio for the player.
//Healing has half prio for the player.
@ -3135,7 +3189,7 @@ public:
PLAYER_TURN_COMPLETE = true ;
PLAYER_TURN_COMPLETE = true ;
}
}
if ( ent - > hp > 0 & & ! ent - > turnComplete & &
if ( ent - > hp > 0 & & ! ent - > turnComplete & &
! ent - > slowed & & rand ( ) % 2 = = 0 & & ! ent - > selectedMove - > lowPriority ) {
ent - > speed > = 0 & & rand ( ) % 2 = = 0 & & ! ent - > selectedMove - > lowPriority ) {
turnOrder . push ( i ) ;
turnOrder . push ( i ) ;
ent - > turnComplete = true ;
ent - > turnComplete = true ;
}
}
@ -3460,13 +3514,19 @@ public:
void DrawBuffs ( vf2d pos , Entity * ent ) {
void DrawBuffs ( vf2d pos , Entity * ent ) {
if ( ent ! = NULL ) {
if ( ent ! = NULL ) {
if ( ent - > slowed ) {
if ( ent - > speed = = - 1 ) {
DrawDecal ( pos , SLOWED_DECAL ) ;
DrawDecal ( pos , SLOWED_DECAL ) ;
} else
if ( ent - > speed = = 1 ) {
DrawDecal ( pos , SPEED_DECAL ) ;
}
}
} else {
} else {
//Draw Player's Buffs.
//Draw Player's Buffs.
if ( FOOD_REGEN_TURNS > 0 ) {
if ( FOOD_REGEN_TURNS > 0 ) {
DrawDecal ( pos , HP_REGEN_DECAL ) ;
DrawDecal ( pos , HP_REGEN_DECAL ) ;
std : : string txt = std : : to_string ( FOOD_REGEN_TURNS ) ;
DrawStringDecal ( { pos . x + 16 - GetTextSize ( txt ) . x + 1 , pos . y + 16 - GetTextSize ( txt ) . y + 1 } , txt , VERY_DARK_GREEN ) ;
DrawStringDecal ( { pos . x + 16 - GetTextSize ( txt ) . x , pos . y + 16 - GetTextSize ( txt ) . y } , txt ) ;
}
}
}
}
}
}