From 1ed6b3c05f5cb40a5f4b8ed06092991ada142584 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 1 Jun 2001 16:30:37 +0000 Subject: [PATCH] --- source/enemy/nbblob.cpp | 5 +++++ source/enemy/nfskull.cpp | 2 ++ source/enemy/nmjfish.cpp | 2 ++ source/enemy/npbug.cpp | 2 +- source/enemy/npcdata.cpp | 23 ++++++++++++----------- source/enemy/nssnake.cpp | 5 +++++ source/enemy/nsstomp.cpp | 1 + source/friend/fgary.cpp | 4 ++++ source/hazard/hazard.h | 3 +++ source/hazard/hbwheel.cpp | 1 + source/hazard/hcsaw.cpp | 2 ++ source/hazard/hfalling.cpp | 2 ++ source/hazard/hfirebal.cpp | 3 +++ source/hazard/hmower.cpp | 2 ++ source/hazard/hrckshrd.cpp | 2 ++ source/hazard/hrrock.cpp | 5 +++++ source/hazard/hsaw.cpp | 2 ++ source/platform/pgeyser.cpp | 1 + source/platform/pseesaw.cpp | 6 +++++- 19 files changed, 60 insertions(+), 13 deletions(-) diff --git a/source/enemy/nbblob.cpp b/source/enemy/nbblob.cpp index 1edc242e7..5c62f6976 100644 --- a/source/enemy/nbblob.cpp +++ b/source/enemy/nbblob.cpp @@ -83,6 +83,11 @@ void CNpcBallBlobEnemy::processMovement( int _frames ) } moveY = groundHeight; + + if ( m_data[m_type].moveSfx < CSoundMediator::NUM_SFXIDS ) + { + CSoundMediator::playSfx( m_data[m_type].moveSfx ); + } } // deal with horizontal diff --git a/source/enemy/nfskull.cpp b/source/enemy/nfskull.cpp index 17fe22a0b..13d348901 100644 --- a/source/enemy/nfskull.cpp +++ b/source/enemy/nfskull.cpp @@ -67,6 +67,8 @@ void CNpcFlamingSkullEnemy::processClose( int _frames ) s32 distX, distY; s32 distXSqr, distYSqr; + CSoundMediator::playSfx( CSoundMediator::SFX_FLAMING_SKULL_ATTACK ); + if ( m_state == FLAMING_SKULL_ATTACK ) { processGenericGetUserDist( _frames, &distX, &distY ); diff --git a/source/enemy/nmjfish.cpp b/source/enemy/nmjfish.cpp index e4e477b86..61ffad17d 100644 --- a/source/enemy/nmjfish.cpp +++ b/source/enemy/nmjfish.cpp @@ -259,6 +259,8 @@ void CNpcMotherJellyfishEnemy::processClose( int _frames ) m_controlFunc = NPC_CONTROL_MOVEMENT; m_state = MOTHER_JELLYFISH_RETURN_TO_START_1; + + CSoundMediator::playSfx( CSoundMediator::SFX_JELLYFISH_ATTACK ); } break; diff --git a/source/enemy/npbug.cpp b/source/enemy/npbug.cpp index fd7ffece0..837100aed 100644 --- a/source/enemy/npbug.cpp +++ b/source/enemy/npbug.cpp @@ -53,7 +53,7 @@ void CNpcPricklyBugEnemy::processMovementModifier( int _frames, s32 distX, s32 d // sound - CSoundMediator::playSfx( CSoundMediator::SFX_PRICKLY_BUG_MOVE ); + //CSoundMediator::playSfx( CSoundMediator::SFX_PRICKLY_BUG_MOVE ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/npcdata.cpp b/source/enemy/npcdata.cpp index 281487abb..00602d165 100644 --- a/source/enemy/npcdata.cpp +++ b/source/enemy/npcdata.cpp @@ -410,7 +410,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::SFX_PRICKLY_BUG_DEFEATED, - CSoundMediator::NUM_SFXIDS, + //CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_PRICKLY_BUG_MOVE, }, { // NPC_SEA_SNAKE @@ -435,7 +436,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_SEASNAKE_MOVE, }, { // NPC_PUFFA_FISH @@ -460,7 +461,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_PUFFAFISH_MOVE, }, { // NPC_ANGLER_FISH @@ -485,7 +486,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_ANGLER_FISH_MOVE, }, { // NPC_HERMIT_CRAB @@ -535,7 +536,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_HAZARD__MINE, }, { // NPC_BOOGER_MONSTER @@ -735,7 +736,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_GHOST, }, { // NPC_GHOST_PIRATE @@ -784,8 +785,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, false, true, - CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_FLAMING_SKULL_DEFEATED, + CSoundMediator::SFX_FLAMING_SKULL_MOVE, }, { // NPC_SHARK_MAN @@ -884,8 +885,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, false, false, - CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_JELLYFISH_DEFEATED, + CSoundMediator::SFX_JELLYFISH_MOVE, }, { // NPC_SUB_SHARK @@ -1035,7 +1036,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, true, CSoundMediator::NUM_SFXIDS, - CSoundMediator::NUM_SFXIDS, + CSoundMediator::SFX_BALL_BLOB_MOVE, }, { // NPC_SHELL diff --git a/source/enemy/nssnake.cpp b/source/enemy/nssnake.cpp index 6784e68aa..619cd6480 100644 --- a/source/enemy/nssnake.cpp +++ b/source/enemy/nssnake.cpp @@ -246,6 +246,11 @@ void CNpcSeaSnakeEnemy::processMovement( int _frames ) DVECTOR oldPos = Pos; u8 skipCounter; + if ( m_data[m_type].moveSfx < CSoundMediator::NUM_SFXIDS ) + { + CSoundMediator::playSfx( m_data[m_type].moveSfx ); + } + processGenericFixedPathMove( _frames, &moveX, &moveY, &moveVel, &moveDist ); Pos.vx += moveX; diff --git a/source/enemy/nsstomp.cpp b/source/enemy/nsstomp.cpp index d649ff8b4..d18e46b01 100644 --- a/source/enemy/nsstomp.cpp +++ b/source/enemy/nsstomp.cpp @@ -55,6 +55,7 @@ bool CNpcSkullStomperEnemy::processSensor() { m_controlFunc = NPC_CONTROL_CLOSE; m_extendDir = EXTEND_DOWN; + CSoundMediator::playSfx( CSoundMediator::SFX_SKULL_ATTACK ); return( true ); } diff --git a/source/friend/fgary.cpp b/source/friend/fgary.cpp index 80ea6aae3..a28ce850a 100644 --- a/source/friend/fgary.cpp +++ b/source/friend/fgary.cpp @@ -83,6 +83,8 @@ void CNpcGaryFriend::think( int _frames ) if ( m_started ) { + CSoundMediator::playSfx( CSoundMediator::SFX_GARY_DE_SNAIL ); + Pos.vx += multiplier * _frames; } } @@ -107,6 +109,8 @@ void CNpcGaryFriend::think( int _frames ) { if ( m_started ) { + CSoundMediator::playSfx( CSoundMediator::SFX_GARY_DE_SNAIL ); + Pos.vx += multiplier * _frames; } } diff --git a/source/hazard/hazard.h b/source/hazard/hazard.h index 9422f6fb1..832794efc 100644 --- a/source/hazard/hazard.h +++ b/source/hazard/hazard.h @@ -30,6 +30,9 @@ #include "gfx\actor.h" #endif +#ifndef __SOUND_SOUND_H__ +#include "sound\sound.h" +#endif class CNpcHazard : public CHazardThing { diff --git a/source/hazard/hbwheel.cpp b/source/hazard/hbwheel.cpp index dfa853434..231c3977c 100644 --- a/source/hazard/hbwheel.cpp +++ b/source/hazard/hbwheel.cpp @@ -39,6 +39,7 @@ void CNpcBigWheelHazard::processMovement( int _frames ) { m_rotation += 5 * _frames; m_rotation &= 4095; + CSoundMediator::playSfx( CSoundMediator::SFX_WORLD_OBJECT__BIG_WHEEL ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hcsaw.cpp b/source/hazard/hcsaw.cpp index ffc10c380..50b678734 100644 --- a/source/hazard/hcsaw.cpp +++ b/source/hazard/hcsaw.cpp @@ -39,6 +39,8 @@ void CNpcCircularSawHazard::processMovement( int _frames ) { m_rotation += 256 * _frames; m_rotation &= 4095; + + CSoundMediator::playSfx( CSoundMediator::SFX_SAW ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hfalling.cpp b/source/hazard/hfalling.cpp index 98b51542a..20e3c3eed 100644 --- a/source/hazard/hfalling.cpp +++ b/source/hazard/hfalling.cpp @@ -132,6 +132,8 @@ void CNpcFallingHazard::processMovement( int _frames ) if ( groundHeight < yMovement ) { + CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__ACORN_LAND ); + // colliding with ground Pos.vy += groundHeight; diff --git a/source/hazard/hfirebal.cpp b/source/hazard/hfirebal.cpp index 7d4540223..6b18cf0bf 100644 --- a/source/hazard/hfirebal.cpp +++ b/source/hazard/hfirebal.cpp @@ -96,6 +96,7 @@ void CNpcFireballHazard::processMovement( int _frames ) m_isActive = false; m_timerActive = true; m_timer = ( m_respawnRate - 1 ) * GameState::getOneSecondInFrames(); + CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__FIREBALL_LAND ); return; } @@ -114,5 +115,7 @@ void CNpcFireballHazard::processTimer( int _frames ) { m_timerActive = false; m_isActive = true; + + CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__FIREBALL_LAUNCH ); } } diff --git a/source/hazard/hmower.cpp b/source/hazard/hmower.cpp index b36b11292..de1701b88 100644 --- a/source/hazard/hmower.cpp +++ b/source/hazard/hmower.cpp @@ -39,6 +39,8 @@ void CNpcMowerHazard::processMovement( int _frames ) { m_rotation += 256 * _frames; m_rotation &= 4095; + + CSoundMediator::playSfx( CSoundMediator::SFX_SAW ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/hazard/hrckshrd.cpp b/source/hazard/hrckshrd.cpp index 2863040e8..0dd2e9551 100644 --- a/source/hazard/hrckshrd.cpp +++ b/source/hazard/hrckshrd.cpp @@ -58,6 +58,7 @@ void CNpcRockShardHazard::processMovement( int _frames ) { Pos.vx = m_base.vx + ( -3 + ( getRnd() % 7 ) ); Pos.vy = m_base.vy + ( -3 + ( getRnd() % 7 ) ); + CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__STALACTITE_RATTLE ); } } else @@ -75,6 +76,7 @@ void CNpcRockShardHazard::processMovement( int _frames ) m_isActive = false; m_timerActive = true; m_timer = ( m_respawnRate - 1 ) * GameState::getOneSecondInFrames(); + CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__STALACTITE_LAND ); } else { diff --git a/source/hazard/hrrock.cpp b/source/hazard/hrrock.cpp index ab6dd5d11..6a66a6bee 100644 --- a/source/hazard/hrrock.cpp +++ b/source/hazard/hrrock.cpp @@ -64,6 +64,11 @@ void CNpcRollingRockHazard::processMovement( int _frames ) } else { + if ( !m_jump ) + { + CSoundMediator::playSfx( CSoundMediator::SFX_ROLLING_ROCK ); + } + if ( distX ) { // move along ground diff --git a/source/hazard/hsaw.cpp b/source/hazard/hsaw.cpp index acb19ad9e..d9d6dab06 100644 --- a/source/hazard/hsaw.cpp +++ b/source/hazard/hsaw.cpp @@ -45,6 +45,8 @@ void CNpcSawbladeHazard::processMovement( int _frames ) s16 headingToTarget = m_npcPath.think( Pos, &pathComplete, &waypointChange, &xDist, &yDist ); + CSoundMediator::playSfx( CSoundMediator::SFX_SAW ); + if ( !pathComplete ) { s16 decDir, incDir, moveDist; diff --git a/source/platform/pgeyser.cpp b/source/platform/pgeyser.cpp index 7deef0481..375290732 100644 --- a/source/platform/pgeyser.cpp +++ b/source/platform/pgeyser.cpp @@ -134,6 +134,7 @@ void CNpcGeyserPlatform::processTimer( int _frames ) m_isFiring = true; Pos = m_base; m_state = GEYSER_RISING; + CSoundMediator::playSfx( CSoundMediator::SFX_WORLD_OBJECT__GEYSER ); } } } diff --git a/source/platform/pseesaw.cpp b/source/platform/pseesaw.cpp index 22a0ac98b..51dd19b71 100644 --- a/source/platform/pseesaw.cpp +++ b/source/platform/pseesaw.cpp @@ -104,7 +104,11 @@ void CNpcSeesawPlatform::processMovement( int _frames ) m_angularVelocity = 0; } - m_currentAngle = newAngle; + if ( m_currentAngle != newAngle ) + { + m_currentAngle = newAngle; + CSoundMediator::playSfx( CSoundMediator::SFX_WORLD_OBJECT__SEESAW ); + } setCollisionAngle( newAngle >> 8 ); }