From 61fc9629e2fba2483c0c21b1e6dd23c9ddc38ed4 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 8 Apr 2004 03:40:28 +0000 Subject: [PATCH] fix both ScoreKeeperRave launch attack p1 and Player attack launch p2 being played when p1 launches an attack simplify battle/course attack sound handling; do it in the same place; make the sound filenames clear --- stepmania/src/Player.cpp | 16 ++++++++++++++-- stepmania/src/ScoreKeeperRave.cpp | 7 ------- stepmania/src/ScoreKeeperRave.h | 4 ---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/stepmania/src/Player.cpp b/stepmania/src/Player.cpp index 0cfe4017ca..2c154e1865 100644 --- a/stepmania/src/Player.cpp +++ b/stepmania/src/Player.cpp @@ -232,8 +232,20 @@ void PlayerMinus::Load( PlayerNumber pn, const NoteData* pNoteData, LifeMeter* p m_soundMine.SetParams( p ); } - m_soundAttackLaunch.Load( THEME->GetPathToS(ssprintf("Player attack launch p%d",pn+1)), true ); - m_soundAttackEnding.Load( THEME->GetPathToS(ssprintf("Player attack ending p%d",pn+1)), true ); + /* Attacks can be launched in course modes and in battle modes. They both come + * here to play, but allow loading a different sound for different modes. */ + switch( GAMESTATE->m_PlayMode ) + { + case PLAY_MODE_RAVE: + case PLAY_MODE_BATTLE: + m_soundAttackLaunch.Load( THEME->GetPathToS(ssprintf("Player battle attack launch p%d",pn+1)), true ); + m_soundAttackEnding.Load( THEME->GetPathToS(ssprintf("Player battle attack ending p%d",pn+1)), true ); + break; + default: + m_soundAttackLaunch.Load( THEME->GetPathToS(ssprintf("Player course attack launch p%d",pn+1)), true ); + m_soundAttackEnding.Load( THEME->GetPathToS(ssprintf("Player course attack ending p%d",pn+1)), true ); + break; + } } void PlayerMinus::Update( float fDeltaTime ) diff --git a/stepmania/src/ScoreKeeperRave.cpp b/stepmania/src/ScoreKeeperRave.cpp index 3d81eaa224..effc5a20b2 100644 --- a/stepmania/src/ScoreKeeperRave.cpp +++ b/stepmania/src/ScoreKeeperRave.cpp @@ -24,9 +24,6 @@ CachedThemeMetricF ATTACK_DURATION_SECONDS ("ScoreKeeperRave","AttackDurationSec ScoreKeeperRave::ScoreKeeperRave(PlayerNumber pn) : ScoreKeeper(pn) { ATTACK_DURATION_SECONDS.Refresh(); - - m_soundLaunchAttack.Load( THEME->GetPathToS(ssprintf("ScoreKeeperRave launch attack p%d",pn+1)) ); - m_soundAttackEnding.Load( THEME->GetPathToS(ssprintf("ScoreKeeperRave attack end p%d",pn+1)) ); } void ScoreKeeperRave::OnNextSong( int iSongInCourseIndex, const Steps* pNotes, const NoteData* pNoteData ) @@ -125,8 +122,6 @@ void ScoreKeeperRave::AddSuperMeterDelta( float fUnscaledPercentChange ) void ScoreKeeperRave::Update( float fDelta ) { - if( GAMESTATE->m_bAttackEndedThisUpdate[m_PlayerNumber] ) - m_soundAttackEnding.Play(); } void ScoreKeeperRave::LaunchAttack( AttackLevel al ) @@ -157,6 +152,4 @@ void ScoreKeeperRave::LaunchAttack( AttackLevel al ) GAMESTATE->LaunchAttack( pnToAttack, a ); // SCREENMAN->SystemMessage( ssprintf( "attacking %d with %s", pnToAttack, sAttackToGive.c_str() ) ); - - m_soundLaunchAttack.Play(); } diff --git a/stepmania/src/ScoreKeeperRave.h b/stepmania/src/ScoreKeeperRave.h index 5403be8af3..76ec303c88 100644 --- a/stepmania/src/ScoreKeeperRave.h +++ b/stepmania/src/ScoreKeeperRave.h @@ -12,7 +12,6 @@ */ #include "ScoreKeeper.h" -#include "RageSound.h" #include "GameConstantsAndTypes.h" @@ -30,9 +29,6 @@ public: protected: void LaunchAttack( AttackLevel al ); void AddSuperMeterDelta( float fUnscaledPercentChange ); - - RageSound m_soundLaunchAttack; - RageSound m_soundAttackEnding; }; #endif