]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator_nix.qc
Unify boolean constants
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator_nix.qc
index 4603a1cca785d0a33a860276cbc362cdfcca26de..ee337b50ae556e80d649472baa3706642caea515 100644 (file)
@@ -1,4 +1,4 @@
-float g_nix_with_laser;
+float g_nix_with_blaster;
 // WEAPONTODO
 float nix_weapon;
 float nix_nextchange;
@@ -12,22 +12,22 @@ float NIX_CanChooseWeapon(float wpn)
        entity e;
        e = get_weaponinfo(wpn);
        if(!e.weapon) // skip dummies
-               return FALSE;
+               return false;
        if(g_weaponarena)
        {
                if(!(g_weaponarena_weapons & WepSet_FromWeapon(wpn)))
-                       return FALSE;
+                       return false;
        }
        else
        {
-               if(wpn == WEP_BLASTER && g_nix_with_laser) // WEAPONTODO: rename to g_nix_with_blaster
-                       return FALSE;
+               if(wpn == WEP_BLASTER && g_nix_with_blaster) // WEAPONTODO: rename to g_nix_with_blaster
+                       return false;
                if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
-                       return FALSE;
+                       return false;
                if (!(e.spawnflags & WEP_FLAG_NORMAL))
-                       return FALSE;
+                       return false;
        }
-       return TRUE;
+       return true;
 }
 void NIX_ChooseNextWeapon()
 {
@@ -64,7 +64,7 @@ void NIX_GiveCurrentWeapon()
 
        if(nix_nextchange != self.nix_lastchange_id) // this shall only be called once per round!
        {
-               self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = self.ammo_fuel = 0;
+               self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = self.ammo_plasma = self.ammo_fuel = 0;
                
                if(self.items & IT_UNLIMITED_WEAPON_AMMO)
                {
@@ -74,6 +74,7 @@ void NIX_GiveCurrentWeapon()
                                case ammo_nails:   self.ammo_nails   = autocvar_g_pickup_nails_max;   break;
                                case ammo_rockets: self.ammo_rockets = autocvar_g_pickup_rockets_max; break;
                                case ammo_cells:   self.ammo_cells   = autocvar_g_pickup_cells_max;   break;
+                               case ammo_plasma:  self.ammo_plasma  = autocvar_g_pickup_plasma_max;   break;
                                case ammo_fuel:    self.ammo_fuel    = autocvar_g_pickup_fuel_max;    break;
                        }
                }
@@ -85,6 +86,7 @@ void NIX_GiveCurrentWeapon()
                                case ammo_nails:   self.ammo_nails   = autocvar_g_balance_nix_ammo_nails;   break;
                                case ammo_rockets: self.ammo_rockets = autocvar_g_balance_nix_ammo_rockets; break;
                                case ammo_cells:   self.ammo_cells   = autocvar_g_balance_nix_ammo_cells;   break;
+                               case ammo_plasma:  self.ammo_plasma  = autocvar_g_balance_nix_ammo_plasma;   break;
                                case ammo_fuel:    self.ammo_fuel    = autocvar_g_balance_nix_ammo_fuel;    break;
                        }
                }
@@ -101,7 +103,7 @@ void NIX_GiveCurrentWeapon()
                if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                        self.(weapon_load[nix_weapon]) = e.reloading_ammo;
 
-               // nex too
+               // vortex too
                if(WEP_CVAR(vortex, charge))
                {
                        if(WEP_CVAR_SEC(vortex, chargepool))
@@ -127,6 +129,7 @@ void NIX_GiveCurrentWeapon()
                        case ammo_nails:   self.ammo_nails   += autocvar_g_balance_nix_ammoincr_nails;   break;
                        case ammo_rockets: self.ammo_rockets += autocvar_g_balance_nix_ammoincr_rockets; break;
                        case ammo_cells:   self.ammo_cells   += autocvar_g_balance_nix_ammoincr_cells;   break;
+                       case ammo_plasma:  self.ammo_plasma  += autocvar_g_balance_nix_ammoincr_plasma;   break;
                        case ammo_fuel:    self.ammo_fuel    += autocvar_g_balance_nix_ammoincr_fuel;    break;
                }
 
@@ -134,13 +137,13 @@ void NIX_GiveCurrentWeapon()
        }
 
        self.weapons = '0 0 0';
-       if(g_nix_with_laser)
-               self.weapons &= ~WEPSET_BLASTER;
+       if(g_nix_with_blaster)
+               self.weapons |= WEPSET_BLASTER;
        self.weapons |= WepSet_FromWeapon(nix_weapon);
 
        if(self.switchweapon != nix_weapon)
-               if(!client_hasweapon(self, self.switchweapon, TRUE, FALSE))
-                       if(client_hasweapon(self, nix_weapon, TRUE, FALSE))
+               if(!client_hasweapon(self, self.switchweapon, true, false))
+                       if(client_hasweapon(self, nix_weapon, true, false))
                                W_SwitchWeapon(nix_weapon);
 }
 
@@ -236,7 +239,7 @@ MUTATOR_DEFINITION(mutator_nix)
 
        MUTATOR_ONADD
        {
-               g_nix_with_laser = autocvar_g_nix_with_laser;
+               g_nix_with_blaster = autocvar_g_nix_with_blaster;
 
                nix_nextchange = 0;
                nix_nextweapon = 0;
@@ -256,12 +259,13 @@ MUTATOR_DEFINITION(mutator_nix)
                FOR_EACH_PLAYER(e) if(e.deadflag == DEAD_NO)
                {
                        e.ammo_cells = start_ammo_cells;
+                       e.ammo_plasma = start_ammo_plasma;
                        e.ammo_shells = start_ammo_shells;
                        e.ammo_nails = start_ammo_nails;
                        e.ammo_rockets = start_ammo_rockets;
                        e.ammo_fuel = start_ammo_fuel;
                        e.weapons = start_weapons;
-                       if(!client_hasweapon(e, e.weapon, TRUE, FALSE))
+                       if(!client_hasweapon(e, e.weapon, true, false))
                                e.switchweapon = w_getbestweapon(self);
                }
        }