35
35
#include " c_tf_objective_resource.h"
36
36
#include " tf_time_panel.h"
37
37
#include " tf_hud_match_status.h"
38
+ #ifdef BDSBASE
39
+ #include " engine/IEngineSound.h"
40
+ #endif
38
41
39
42
#include " tf_gc_client.h"
40
43
#include " tf_lobby_server.h"
@@ -109,7 +112,7 @@ CHudTournament::~CHudTournament()
109
112
{
110
113
m_pPlayerPanelKVs->deleteThis ();
111
114
m_pPlayerPanelKVs = NULL ;
112
- }
115
+ }
113
116
}
114
117
115
118
// -----------------------------------------------------------------------------
@@ -142,6 +145,12 @@ void CHudTournament::PlaySounds( int nTime )
142
145
143
146
bool bCompetitiveMode = TFGameRules () && TFGameRules ()->IsCompetitiveMode ();
144
147
148
+ #ifdef BDSBASE
149
+ bool bAdminCanTalk = gpGlobals->curtime > m_flNextActionTime;
150
+ #else
151
+ bool bAdminCanTalk = true ;
152
+ #endif
153
+
145
154
switch ( nTime )
146
155
{
147
156
case 60 :
@@ -162,32 +171,60 @@ void CHudTournament::PlaySounds( int nTime )
162
171
}
163
172
case 10 :
164
173
{
174
+ #ifdef BDSBASE
175
+ const char * pszEntryName = " " ;
176
+ #endif
165
177
if ( TFGameRules () && TFGameRules ()->IsMannVsMachineMode () )
166
178
{
167
179
if ( TFObjectiveResource ()->GetMannVsMachineWaveCount () >= TFObjectiveResource ()->GetMannVsMachineMaxWaveCount () )
168
180
{
181
+ #ifdef BDSBASE
182
+ pszEntryName = UTIL_GetRandomSoundFromEntry (" Announcer.MVM_Final_Wave_Start" );
183
+ #else
169
184
pLocalPlayer->EmitSound ( " Announcer.MVM_Final_Wave_Start" );
185
+ #endif
170
186
}
171
187
else if ( TFObjectiveResource ()->GetMannVsMachineWaveCount () <= 1 )
172
188
{
173
189
if ( GTFGCClientSystem ()->GetLobby () && IsMannUpGroup ( GTFGCClientSystem ()->GetLobby ()->GetMatchGroup () ) )
174
190
{
191
+ #ifdef BDSBASE
192
+ pszEntryName = UTIL_GetRandomSoundFromEntry (" Announcer.MVM_Manned_Up" );
193
+ #else
175
194
pLocalPlayer->EmitSound ( " Announcer.MVM_Manned_Up" );
195
+ #endif
176
196
}
177
197
else
178
198
{
199
+ #ifdef BDSBASE
200
+ pszEntryName = UTIL_GetRandomSoundFromEntry (" Announcer.MVM_First_Wave_Start" );
201
+ #else
179
202
pLocalPlayer->EmitSound ( " Announcer.MVM_First_Wave_Start" );
203
+ #endif
180
204
}
181
205
}
182
206
else
183
207
{
208
+ #ifdef BDSBASE
209
+ pszEntryName = UTIL_GetRandomSoundFromEntry (" Announcer.MVM_Wave_Start" );
210
+ #else
184
211
pLocalPlayer->EmitSound ( " Announcer.MVM_Wave_Start" );
212
+ #endif
185
213
}
186
214
}
187
215
else
188
216
{
217
+ #ifdef BDSBASE
218
+ pszEntryName = UTIL_GetRandomSoundFromEntry (bCompetitiveMode ? " Announcer.CompGame1Begins10Seconds" : " Announcer.RoundBegins10Seconds" );
219
+ #else
189
220
pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGame1Begins10Seconds" : " Announcer.RoundBegins10Seconds" );
221
+ #endif
190
222
}
223
+ #ifdef BDSBASE
224
+ float flDelay = enginesound->GetSoundDuration (pszEntryName); // Pulling sound length
225
+ pLocalPlayer->EmitSound (pszEntryName); // Playing sound
226
+ m_flNextActionTime = gpGlobals->curtime + flDelay; // Determining min time for admin to not talk over herself
227
+ #endif
191
228
break ;
192
229
}
193
230
case 9 :
@@ -227,27 +264,27 @@ void CHudTournament::PlaySounds( int nTime )
227
264
}
228
265
case 5 :
229
266
{
230
- pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins05Seconds" : " Announcer.RoundBegins5Seconds" );
267
+ if (bAdminCanTalk) pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins05Seconds" : " Announcer.RoundBegins5Seconds" );
231
268
break ;
232
269
}
233
270
case 4 :
234
271
{
235
- pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins04Seconds" : " Announcer.RoundBegins4Seconds" );
272
+ if (bAdminCanTalk) pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins04Seconds" : " Announcer.RoundBegins4Seconds" );
236
273
break ;
237
274
}
238
275
case 3 :
239
276
{
240
- pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins03Seconds" : " Announcer.RoundBegins3Seconds" );
277
+ if (bAdminCanTalk) pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins03Seconds" : " Announcer.RoundBegins3Seconds" );
241
278
break ;
242
279
}
243
280
case 2 :
244
281
{
245
- pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins02Seconds" : " Announcer.RoundBegins2Seconds" );
282
+ if (bAdminCanTalk) pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins02Seconds" : " Announcer.RoundBegins2Seconds" );
246
283
break ;
247
284
}
248
285
case 1 :
249
286
{
250
- pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins01Seconds" : " Announcer.RoundBegins1Seconds" );
287
+ if (bAdminCanTalk) pLocalPlayer->EmitSound ( bCompetitiveMode ? " Announcer.CompGameBegins01Seconds" : " Announcer.RoundBegins1Seconds" );
251
288
break ;
252
289
}
253
290
}
0 commit comments