This commit is contained in:
Charles 2001-07-13 22:11:49 +00:00
parent 131369d2f4
commit b491c4c10b
8 changed files with 83 additions and 14 deletions

View File

@ -107,6 +107,11 @@ void CNpcIronDogfishEnemy::processMovement( int _frames )
if ( m_movementTimer > 0 )
{
if ( m_soundId == NOT_PLAYING && m_data[m_type].moveSfx < CSoundMediator::NUM_SFXIDS )
{
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
if ( m_animNo != ANIM_IRONDOGFISH_WALK || !m_animPlaying )
{
m_animPlaying = true;
@ -227,6 +232,8 @@ void CNpcIronDogfishEnemy::processStandardIronDogfishAttack( int _frames )
m_animPlaying = true;
m_animNo = ANIM_IRONDOGFISH_PUNCH;
m_frame = 0;
CSoundMediator::playSfx( CSoundMediator::SFX_DOGFISH_THUMP );
}
else if ( !m_animPlaying )
{
@ -270,6 +277,7 @@ void CNpcIronDogfishEnemy::processStandardIronDogfishAttack( int _frames )
m_laserTimer = GameState::getOneSecondInFrames() >> 1;
CSoundMediator::playSfx( CSoundMediator::SFX_DOGFISH_LASER );
/*m_effect = (CFXLaser*) CFX::Create( CFX::FX_TYPE_LASER, this );
DVECTOR offsetPos;
@ -364,6 +372,8 @@ void CNpcIronDogfishEnemy::processStandardIronDogfishAttack( int _frames )
m_animPlaying = true;
m_animNo = ANIM_IRONDOGFISH_TAILSMASH;
m_frame = 0;
CSoundMediator::playSfx( CSoundMediator::SFX_DOGFISH_GROWL );
}
else if ( !m_animPlaying )
{

View File

@ -331,6 +331,8 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
m_state = FLYING_DUTCHMAN_RETURN;
m_timerTimer = 2 * GameState::getOneSecondInFrames();
}
CSoundMediator::playSfx( CSoundMediator::SFX_FLYING_DUTCHMAN );
}
}
}

View File

@ -218,6 +218,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
projectile->setGraphic( FRM__LIGHTNING1 );
projectile->setSpeed( 6 );
projectile->setXScale( 8192 );
projectile->setShock();
m_movementTimer = GameState::getOneSecondInFrames() * 2;
m_pulsateTimer = GameState::getOneSecondInFrames();
@ -256,7 +257,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_ATTACK, true );
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_BOSS_JELLYFISH_ELECTRIC_SHOCK, true );
}
}
}
@ -267,9 +268,20 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
m_renderScale = 2048 + ( ( ( 4096 - 2048 ) * m_health ) / m_data[m_type].initHealth );
m_renderScale += ( ( 256 * rsin( ( ( m_pulsateTimer << 14 ) / GameState::getOneSecondInFrames() ) & 4095 ) ) >> 12 );
if ( m_soundId == NOT_PLAYING )
if ( m_pulsateTimer > 0 )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_NAUTILUS_ATTACK, true );
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_BOSS_JELLYFISH_PULSATE, true );
}
}
else
{
if ( m_soundId != NOT_PLAYING )
{
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId );
m_soundId = NOT_PLAYING;
}
}
}
}
@ -313,7 +325,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_MOVE, true );
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
}
else
@ -348,7 +360,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_MOVE, true );
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
break;
@ -374,7 +386,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_MOVE, true );
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
break;
@ -395,7 +407,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_MOVE, true );
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
break;
@ -427,7 +439,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_MOVE, true );
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
break;
@ -446,7 +458,7 @@ void CNpcMotherJellyfishEnemy::processMovement( int _frames )
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_ATTACK, true );
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_BOSS_JELLYFISH_ELECTRIC_SHOCK, true );
}
s32 distX, distY;

View File

@ -447,7 +447,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
false,
true,
CSoundMediator::NUM_SFXIDS,
CSoundMediator::SFX_SEASNAKE_MOVE,
CSoundMediator::SFX_WORM___SWIM,
false,
},
@ -811,7 +811,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
false,
false,
CSoundMediator::SFX_JELLYFISH_DEFEATED,
CSoundMediator::SFX_JELLYFISH_MOVE,
CSoundMediator::SFX_BOSS_JELLYFISH_MOVE,
false,
},
@ -837,7 +837,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
false,
false,
CSoundMediator::NUM_SFXIDS,
CSoundMediator::NUM_SFXIDS,
CSoundMediator::SFX_SHARK___SWIM,
true,
},
@ -916,7 +916,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
false,
false,
CSoundMediator::NUM_SFXIDS,
CSoundMediator::NUM_SFXIDS,
CSoundMediator::SFX_DOGFISH_STOMP,
true,
},

View File

@ -98,6 +98,11 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
{
case SUB_SHARK_MINE_1:
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
if ( !m_animPlaying )
{
m_animPlaying = true;
@ -164,6 +169,11 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
case SUB_SHARK_GOTO_CHARGE:
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
if ( !m_animPlaying )
{
m_animPlaying = true;
@ -207,6 +217,11 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
case SUB_SHARK_DROP:
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
if ( !m_animPlaying )
{
m_animPlaying = true;
@ -237,6 +252,11 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
case SUB_SHARK_START_CHARGE:
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_SHARK___CREAKING_ATTACK_SOUND, true );
}
if ( !m_animPlaying )
{
m_animPlaying = true;
@ -281,6 +301,11 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
case SUB_SHARK_CHARGE:
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
if ( !m_carryPlayer && abs( playerXDist ) < 200 )
{
if ( m_animNo != ANIM_SHARKSUB_CHOMP || !m_animPlaying )
@ -288,6 +313,7 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
m_animPlaying = true;
m_animNo = ANIM_SHARKSUB_CHOMP;
m_frame = 0;
CSoundMediator::playSfx( CSoundMediator::SFX_SHARK___CHOMP );
}
}
else
@ -327,6 +353,11 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
case SUB_SHARK_END_CHARGE:
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( m_data[m_type].moveSfx, true );
}
if ( !m_animPlaying )
{
m_animPlaying = true;

View File

@ -365,6 +365,8 @@ void CNpcSeaSnakeEnemy::processMovement( int _frames )
m_animNo = ANIM_SEASNAKE_HEADSNAP;
m_animPlaying = true;
m_frame = 0;
CSoundMediator::playSfx( CSoundMediator::SFX_WORM___CHOMP );
}
}
}
@ -828,6 +830,8 @@ void CNpcSeaSnakeEnemy::processClose( int _frames )
m_sensorFunc = NPC_SENSOR_NONE;
m_snapTimer = m_movementTimer;
CSoundMediator::playSfx( CSoundMediator::SFX_WORM___HISS );
}
if ( m_soundId == NOT_PLAYING )

View File

@ -89,6 +89,7 @@ void CProjectile::init()
m_speed = 3;
m_xScale = ONE;
m_yScale = ONE;
m_shock = false;
updateCollisionArea();
}
@ -470,7 +471,14 @@ void CProjectile::collidedWith(CThing *_thisThing)
{
CPlayer *player = (CPlayer *) _thisThing;
player->takeDamage( DAMAGE__HIT_ENEMY );
if ( m_shock )
{
player->takeDamage( DAMAGE__SHOCK_ENEMY );
}
else
{
player->takeDamage( DAMAGE__HIT_ENEMY );
}
if ( m_lifetimeType != PROJECTILE_INFINITE_LIFE )
{

View File

@ -68,6 +68,7 @@ public:
void setSpeed( u16 newSpeed ) {m_speed = newSpeed;}
void setXScale( s16 newScale ) {m_xScale = newScale;}
void setYScale( s16 newScale ) {m_yScale = newScale;}
void setShock() {m_shock = true;}
protected:
DVECTOR getScreenOffset();
@ -88,6 +89,7 @@ protected:
u16 m_speed;
s16 m_xScale;
s16 m_yScale;
u8 m_shock;
};
/*****************************************************************************/