]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an announcement for the headshot
authorMario <mario.mario@y7mail.com>
Wed, 3 Jun 2020 11:03:03 +0000 (21:03 +1000)
committerMario <mario.mario@y7mail.com>
Wed, 3 Jun 2020 11:03:03 +0000 (21:03 +1000)
notifications.cfg
qcsrc/common/notifications/all.inc
qcsrc/server/weapons/tracing.qc

index 41f0706ea3d72f95c1d2b4180c3a27d5dd6232ad..10f2f8b03049f4ba921c48f5465322b6eeff41a3 100644 (file)
@@ -20,6 +20,7 @@ seta notification_ANNCE_ACHIEVEMENT_ELECTROBITCH "2" "0 = disabled, 1 = enabled
 seta notification_ANNCE_ACHIEVEMENT_IMPRESSIVE "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_ACHIEVEMENT_YODA "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_BEGIN "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
+seta notification_ANNCE_HEADSHOT "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_INSTAGIB_LASTSECOND "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_INSTAGIB_NARROWLY "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_INSTAGIB_TERMINATED "1" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
index a9a2ee655139555dfc70bb72ae875d9fc2061a28..2c6a16d88f81b90d4b984c43effc5f663f70dcfd 100644 (file)
 
     MSG_ANNCE_NOTIF(BEGIN,                      N__ALWAYS, "begin",             CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
 
+    MSG_ANNCE_NOTIF(HEADSHOT,                   N__ALWAYS, "headshot",          CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
+
     MSG_ANNCE_NOTIF(KILLSTREAK_03,              N_GNTLOFF, "03kills",           CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
     MSG_ANNCE_NOTIF(KILLSTREAK_05,              N_GNTLOFF, "05kills",           CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
     MSG_ANNCE_NOTIF(KILLSTREAK_10,              N_GNTLOFF, "10kills",           CH_INFO, VOL_BASEVOICE, ATTEN_NONE)
index b1dbd5d596ef11ceee774920c046633ed4207536..508f91be7821c808a90625da29c821de83a63043 100644 (file)
@@ -364,6 +364,7 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
 
        WarpZone_trace_forent = this;
 
+       bool headshot = false; // indicates that one of the hit targets was a headshot
        for (;;)
        {
                WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, false, WarpZone_trace_forent, NULL, fireBullet_trace_callback);
@@ -414,7 +415,7 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
                        if(headshot_multiplier && Headshot(hit, this, start, end))
                        {
                                damage *= headshot_multiplier;
-                               // TODO: sound/announcement
+                               headshot = true;
                        }
                        bool gooddamage = accuracy_isgooddamage(this, hit);
                        Damage(hit, this, this, damage * damage_fraction, dtype, weaponentity, start, force * dir * damage_fraction);
@@ -475,6 +476,9 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
                        Damage_DamageInfo(start, 0, 0, 0, max(1, force) * normalize(dir) * -damage_fraction, dtype, 0, this);
        }
 
+       if(headshot)
+               Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_HEADSHOT);
+
        if(lag)
                antilag_restore_all(this);