diff --git a/source/enemy/npcdata.cpp b/source/enemy/npcdata.cpp index e2ff3ec69..0b2ebd7de 100644 --- a/source/enemy/npcdata.cpp +++ b/source/enemy/npcdata.cpp @@ -421,7 +421,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::SFX_PRICKLY_BUG_DEFEATED, - //CSoundMediator::NUM_SFXIDS, CSoundMediator::SFX_PRICKLY_BUG_MOVE, true, }, @@ -525,7 +524,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, false, true, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_PRICKLY_BUG_DEFEATED, CSoundMediator::NUM_SFXIDS, true, }, diff --git a/source/enemy/nsdart.cpp b/source/enemy/nsdart.cpp index 5b1e3730b..e9d370c1d 100644 --- a/source/enemy/nsdart.cpp +++ b/source/enemy/nsdart.cpp @@ -141,10 +141,9 @@ bool CNpcSquidDartEnemy::processSensor() if( m_soundId != NOT_PLAYING ) { CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId ); + m_soundId = NOT_PLAYING; } - m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_SQUIDDART_ATTACK, true ); - return( true ); } else @@ -179,6 +178,11 @@ void CNpcSquidDartEnemy::processClose( int _frames ) } Pos.vx += movement; + + if( m_soundId != NOT_PLAYING ) + { + m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_SQUIDDART_ATTACK, true ); + } } else { diff --git a/source/hazard/hbbarrel.cpp b/source/hazard/hbbarrel.cpp index 6ad282eb1..e46fc8ef5 100644 --- a/source/hazard/hbbarrel.cpp +++ b/source/hazard/hbbarrel.cpp @@ -169,6 +169,16 @@ void CNpcBouncingBarrelHazard::processMovement( int _frames ) Pos.vy = m_lastWaypoint.vy - ( ( abs( nextWaypoint.vy - m_lastWaypoint.vy ) * rsin( sineVal ) ) >> 12 ); } + + int groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy, 16 ); + + if ( groundHeight < 8 ) + { + if ( m_soundId == NOT_PLAYING ) + { + m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND, true ); + } + } } } @@ -215,6 +225,13 @@ void CNpcBouncingBarrelHazard::collidedWith( CThing *_thisThing ) player->takeDamage( DAMAGE__HIT_ENEMY ); } + if( m_soundId != NOT_PLAYING ) + { + CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId ); + } + + m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND, true ); + m_hitPlayer = true; m_speed = -5; } diff --git a/source/hazard/hfalling.cpp b/source/hazard/hfalling.cpp index 1f23c537d..e887a8f28 100644 --- a/source/hazard/hfalling.cpp +++ b/source/hazard/hfalling.cpp @@ -211,6 +211,13 @@ void CNpcFallingHazard::collidedWith( CThing *_thisThing ) m_speed = -5; m_bounceDir = getRnd() % 2; + if( m_soundId != NOT_PLAYING ) + { + CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId ); + } + + m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND, true ); + m_bouncePos = Pos; break; diff --git a/source/platform/pbranch.cpp b/source/platform/pbranch.cpp index 4afb288ec..3de6a9b1a 100644 --- a/source/platform/pbranch.cpp +++ b/source/platform/pbranch.cpp @@ -122,6 +122,7 @@ void CNpcBranchPlatform::processMovement( int _frames ) if ( m_angularVelocity > 6 && newAngle < -20 ) { player->springPlayerUp(); + CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_BUTTBOUNCE); } } else @@ -129,6 +130,7 @@ void CNpcBranchPlatform::processMovement( int _frames ) if ( m_angularVelocity < -6 && newAngle > 20 ) { player->springPlayerUp(); + CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_BUTTBOUNCE); } } diff --git a/source/platform/pjellfsh.cpp b/source/platform/pjellfsh.cpp index ea20ae2f8..371884881 100644 --- a/source/platform/pjellfsh.cpp +++ b/source/platform/pjellfsh.cpp @@ -50,6 +50,7 @@ void CNpcJellyfishPlatform::postInit() m_vertScale = 0; m_dipCount = 0; m_dipOffset = 0; + m_contactTimeout = 0; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -85,6 +86,16 @@ void CNpcJellyfishPlatform::collidedWith( CThing *_thisThing ) if( height == 0 ) { m_contact = true; + + if ( m_contactTimeout <= 0 ) + { + if ( m_soundId == NOT_PLAYING ) + { + m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_LAND_ON_JELLYFISH, true ); + } + } + + m_contactTimeout = 2; } } } @@ -115,6 +126,11 @@ void CNpcJellyfishPlatform::think( int _frames ) m_vertScale += 10; }*/ + if ( m_contactTimeout > 0 ) + { + m_contactTimeout--; + } + if ( m_contact ) { if ( m_dipCount < GameState::getOneSecondInFrames() ) diff --git a/source/platform/pjellfsh.h b/source/platform/pjellfsh.h index a8684ea70..17cee2c20 100644 --- a/source/platform/pjellfsh.h +++ b/source/platform/pjellfsh.h @@ -29,6 +29,7 @@ protected: s32 m_vertScale; u8 m_dipCount; s32 m_dipOffset; + s32 m_contactTimeout; }; #endif \ No newline at end of file diff --git a/source/player/psduck.cpp b/source/player/psduck.cpp index 01e39f661..f285ebbc7 100644 --- a/source/player/psduck.cpp +++ b/source/player/psduck.cpp @@ -74,6 +74,8 @@ void CPlayerStateSoakUp::enter(CPlayerModeBase *_playerMode) _playerMode->zeroMoveVelocity(); _playerMode->setAnimNo(ANIM_SPONGEBOB_DONOTDRAW); m_breatheDelayFrames=0; + + CSoundMediator::playSfx(CSoundMediator::SFX_SPLASH); }