Commit MetaInfo

Revisión3d2e9c004bfbd95c6d7d2be41dbf9c526ac525e2 (tree)
Tiempo2022-09-22 22:00:48
AutorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

Added a "WelcomeSound" property to the GAMEMODE lump, which determines what announcer sound to play at the start of a level.

Cambiar Resumen

Diferencia incremental

diff -r 36def6dbea37 -r 3d2e9c004bfb src/g_game.cpp
--- a/src/g_game.cpp Thu Sep 22 08:47:41 2022 -0400
+++ b/src/g_game.cpp Thu Sep 22 09:00:48 2022 -0400
@@ -1785,19 +1785,13 @@
17851785 // Tick the medal system.
17861786 MEDAL_Tick( );
17871787
1788- // Play "Welcome" sounds for teamgame modes.
1789- if ( g_ulLevelIntroTicks < TICRATE )
1788+ // [AK] Play "welcome" sounds for any game modes that have defined one.
1789+ if (( g_ulLevelIntroTicks < TICRATE ) && ( ++g_ulLevelIntroTicks == TICRATE ))
17901790 {
1791- g_ulLevelIntroTicks++;
1792- if ( g_ulLevelIntroTicks == TICRATE )
1793- {
1794- if ( oneflagctf )
1795- ANNOUNCER_PlayEntry( cl_announcer, "WelcomeToOneFlagCTF" );
1796- else if ( ctf )
1797- ANNOUNCER_PlayEntry( cl_announcer, "WelcomeToCTF" );
1798- else if ( skulltag )
1799- ANNOUNCER_PlayEntry( cl_announcer, "WelcomeToST" );
1800- }
1791+ const char *pszWelcomeSound = GAMEMODE_GetWelcomeSound( GAMEMODE_GetCurrentMode( ));
1792+
1793+ if ( pszWelcomeSound != NULL )
1794+ ANNOUNCER_PlayEntry( cl_announcer, pszWelcomeSound );
18011795 }
18021796
18031797 // Apply end level delay.
diff -r 36def6dbea37 -r 3d2e9c004bfb src/gamemode.cpp
--- a/src/gamemode.cpp Thu Sep 22 08:47:41 2022 -0400
+++ b/src/gamemode.cpp Thu Sep 22 09:00:48 2022 -0400
@@ -196,6 +196,11 @@
196196 // [AK] The F1 texture cannot exceed more than 8 characters.
197197 g_GameModes[GameMode].F1Texture.Truncate( 8 );
198198 }
199+ else if (0 == stricmp (sc.String, "welcomesound"))
200+ {
201+ sc.MustGetString();
202+ g_GameModes[GameMode].WelcomeSound = sc.String;
203+ }
199204 else if ((0 == stricmp (sc.String, "gamesettings")) || (0 == stricmp (sc.String, "lockedgamesettings")))
200205 {
201206 GAMEMODE_ParseGameSettingBlock( sc, GameMode, !stricmp( sc.String, "lockedgamesettings" ));
@@ -423,6 +428,16 @@
423428
424429 //*****************************************************************************
425430 //
431+const char *GAMEMODE_GetWelcomeSound( GAMEMODE_e GameMode )
432+{
433+ if ( GameMode >= NUM_GAMEMODES )
434+ return ( NULL );
435+
436+ return ( g_GameModes[GameMode].WelcomeSound.GetChars( ));
437+}
438+
439+//*****************************************************************************
440+//
426441 int GAMEMODE_GetFlagsetMask( GAMEMODE_e GameMode, FIntCVar *Flagset, bool bLocked )
427442 {
428443 ULONG ulMask = bLocked ? FLAGSET_LOCKEDMASK : FLAGSET_MASK;
diff -r 36def6dbea37 -r 3d2e9c004bfb src/gamemode.h
--- a/src/gamemode.h Thu Sep 22 08:47:41 2022 -0400
+++ b/src/gamemode.h Thu Sep 22 09:00:48 2022 -0400
@@ -166,6 +166,9 @@
166166 // this game mode.
167167 FString F1Texture;
168168
169+ // [AK] The announcer sound (e.g. "welcome to...") that plays at the start of a level.
170+ FString WelcomeSound;
171+
169172 // [AK] All of the gameplay or compatibility flags we set for this game mode
170173 // (dmflags, compatflags, lmsallowedweapons, lmsspectatorsettings, etc.).
171174 LONG lFlagsets[NUM_FLAGSETS][3];
@@ -185,6 +188,7 @@
185188 const char *GAMEMODE_GetName( GAMEMODE_e GameMode );
186189 const char *GAMEMODE_GetCurrentName( void );
187190 const char *GAMEMODE_GetF1Texture( GAMEMODE_e GameMode );
191+const char *GAMEMODE_GetWelcomeSound( GAMEMODE_e GameMode );
188192 int GAMEMODE_GetFlagsetMask( GAMEMODE_e GameMode, FIntCVar *Flagset, bool bLocked = false );
189193 int GAMEMODE_GetCurrentFlagsetMask( FIntCVar *Flagset, bool bLocked = false );
190194 void GAMEMODE_DetermineGameMode( void );
diff -r 36def6dbea37 -r 3d2e9c004bfb wadsrc/static/gamemode.txt
--- a/wadsrc/static/gamemode.txt Thu Sep 22 08:47:41 2022 -0400
+++ b/wadsrc/static/gamemode.txt Thu Sep 22 09:00:48 2022 -0400
@@ -173,6 +173,7 @@
173173 Name "Capture the Flag"
174174 ShortName "CTF"
175175 F1Texture "F1_CTF"
176+ WelcomeSound "WelcomeToCTF"
176177 }
177178
178179 // One flag CTF
@@ -187,6 +188,7 @@
187188 Name "1-Flag CTF"
188189 ShortName "1F-CTF"
189190 F1Texture "F1_1FCTF"
191+ WelcomeSound "WelcomeToOneFlagCTF"
190192 }
191193
192194 // Skulltag
@@ -200,6 +202,7 @@
200202 Name "Skulltag"
201203 ShortName "ST"
202204 F1Texture "F1_ST"
205+ WelcomeSound "WelcomeToST"
203206 }
204207
205208 // Domination
Show on old repository browser