]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
also make minstanex a superweapon
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index 298fd47e3c4f7273d3d461d14bf8ba041109bfc2..40b82224b02966f8d78c5902c2ea0ad4571e58fc 100644 (file)
@@ -474,6 +474,7 @@ void PutObserverInServer (void)
        self.pain_finished = 0;
        self.strength_finished = 0;
        self.invincible_finished = 0;
+       self.superweapons_finished = 0;
        self.pushltime = 0;
        self.think = SUB_Null;
        self.nextthink = 0;
@@ -750,6 +751,11 @@ void PutClientInServer (void)
                        self.weapons = start_weapons;
                }
 
+               if(self.weapons & WEPBIT_SUPERWEAPONS) // exception for minstagib, as minstanex is a superweapon
+                       self.superweapons_finished = time + autocvar_g_balance_superweapons_time;
+               else
+                       self.superweapons_finished = 0;
+
                if(g_weaponarena_random)
                {
                        if(g_weaponarena_random_with_laser)
@@ -1887,6 +1893,31 @@ void player_powerups (void)
                                sprint(self, "^3Shield surrounds you\n");
                        }
                }
+               if (self.items & IT_SUPERWEAPON)
+               {
+                       play_countdown(self.superweapons_finished, "misc/poweroff.wav");
+                       self.effects = self.effects | EF_RED;
+                       if (self.items & IT_UNLIMITED_SUPERWEAPONS)
+                       {
+                               // don't let them run out
+                       }
+                       else if (time > self.superweapons_finished)
+                       {
+                               self.items = self.items - (self.items & IT_SUPERWEAPON);
+                               self.weapons &~= WEPBIT_SUPERWEAPONS;
+                               sprint(self, "^3Superweapons have broken down\n");
+                       }
+               }
+               else
+               {
+                       if (time < self.superweapons_finished)
+                       {
+                               self.items = self.items | IT_SUPERWEAPON;
+                               sprint(self, "^3You now have a superweapon\n");
+                       }
+                       else
+                               self.weapons &~= WEPBIT_SUPERWEAPONS; // just in case
+               }
        }
        
        if(autocvar_g_nodepthtestplayers)