From f3a894e1574da620879e4eacd0c403eed0c84bfb Mon Sep 17 00:00:00 2001 From: z411 Date: Tue, 2 Jun 2020 15:24:26 -0400 Subject: [PATCH] Overtime and sound changes --- qcsrc/client/hud/panel/timer.qc | 5 +++++ qcsrc/client/view.qc | 8 +++++++- qcsrc/common/notifications/all.inc | 3 +++ qcsrc/common/sounds/all.inc | 4 ++++ qcsrc/common/stats.qh | 2 ++ qcsrc/server/command/common.qc | 1 + qcsrc/server/g_damage.qc | 2 ++ qcsrc/server/g_world.qc | 6 ++++++ qcsrc/server/g_world.qh | 2 +- 9 files changed, 31 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/hud/panel/timer.qc b/qcsrc/client/hud/panel/timer.qc index 8bb4ade6a..98905faf6 100644 --- a/qcsrc/client/hud/panel/timer.qc +++ b/qcsrc/client/hud/panel/timer.qc @@ -81,6 +81,11 @@ void HUD_Timer() else timer = seconds_tostring(timeleft); } + + if(STAT(OVERTIMESADDED) >= 1) + { + timer = sprintf("%s (OT #%d)", timer, floor(STAT(OVERTIMESADDED))); + } drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 9a753f5ff..c349d2af5 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -991,7 +991,7 @@ void HitSound() float kill_time = STAT(KILL_TIME); if (COMPARE_INCREASING(kill_time, kill_time_prev) > autocvar_cl_hitsound_antispam_time) { - sound(NULL, CH_INFO, SND_KILL, VOL_BASE, ATTN_NONE); + sound(NULL, CH_INFO, SND_KILL, VOL_BASE * 1.15, ATTN_NONE); kill_time_prev = kill_time; } } @@ -1939,6 +1939,12 @@ void HUD_Damage() myhealth_flash += autocvar_hud_damage_fade_rate * frametime; // dead } } + + if(myhealth_prev > 1 && myhealth <= 0 && !intermission) + { + // Just died + sound(NULL, CH_INFO, SND_DEATH, VOL_BASE, ATTN_NONE); + } if(spectatee_status == -1 || intermission) { diff --git a/qcsrc/common/notifications/all.inc b/qcsrc/common/notifications/all.inc index a9a2ee655..beb05d959 100644 --- a/qcsrc/common/notifications/all.inc +++ b/qcsrc/common/notifications/all.inc @@ -201,6 +201,9 @@ MSG_ANNCE_NOTIF(REMAINING_MIN_5, N__ALWAYS, "5minutesremain", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) MSG_ANNCE_NOTIF(TIMEOUT, N__ALWAYS, "timeoutcalled", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(OVERTIME, N__ALWAYS, "overtime", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(SUICIDE, N_GNTLOFF, "suicide", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) + MSG_ANNCE_NOTIF(ACCIDENT, N_GNTLOFF, "accident", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) MSG_ANNCE_NOTIF(VOTE_ACCEPT, N__ALWAYS, "voteaccept", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) MSG_ANNCE_NOTIF(VOTE_CALL, N__ALWAYS, "votecall", CH_INFO, VOL_BASEVOICE, ATTEN_NONE) diff --git a/qcsrc/common/sounds/all.inc b/qcsrc/common/sounds/all.inc index 58b145a4c..55e1da882 100644 --- a/qcsrc/common/sounds/all.inc +++ b/qcsrc/common/sounds/all.inc @@ -271,6 +271,10 @@ Sound SND_GIB_SPLAT_RANDOM() { SOUND(HIT, "misc/hit"); SOUND(TYPEHIT, "misc/typehit"); SOUND(KILL, "misc/kill"); +SOUND(DEATH, "misc/death"); +SOUND(ENDMATCH, "misc/endmatch"); +SOUND(OVERTIME, "misc/overtime"); +SOUND(TIMEOUT, "misc/timeout"); SOUND(SPAWN, "misc/spawn"); diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index c77ca16be..90993d728 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -65,6 +65,7 @@ float W_WeaponRateFactor(entity this); float game_stopped; float game_starttime; float round_starttime; +float checkrules_overtimesadded; // z411 add bool autocvar_g_allow_oldvortexbeam; int autocvar_leadlimit; #endif @@ -104,6 +105,7 @@ REGISTER_STAT(SECRETS_TOTAL, float) REGISTER_STAT(SECRETS_FOUND, float) REGISTER_STAT(RESPAWN_TIME, float) REGISTER_STAT(ROUNDSTARTTIME, float, round_starttime) +REGISTER_STAT(OVERTIMESADDED, float, checkrules_overtimesadded) REGISTER_STAT(MONSTERS_TOTAL, int) REGISTER_STAT(MONSTERS_KILLED, int) REGISTER_STAT(BUFFS, int) diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index f791446eb..b78222505 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -753,6 +753,7 @@ void CommonCommand_timeout(int request, entity caller) // DEAR GOD THIS COMMAND setthink(timeout_handler, timeout_handler_think); timeout_handler.nextthink = time; // always let the entity think asap + sound(NULL, CH_INFO, SND_TIMEOUT, VOL_BASE, ATTN_NONE); Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_TIMEOUT); } } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index e5363db77..ce3807503 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -281,6 +281,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en return; } LogDeath("suicide", deathtype, targ, targ); + Send_Notification(NOTIF_ONE, targ, MSG_ANNCE, ANNCE_SUICIDE); if(deathtype != DEATH_AUTOTEAMCHANGE.m_id) // special case: don't negate frags if auto switched GiveFrags(attacker, targ, -1, deathtype, weaponentity); } @@ -445,6 +446,7 @@ void Obituary(entity attacker, entity inflictor, entity targ, int deathtype, .en } LogDeath("accident", deathtype, targ, targ); + Send_Notification(NOTIF_ONE, targ, MSG_ANNCE, ANNCE_ACCIDENT); GiveFrags(targ, targ, -1, deathtype, weaponentity); if(GameRules_scoring_add(targ, SCORE, 0) == -5) diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 511a448b4..a7b071fcd 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1585,6 +1585,8 @@ void NextLevel() */ //pos = FindIntermission (); + + sound(NULL, CH_INFO, SND_ENDMATCH, VOL_BASE, ATTN_NONE); VoteReset(); @@ -1651,6 +1653,10 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true //add one more overtime by simply extending the timelimit cvar_set("timelimit", ftos(autocvar_timelimit + autocvar_timelimit_overtime)); Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60); + + sound(NULL, CH_INFO, SND_OVERTIME, VOL_BASE, ATTN_NONE); + if(checkrules_overtimesadded == 1) + Send_Notification(NOTIF_ALL, NULL, MSG_ANNCE, ANNCE_OVERTIME); } float GetWinningCode(float fraglimitreached, float equality) diff --git a/qcsrc/server/g_world.qh b/qcsrc/server/g_world.qh index da950f185..f2a3ceeb7 100644 --- a/qcsrc/server/g_world.qh +++ b/qcsrc/server/g_world.qh @@ -3,7 +3,7 @@ float checkrules_equality; float checkrules_suddendeathwarning; float checkrules_suddendeathend; -float checkrules_overtimesadded; //how many overtimes have been already added +//float checkrules_overtimesadded; //how many overtimes have been already added string cache_mutatormsg; string cache_lastmutatormsg; -- 2.39.2