]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nades/nades.qc
Show nade throw message when it explodes while holding it in hand.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nades / nades.qc
index c6a853d0e11bf02ac8a7ee8c540870d88097d2e4..67e3d4ad1c02ccb86afa812b194ada6bf25e43c2 100644 (file)
@@ -10,6 +10,9 @@ float autocvar_g_nades_spread = 0.04;
 REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
 
 #ifdef GAMEQC
+REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
+REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
+
 entity Nade_TrailEffect(int proj, int nade_team)
 {
     switch (proj)
@@ -1033,7 +1036,7 @@ void nades_GiveBonus(entity player, float score)
                if ( STAT(NADE_BONUS_SCORE, player) >= 1 )
                {
                        Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_NADE_BONUS);
-                       play2(player, SND(KH_ALARM));
+                       play2(player, SND(NADE_BONUS));
                        STAT(NADE_BONUS, player)++;
                        STAT(NADE_BONUS_SCORE, player) -= 1;
                }
@@ -1186,7 +1189,6 @@ void nades_CheckThrow(entity this)
                this.nade_altbutton = true;
                if(time > this.nade_refire)
                {
-                       Send_Notification(NOTIF_ONE, this, MSG_CENTER, CENTER_NADE_THROW);
                        nade_prime(this);
                        this.nade_refire = time + autocvar_g_nades_nade_refire;
                }
@@ -1291,7 +1293,10 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
                held_nade.angles_y = player.angles.y;
 
                if (time + 0.1 >= held_nade.wait)
+               {
                        toss_nade(player, false, '0 0 0', time + 0.05);
+                       Send_Notification(NOTIF_ONE, player, MSG_CENTER, CENTER_NADE_THROW);
+               }
        }
 
        if(IS_PLAYER(player))
@@ -1450,7 +1455,6 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST)
        {
                float killcount_bonus = ((CS(frag_attacker).killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * CS(frag_attacker).killcount, autocvar_g_nades_bonus_score_medium) 
                                                                                                                                        : autocvar_g_nades_bonus_score_minor);
-
                if (SAME_TEAM(frag_attacker, frag_target) || frag_attacker == frag_target)
                        nades_RemoveBonus(frag_attacker);
                else if(GameRules_scoring_is_vip(frag_target))
@@ -1546,9 +1550,6 @@ MUTATOR_HOOKFUNCTION(nades, SpectateCopy)
        STAT(VEIL_ORB_ALPHA, client) = STAT(VEIL_ORB_ALPHA, spectatee);
 }
 
-REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
-REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
-
 MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
 {
        M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");