battle stuff

This commit is contained in:
Chris Danford
2003-07-09 02:27:05 +00:00
parent e70158e4bc
commit 3ee5463de7
5 changed files with 47 additions and 9 deletions
+7 -2
View File
@@ -26,8 +26,7 @@ RandomSample::RandomSample()
RandomSample::~RandomSample()
{
for( unsigned i=0; i<m_pSamples.size(); i++ )
delete m_pSamples[i];
UnloadAll();
}
bool RandomSample::Load( CString sFilePath, int iMaxToLoad )
@@ -41,6 +40,12 @@ bool RandomSample::Load( CString sFilePath, int iMaxToLoad )
else return LoadSound( sFilePath );
}
void RandomSample::UnloadAll()
{
for( unsigned i=0; i<m_pSamples.size(); i++ )
delete m_pSamples[i];
m_pSamples.clear();
}
bool RandomSample::LoadSoundDir( CString sDir, int iMaxToLoad )
{
+1
View File
@@ -20,6 +20,7 @@ public:
virtual ~RandomSample();
bool Load( CString sFilePath, int iMaxToLoad = 1000 /*load all*/ );
void UnloadAll();
void PlayRandom();
void Stop();
+36 -7
View File
@@ -609,7 +609,6 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
switch( GAMESTATE->m_PlayMode )
{
case PLAY_MODE_HUMAN_BATTLE:
case PLAY_MODE_CPU_BATTLE:
m_announcerBattleTrickLevel1.Load( ANNOUNCER->GetPathTo("gameplay battle trick level1") );
m_announcerBattleTrickLevel2.Load( ANNOUNCER->GetPathTo("gameplay battle trick level2") );
@@ -620,6 +619,8 @@ ScreenGameplay::ScreenGameplay( bool bDemonstration ) : Screen("ScreenGameplay")
m_announcerBattleDamageLevel1.Load( ANNOUNCER->GetPathTo("gameplay battle damage level1") );
m_announcerBattleDamageLevel2.Load( ANNOUNCER->GetPathTo("gameplay battle damage level2") );
m_announcerBattleDamageLevel3.Load( ANNOUNCER->GetPathTo("gameplay battle damage level3") );
// HACK: Load incorrect directory on purpose for now.
m_announcerBattleDie.Load( ANNOUNCER->GetPathTo("gameplay battle damage level3") );
break;
}
}
@@ -1064,6 +1065,34 @@ void ScreenGameplay::Update( float fDeltaTime )
if( GAMESTATE->m_fOpponentHealthPercent == 0 )
{
// HACK: Shut the announcer up
m_announcerReady.UnloadAll();
m_announcerHereWeGo.UnloadAll();
m_announcerDanger.UnloadAll();
m_announcerGood.UnloadAll();
m_announcerHot.UnloadAll();
m_announcerOni.UnloadAll();
m_announcer100Combo.UnloadAll();
m_announcer200Combo.UnloadAll();
m_announcer300Combo.UnloadAll();
m_announcer400Combo.UnloadAll();
m_announcer500Combo.UnloadAll();
m_announcer600Combo.UnloadAll();
m_announcer700Combo.UnloadAll();
m_announcer800Combo.UnloadAll();
m_announcer900Combo.UnloadAll();
m_announcer1000Combo.UnloadAll();
m_announcerComboStopped.UnloadAll();
m_announcerBattleTrickLevel1.UnloadAll();
m_announcerBattleTrickLevel2.UnloadAll();
m_announcerBattleTrickLevel3.UnloadAll();
m_announcerBattleDamageLevel1.UnloadAll();
m_announcerBattleDamageLevel2.UnloadAll();
m_announcerBattleDamageLevel3.UnloadAll();
m_announcerBattleDie.PlayRandom();
GAMESTATE->RemoveAllActiveAttacks();
for( int p=0; p<NUM_PLAYERS; p++ )
@@ -1695,7 +1724,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
break;
case SM_BattleTrickLevel1:
if( SECS_SINCE_LAST_COMMENT > 5 )
if( SECS_SINCE_LAST_COMMENT > 3 )
{
m_announcerBattleTrickLevel1.PlayRandom();
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
@@ -1703,7 +1732,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
m_soundBattleTrickLevel1.PlayRandom();
break;
case SM_BattleTrickLevel2:
if( SECS_SINCE_LAST_COMMENT > 5 )
if( SECS_SINCE_LAST_COMMENT > 3 )
{
m_announcerBattleTrickLevel2.PlayRandom();
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
@@ -1711,7 +1740,7 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
m_soundBattleTrickLevel2.PlayRandom();
break;
case SM_BattleTrickLevel3:
if( SECS_SINCE_LAST_COMMENT > 5 )
if( SECS_SINCE_LAST_COMMENT > 3 )
{
m_announcerBattleTrickLevel3.PlayRandom();
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
@@ -1720,21 +1749,21 @@ void ScreenGameplay::HandleScreenMessage( const ScreenMessage SM )
break;
case SM_BattleDamageLevel1:
if( SECS_SINCE_LAST_COMMENT > 5 )
if( SECS_SINCE_LAST_COMMENT > 3 )
{
m_announcerBattleDamageLevel1.PlayRandom();
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
}
break;
case SM_BattleDamageLevel2:
if( SECS_SINCE_LAST_COMMENT > 5 )
if( SECS_SINCE_LAST_COMMENT > 3 )
{
m_announcerBattleDamageLevel2.PlayRandom();
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
}
break;
case SM_BattleDamageLevel3:
if( SECS_SINCE_LAST_COMMENT > 5 )
if( SECS_SINCE_LAST_COMMENT > 3 )
{
m_announcerBattleDamageLevel3.PlayRandom();
m_fTimeLeftBeforeDancingComment = SECONDS_BETWEEN_COMMENTS;
+1
View File
@@ -182,6 +182,7 @@ protected:
RandomSample m_announcerBattleDamageLevel1;
RandomSample m_announcerBattleDamageLevel2;
RandomSample m_announcerBattleDamageLevel3;
RandomSample m_announcerBattleDie;
bool m_bZeroDeltaOnNextUpdate;
bool m_bDemonstration;
+2
View File
@@ -301,6 +301,8 @@ void Sprite::DrawPrimitives()
switch( m_VertAlign )
{
// FIXME: Top and bottom are flipped, but changing them now breaks a lot
// in our themes. -Chris
case align_top: quadVerticies.top = 0; quadVerticies.bottom = m_size.y; break;
case align_middle: quadVerticies.top = -m_size.y/2; quadVerticies.bottom = m_size.y/2; break;
case align_bottom: quadVerticies.top = -m_size.y; quadVerticies.bottom = 0; break;