@ -69,6 +69,18 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
m . GetInt ( A : : CANNON_PHASE ) = ( m . GetInt ( A : : CANNON_PHASE ) + 1 ) % PHASE_COUNT ;
} } ;
if ( m . F ( A : : SHRAPNEL_SHOT_FALL_TIMER ) > 0.f ) {
m . F ( A : : SHRAPNEL_SHOT_FALL_TIMER ) - = fElapsedTime ;
while ( m . I ( A : : SHRAPNEL_SHOT_COUNT ) & & m . F ( A : : SHRAPNEL_SHOT_FALL_TIMER ) < = 0.f ) {
const float randomAng { util : : random_range ( 0 , 2 * PI ) } ;
const float range { util : : random_range ( 0 , ConfigPixels ( " Bombardment Max Distance " ) ) } ;
const vf2d targetPos { game - > GetPlayer ( ) - > GetPos ( ) + vf2d { range , randomAng } . cart ( ) } ;
m . F ( A : : SHRAPNEL_SHOT_FALL_TIMER ) + = ConfigFloat ( " Shrapnel Shot Bullet Separation " ) ;
CreateBullet ( FallingBullet ) ( " cannonball.png " , targetPos , ConfigVec ( " Cannon Vel " ) , ConfigFloatArr ( " Cannon Vel " , 2 ) , ConfigFloat ( " Indicator Time " ) , ConfigPixels ( " Shrapnel Shot Bullet Radius " ) , ConfigInt ( " Shrapnel Shot Damage " ) , m . OnUpperLevel ( ) , false , ConfigFloat ( " Shrapnel Knockback Amt " ) , ConfigFloat ( " Shrapnel Shot Impact Time " ) , false , ConfigPixel ( " Cannon Spell Circle Color " ) , vf2d { ConfigFloat ( " Shrapnel Shot Bullet Radius " ) / 100.f * 1.75f , ConfigFloat ( " Shrapnel Shot Bullet Radius " ) / 100.f * 1.75f } , util : : random ( 2 * PI ) , util : : random ( 2 * PI ) , util : : degToRad ( ConfigFloat ( " Cannon Spell Circle Rotation Spd " ) ) , ConfigPixel ( " Cannon Spell Insignia Color " ) , util : : random ( 2 * PI ) , util : : degToRad ( ConfigFloat ( " Cannon Spell Insignia Rotation Spd " ) ) ) EndBullet ;
m . I ( A : : SHRAPNEL_SHOT_COUNT ) - - ;
}
}
switch ( PHASE ( ) ) {
case INIT : {
for ( int i : std : : ranges : : iota_view ( 0U , PHASE_COUNT ) ) {
@ -92,7 +104,7 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
case BOMBARDMENT : {
const float randomAng { util : : random_range ( 0 , 2 * PI ) } ;
const float range { util : : random_range ( 0 , ConfigPixels ( " Bombardment Max Distance " ) ) } ;
const vf2d targetPos { game - > camera . GetTarget ( ) - ConfigPixels ( " Bombardment Max Distance " ) / 2.f + vf2d { range , randomAng } . cart ( ) } ;
const vf2d targetPos { game - > GetPlayer ( ) - > GetPos ( ) + vf2d { range , randomAng } . cart ( ) } ;
CreateBullet ( FallingBullet ) ( " cannonball.png " , targetPos , ConfigVec ( " Cannon Vel " ) , ConfigFloatArr ( " Cannon Vel " , 2 ) , ConfigFloat ( " Indicator Time " ) , ConfigPixels ( " Cannon Radius " ) , ConfigInt ( " Cannon Damage " ) , m . OnUpperLevel ( ) , false , ConfigFloat ( " Cannon Knockback Amt " ) , ConfigFloat ( " Cannon Shot Impact Time " ) , false , ConfigPixel ( " Cannon Spell Circle Color " ) , vf2d { ConfigFloat ( " Cannon Radius " ) / 100.f * 1.75f , ConfigFloat ( " Cannon Radius " ) / 100.f * 1.75f } , util : : random ( 2 * PI ) , util : : random ( 2 * PI ) , util : : degToRad ( ConfigFloat ( " Cannon Spell Circle Rotation Spd " ) ) , ConfigPixel ( " Cannon Spell Insignia Color " ) , util : : random ( 2 * PI ) , util : : degToRad ( ConfigFloat ( " Cannon Spell Insignia Rotation Spd " ) ) ) EndBullet ;
} break ;
case PRECISE_BOMBARDMENT : {
@ -115,7 +127,11 @@ void Monster::STRATEGY::GHOST_OF_PIRATE_CAPTAIN(Monster&m,float fElapsedTime,std
if ( m . F ( A : : CANNON_TIMER ) > = ConfigFloat ( " Silence Time " ) ) AdvanceCannonPhase ( ) ;
} break ;
case SHRAPNEL_SHOT : {
if ( m . F ( A : : CANNON_TIMER ) > = ConfigFloat ( " Shrapnel Shot Delay " ) ) AdvanceCannonPhase ( ) ;
if ( m . F ( A : : CANNON_TIMER ) > = ConfigFloat ( " Shrapnel Shot Delay " ) ) {
m . I ( A : : SHRAPNEL_SHOT_COUNT ) = ConfigInt ( " Shrapnel Shot Bullet Count " ) ;
m . F ( A : : SHRAPNEL_SHOT_FALL_TIMER ) = ConfigFloat ( " Shrapnel Shot Bullet Separation " ) ;
AdvanceCannonPhase ( ) ;
}
} break ;
}
} break ;