Add g_pickup_ammo/weapons_anyway functionality
authorsamual <samual@samual-desktop.(none)>
Fri, 21 May 2010 09:27:23 +0000 (05:27 -0400)
committersamual <samual@samual-desktop.(none)>
Fri, 21 May 2010 09:27:23 +0000 (05:27 -0400)
balance.cfg
balance25.cfg
balanceSamual.cfg
balanceXPM.cfg
qcsrc/server/miscfunctions.qc
qcsrc/server/t_items.qc

index dbe328c7af37795a5b215571678250be29cba85d..cb58e9a14e563876567ed9accf0ebb85b4e2b5c3 100644 (file)
@@ -52,6 +52,8 @@ set g_balance_nix_ammoincr_fuel 2
 // }}}
 
 // {{{ pickup items
+set g_pickup_ammo_anyway 0
+set g_pickup_weapons_anyway 0
 set g_pickup_shells 30
 set g_pickup_shells_max 120
 set g_pickup_nails 80
index e1079db5fb3a75343621a655f8b7681591050a69..a4369249fad75c47203fb17c752354c91dcf8677 100644 (file)
@@ -52,6 +52,8 @@ set g_balance_nix_ammoincr_fuel 2
 // }}}
 
 // {{{ pickup items
+set g_pickup_ammo_anyway 0
+set g_pickup_weapons_anyway 0
 set g_pickup_shells 15
 set g_pickup_shells_max 999
 set g_pickup_nails 80
index dd2bd1cd104fa370c279cc42fb1c5101adee7569..21242f16f0364632fbd0eaeb42bf0fba6d854283 100644 (file)
@@ -52,6 +52,8 @@ set g_balance_nix_ammoincr_fuel 2
 // }}}
 
 // {{{ pickup items
+set g_pickup_ammo_anyway 1
+set g_pickup_weapons_anyway 1
 set g_pickup_shells 30
 set g_pickup_shells_max 120
 set g_pickup_nails 80
index b89adf56886b34f09ebe1b5b3f63c61990e5e7f4..bb0416a3418daac9523bfc87c806ba0c4054d29c 100644 (file)
@@ -52,6 +52,8 @@ set g_balance_nix_ammoincr_fuel 2
 // }}}
 
 // {{{ pickup items
+set g_pickup_ammo_anyway 0
+set g_pickup_weapons_anyway 0
 set g_pickup_shells 10
 set g_pickup_shells_max 30
 set g_pickup_nails 30
index ebb3ee1444a9a660a45e234c5e23ed57ac06717e..c54235d2cbdbc1a8ffe493209a72a4681cda8f5c 100644 (file)
@@ -847,6 +847,8 @@ float g_pickup_healthlarge_anyway;
 float g_pickup_healthmega;
 float g_pickup_healthmega_max;
 float g_pickup_healthmega_anyway;
+float g_pickup_ammo_anyway;
+float g_pickup_weapons_anyway;
 float g_weaponarena;
 float g_weaponarena_random;
 string g_weaponarena_list;
@@ -1293,6 +1295,9 @@ void readlevelcvars(void)
        g_pickup_healthmega_max = cvar("g_pickup_healthmega_max");
        g_pickup_healthmega_anyway = cvar("g_pickup_healthmega_anyway");
 
+       g_pickup_ammo_anyway = cvar("g_pickup_ammo_anyway");
+       g_pickup_weapons_anyway = cvar("g_pickup_weapons_anyway");
+
        g_pinata = cvar("g_pinata");
 
        g_weapon_stay = cvar("g_weapon_stay");
index ee56acc9ca696b95ede26343e20d08a80a98a955..cb8f0b1025bd204260b6ea396918afad7e890268 100644 (file)
@@ -326,7 +326,7 @@ float Item_GiveTo(entity item, entity player)
                        }
 
                        if (item.ammo_fuel)
-                       if (player.ammo_fuel < g_pickup_fuel_max)
+                       if (player.ammo_fuel < g_pickup_fuel_max) 
                        {
                                pickedup = TRUE;
                                player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
@@ -365,31 +365,31 @@ float Item_GiveTo(entity item, entity player)
                if(item.spawnshieldtime)
                {
                        if (item.ammo_shells)
-                       if (player.ammo_shells < g_pickup_shells_max)
+                       if ((player.ammo_shells < g_pickup_shells_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
                                player.ammo_shells = min (player.ammo_shells + item.ammo_shells, g_pickup_shells_max);
                        }
                        if (item.ammo_nails)
-                       if (player.ammo_nails < g_pickup_nails_max)
+                       if ((player.ammo_nails < g_pickup_nails_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
                                player.ammo_nails = min (player.ammo_nails + item.ammo_nails, g_pickup_nails_max);
                        }
                        if (item.ammo_rockets)
-                       if (player.ammo_rockets < g_pickup_rockets_max)
+                       if ((player.ammo_rockets < g_pickup_rockets_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
                                player.ammo_rockets = min (player.ammo_rockets + item.ammo_rockets, g_pickup_rockets_max);
                        }
                        if (item.ammo_cells)
-                       if (player.ammo_cells < g_pickup_cells_max)
+                       if ((player.ammo_cells < g_pickup_cells_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
                                player.ammo_cells = min (player.ammo_cells + item.ammo_cells, g_pickup_cells_max);
                        }
                        if (item.ammo_fuel)
-                       if (player.ammo_fuel < g_pickup_fuel_max)
+                       if ((player.ammo_fuel < g_pickup_fuel_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
                                player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
@@ -398,7 +398,7 @@ float Item_GiveTo(entity item, entity player)
                }
 
                if (item.flags & FL_WEAPON)
-               if ((it = item.weapons - (item.weapons & player.weapons)))
+               if ((it = item.weapons - (item.weapons & player.weapons)) || g_pickup_weapons_anyway)
                {
                        pickedup = TRUE;
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
@@ -1149,6 +1149,8 @@ void spawnfunc_weapon_rocketlauncher (void)
 void spawnfunc_item_rockets (void) {
        if(!self.ammo_rockets)
                self.ammo_rockets = g_pickup_rockets;
+       if(!self.pickup_anyway)
+               self.pickup_anyway = g_pickup_ammo_anyway;
        StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "rockets", IT_ROCKETS, 0, 0, commodity_pickupevalfunc, 3000);
 }
 
@@ -1166,12 +1168,16 @@ void spawnfunc_item_bullets (void) {
 
        if(!self.ammo_nails)
                self.ammo_nails = g_pickup_nails;
+       if(!self.pickup_anyway)
+               self.pickup_anyway = g_pickup_ammo_anyway;
        StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "bullets", IT_NAILS, 0, 0, commodity_pickupevalfunc, 2000);
 }
 
 void spawnfunc_item_cells (void) {
        if(!self.ammo_cells)
                self.ammo_cells = g_pickup_cells;
+       if(!self.pickup_anyway)
+               self.pickup_anyway = g_pickup_ammo_anyway;
        StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "cells", IT_CELLS, 0, 0, commodity_pickupevalfunc, 2000);
 }
 
@@ -1188,6 +1194,8 @@ void spawnfunc_item_shells (void) {
 
        if(!self.ammo_shells)
                self.ammo_shells = g_pickup_shells;
+       if(!self.pickup_anyway)
+               self.pickup_anyway = g_pickup_ammo_anyway;
        StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "shells", IT_SHELLS, 0, 0, commodity_pickupevalfunc, 500);
 }
 
@@ -1477,6 +1485,8 @@ void spawnfunc_item_fuel(void)
 {
        if(!self.ammo_fuel)
                self.ammo_fuel = g_pickup_fuel;
+       if(!self.pickup_anyway)
+               self.pickup_anyway = g_pickup_ammo_anyway;
        StartItem ("models/items/g_fuel.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "Fuel", IT_FUEL, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 }