]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/menu_updates
authorSamual <samual@xonotic.org>
Fri, 13 Jan 2012 23:18:18 +0000 (18:18 -0500)
committerSamual <samual@xonotic.org>
Fri, 13 Jan 2012 23:18:18 +0000 (18:18 -0500)
27 files changed:
_hud_descriptions.cfg
balance25.cfg
balanceFruitieX.cfg
balanceXPM.cfg
balanceXonotic.cfg
gfx/hud/default/superweapons.tga [new file with mode: 0644]
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/miscfunctions.qc
qcsrc/common/constants.qh
qcsrc/common/items.qh
qcsrc/server/autocvars.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/t_items.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_minstanex.qc

index 109d410e8046cc1ee52e1965120d4618124cece1..c8ab15f987894c7bd8a9c8963a0274dc5601cf68 100644 (file)
@@ -16,6 +16,7 @@ seta hud_dock_alpha "" "alpha of the dock"
 
 seta hud_progressbar_alpha "" "alpha of progressbars"
 seta hud_progressbar_strength_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_superweapons_color "" "R G B vector of the progress bar background color"
 seta hud_progressbar_shield_color "" "R G B vector of the progress bar background color"
 seta hud_progressbar_health_color "" "R G B vector of the progress bar background color"
 seta hud_progressbar_armor_color "" "R G B vector of the progress bar background color"
@@ -88,6 +89,7 @@ seta hud_panel_powerups_bg_padding "" "if set to something else than \"\" = over
 seta hud_panel_powerups_progressbar "" "enable progressbar in panel"
 seta hud_panel_powerups_progressbar_strength "" "progressbar image for strength"
 seta hud_panel_powerups_progressbar_shield "" "progressbar image for shield"
+seta hud_panel_powerups_progressbar_superweapons "" "progressbar image for superweapons"
 seta hud_panel_powerups_text "" "show text/icons in the powerups panel"
 
 seta hud_panel_healtharmor "" "enable/disable this panel, 2 = combined health/armor display"
index 612f6f10873ea911cd66a6e4b09461cdca47f002..f65ee473fef5c9dc6beb3b5492d1c261fd8536aa 100644 (file)
@@ -205,6 +205,7 @@ set g_balance_powerup_strength_force 4
 set g_balance_powerup_strength_time 30
 set g_balance_powerup_strength_selfdamage 1.5
 set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
 // }}}
 
 // {{{ jetpack/hook
index e135c805b1ed9b20e9bb3285b4eb1cc843a5c0d6..9777b904d78438b66489804962e25366be936354 100644 (file)
@@ -205,6 +205,7 @@ set g_balance_powerup_strength_force 4
 set g_balance_powerup_strength_time 30
 set g_balance_powerup_strength_selfdamage 1.5
 set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
 // }}}
 
 // {{{ jetpack/hook
index 57286d56af79368e9fef2d1e501fb66d41273b81..a15f060d0f269e15068c836360fb39b888181480 100644 (file)
@@ -205,6 +205,7 @@ set g_balance_powerup_strength_force 3
 set g_balance_powerup_strength_time 30
 set g_balance_powerup_strength_selfdamage 1.5
 set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
 // }}}
 
 // {{{ jetpack/hook
index 13a4f9f6f9a9d1c5a1d0b35eb3864cee0f7b2f8f..d42284a3066230bdd0658a16e6cdc48eeb45e3a2 100644 (file)
@@ -205,6 +205,7 @@ set g_balance_powerup_strength_force 3
 set g_balance_powerup_strength_time 30
 set g_balance_powerup_strength_selfdamage 1.5
 set g_balance_powerup_strength_selfforce 1.5
+set g_balance_superweapons_time 30
 // }}}
 
 // {{{ jetpack/hook
diff --git a/gfx/hud/default/superweapons.tga b/gfx/hud/default/superweapons.tga
new file mode 100644 (file)
index 0000000..740019e
Binary files /dev/null and b/gfx/hud/default/superweapons.tga differ
index f32279f2b9b1d36c06a97512dbd3048037d093a9..25e7dea1fd2de150e8ecfcfe8b4b0c55bdc90d7f 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "1"
 
 seta hud_progressbar_alpha "0.500000"
 seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
 seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index 52a7d96c1327844d54a461e89f6305f0c4c95b7f..05a11b4e92981b095ed9441cd1ba20c488ecab19 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "1"
 
 seta hud_progressbar_alpha "0.500000"
 seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
 seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "1"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index 2d5e07600c09265f849b888e6584ab75c87994c1..3774b9cbd68fec029181173523481ed2b1d00b2b 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "1"
 
 seta hud_progressbar_alpha "0.3"
 seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
 seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "1"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index fe7f66085519cc3ed94cf1e08cd44390e3b2ccd3..c5e2c928fab635126db5ffa90c8fc82f34981f90 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "1"
 
 seta hud_progressbar_alpha "0.500000"
 seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
 seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index 5c2138370660bdf3e40d204af441cbe42cb81b9f..10d77e7129684ad492d4405ae1f44ee4cc596ec0 100644 (file)
@@ -14,6 +14,7 @@ seta hud_dock_alpha "0.700000"
 
 seta hud_progressbar_alpha "0.5"
 seta hud_progressbar_strength_color "0 0 0.6"
+seta hud_progressbar_superweapons_color "0.6 0.3 0"
 seta hud_progressbar_shield_color "0.6 0 0.6"
 seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
@@ -86,6 +87,7 @@ seta hud_panel_powerups_baralign "0"
 seta hud_panel_powerups_progressbar "0"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
+seta hud_panel_powerups_progressbar_superweapons "progressbar"
 seta hud_panel_powerups_text "1"
 
 seta hud_panel_healtharmor 1
index 6d3aff52c2c483c129e542a654cbc86e9020bcdf..6ea8ad80e337312bd0be9b05ceda47eb56bf2266 100644 (file)
@@ -271,6 +271,7 @@ float autocvar_hud_panel_powerups_iconalign;
 float autocvar_hud_panel_powerups_progressbar;
 string autocvar_hud_panel_powerups_progressbar_shield;
 string autocvar_hud_panel_powerups_progressbar_strength;
+string autocvar_hud_panel_powerups_progressbar_superweapons;
 float autocvar_hud_panel_powerups_text;
 float autocvar_hud_panel_pressedkeys;
 float autocvar_hud_panel_pressedkeys_aspect;
index 8db3f00eb3c38969bf94a53777b75b7df22936dc..1d0ad220022b8f1cf33cbb6282d01863cd303c59 100644 (file)
@@ -988,7 +988,7 @@ void HUD_Ammo(void)
        }
 }
 
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha)
+void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha, float fadelerp)
 {
        vector newPos, newSize;
        vector picpos, numpos;
@@ -1061,32 +1061,39 @@ void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertic
                picpos = newPos;
        }
 
-       drawstring_aspect(numpos, ftos(x), '2 1 0' * newSize_y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL);
+       // FIXME newSize_x is unused, is that right?
+
+       drawstring_aspect_expanding(numpos, ftos(x), '2 1 0' * newSize_y, color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
+       drawpic_aspect_skin_expanding(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
 }
 
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float fadelerp)
+void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha)
 {
-       float sz;
-       sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
-
-       DrawNumIcon(myPos + expandingbox_resize_centered_box_offset(sz, mySize, 1), mySize * sz, x, icon, vertical, icon_right_align, color, (1 - fadelerp));
+       DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
 }
 
 // Powerups (#2)
 //
 void HUD_Powerups(void)
 {
-       float strength_time, shield_time;
+       float strength_time, shield_time, superweapons_time;
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_powerups) return;
                if(spectatee_status == -1) return;
-               if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE)) return;
+               if not(getstati(STAT_ITEMS, 0, 24) & (IT_STRENGTH | IT_INVINCIBLE | IT_SUPERWEAPON)) return;
                if (getstati(STAT_HEALTH) <= 0) return;
 
                strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
                shield_time = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
+               superweapons_time = bound(0, getstatf(STAT_SUPERWEAPONS_FINISHED) - time, 99);
+
+               if (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_SUPERWEAPONS)
+                       superweapons_time = 99; // force max
+
+               // prevent stuff to show up on mismatch that will be fixed next frame
+               if (!(getstati(STAT_ITEMS, 0, 24) & IT_SUPERWEAPON))
+                       superweapons_time = 0;
        }
        else
        {
@@ -1094,6 +1101,7 @@ void HUD_Powerups(void)
 
                strength_time = 15;
                shield_time = 27;
+               superweapons_time = 13;
        }
 
        HUD_Panel_UpdateCvars(powerups);
@@ -1102,7 +1110,7 @@ void HUD_Powerups(void)
        pos = panel_pos;
        mySize = panel_size;
 
-       HUD_Panel_DrawBg(bound(0, max(strength_time, shield_time), 1));
+       HUD_Panel_DrawBg(bound(0, max(strength_time, shield_time, superweapons_time), 1));
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
@@ -1111,26 +1119,73 @@ void HUD_Powerups(void)
 
        float panel_ar = mySize_x/mySize_y;
        float is_vertical = (panel_ar < 1);
-       vector shield_offset, strength_offset;
-       if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
+       vector shield_offset, strength_offset, superweapons_offset;
+
+       float superweapons_is = -1;
+
+       if(superweapons_time)
+       {
+               if(strength_time)
+               {
+                       if(shield_time)
+                               superweapons_is = 0;
+                       else
+                               superweapons_is = 2;
+               }
+               else
+               {
+                       if(shield_time)
+                               superweapons_is = 1;
+                       else
+                               superweapons_is = 2;
+               }
+       }
+
+       // FIXME handle superweapons here
+       if(superweapons_is == 0)
        {
-               mySize_x *= 0.5;
-               if (autocvar_hud_panel_powerups_flip)
-                       shield_offset_x = mySize_x;
+               if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
+               {
+                       mySize_x *= (1.0 / 3.0);
+                       superweapons_offset_x = mySize_x;
+                       if (autocvar_hud_panel_powerups_flip)
+                               shield_offset_x = 2*mySize_x;
+                       else
+                               strength_offset_x = 2*mySize_x;
+               }
                else
-                       strength_offset_x = mySize_x;
+               {
+                       mySize_y *= (1.0 / 3.0);
+                       superweapons_offset_y = mySize_y;
+                       if (autocvar_hud_panel_powerups_flip)
+                               shield_offset_y = 2*mySize_y;
+                       else
+                               strength_offset_y = 2*mySize_y;
+               }
        }
        else
        {
-               mySize_y *= 0.5;
-               if (autocvar_hud_panel_powerups_flip)
-                       shield_offset_y = mySize_y;
+               if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
+               {
+                       mySize_x *= 0.5;
+                       if (autocvar_hud_panel_powerups_flip)
+                               shield_offset_x = mySize_x;
+                       else
+                               strength_offset_x = mySize_x;
+               }
                else
-                       strength_offset_y = mySize_y;
+               {
+                       mySize_y *= 0.5;
+                       if (autocvar_hud_panel_powerups_flip)
+                               shield_offset_y = mySize_y;
+                       else
+                               strength_offset_y = mySize_y;
+               }
        }
 
-       float shield_baralign, strength_baralign;
-       float shield_iconalign, strength_iconalign;
+       float shield_baralign, strength_baralign, superweapons_baralign;
+       float shield_iconalign, strength_iconalign, superweapons_iconalign;
+
        if (autocvar_hud_panel_powerups_flip)
        {
                strength_baralign = (autocvar_hud_panel_powerups_baralign == 2 || autocvar_hud_panel_powerups_baralign == 1);
@@ -1146,6 +1201,24 @@ void HUD_Powerups(void)
                strength_iconalign = (autocvar_hud_panel_powerups_iconalign == 3 || autocvar_hud_panel_powerups_iconalign == 1);
        }
 
+       if(superweapons_is == 0)
+       {
+               superweapons_iconalign = strength_iconalign;
+               superweapons_baralign = 2;
+       }
+       else if(superweapons_is == 1)
+       {
+               superweapons_offset = strength_offset;
+               superweapons_iconalign = strength_iconalign;
+               superweapons_baralign = strength_baralign;
+       }
+       else if(superweapons_is == 2)
+       {
+               superweapons_offset = shield_offset;
+               superweapons_iconalign = shield_iconalign;
+               superweapons_baralign = shield_baralign;
+       }
+
        if(shield_time)
        {
                const float maxshield = 30;
@@ -1160,7 +1233,7 @@ void HUD_Powerups(void)
                        if(shield > 1)
                                DrawNumIcon(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', 1);
                        if(shield <= 5)
-                               DrawNumIcon_expanding(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', bound(0, (shield - shield_time) / 0.5, 1));
+                               DrawNumIcon_expanding(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', 1, bound(0, (shield - shield_time) / 0.5, 1));
                }
        }
 
@@ -1178,7 +1251,25 @@ void HUD_Powerups(void)
                        if(strength > 1)
                                DrawNumIcon(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', 1);
                        if(strength <= 5)
-                               DrawNumIcon_expanding(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', bound(0, (strength - strength_time) / 0.5, 1));
+                               DrawNumIcon_expanding(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', 1, bound(0, (strength - strength_time) / 0.5, 1));
+               }
+       }
+
+       if(superweapons_time)
+       {
+               const float maxsuperweapons = 30;
+               float superweapons = ceil(superweapons_time);
+               if(autocvar_hud_panel_powerups_progressbar)
+               {
+                       HUD_Panel_GetProgressBarColor(superweapons);
+                       HUD_Panel_DrawProgressBar(pos + superweapons_offset, mySize, autocvar_hud_panel_powerups_progressbar_superweapons, superweapons/maxsuperweapons, is_vertical, superweapons_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+               }
+               if(autocvar_hud_panel_powerups_text)
+               {
+                       if(superweapons > 1)
+                               DrawNumIcon(pos + superweapons_offset, mySize, superweapons, "superweapons", is_vertical, superweapons_iconalign, '1 1 1', 1);
+                       if(superweapons <= 5)
+                               DrawNumIcon_expanding(pos + superweapons_offset, mySize, superweapons, "superweapons", is_vertical, superweapons_iconalign, '1 1 1', 1, bound(0, (superweapons - superweapons_time) / 0.5, 1));
                }
        }
 }
index 93a47f50e5f5d94cf5fb0298bf16ea0003399824..f4eaf927fe2b56943cc8e0ec2c287080a8325d43 100644 (file)
@@ -601,4 +601,4 @@ float getplayerisdead(float pl)
                return e.csqcmodel_isdead;
        
        return FALSE;
-}
\ No newline at end of file
+}
index 7532b3f50b0a85a25dab66ae98a40ccc79dff39c..afd2677a66230adbdb9cb41aa297501a20d7c7c2 100644 (file)
@@ -161,6 +161,7 @@ const float STAT_TYPEHIT_TIME = 55;
 const float STAT_LAYED_MINES = 56;
 const float STAT_HAGAR_LOAD = 57;
 const float STAT_SWITCHINGWEAPON = 58;
+const float STAT_SUPERWEAPONS_FINISHED = 59;
 
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
index c98ff786b9cb9c12ceaa380907930d2f0334d7bd..07a7625345dcddeb80745a044bebbaf9b57536a1 100644 (file)
@@ -2,53 +2,53 @@ float BOT_PICKUP_RATING_LOW   = 2500;
 float BOT_PICKUP_RATING_MID    = 5000;
 float BOT_PICKUP_RATING_HIGH   = 10000;
 
-float WEP_TYPE_OTHER       = 0x00;     // e.g: Hook, Port-o-launch, etc
-float WEP_TYPE_SPLASH      = 0x01;
-float WEP_TYPE_HITSCAN     = 0x02;
-float WEP_TYPEMASK          = 0x0F;
-float WEP_FLAG_CANCLIMB     = 0x10;
-float WEP_FLAG_NORMAL       = 0x20;
-float WEP_FLAG_HIDDEN       = 0x40;
-float WEP_FLAG_RELOADABLE   = 0x80;
+float WEP_TYPE_OTHER       =  0x00;    // e.g: Hook, Port-o-launch, etc
+float WEP_TYPE_SPLASH      =  0x01;
+float WEP_TYPE_HITSCAN     =  0x02;
+float WEP_TYPEMASK          =  0x0F;
+float WEP_FLAG_CANCLIMB     =  0x10;
+float WEP_FLAG_NORMAL       =  0x20;
+float WEP_FLAG_HIDDEN       =  0x40;
+float WEP_FLAG_RELOADABLE   =  0x80;
+float WEP_FLAG_SUPERWEAPON  = 0x100;
 
-float  IT_UNLIMITED_WEAPON_AMMO  = 1;
+float  IT_UNLIMITED_WEAPON_AMMO     = 1;
 // when this bit is set, using a weapon does not reduce ammo. Checkpoints can give this powerup.
-float  IT_UNLIMITED_SUPERWEAPONS = 2;
-// when this bit is set, using a superweapon does not throw it away. Checkpoints can give this powerup.
-float  IT_CTF_SHIELDED           = 4; // set for the flag shield
-// using jetpack
-float   IT_USING_JETPACK          = 8; // confirmation that button is pressed
-float   IT_JETPACK                = 16; // actual item
-float  IT_FUEL_REGEN             = 32; // fuel regeneration trigger
-float  IT_SHELLS                               = 256;
-float  IT_NAILS                                = 512;
-float  IT_ROCKETS                              = 1024;
-float  IT_CELLS                                = 2048;
-float  IT_SUPERWEAPON                  = 4096;
-float  IT_FUEL                                 = 128;
-float  IT_STRENGTH                             = 8192;
-float  IT_INVINCIBLE                   = 16384;
-float  IT_HEALTH                               = 32768;
+float  IT_UNLIMITED_SUPERWEAPONS    = 2;
+// when this bit is set, superweapons don't expire. Checkpoints can give this powerup.
+float   IT_CTF_SHIELDED              = 4; // set for the flag shield
+float   IT_USING_JETPACK             = 8; // confirmation that button is pressed
+float   IT_JETPACK                   = 16; // actual item
+float   IT_FUEL_REGEN                = 32; // fuel regeneration trigger
+float   IT_SHELLS                    = 256;
+float   IT_NAILS                     = 512;
+float   IT_ROCKETS                   = 1024;
+float   IT_CELLS                     = 2048;
+float   IT_SUPERWEAPON               = 4096;
+float   IT_FUEL                      = 128;
+float   IT_STRENGTH                  = 8192;
+float   IT_INVINCIBLE                = 16384;
+float   IT_HEALTH                    = 32768;
 // union:
-       // for items:
-       float   IT_KEY1                                 = 131072;
-       float   IT_KEY2                                 = 262144;
-       // for players:
-       float   IT_RED_FLAG_TAKEN               = 32768;
-       float   IT_RED_FLAG_LOST                = 65536;
-       float   IT_RED_FLAG_CARRING             = 98304;
-       float   IT_BLUE_FLAG_TAKEN              = 131072;
-       float   IT_BLUE_FLAG_LOST               = 262144;
-       float   IT_BLUE_FLAG_CARRING    = 393216;
+        // for items:
+        float   IT_KEY1              = 131072;
+        float   IT_KEY2              = 262144;
+        // for players:
+        float   IT_RED_FLAG_TAKEN    = 32768;
+        float   IT_RED_FLAG_LOST     = 65536;
+        float   IT_RED_FLAG_CARRING  = 98304;
+        float   IT_BLUE_FLAG_TAKEN   = 131072;
+        float   IT_BLUE_FLAG_LOST    = 262144;
+        float   IT_BLUE_FLAG_CARRING = 393216;
 // end
-float  IT_5HP                                  = 524288;
-float  IT_25HP                                 = 1048576;
-float  IT_ARMOR_SHARD                  = 2097152;
-float  IT_ARMOR                                = 4194304;
+float   IT_5HP                       = 524288;
+float   IT_25HP                      = 1048576;
+float   IT_ARMOR_SHARD               = 2097152;
+float   IT_ARMOR                     = 4194304;
 
-float  IT_AMMO                                 = 8064; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_SUPERWEAPON | IT_FUEL;
-float  IT_PICKUPMASK           = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
-float  IT_UNLIMITED_AMMO       = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
+float   IT_AMMO                      = 3968; // IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS | IT_FUEL;
+float   IT_PICKUPMASK                = 51; // IT_FUEL_REGEN | IT_JETPACK | IT_UNLIMITED_AMMO; // strength and invincible are handled separately
+float   IT_UNLIMITED_AMMO            = 3; // IT_UNLIMITED_SUPERWEAPONS | IT_UNLIMITED_WEAPON_AMMO;
 
 float AMMO_COUNT = 4; // amount of ammo types to show in the inventory panel
 
@@ -94,6 +94,7 @@ float WEP_FIRST = 1;
 float WEP_LAST;
 #define WEP_MAXCOUNT 24
 float WEPBIT_ALL;
+float WEPBIT_SUPERWEAPONS;
 #define REGISTER_WEAPON_2(id,bit,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname) \
        float id; \
        float bit; \
@@ -102,6 +103,7 @@ float WEPBIT_ALL;
        { \
                WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \
                WEPBIT_ALL |= (bit = power2of(WEP_COUNT)); \
+               WEPBIT_SUPERWEAPONS |= (bit = power2of(WEP_COUNT)) * !!(weapontype & WEP_FLAG_SUPERWEAPON); \
                ++WEP_COUNT; \
                register_weapon(id,func,ammotype,i,weapontype,pickupbasevalue,modelname,shortname,wname); \
        } \
index 538d65307f1c3647d7c3264ae9c1e070ca99f42f..1111909b3ea194fcbb6df6ddc698912dcaebff24 100644 (file)
@@ -568,6 +568,7 @@ float autocvar_g_balance_powerup_strength_force;
 float autocvar_g_balance_powerup_strength_selfdamage;
 float autocvar_g_balance_powerup_strength_selfforce;
 float autocvar_g_balance_powerup_strength_time;
+float autocvar_g_balance_superweapons_time;
 float autocvar_g_balance_rocketlauncher_ammo;
 float autocvar_g_balance_rocketlauncher_animtime;
 float autocvar_g_balance_rocketlauncher_damage;
index 298fd47e3c4f7273d3d461d14bf8ba041109bfc2..ebf4abc4b4d85bc7181fd408221f03c75df988a4 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,40 @@ void player_powerups (void)
                                sprint(self, "^3Shield surrounds you\n");
                        }
                }
+               if (self.items & IT_SUPERWEAPON)
+               {
+                       self.effects = self.effects | EF_RED;
+                       if (!(self.weapons & WEPBIT_SUPERWEAPONS))
+                       {
+                               self.superweapons_finished = 0;
+                               self.items = self.items - (self.items & IT_SUPERWEAPON);
+                               sprint(self, "^3Superweapons have been lost\n");
+                       }
+                       else if (self.items & IT_UNLIMITED_SUPERWEAPONS)
+                       {
+                               // don't let them run out
+                       }
+                       else
+                       {
+                               play_countdown(self.superweapons_finished, "misc/poweroff.wav");
+                               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)
index b1f6aabba106d9728c27f967dab608f6a365a0ad..8c0cb96e0eb4f0627867800f7691eb979aa53af2 100644 (file)
@@ -170,7 +170,7 @@ float W_WeaponBit(float wpn)
 
 float W_AmmoItemCode(float wpn)
 {
-       return (get_weaponinfo(wpn)).items;
+       return (get_weaponinfo(wpn)).items & IT_AMMO;
 }
 
 void thrown_wep_think()
@@ -198,7 +198,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        wep.colormap = own.colormap;
 
        wa = W_AmmoItemCode(wpn);
-       if(wa == IT_SUPERWEAPON || wa == 0)
+       if(wa == 0)
        {
                oldself = self;
                self = wep;
@@ -288,14 +288,14 @@ float W_IsWeaponThrowable(float w)
        wb = W_WeaponBit(w);
        if(!wb)
                return 0;
+       if(wb & WEPBIT_SUPERWEAPONS) // can't throw a superweapon, they don't work
+               return 0;
        wa = W_AmmoItemCode(w);
        if(start_weapons & wb)
        {
-               if(wa == IT_SUPERWEAPON && start_items & IT_UNLIMITED_SUPERWEAPONS)
-                       return 0;
-               if(wa != IT_SUPERWEAPON && start_items & IT_UNLIMITED_WEAPON_AMMO)
-                       return 0;
                // start weapons that take no ammo can't be dropped (this prevents dropping the laser, as long as it continues to use no ammo)
+               if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+                       return 0;
                if(wa == 0)
                        return 0;
        }
index 3b69e13eb0942f30b1e394a3a7b0813ae6e3cce7..1208766e21a99fca98117786b7391e0cb312d6f4 100644 (file)
@@ -853,7 +853,7 @@ void weapon_setup(float windex)
        entity e;
        e = get_weaponinfo(windex);
        self.items &~= IT_AMMO;
-       self.items = self.items | e.items;
+       self.items = self.items | (e.items & IT_AMMO);
 
        // the two weapon entities will notice this has changed and update their models
        self.weapon = windex;
index 53bfde7ce94bd90d96c8d6f3822a6e99d71387f5..22d9e54d6c71d4c8ea4a007a157354eb23b7e6d4 100644 (file)
@@ -91,9 +91,8 @@ float maxclients;
 .float  crouch;        // Crouching or not?
 
 .float strength_finished;
-//.float       speed_finished;
 .float invincible_finished;
-//.float       slowmo_finished;
+.float superweapons_finished;
 
 .vector                finaldest, finalangle;          //plat.qc stuff
 .void()                think1;
index 93cea80ffd078aaac431bb5a5dbf4b4bcd699178..f699ababc19af8f4e8bd324574a7b386b6b2c769 100644 (file)
@@ -772,6 +772,7 @@ void spawnfunc_worldspawn (void)
 
        addstat(STAT_STRENGTH_FINISHED, AS_FLOAT, strength_finished);
        addstat(STAT_INVINCIBLE_FINISHED, AS_FLOAT, invincible_finished);
+       addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);
        addstat(STAT_PRESSED_KEYS, AS_FLOAT, pressedkeys);
        addstat(STAT_FUEL, AS_INT, ammo_fuel);
        addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
index 7c6c28bf5b361ef6c511ba1702a9ade5e04d6d08..4b19730adcd3d15f9708bebbe7846a608598ea77 100644 (file)
@@ -908,6 +908,7 @@ void readplayerstartcvars()
                start_weapons = WEPBIT_MINSTANEX;
                weapon_action(WEP_MINSTANEX, WR_PRECACHE);
                g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
+               start_items |= IT_UNLIMITED_SUPERWEAPONS;
 
                if (g_minstagib_invis_alpha <= 0)
                        g_minstagib_invis_alpha = -1;
index 519d51daa2510edd8f23ecef335e454127bd4f9c..28bb8446902b29249d375d94e953886da444961c 100644 (file)
@@ -228,6 +228,7 @@ MUTATOR_HOOKFUNCTION(nix_PlayerSpawn)
 {
        self.nix_lastchange_id = -1;
        NIX_GiveCurrentWeapon(); // overrides the weapons you got when spawning
+       self.items |= IT_UNLIMITED_SUPERWEAPONS;
        return 0;
 }
 
index 090788a6655661595118c73aa160823099ab0ca4..11688ae36a67cbdca3117edb78df76df93f94786 100644 (file)
@@ -131,7 +131,7 @@ void Item_Show (entity e, float mode)
 
                e.spawnshieldtime = 1;
        }
-       else if((e.flags & FL_WEAPON) && !(get_weaponinfo(e.weapon).items & IT_SUPERWEAPON) && g_weapon_stay)
+       else if((e.flags & FL_WEAPON) && !(e.flags & FL_NO_WEAPON_STAY) && g_weapon_stay)
        {
                // make the item translucent and not touchable
                e.model = e.mdl;
@@ -239,7 +239,7 @@ void Item_RespawnCountdown (void)
                                if(wi)
                                {
                                        name = wi.model2;
-                                       rgb = '0 0 0';
+                                       rgb = '1 0 0';
                                }
                        }
                        if(!name)
@@ -265,7 +265,7 @@ void Item_RespawnCountdown (void)
 
 void Item_ScheduleRespawnIn(entity e, float t)
 {
-       if((e.flags & FL_POWERUP) || ((e.flags & FL_WEAPON) && (get_weaponinfo(e.weapon).items & IT_SUPERWEAPON)))
+       if((e.flags & FL_POWERUP) || (e.weapons & WEPBIT_SUPERWEAPONS))
        {
                e.think = Item_RespawnCountdown;
                e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
@@ -461,12 +461,17 @@ float Item_GiveTo(entity item, entity player)
                if (item.strength_finished)
                {
                        pickedup = TRUE;
-                       player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
+                       player.strength_finished = max(player.strength_finished, time) + item.strength_finished;
                }
                if (item.invincible_finished)
                {
                        pickedup = TRUE;
-                       player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
+                       player.invincible_finished = max(player.invincible_finished, time) + item.invincible_finished;
+               }
+               if (item.superweapons_finished)
+               {
+                       pickedup = TRUE;
+                       player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
                }
        }
 
@@ -537,6 +542,17 @@ void Item_Touch (void)
        }
 }
 
+void Item_Reset()
+{
+       Item_Show(self, !self.state);
+       setorigin (self, self.origin);
+       self.think = SUB_Null;
+       self.nextthink = 0;
+
+       if((self.flags & FL_POWERUP) | (self.weapons & WEPBIT_SUPERWEAPONS)) // do not spawn powerups initially!
+               Item_ScheduleInitialRespawn(self);
+}
+
 void Item_FindTeam()
 {
        entity head, e;
@@ -563,22 +579,10 @@ void Item_FindTeam()
                        head.effects &~= EF_NODRAW;
                }
 
-               if(e.flags & FL_POWERUP) // do not spawn powerups initially!
-                       Item_ScheduleInitialRespawn(e);
+               Item_Reset();
        }
 }
 
-void Item_Reset()
-{
-       Item_Show(self, !self.state);
-       setorigin (self, self.origin);
-       self.think = SUB_Null;
-       self.nextthink = 0;
-
-       if(self.flags & FL_POWERUP) // do not spawn powerups initially!
-               Item_ScheduleInitialRespawn(self);
-}
-
 // Savage: used for item garbage-collection
 // TODO: perhaps nice special effect?
 void RemoveItem(void)
@@ -824,6 +828,10 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
        self.bot_pickupbasevalue = pickupbasevalue;
        self.mdl = itemmodel;
        self.item_pickupsound = pickupsound;
+       if(self.weapons)
+               self.weapon = WEP_FIRST + log2of(lowestbit(self.weapons));
+       else
+               self.weapon = 0;
        // let mappers override respawntime
        if(!self.respawntime) // both set
        {
@@ -857,8 +865,8 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                self.effects = self.effects | EF_NODRAW; // marker for item team search
                InitializeEntity(self, Item_FindTeam, INITPRIO_FINDTARGET);
        }
-       else if(self.flags & FL_POWERUP) // do not spawn powerups initially!
-               Item_ScheduleInitialRespawn(self);
+       else
+               Item_Reset();
 }
 
 /* replace items in minstagib
@@ -893,7 +901,8 @@ void minstagib_items (float itemid)
        // replace with invis
        if (itemid == IT_STRENGTH)
        {
-               self.strength_finished = 30;
+               if(!self.strength_finished)
+                       self.strength_finished = autocvar_g_balance_powerup_strength_time;
                StartItem ("models/items/g_strength.md3",
                        "misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
                        "Invisibility", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
@@ -909,7 +918,8 @@ void minstagib_items (float itemid)
        // replace with speed
        if (itemid == IT_INVINCIBLE)
        {
-               self.invincible_finished = 30;
+               if(!self.invincible_finished)
+                       self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
                StartItem ("models/items/g_invincible.md3",
                        "misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup,
                        "Speed", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, BOT_PICKUP_RATING_MID);
@@ -934,23 +944,6 @@ void weapon_defaultspawnfunc(float wpn)
        entity oldself;
        float i, j;
 
-       // set the respawntime in advance (so replaced weapons can copy it)
-
-       if(!self.respawntime)
-       {
-               e = get_weaponinfo(wpn);
-               if(e.items == IT_SUPERWEAPON)
-               {
-                       self.respawntime = g_pickup_respawntime_superweapon;
-                       self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
-               }
-               else
-               {
-                       self.respawntime = g_pickup_respawntime_weapon;
-                       self.respawntimejitter = g_pickup_respawntimejitter_weapon;
-               }
-       }
-
        if(self.classname != "droppedweapon" && self.classname != "replacedweapon")
        {
                e = get_weaponinfo(wpn);
@@ -1016,7 +1009,25 @@ void weapon_defaultspawnfunc(float wpn)
 
        e = get_weaponinfo(wpn);
 
-       if(e.items && e.items != IT_SUPERWEAPON)
+       if(!self.respawntime)
+       {
+               if(e.weapons & WEPBIT_SUPERWEAPONS)
+               {
+                       self.respawntime = g_pickup_respawntime_superweapon;
+                       self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
+               }
+               else
+               {
+                       self.respawntime = g_pickup_respawntime_weapon;
+                       self.respawntimejitter = g_pickup_respawntimejitter_weapon;
+               }
+       }
+
+       if(e.weapons & WEPBIT_SUPERWEAPONS)
+               if(!self.superweapons_finished)
+                       self.superweapons_finished = autocvar_g_balance_superweapons_time;
+
+       if(e.items)
        {
                for(i = 0, j = 1; i < 24; ++i, j *= 2)
                {
@@ -1028,10 +1039,10 @@ void weapon_defaultspawnfunc(float wpn)
                        }
                }
        }
-       else
-       {
+
+       // no weapon-stay on superweapons
+       if(self.weapons & WEPBIT_SUPERWEAPONS)
                self.flags |= FL_NO_WEAPON_STAY;
-       }
 
        // weapon stay isn't supported for teamed weapons
        if(self.team)
@@ -1248,7 +1259,8 @@ void spawnfunc_item_strength (void) {
                minstagib_items(IT_STRENGTH);
        } else {
                precache_sound("weapons/strength_fire.wav");
-               self.strength_finished = 30;
+               if(!self.strength_finished)
+                       self.strength_finished = autocvar_g_balance_powerup_strength_time;
                StartItem ("models/items/g_strength.md3", "misc/powerup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Strength Powerup", IT_STRENGTH, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
        }
 }
@@ -1257,7 +1269,8 @@ void spawnfunc_item_invincible (void) {
        if(g_minstagib) {
                minstagib_items(IT_INVINCIBLE);
        } else {
-               self.invincible_finished = 30;
+               if(!self.invincible_finished)
+                       self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
                StartItem ("models/items/g_invincible.md3", "misc/powerup_shield.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Shield", IT_INVINCIBLE, 0, FL_POWERUP, generic_pickupevalfunc, 100000);
        }
 }
@@ -1310,6 +1323,8 @@ void spawnfunc_target_items (void)
                self.strength_finished = autocvar_g_balance_powerup_strength_time;
        if(!self.invincible_finished)
                self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
+       if(!self.superweapons_finished)
+               self.superweapons_finished = autocvar_g_balance_superweapons_time;
 
        precache_sound("misc/itempickup.wav");
        precache_sound("misc/megahealth.wav");
@@ -1332,6 +1347,7 @@ void spawnfunc_target_items (void)
                        else if(argv(i) == "unlimited_superweapons") self.items |= IT_UNLIMITED_SUPERWEAPONS;
                        else if(argv(i) == "strength")               self.items |= IT_STRENGTH;
                        else if(argv(i) == "invincible")             self.items |= IT_INVINCIBLE;
+                       else if(argv(i) == "superweapons")           self.items |= IT_SUPERWEAPON;
                        else if(argv(i) == "jetpack")                self.items |= IT_JETPACK;
                        else if(argv(i) == "fuel_regen")             self.items |= IT_FUEL_REGEN;
                        else
@@ -1379,6 +1395,7 @@ void spawnfunc_target_items (void)
                self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_UNLIMITED_SUPERWEAPONS), "unlimited_superweapons");
                self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.strength_finished * !!(self.items & IT_STRENGTH), "strength");
                self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.invincible_finished * !!(self.items & IT_INVINCIBLE), "invincible");
+               self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, self.superweapons_finished * !!(self.items & IT_SUPERWEAPON), "superweapons");
                self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_JETPACK), "jetpack");
                self.netname = sprintf("%s %s%d %s", self.netname, itemprefix, !!(self.items & IT_FUEL_REGEN), "fuel_regen");
                if(self.ammo_shells != 0) self.netname = sprintf("%s %s%d %s", self.netname, valueprefix, max(0, self.ammo_shells), "shells");
@@ -1557,11 +1574,13 @@ float GiveItems(entity e, float beginarg, float endarg)
 
        e.strength_finished = max(0, e.strength_finished - time);
        e.invincible_finished = max(0, e.invincible_finished - time);
+       e.superweapons_finished = max(0, e.superweapons_finished - time);
        
        PREGIVE(e, items);
        PREGIVE(e, weapons);
        PREGIVE(e, strength_finished);
        PREGIVE(e, invincible_finished);
+       PREGIVE(e, superweapons_finished);
        PREGIVE(e, ammo_nails);
        PREGIVE(e, ammo_cells);
        PREGIVE(e, ammo_shells);
@@ -1599,8 +1618,9 @@ float GiveItems(entity e, float beginarg, float endarg)
                                continue;
                        case "ALL":
                                got += GiveBit(e, items, IT_FUEL_REGEN, op, val);
-                               got += GiveValue(e, strength_finished, op, time);
-                               got += GiveValue(e, invincible_finished, op, time);
+                               got += GiveValue(e, strength_finished, op, val);
+                               got += GiveValue(e, invincible_finished, op, val);
+                               got += GiveValue(e, superweapons_finished, op, val);
                                got += GiveBit(e, items, IT_UNLIMITED_AMMO, op, val);
                        case "all":
                                got += GiveBit(e, items, IT_JETPACK, op, val);
@@ -1641,6 +1661,9 @@ float GiveItems(entity e, float beginarg, float endarg)
                        case "invincible":
                                got += GiveValue(e, invincible_finished, op, val);
                                break;
+                       case "superweapons":
+                               got += GiveValue(e, superweapons_finished, op, val);
+                               break;
                        case "cells":
                                got += GiveValue(e, ammo_cells, op, val);
                                break;
@@ -1706,6 +1729,10 @@ float GiveItems(entity e, float beginarg, float endarg)
        POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/armor25.wav", string_null);
        POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
 
+       if(e.superweapons_finished <= 0)
+               if(self.weapons & WEPBIT_SUPERWEAPONS)
+                       e.superweapons_finished = autocvar_g_balance_superweapons_time;
+
        if (g_minstagib)
        {
                e.health = bound(0, e.health, 100);
@@ -1720,6 +1747,10 @@ float GiveItems(entity e, float beginarg, float endarg)
                e.invincible_finished = 0;
        else
                e.invincible_finished += time;
+       if(e.superweapons_finished <= 0)
+               e.superweapons_finished = 0;
+       else
+               e.superweapons_finished += time;
 
        if not(e.weapons & W_WeaponBit(e.switchweapon))
                _switchweapon = TRUE;
index 3cc484da9c9beaaec33fb179cd9be34de25d6807..02463c2c007444ec0b3305b55fd1c7b6cf1b222e 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef REGISTER_WEAPON
-REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", _("Fireball"));
+REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_FLAG_RELOADABLE | WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", _("Fireball"));
 #else
 #ifdef SVQC
 .float bot_primary_fireballmooth; // whatever a mooth is
index 34c71cf50935508902626903d48a75cad3369c44..f688219bd32b0a350a3a052faf58b7f9d68d5b09 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef REGISTER_WEAPON
-REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", _("MinstaNex"))
+REGISTER_WEAPON(MINSTANEX, w_minstanex, IT_CELLS, 7, WEP_FLAG_HIDDEN | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_HIGH, "minstanex", "minstanex", _("MinstaNex"))
 #else
 #ifdef SVQC
 .float minstanex_lasthit;