@ -54,6 +54,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
enum Phase {
INITIALIZE ,
IDLE ,
ATTACK_RESET ,
FLY_ACROSS_PREPARE ,
FLY_ACROSS ,
TORNADO_ATTACK_PREPARE ,
@ -61,6 +62,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
WIND_ATTACK_FLY ,
WIND_ATTACK_LAND ,
WIND_ATTACK ,
HALFHEALTH_PREPARE_PHASE ,
HALFHEALTH_PHASE ,
} ;
@ -72,7 +74,7 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
if ( m . phase ! = HALFHEALTH_PHASE ) m . F ( A : : SPAWNER_TIMER ) - = fElapsedTime ;
if ( m . F ( A : : SPAWNER_TIMER ) < = 0.f ) {
const float randomDir = util : : random ( 2 * PI ) ;
game - > SpawnMonster ( m . GetPos ( ) + vf2d { ConfigFloat ( " Basic Hawk Spawn Radius " ) , randomDir } . cart ( ) , MONSTER_DATA . at ( " Hawk_NOXP " ) , m . OnUpperLevel ( ) ) ;
game - > SpawnMonster ( m . GetPos ( ) + vf2d { ConfigFloat ( " Basic Hawk Spawn Radius " ) , randomDir } . cart ( ) , MONSTER_DATA . at ( " Hawk_NOXP " ) , m . OnUpperLevel ( ) , true ) ;
m . F ( A : : SPAWNER_TIMER ) = ConfigFloat ( " Basic Hawk Spawn Time " ) ;
}
@ -90,19 +92,54 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
game - > SetOverlay ( ConfigString ( " Wind Attack.Wind Overlay Sprite " ) , ConfigPixel ( " Wind Attack.Wind Overlay Color " ) ) ;
game - > GetOverlay ( ) . Disable ( ) ;
m . SetStrategyDeathFunction ( [ ] ( GameEvent & ev , Monster & m , const std : : string & strategy ) {
m . SetStrategyDeathFunction ( [ & ] ( GameEvent & ev , Monster & m , const std : : string & strategy ) {
game - > SetWindSpeed ( { } ) ;
game - > GetOverlay ( ) . Disable ( ) ;
std : : for_each ( BULLET_LIST . begin ( ) , BULLET_LIST . end ( ) , [ ] ( const std : : unique_ptr < Bullet > & bullet ) {
if ( ! bullet - > friendly ) { //Forces all bullets at the end of a fight for the boss to be completely nullified.
bullet - > fadeOutTime = 0.5f ;
bullet - > deactivated = true ;
}
} ) ;
return true ;
} ) ;
m . I ( A : : PREVIOUS_PHASE ) = - 1 ;
} break ;
case IDLE : {
# pragma region Mid Phase Check
if ( m . GetHealthRatio ( ) < = ConfigFloat ( " Mid Phase Health Transition % " ) / 100.f & & ! m . B ( A : : PHASE ) ) {
m . B ( A : : PHASE ) = true ;
m . phase = HALFHEALTH_PHASE ;
m . phase = HALFHEALTH_PREPARE_PHASE ;
m . F ( A : : TARGET_FLYING_HEIGHT ) = 50.f ;
m . target = ConfigVec ( " Mid Phase.Pillar Position " ) ;
for ( int i = 0 ; i < ConfigInt ( " Mid Phase.Basic Hawk Spawn Count " ) ; i + + ) {
const vf2d xRange = ConfigVec ( " Mid Phase.Adds Spawn X Range " ) ;
const vf2d yRange = ConfigVec ( " Mid Phase.Adds Spawn Y Range " ) ;
const vf2d spawnPos = { util : : random_range ( xRange . x , xRange . y ) , util : : random_range ( yRange . x , yRange . y ) } ;
game - > SpawnMonster ( spawnPos , MONSTER_DATA . at ( " Hawk_NOXP " ) , m . OnUpperLevel ( ) , true ) ;
}
for ( int i = 0 ; i < ConfigInt ( " Mid Phase.Major Hawk Spawn Count " ) ; i + + ) {
const vf2d xRange = ConfigVec ( " Mid Phase.Adds Spawn X Range " ) ;
const vf2d yRange = ConfigVec ( " Mid Phase.Adds Spawn Y Range " ) ;
const vf2d spawnPos = { util : : random_range ( xRange . x , xRange . y ) , util : : random_range ( yRange . x , yRange . y ) } ;
game - > SpawnMonster ( spawnPos , MONSTER_DATA . at ( " Major Hawk " ) , m . OnUpperLevel ( ) , true ) ;
}
break ; //An early break to not perform an attack.
}
} break ;
case IDLE : {
const int randomAttackChoice = 2 ;
# pragma endregion
int randomAttackChoice ;
do randomAttackChoice = util : : random ( ) % 3 ;
while ( randomAttackChoice = = m . I ( A : : PREVIOUS_PHASE ) ) ;
m . I ( A : : PREVIOUS_PHASE ) = randomAttackChoice ;
switch ( randomAttackChoice ) {
case 0 : {
@ -124,7 +161,6 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
const bool LeftLandingSite = m . I ( A : : ATTACK_CHOICE ) = util : : random ( ) % 2 ;
if ( LeftLandingSite ) m . target = ConfigVec ( " Wind Attack.Left Landing Site " ) ;
else m . target = ConfigVec ( " Wind Attack.Right Landing Site " ) ;
} break ;
}
} break ;
@ -291,8 +327,19 @@ void Monster::STRATEGY::ZEPHY(Monster&m,float fElapsedTime,std::string strategy)
m . F ( A : : SHOOT_TIMER ) = ConfigFloat ( " Wind Attack.Wind Projectile Spawn Rate " ) ;
}
} break ;
case HALFHEALTH_PREPARE_PHASE : {
m . targetAcquireTimer = 20.f ;
RUN_TOWARDS ( m , fElapsedTime , " Run Towards " ) ;
if ( m . ReachedTargetPos ( ) ) {
m . F ( A : : TARGET_FLYING_HEIGHT ) = 0.f ;
if ( m . GetZ ( ) = = 0.f ) m . phase = HALFHEALTH_PHASE ;
}
} break ;
case HALFHEALTH_PHASE : {
m . ApplyIframes ( 1.f ) ;
m . UpdateFacingDirection ( Direction : : SOUTH ) ;
m . PerformAnimation ( " ATTACK " ) ;
if ( game - > BossEncounterMobCount ( ) = = 1 ) m . phase = IDLE ;
} break ;
}
}