From f3f7345ccde4ef1eb313bf45df69980d8813e5b7 Mon Sep 17 00:00:00 2001 From: Harry Young Date: Wed, 9 Jan 2013 19:27:36 +0100 Subject: [PATCH] Minor fixes to selfdestruct + audio for terminal count Signed-off-by: Harry Young --- code/cgame/cg_draw.c | 25 +++++++++++++++++++++++-- code/game/g_cmds.c | 4 +--- code/game/g_target.c | 4 +--- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/code/cgame/cg_draw.c b/code/cgame/cg_draw.c index 0b564e3..096cd56 100644 --- a/code/cgame/cg_draw.c +++ b/code/cgame/cg_draw.c @@ -1852,11 +1852,32 @@ static float CG_DrawSelfdestructTimer( void ) { s = va( "%i:%i%i.%i", mins, tens, seconds, remainder ); - w = UI_ProportionalStringWidth("SELF-DESTRTUCT IN",UI_SMALLFONT); - UI_DrawProportionalString(320 - (w / 2), 10, "SELF-DESTRTUCT IN", UI_SMALLFONT, colorTable[CT_RED]); + w = UI_ProportionalStringWidth("SELF-DESTRUCT IN",UI_SMALLFONT); + UI_DrawProportionalString(320 - (w / 2), 10, "SELF-DESTRUCT IN", UI_SMALLFONT, colorTable[CT_RED]); w = UI_ProportionalStringWidth(s,UI_SMALLFONT); UI_DrawProportionalString(320 - (w / 2), 30, s, UI_SMALLFONT, colorTable[CT_RED]); + + if((10000 - 0.5 * cg.frametime) < msec && msec < (10000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/10sec.mp3" ) ); + if((9000 - 0.5 * cg.frametime) < msec && msec < (9000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/9sec.mp3" ) ); + if((8000 - 0.5 * cg.frametime) < msec && msec < (8000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/8sec.mp3" ) ); + if((7000 - 0.5 * cg.frametime) < msec && msec < (7000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/7sec.mp3" ) ); + if((6000 - 0.5 * cg.frametime) < msec && msec < (6000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/6sec.mp3" ) ); + if((5000 - 0.5 * cg.frametime) < msec && msec < (5000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/5sec.mp3" ) ); + if((4000 - 0.5 * cg.frametime) < msec && msec < (4000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/4sec.mp3" ) ); + if((3000 - 0.5 * cg.frametime) < msec && msec < (3000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/3sec.mp3" ) ); + if((2000 - 0.5 * cg.frametime) < msec && msec < (2000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/2sec.mp3" ) ); + if((1000 - 0.5 * cg.frametime) < msec && msec < (1000 + 0.5 * cg.frametime)) + trap_S_StartSound (NULL, cg.snap->ps.clientNum, CHAN_AUTO, trap_S_RegisterSound( "sound/voice/computer/voy3/1sec.mp3" ) ); } diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index e5ab14e..0f0e923 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -5850,9 +5850,7 @@ static void Cmd_selfdestruct_f(gentity_t *ent) { G_PrintfClient(ent, "safezone: safezone to toggle unsafe at T-50ms. Only for maps with multiple ships (like rpg_runabout). Set NULL to skip."); G_PrintfClient(ent, "target: Optional Argument for Effects to fire once the countdown hist 0. The entity will automatically shake everyones screen and kill all clients outside an active target_safezone."); G_PrintfClient(ent, "\n^3Usage: selfdestruct remaining"); - G_PrintfClient(ent, "This will give out the remaining countdown-time to the activating client if the count is muted. It is free to use for all client."); - G_PrintfClient(ent, "\n^3Usage: selfdestruct remaining global"); - G_PrintfClient(ent, "This will give out the remaining countdown-time to all clients if the count is muted. Calling this is restricted to admins"); + G_PrintfClient(ent, "This will give out the remaining countdown-time to all clients if the count is muted."); G_PrintfClient(ent, "\n^3Usage: selfdestruct abort"); G_PrintfClient(ent, "This will abort any self destruct running"); return; diff --git a/code/game/g_target.c b/code/game/g_target.c index 2a2298f..702cb8c 100644 --- a/code/game/g_target.c +++ b/code/game/g_target.c @@ -2804,8 +2804,6 @@ void target_selfdestruct_think(gentity_t *ent) { G_AddEvent(ent, EV_GLOBAL_SOUND, G_SoundIndex("sound/weapons/explosions/explode2.wav")); //let's be shakey for a sec... I hope lol ^^ trap_SetConfigstring( CS_CAMERA_SHAKE, va( "%i %i", 9999, ( 1000 + ( level.time - level.startTime ) ) ) ); - //let's clear the lower right corner - trap_SendServerCommand( -1, va("servermsg \" \"")); } if(ent->target) G_UseTargets(ent, ent); @@ -2865,7 +2863,7 @@ void SP_target_selfdestruct(gentity_t *ent) { if(ETAsec / 10 < 1) //get leading 0 for secs trap_SendServerCommand( -1, va("servermsg \"^1Self Destruct in %.0f:0%.0f\"", ETAmin, ETAsec )); else - trap_SendServerCommand( -1, va("servermsg \"^1Self Destruct in %.0f:0%.0f\"", ETAmin, ETAsec )); + trap_SendServerCommand( -1, va("servermsg \"^1Self Destruct in %.0f:%.0f\"", ETAmin, ETAsec )); else if(ETAsec / 10 < 1) //get leading 0 for secs trap_SendServerCommand( -1, va("servermsg \"^1Self Destruct in %.0f:0%.0f; There will be no ^1further audio warnings.\"", ETAmin, ETAsec ));