- Bugfix: Externalized Music (Music.lua) (by Jazz)

o Added missing:
6 - creature start battle  (CREATURE_BATTLE_xxx.wav or CREATURE_BATTLE_xxx.ogg)
7 - creepy music  (CREEPY_xxx.wav or CREEPY_xxx.ogg)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6296 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-08-20 08:33:32 +00:00
parent ab02106512
commit 643612540d
12 changed files with 133 additions and 3 deletions
+16
View File
@@ -2061,7 +2061,12 @@ void RenderAutoResolve()
SectorInfo[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].bLastKnownEnemies = 0;
SetThisSectorAsPlayerControlled( gpAR->ubSectorX, gpAR->ubSectorY, 0, TRUE );
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0];
if ( MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0] != -1 )
SetMusicModeID( MUSIC_TACTICAL_VICTORY, MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalVictory[0] );
else
SetMusicMode( MUSIC_TACTICAL_VICTORY );
LogBattleResults( LOG_VICTORY );
break;
@@ -2081,7 +2086,12 @@ void RenderAutoResolve()
HandleMoraleEvent( NULL, MORALE_HEARD_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
if( ProcessLoyalty() )HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_BATTLE_LOST, gpAR->ubSectorX, gpAR->ubSectorY, 0 );
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0];
if ( MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] != -1 )
SetMusicModeID( MUSIC_TACTICAL_DEATH, MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] );
else
SetMusicMode( MUSIC_TACTICAL_DEATH );
gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY );
break;
case BATTLE_DEFEAT:
@@ -2096,7 +2106,13 @@ void RenderAutoResolve()
gsEnemyGainedControlOfSectorID = (INT16)SECTOR( gpAR->ubSectorX, gpAR->ubSectorY );
gsCiviliansEatenByMonsters = gpAR->ubAliveEnemies;
}
GlobalSoundID = MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0];
if ( MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] != -1 )
SetMusicModeID( MUSIC_TACTICAL_DEATH, MusicSoundValues[ SECTOR( gpAR->ubSectorX, gpAR->ubSectorY ) ].SoundTacticalDeath[0] );
else
SetMusicMode( MUSIC_TACTICAL_DEATH );
LogBattleResults( LOG_DEFEAT );
break;
+6
View File
@@ -1284,7 +1284,13 @@ BOOLEAN PrepareCreaturesForBattle()
{ //creatures are attacking a town sector
//gfUseCreatureMusic = TRUE;
UseCreatureMusic(TRUE);
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ];
if ( MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_NOTHING, MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalNothing[gbWorldSectorZ] );
else
SetMusicMode( MUSIC_TACTICAL_NOTHING );
ubCreatureHabitat = MINE_EXIT;
ubNumCreatures = gubNumCreaturesAttackingTown;
}
+40
View File
@@ -5283,6 +5283,16 @@ static int l_SetMusicID (lua_State *L)
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
SetMusicModeID( MUSIC_TACTICAL_DEATH, MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalDeath[z] );
}
else if ( MusicType == 6 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
SetMusicModeID( MUSIC_TACTICAL_BATTLE, MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalBattleCreature[z] );
}
else if ( MusicType == 7 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
SetMusicModeID( MUSIC_TACTICAL_BATTLE, MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalBattleCreepy[z] );
}
}
return 0;
@@ -5320,6 +5330,21 @@ INT32 SoundID = -1;
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
SoundID = MusicSoundValues[SECTOR( x, y )].SoundTacticalVictory[z];
}
else if ( MusicType == 5 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
SoundID = MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalDeath[z];
}
else if ( MusicType == 6 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
SoundID = MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalBattleCreature[z];
}
else if ( MusicType == 7 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
SoundID = MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalBattleCreepy[z];
}
}
lua_pushinteger(L, SoundID);
@@ -5364,6 +5389,21 @@ static int l_gAddMusic(lua_State *L)
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
MusicSoundValues[SECTOR( x, y )].SoundTacticalVictory[z] = SoundId;
}
else if ( MusicType == 5 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalDeath[z] = SoundId;
}
else if ( MusicType == 6 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalBattleCreature[z] = SoundId;
}
else if ( MusicType == 7 )
{
if ((x>=1 || x<=16) && (y>=1 || y<=16) && (z>=0 || z<=3) )
MusicSoundValues[ SECTOR( x, y ) ].SoundTacticalBattleCreepy[z] = SoundId;
}
}
return 0;
+5 -1
View File
@@ -873,6 +873,10 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
UseCreatureMusic(HostileZombiesPresent());
#endif
GlobalSoundID = MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ];
if ( MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_ENEMYPRESENT, MusicSoundValues[ SECTOR( gubPBSectorX, gubPBSectorY ) ].SoundTacticalTensor[gubPBSectorZ] );
else
SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT );
#ifdef JA2UB
@@ -2210,4 +2214,4 @@ void HandlePreBattleInterfaceStates()
{
gfTransitionMapscreenToAutoResolve = FALSE;
}
}
}
+4
View File
@@ -963,6 +963,10 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating
UseCreatureMusic(HostileZombiesPresent());
#endif
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
if ( MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ] != -1 )
SetMusicModeID( MUSIC_TACTICAL_ENEMYPRESENT, MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ] );
else
SetMusicMode( MUSIC_TACTICAL_ENEMYPRESENT );
if( gfTacticalTraversal && pInitiatingBattleGroup == gpTacticalTraversalGroup ||