]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a new ammo type: plasma
authorMario <mario.mario@y7mail.com>
Sat, 22 Mar 2014 08:14:35 +0000 (19:14 +1100)
committerMario <mario.mario@y7mail.com>
Sat, 22 Mar 2014 08:14:35 +0000 (19:14 +1100)
24 files changed:
balance-xonotic.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/common/constants.qh
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_vortex.qc
qcsrc/common/weapons/weapons.qc
qcsrc/common/weapons/weapons.qh
qcsrc/server/autocvars.qh
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/t_items.qc
qcsrc/server/t_items.qh
qcsrc/server/t_quake3.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/throwing.qc

index 76a7b4f985d2ff8afcdc40e6b93fa71d75145fd3..23d4c774eac37e2308e4c966e01138747b8552bf 100644 (file)
@@ -21,6 +21,7 @@ set g_start_ammo_shells 15
 set g_start_ammo_nails 0
 set g_start_ammo_rockets 0
 set g_start_ammo_cells 0
+set g_start_ammo_plasma 0
 set g_start_ammo_fuel 0
 set g_warmup_start_health 100 "starting values when being in warmup-stage"
 set g_warmup_start_armor 100 "starting values when being in warmup-stage"
@@ -28,6 +29,7 @@ set g_warmup_start_ammo_shells 30 "starting values when being in warmup-stage"
 set g_warmup_start_ammo_nails 160 "starting values when being in warmup-stage"
 set g_warmup_start_ammo_rockets 80 "starting values when being in warmup-stage"
 set g_warmup_start_ammo_cells 90 "starting values when being in warmup-stage"
+set g_warmup_start_ammo_plasma 90 "starting values when being in warmup-stage"
 set g_warmup_start_ammo_fuel 0 "starting values when being in warmup-stage"
 set g_lms_start_health 200
 set g_lms_start_armor 200
@@ -35,6 +37,7 @@ set g_lms_start_ammo_shells 60
 set g_lms_start_ammo_nails 320
 set g_lms_start_ammo_rockets 160
 set g_lms_start_ammo_cells 180
+set g_lms_start_ammo_plasma 180
 set g_lms_start_ammo_fuel 0
 set g_balance_nix_roundtime 25
 set g_balance_nix_incrtime 1.6
@@ -42,11 +45,13 @@ set g_balance_nix_ammo_shells 60
 set g_balance_nix_ammo_nails 320
 set g_balance_nix_ammo_rockets 160
 set g_balance_nix_ammo_cells 180
+set g_balance_nix_ammo_plasma 180
 set g_balance_nix_ammo_fuel 0
 set g_balance_nix_ammoincr_shells 2 // eh this will need figured out later I assume
 set g_balance_nix_ammoincr_nails 6
 set g_balance_nix_ammoincr_rockets 2
 set g_balance_nix_ammoincr_cells 2
+set g_balance_nix_ammoincr_plasma 2
 set g_balance_nix_ammoincr_fuel 2
 // }}}
 
@@ -65,6 +70,9 @@ set g_pickup_rockets_max 160
 set g_pickup_cells 30
 set g_pickup_cells_weapon 30
 set g_pickup_cells_max 180
+set g_pickup_plasma 30
+set g_pickup_plasma_weapon 30
+set g_pickup_plasma_max 180
 set g_pickup_fuel 50
 set g_pickup_fuel_weapon 50
 set g_pickup_fuel_jetpack 100
index 806cd22ce5a8082891074f0513116e94f965e3ed..bb2c6ce091f81fd36a1e6c8baffaaa9e46fe0dd1 100644 (file)
@@ -322,6 +322,7 @@ float autocvar_hud_panel_weapons_ammo;
 float autocvar_hud_panel_weapons_ammo_alpha;
 string autocvar_hud_panel_weapons_ammo_color;
 float autocvar_hud_panel_weapons_ammo_full_cells;
+float autocvar_hud_panel_weapons_ammo_full_plasma;
 float autocvar_hud_panel_weapons_ammo_full_fuel;
 float autocvar_hud_panel_weapons_ammo_full_nails;
 float autocvar_hud_panel_weapons_ammo_full_rockets;
index a6d06d783bf745474c51d9e9c28e116e27d87a13..e52591b0b223ccc22f01dc56cad6b612c10dec06 100644 (file)
@@ -762,6 +762,7 @@ void HUD_Weapons(void)
                                                case ammo_nails:   ammo_full = autocvar_hud_panel_weapons_ammo_full_nails;   break;
                                                case ammo_rockets: ammo_full = autocvar_hud_panel_weapons_ammo_full_rockets; break;
                                                case ammo_cells:   ammo_full = autocvar_hud_panel_weapons_ammo_full_cells;   break;
+                                               case ammo_plasma:  ammo_full = autocvar_hud_panel_weapons_ammo_full_plasma;  break;
                                                case ammo_fuel:    ammo_full = autocvar_hud_panel_weapons_ammo_full_fuel;    break;
                                                default: ammo_full = 60;
                                        }
@@ -924,7 +925,7 @@ void HUD_Ammo(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       const float AMMO_COUNT = 4;
+       const float AMMO_COUNT = 5;
        float rows = 0, columns, row, column;
        vector ammo_size;
        if(autocvar_hud_panel_ammo_onlycurrent)
index c270689b6dccd77b3143d96a469ef03bb5cdda53..ee8a228ed9a7905772e275fa37064056c04e2e54 100644 (file)
@@ -185,6 +185,8 @@ const float STAT_WEAPONS3 = 75;
 const float STAT_MONSTERS_TOTAL = 76;
 const float STAT_MONSTERS_KILLED = 77;
 
+const float STAT_PLASMA = 80;
+
 // mod stats (1xx)
 const float STAT_REDALIVE = 100;
 const float STAT_BLUEALIVE = 101;
index 77ff4026a34b535966eeb0e9128fbbc9c5615503..d7cf63a9d7b0890ceab5fbefb2f1da404195dfce 100644 (file)
@@ -70,7 +70,7 @@ float friend_needshelp(entity e)
        switch(self.skin)
        {
                case 0: return (e.health < autocvar_g_balance_health_regenstable);
-               case 1: return ((e.ammo_cells && e.ammo_cells < g_pickup_cells_max) || (e.ammo_rockets && e.ammo_rockets < g_pickup_rockets_max) || (e.ammo_nails && e.ammo_nails < g_pickup_nails_max) || (e.ammo_shells && e.ammo_shells < g_pickup_shells_max));
+               case 1: return ((e.ammo_cells && e.ammo_cells < g_pickup_cells_max) || (e.ammo_plasma && e.ammo_plasma < g_pickup_plasma_max) || (e.ammo_rockets && e.ammo_rockets < g_pickup_rockets_max) || (e.ammo_nails && e.ammo_nails < g_pickup_nails_max) || (e.ammo_shells && e.ammo_shells < g_pickup_shells_max));
                case 2: return (e.armorvalue < autocvar_g_balance_armor_regenstable);
                case 3: return (e.health > 0);
        }
@@ -209,6 +209,7 @@ void mage_heal()
                                        break;
                                case 1:
                                        if(head.ammo_cells) head.ammo_cells = bound(head.ammo_cells, head.ammo_cells + 1, g_pickup_cells_max);
+                                       if(head.ammo_plasma) head.ammo_plasma = bound(head.ammo_plasma, head.ammo_plasma + 1, g_pickup_plasma_max);
                                        if(head.ammo_rockets) head.ammo_rockets = bound(head.ammo_rockets, head.ammo_rockets + 1, g_pickup_rockets_max);
                                        if(head.ammo_shells) head.ammo_shells = bound(head.ammo_shells, head.ammo_shells + 2, g_pickup_shells_max);
                                        if(head.ammo_nails) head.ammo_nails = bound(head.ammo_nails, head.ammo_nails + 5, g_pickup_nails_max);
index d17826a9247908f7c1bceb42dcfc2d91645d585c..f37e2d49376a62f0004f74c6a09aa6e75b541dbe 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id  */ CRYLINK,
 /* function  */ W_Crylink,
-/* ammotype  */ ammo_cells,
+/* ammotype  */ ammo_plasma,
 /* impulse   */ 6,
 /* flags     */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
 /* rating    */ BOT_PICKUP_RATING_MID,
index 6512d0430809ffdff549f8834460c49b0d254ad5..784f2056ad5f7ad96d151a53f9f44c299ad7d9e8 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id  */ VORTEX,
 /* function  */ W_Vortex,
-/* ammotype  */ ammo_cells,
+/* ammotype  */ ammo_plasma,
 /* impulse   */ 7,
 /* flags     */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
 /* rating    */ BOT_PICKUP_RATING_HIGH,
index b5aedfd1814779c88e8f8cb8a50c11e3dfc32f13..51fd20f5a05f89640be51029256e8917488f2fc0 100644 (file)
@@ -269,6 +269,7 @@ string GetAmmoPicture(.float ammotype)
                case ammo_nails:   return "ammo_bullets";
                case ammo_rockets: return "ammo_rockets";
                case ammo_cells:   return "ammo_cells";
+               case ammo_plasma:  return "ammo_cells";
                case ammo_fuel:    return "ammo_fuel";
                default: return ""; // wtf, no ammo type?
        }
@@ -283,7 +284,8 @@ string GetAmmoPicture(.float ammotype)
                case 1: return ammo_nails;
                case 2: return ammo_rockets;
                case 3: return ammo_cells;
-               case 4: return ammo_fuel;
+               case 4: return ammo_plasma;
+               case 5: return ammo_fuel;
                default: return ammo_none;
        }
 }
@@ -296,6 +298,7 @@ float GetAmmoStat(.float ammotype)
                case ammo_nails: return STAT_NAILS;
                case ammo_rockets: return STAT_ROCKETS;
                case ammo_cells: return STAT_CELLS;
+               case ammo_plasma: return STAT_PLASMA;
                case ammo_fuel: return STAT_FUEL;
                default: return -1;
        }
index f05ae184f805a428f6b92eb1ed7301feeea17fd5..9fd986022b6c4ed5b5adf19346dd4e4dd257a91a 100644 (file)
@@ -83,6 +83,7 @@ float GetAmmoStat(.float ammotype);
 .float ammo_nails;
 .float ammo_rockets;
 .float ammo_cells;
+.float ammo_plasma;
 .float ammo_fuel;
 .float ammo_none;
 
index 9521c79e2a70f48638155899467b6967864173c4..06d21415849c9dfbefa8950ee8886999c1f4dd8a 100644 (file)
@@ -143,11 +143,13 @@ float autocvar_g_balance_nexball_secondary_lifetime;
 float autocvar_g_balance_nexball_secondary_refire;
 float autocvar_g_balance_nexball_secondary_speed;
 float autocvar_g_balance_nix_ammo_cells;
+float autocvar_g_balance_nix_ammo_plasma;
 float autocvar_g_balance_nix_ammo_fuel;
 float autocvar_g_balance_nix_ammo_nails;
 float autocvar_g_balance_nix_ammo_rockets;
 float autocvar_g_balance_nix_ammo_shells;
 float autocvar_g_balance_nix_ammoincr_cells;
+float autocvar_g_balance_nix_ammoincr_plasma;
 float autocvar_g_balance_nix_ammoincr_fuel;
 float autocvar_g_balance_nix_ammoincr_nails;
 float autocvar_g_balance_nix_ammoincr_rockets;
@@ -428,6 +430,7 @@ float autocvar_g_onslaught_cp_health;
 float autocvar_g_onslaught_cp_regen;
 float autocvar_g_onslaught_gen_health;
 float autocvar_g_pickup_cells_max;
+float autocvar_g_pickup_plasma_max;
 float autocvar_g_pickup_fuel_max;
 float autocvar_g_pickup_items;
 float autocvar_g_pickup_nails_max;
index 3e0e60fcc09995c25dd8525b050bc8f6f3f93561..f9faf528077b97da627cb3b97931290ef22433a5 100644 (file)
@@ -98,7 +98,10 @@ void havocbot_goalrating_items(float ratingscale, vector org, float sradius)
                                        if (head.ammo_rockets && player.ammo_rockets > self.ammo_rockets)
                                                continue;
 
-                                       if (head.ammo_cells && player.ammo_cells > self.ammo_cells )
+                                       if (head.ammo_cells && player.ammo_cells > self.ammo_cells)
+                                               continue;
+
+                                       if (head.ammo_plasma && player.ammo_plasma > self.ammo_plasma)
                                                continue;
 
                                        discard = FALSE;
index 4ffa3c803ae7cb1ac7703faf400527cb0693795b..22b793d3966a35cd631f2c1a0c2e73213984e42f 100644 (file)
@@ -140,6 +140,7 @@ float CheatImpulse(float i)
                        self.personal.ammo_rockets = self.ammo_rockets;
                        self.personal.ammo_nails = self.ammo_nails;
                        self.personal.ammo_cells = self.ammo_cells;
+                       self.personal.ammo_plasma = self.ammo_plasma;
                        self.personal.ammo_shells = self.ammo_shells;
                        self.personal.ammo_fuel = self.ammo_fuel;
                        self.personal.health = self.health;
@@ -197,6 +198,7 @@ float CheatImpulse(float i)
                                self.ammo_rockets = self.personal.ammo_rockets;
                                self.ammo_nails = self.personal.ammo_nails;
                                self.ammo_cells = self.personal.ammo_cells;
+                               self.ammo_plasma = self.personal.ammo_plasma;
                                self.ammo_shells = self.personal.ammo_shells;
                                self.ammo_fuel = self.personal.ammo_fuel;
                                self.health = self.personal.health;
index 697a67914afb57a7d7c849512e31db19557e1a8f..0e0a271276c43afbfab43a0c102de4468f0c081e 100644 (file)
@@ -441,6 +441,7 @@ void PutClientInServer (void)
                        self.ammo_nails = warmup_start_ammo_nails;
                        self.ammo_rockets = warmup_start_ammo_rockets;
                        self.ammo_cells = warmup_start_ammo_cells;
+                       self.ammo_plasma = warmup_start_ammo_plasma;
                        self.ammo_fuel = warmup_start_ammo_fuel;
                        self.health = warmup_start_health;
                        self.armorvalue = warmup_start_armorvalue;
@@ -452,6 +453,7 @@ void PutClientInServer (void)
                        self.ammo_nails = start_ammo_nails;
                        self.ammo_rockets = start_ammo_rockets;
                        self.ammo_cells = start_ammo_cells;
+                       self.ammo_plasma = start_ammo_plasma;
                        self.ammo_fuel = start_ammo_fuel;
                        self.health = start_health;
                        self.armorvalue = start_armorvalue;
@@ -1686,6 +1688,7 @@ void SpectateCopy(entity spectatee) {
        self.armortype = spectatee.armortype;
        self.armorvalue = spectatee.armorvalue;
        self.ammo_cells = spectatee.ammo_cells;
+       self.ammo_plasma = spectatee.ammo_plasma;
        self.ammo_shells = spectatee.ammo_shells;
        self.ammo_nails = spectatee.ammo_nails;
        self.ammo_rockets = spectatee.ammo_rockets;
index 42c5bcf4e1d6976b9089a001dde7394308aa56f5..d1306f5c26b44460c80811802fbb344bad597f29 100644 (file)
@@ -778,6 +778,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);
        addstat(STAT_PRESSED_KEYS, AS_FLOAT, pressedkeys);
        addstat(STAT_FUEL, AS_INT, ammo_fuel);
+       addstat(STAT_PLASMA, AS_INT, ammo_plasma);
        addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
        addstat(STAT_WEAPON_CLIPLOAD, AS_INT, clip_load);
index f5861909162a60c2351045ca49035ac0c9e59993..77ebe6426094fd9a6b49cbe9c542adb19925b541 100644 (file)
@@ -361,6 +361,7 @@ string formatmessage(string msg)
                        else if (self.items & IT_NAILS) replacement = "bullets";
                        else if (self.items & IT_ROCKETS) replacement = "rockets";
                        else if (self.items & IT_CELLS) replacement = "cells";
+                       else if (self.items & IT_PLASMA) replacement = "plasma";
                        else replacement = "batteries"; // ;)
                } else if (escape == "x") {
                        replacement = cursor_ent.netname;
@@ -562,6 +563,8 @@ float g_pickup_rockets;
 float g_pickup_rockets_max;
 float g_pickup_cells;
 float g_pickup_cells_max;
+float g_pickup_plasma;
+float g_pickup_plasma_max;
 float g_pickup_fuel;
 float g_pickup_fuel_jetpack;
 float g_pickup_fuel_max;
@@ -610,6 +613,7 @@ float start_ammo_shells;
 float start_ammo_nails;
 float start_ammo_rockets;
 float start_ammo_cells;
+float start_ammo_plasma;
 float start_ammo_fuel;
 float start_health;
 float start_armorvalue;
@@ -621,6 +625,7 @@ float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
 float warmup_start_ammo_cells;
+float warmup_start_ammo_plasma;
 float warmup_start_ammo_fuel;
 float warmup_start_health;
 float warmup_start_armorvalue;
@@ -684,6 +689,7 @@ void readplayerstartcvars()
        start_ammo_nails = 0;
        start_ammo_rockets = 0;
        start_ammo_cells = 0;
+       start_ammo_plasma = 0;
        start_health = cvar("g_balance_health_start");
        start_armorvalue = cvar("g_balance_armor_start");
 
@@ -794,6 +800,7 @@ void readplayerstartcvars()
                start_ammo_rockets = 999;
                start_ammo_shells = 999;
                start_ammo_cells = 999;
+               start_ammo_plasma = 999;
                start_ammo_nails = 999;
                start_ammo_fuel = 999;
        }
@@ -803,6 +810,7 @@ void readplayerstartcvars()
                start_ammo_nails = cvar("g_start_ammo_nails");
                start_ammo_rockets = cvar("g_start_ammo_rockets");
                start_ammo_cells = cvar("g_start_ammo_cells");
+               start_ammo_plasma = cvar("g_start_ammo_plasma");
                start_ammo_fuel = cvar("g_start_ammo_fuel");
        }
 
@@ -871,12 +879,14 @@ void readplayerstartcvars()
        start_ammo_shells = max(0, start_ammo_shells);
        start_ammo_nails = max(0, start_ammo_nails);
        start_ammo_cells = max(0, start_ammo_cells);
+       start_ammo_plasma = max(0, start_ammo_plasma);
        start_ammo_rockets = max(0, start_ammo_rockets);
        start_ammo_fuel = max(0, start_ammo_fuel);
 
        warmup_start_ammo_shells = max(0, warmup_start_ammo_shells);
        warmup_start_ammo_nails = max(0, warmup_start_ammo_nails);
        warmup_start_ammo_cells = max(0, warmup_start_ammo_cells);
+       warmup_start_ammo_plasma = max(0, warmup_start_ammo_plasma);
        warmup_start_ammo_rockets = max(0, warmup_start_ammo_rockets);
        warmup_start_ammo_fuel = max(0, warmup_start_ammo_fuel);
 }
@@ -1001,6 +1011,8 @@ void readlevelcvars(void)
        g_pickup_rockets_max = cvar("g_pickup_rockets_max");
        g_pickup_cells = cvar("g_pickup_cells");
        g_pickup_cells_max = cvar("g_pickup_cells_max");
+       g_pickup_plasma = cvar("g_pickup_plasma");
+       g_pickup_plasma_max = cvar("g_pickup_plasma_max");
        g_pickup_fuel = cvar("g_pickup_fuel");
        g_pickup_fuel_jetpack = cvar("g_pickup_fuel_jetpack");
        g_pickup_fuel_max = cvar("g_pickup_fuel_max");
index 0d2d7c96a64d48e1e53daa4dfb6b3c8b14a0d88d..9d7ee17f6e620058d192951e0f5688fb1188538c 100644 (file)
@@ -103,7 +103,7 @@ MUTATOR_HOOKABLE(ForbidThrowCurrentWeapon);
        // returns 1 if throwing the current weapon shall not be allowed
 
 MUTATOR_HOOKABLE(SetStartItems);
-       // adjusts {warmup_}start_{items,weapons,ammo_{cells,rockets,nails,shells,fuel}}
+       // adjusts {warmup_}start_{items,weapons,ammo_{cells,plasma,rockets,nails,shells,fuel}}
 
 MUTATOR_HOOKABLE(BuildMutatorsString);
        // appends ":mutatorname" to ret_string for logging
index 8a6315c4236bd1673758253449af1889fe2e35e8..2b30c8a5ce38989b446e36ed1619133fe1790eac 100644 (file)
@@ -229,6 +229,7 @@ MUTATOR_HOOKFUNCTION(ca_SetStartItems)
        start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_lms_start_ammo_nails");
        start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
        start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_lms_start_ammo_cells");
+       start_ammo_plasma  = warmup_start_ammo_plasma  = cvar("g_lms_start_ammo_plasma");
        start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_lms_start_ammo_fuel");
 
        return 0;
index fb0bb2e865c9fc741726955a7623425144870b81..0684ac8edb20b90dbbbcc1ceb3d3d66cae1d8201 100644 (file)
@@ -135,6 +135,7 @@ MUTATOR_HOOKFUNCTION(lms_SetStartItems)
        start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_lms_start_ammo_nails");
        start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
        start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_lms_start_ammo_cells");
+       start_ammo_plasma  = warmup_start_ammo_plasma  = cvar("g_lms_start_ammo_plasma");
        start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_lms_start_ammo_fuel");
 
        return FALSE;
index 4603a1cca785d0a33a860276cbc362cdfcca26de..5ea5f1ad6200a6fbd47274acdaad525693bb2d4e 100644 (file)
@@ -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;
                        }
                }
@@ -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;
                }
 
@@ -256,6 +259,7 @@ 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;
index 9705af72c6ea2f87451808f3111daab4f2db7fdb..b89a81f688478dc79f675dd6968612f210ba78d3 100644 (file)
@@ -573,6 +573,7 @@ float Item_GiveTo(entity item, entity player)
        pickedup |= Item_GiveAmmoTo(item, player, ammo_nails, g_pickup_nails_max, ITEM_MODE_NONE);
        pickedup |= Item_GiveAmmoTo(item, player, ammo_rockets, g_pickup_rockets_max, ITEM_MODE_NONE);
        pickedup |= Item_GiveAmmoTo(item, player, ammo_cells, g_pickup_cells_max, ITEM_MODE_NONE);
+       pickedup |= Item_GiveAmmoTo(item, player, ammo_plasma, g_pickup_plasma_max, ITEM_MODE_NONE);
        pickedup |= Item_GiveAmmoTo(item, player, health, item.max_health, ITEM_MODE_HEALTH);
        pickedup |= Item_GiveAmmoTo(item, player, armorvalue, item.max_armorvalue, ITEM_MODE_ARMOR);
 
@@ -783,7 +784,7 @@ float weapon_pickupevalfunc(entity player, entity item)
                // If I can pick it up
                if(!item.spawnshieldtime)
                        c = 0;
-               else if(player.ammo_cells || player.ammo_shells || player.ammo_nails || player.ammo_rockets)
+               else if(player.ammo_cells || player.ammo_shells || player.ammo_plasma || player.ammo_nails || player.ammo_rockets)
                {
                        // Skilled bots will grab more
                        c = bound(0, skill / 10, 1) * 0.5;
@@ -826,7 +827,7 @@ float weapon_pickupevalfunc(entity player, entity item)
 float commodity_pickupevalfunc(entity player, entity item)
 {
        float c, i;
-       float need_shells = FALSE, need_nails = FALSE, need_rockets = FALSE, need_cells = FALSE, need_fuel = FALSE;
+       float need_shells = FALSE, need_nails = FALSE, need_rockets = FALSE, need_cells = FALSE, need_plasma = FALSE, need_fuel = FALSE;
        entity wi;
        c = 0;
 
@@ -846,6 +847,8 @@ float commodity_pickupevalfunc(entity player, entity item)
                        need_rockets = TRUE;
                else if(wi.items & IT_CELLS)
                        need_cells = TRUE;
+               else if(wi.items & IT_PLASMA)
+                       need_plasma = TRUE;
                else if(wi.items & IT_FUEL)
                        need_cells = TRUE;
        }
@@ -869,6 +872,10 @@ float commodity_pickupevalfunc(entity player, entity item)
        if (item.ammo_cells)
        if (player.ammo_cells < g_pickup_cells_max)
                c = c + max(0, 1 - player.ammo_cells / g_pickup_cells_max);
+       if (need_plasma)
+       if (item.ammo_plasma)
+       if (player.ammo_plasma < g_pickup_plasma_max)
+               c = c + max(0, 1 - player.ammo_plasma / g_pickup_plasma_max);
        if (need_fuel)
        if (item.ammo_fuel)
        if (player.ammo_fuel < g_pickup_fuel_max)
@@ -1145,6 +1152,15 @@ void spawnfunc_item_cells (void) {
        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);
 }
 
+void spawnfunc_item_plasma()
+{
+       if(!self.ammo_plasma)
+               self.ammo_plasma = g_pickup_plasma;
+       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, "plasma", IT_PLASMA, 0, 0, commodity_pickupevalfunc, 2000);
+}
+
 void spawnfunc_item_shells (void) {
        if(!weaponswapping)
        if(autocvar_sv_q3acompat_machineshotgunswap)
@@ -1387,6 +1403,7 @@ void spawnfunc_target_items (void)
                if(self.ammo_nails != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_nails), "nails");
                if(self.ammo_rockets != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_rockets), "rockets");
                if(self.ammo_cells != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_cells), "cells");
+               if(self.ammo_plasma != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_plasma), "plasma");
                if(self.ammo_fuel != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_fuel), "fuel");
                if(self.health != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "health");
                if(self.armorvalue != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.health), "armor");
@@ -1585,6 +1602,7 @@ float GiveItems(entity e, float beginarg, float endarg)
        PREGIVE(e, superweapons_finished);
        PREGIVE(e, ammo_nails);
        PREGIVE(e, ammo_cells);
+       PREGIVE(e, ammo_plasma);
        PREGIVE(e, ammo_shells);
        PREGIVE(e, ammo_rockets);
        PREGIVE(e, ammo_fuel);
@@ -1638,6 +1656,7 @@ float GiveItems(entity e, float beginarg, float endarg)
                                }
                        case "allammo":
                                got += GiveValue(e, ammo_cells, op, val);
+                               got += GiveValue(e, ammo_plasma, op, val);
                                got += GiveValue(e, ammo_shells, op, val);
                                got += GiveValue(e, ammo_nails, op, val);
                                got += GiveValue(e, ammo_rockets, op, val);
@@ -1670,6 +1689,9 @@ float GiveItems(entity e, float beginarg, float endarg)
                        case "cells":
                                got += GiveValue(e, ammo_cells, op, val);
                                break;
+                       case "plasma":
+                               got += GiveValue(e, ammo_plasma, op, val);
+                               break;
                        case "shells":
                                got += GiveValue(e, ammo_shells, op, val);
                                break;
@@ -1726,6 +1748,7 @@ float GiveItems(entity e, float beginarg, float endarg)
        POSTGIVE_VALUE(e, invincible_finished, 1, "misc/powerup_shield.wav", "misc/poweroff.wav");
        POSTGIVE_VALUE(e, ammo_nails, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE(e, ammo_cells, 0, "misc/itempickup.wav", string_null);
+       POSTGIVE_VALUE(e, ammo_plasma, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE(e, ammo_shells, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE(e, ammo_rockets, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, "misc/itempickup.wav", string_null);
index 465c11ded283d19ba61fcc6b90f7c9086da3e361..edd3df23a5399095d6f439ce6a4fe02e565bb530 100644 (file)
@@ -16,6 +16,7 @@ const      float IT_SUPERWEAPON               =    4096;
 const      float IT_STRENGTH                  =    8192;
 const      float IT_INVINCIBLE                =   16384;
 const      float IT_HEALTH                    =   32768;
+const      float IT_PLASMA                    =   65536;
 
 // shared value space (union):
        // for items:
@@ -36,7 +37,7 @@ const      float IT_ARMOR_SHARD               = 2097152;
 const      float IT_ARMOR                     = 4194304;
 
 // item masks
-const      float IT_AMMO                      =    3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS;
+const      float IT_AMMO                      =    3968; // IT_FUEL | IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_PLASMA;
 const      float IT_PICKUPMASK                =      51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
 const      float IT_UNLIMITED_AMMO            =       3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
 
index f919299c207677518d876916b63d7e8e53934f0c..6f61f7928a9e0ef907b5bd16852a175f9669a1d0 100644 (file)
@@ -23,11 +23,11 @@ void spawnfunc_ammo_cells()          { spawnfunc_item_rockets();        }
 
 // Rail -> Vortex
 void spawnfunc_weapon_railgun()      { spawnfunc_weapon_vortex();          }
-void spawnfunc_ammo_slugs()          { spawnfunc_item_cells();          }
+void spawnfunc_ammo_slugs()          { spawnfunc_item_plasma();          }
 
 // BFG -> Crylink
 void spawnfunc_weapon_bfg()          { spawnfunc_weapon_crylink();      }
-void spawnfunc_ammo_bfg()            { spawnfunc_item_cells();          }
+void spawnfunc_ammo_bfg()            { spawnfunc_item_plasma();          }
 
 // RL -> RL
 void spawnfunc_ammo_rockets()        { spawnfunc_item_rockets();        }
index d6bc658c405abce733c52478e474d177c280cad0..04dd3f6f236efce1f44ddb2cd5ba52e9556d2b7b 100644 (file)
@@ -139,6 +139,7 @@ void weapon_defaultspawnfunc(float wpn)
                        case ammo_nails:   self.ammo_nails   = cvar("g_pickup_nails_weapon");   break;
                        case ammo_rockets: self.ammo_rockets = cvar("g_pickup_rockets_weapon"); break;
                        case ammo_cells:   self.ammo_cells   = cvar("g_pickup_cells_weapon");   break;
+                       case ammo_plasma:  self.ammo_plasma  = cvar("g_pickup_plasma_weapon");  break;
                        case ammo_fuel:    self.ammo_fuel    = cvar("g_pickup_fuel_weapon");    break;
                }
        }
index e5f36b941356f8f6c449da24d45a46aea2e4789b..2d5a83118ea6cc3ca0256f36eea468666a42cb24 100644 (file)
@@ -112,6 +112,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                                case ammo_nails:   s = sprintf("%s and %d nails", s, thisammo);   break;
                                case ammo_rockets: s = sprintf("%s and %d rockets", s, thisammo); break;
                                case ammo_cells:   s = sprintf("%s and %d cells", s, thisammo);   break;
+                               case ammo_plasma:  s = sprintf("%s and %d plasma", s, thisammo);  break;
                                case ammo_fuel:    s = sprintf("%s and %d fuel", s, thisammo);    break;
                        }