@ -41,6 +41,7 @@ All rights reserved.
# include "MonsterStrategyHelpers.h"
# include "BulletTypes.h"
# include "util.h"
# include "SoundEffect.h"
INCLUDE_game
INCLUDE_BULLET_LIST
@ -93,6 +94,7 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string
switch ( randomAttackChoice ) {
case 0 : {
m . PerformAnimation ( " STONE PILLAR CAST " ) ;
m . SIZET ( A : : LOOPING_SOUND_ID ) = SoundEffect : : PlayLoopingSFX ( " Rock Toss Cast " , m . GetPos ( ) ) ;
m . phase = STONE_PILLAR_CAST ;
m . F ( A : : CASTING_TIMER ) = ConfigFloat ( " Stone Pillar Cast Time " ) ;
m . V ( A : : LOCKON_POS ) = game - > GetPlayer ( ) - > GetPos ( ) ;
@ -100,7 +102,9 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string
} break ;
case 1 : {
m . PerformAnimation ( " ROCK TOSS CAST " ) ;
m . SIZET ( A : : LOOPING_SOUND_ID ) = SoundEffect : : PlayLoopingSFX ( " Rock Toss Cast " , m . GetPos ( ) ) ;
m . phase = SHOOT_STONE_CAST ;
m . B ( A : : PLAYED_FLAG ) = false ;
m . F ( A : : CASTING_TIMER ) = ConfigFloat ( " Rock Toss Track Time " ) + ConfigFloat ( " Rock Toss Wait Time " ) ;
CreateBullet ( LevitatingRock ) ( m , game - > GetPlayer ( ) - > GetPos ( ) , 1.f , 0.f , ConfigPixels ( " Rock Toss Max Spawn Distance " ) , ConfigFloat ( " Rock Toss Track Time " ) , ConfigFloat ( " Rock Toss Wait Time " ) , ConfigFloat ( " Rock Toss Bullet Speed " ) , ConfigFloat ( " Rock Radius " ) , std : : max ( 1 , ConfigInt ( " Rock Toss Damage " ) / 5 ) , m . OnUpperLevel ( ) , false , WHITE , vf2d { 1 , 1 } ) EndBullet ;
const int masterRockInd = BULLET_LIST . size ( ) - 1 ;
@ -115,6 +119,7 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string
}
} break ;
case 2 : {
SoundEffect : : PlaySFX ( " Dig " , m . GetPos ( ) ) ;
m . PerformAnimation ( " BURROW UNDERGROUND " ) ;
m . phase = DIVE_UNDERGROUND_DIG ;
m . F ( A : : CASTING_TIMER ) = m . GetCurrentAnimation ( ) . GetTotalAnimationDuration ( ) ;
@ -125,6 +130,8 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string
case STONE_PILLAR_CAST : {
m . F ( A : : CASTING_TIMER ) - = fElapsedTime ;
if ( m . F ( A : : CASTING_TIMER ) < = 0.f ) {
SoundEffect : : StopLoopingSFX ( m . SIZET ( A : : LOOPING_SOUND_ID ) ) ;
SoundEffect : : PlaySFX ( " Pillar Rise " , m . V ( A : : LOCKON_POS ) ) ;
game - > SpawnMonster ( m . V ( A : : LOCKON_POS ) , MONSTER_DATA . at ( " Stone Pillar " ) , m . OnUpperLevel ( ) ) ;
ReturnToWaitingPhase ( ) ;
game - > Hurt ( m . V ( A : : LOCKON_POS ) , MONSTER_DATA . at ( " Stone Pillar " ) . GetCollisionRadius ( ) * MONSTER_DATA . at ( " Stone Pillar " ) . GetSizeMult ( ) , m . GetAttack ( ) , m . OnUpperLevel ( ) , 0.f , HurtType : : PLAYER ) ;
@ -141,10 +148,16 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string
case SHOOT_STONE_CAST : {
m . F ( A : : CASTING_TIMER ) - = fElapsedTime ;
if ( m . F ( A : : CASTING_TIMER ) > = ConfigFloat ( " Rock Toss Wait Time " ) - ConfigFloat ( " Rock Toss Track Time " ) ) {
SoundEffect : : StopLoopingSFX ( m . SIZET ( A : : LOOPING_SOUND_ID ) ) ;
m . PerformAnimation ( " STONE PILLAR CAST " ) ;
m . UpdateFacingDirection ( game - > GetPlayer ( ) - > GetPos ( ) ) ;
}
if ( m . F ( A : : CASTING_TIMER ) > = ConfigFloat ( " Rock Toss Track Time " ) & & ! m . B ( A : : PLAYED_FLAG ) ) {
SoundEffect : : PlaySFX ( " Rock Break " , m . GetPos ( ) ) ;
m . B ( A : : PLAYED_FLAG ) = true ;
}
if ( m . F ( A : : CASTING_TIMER ) < = 0.f ) {
SoundEffect : : StopLoopingSFX ( m . SIZET ( A : : LOOPING_SOUND_ID ) ) ;
ReturnToWaitingPhase ( ) ;
}
} break ;
@ -180,6 +193,7 @@ void Monster::STRATEGY::STONE_ELEMENTAL(Monster&m,float fElapsedTime,std::string
if ( m . F ( A : : CASTING_TIMER ) < = 0.f ) {
m . B ( A : : IGNORE_DEFAULT_ANIMATIONS ) = false ;
SoundEffect : : PlaySFX ( " Rise " , m . GetPos ( ) ) ;
m . PerformAnimation ( " RISE FROM UNDERGROUND " ) ;
m . phase = DIVE_UNDERGROUND_SURFACE ;
m . targetAcquireTimer = 0 ;