]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
give superweapons a special respawn time (note: we have no weapons declared as such...
authorRudolf Polzer <divverent@alientrap.org>
Thu, 12 Jan 2012 12:12:27 +0000 (13:12 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Thu, 12 Jan 2012 12:12:27 +0000 (13:12 +0100)
balance25.cfg
balanceFruitieX.cfg
balanceXPM.cfg
balanceXonotic.cfg
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/t_items.qc

index 2374897b7a96321293da169f00756d951fca8eae..612f6f10873ea911cd66a6e4b09461cdca47f002 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 set g_pickup_respawntime_long 30
 set g_pickup_respawntime_powerup 120
 set g_pickup_respawntime_weapon 15
+set g_pickup_respawntime_superweapon 120
 set g_pickup_respawntime_ammo 15
 set g_pickup_respawntimejitter_short 0
 set g_pickup_respawntimejitter_medium 0
 set g_pickup_respawntimejitter_long 0
 set g_pickup_respawntimejitter_powerup 10
 set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
 set g_pickup_respawntimejitter_ammo 0
 // }}}
 
index 8a0bbc0435cc48c47270461571394c87ebac77f4..e135c805b1ed9b20e9bb3285b4eb1cc843a5c0d6 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 set g_pickup_respawntime_long 30
 set g_pickup_respawntime_powerup 120
 set g_pickup_respawntime_weapon 10
+set g_pickup_respawntime_superweapon 120
 set g_pickup_respawntime_ammo 25
 set g_pickup_respawntimejitter_short 0
 set g_pickup_respawntimejitter_medium 0
 set g_pickup_respawntimejitter_long 0
 set g_pickup_respawntimejitter_powerup 10
 set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
 set g_pickup_respawntimejitter_ammo 0
 // }}}
 
index a866d75245fb85bd2a4a43a49b9c50fdcc5a1bf5..57286d56af79368e9fef2d1e501fb66d41273b81 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 set g_pickup_respawntime_long 30
 set g_pickup_respawntime_powerup 120
 set g_pickup_respawntime_weapon 10
+set g_pickup_respawntime_superweapon 120
 set g_pickup_respawntime_ammo 15
 set g_pickup_respawntimejitter_short 0
 set g_pickup_respawntimejitter_medium 0
 set g_pickup_respawntimejitter_long 0
 set g_pickup_respawntimejitter_powerup 30
 set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
 set g_pickup_respawntimejitter_ammo 0
 // }}}
 
index b4e368a28ed36ec8b45ab8ff88e6386243515d72..13a4f9f6f9a9d1c5a1d0b35eb3864cee0f7b2f8f 100644 (file)
@@ -100,12 +100,14 @@ set g_pickup_respawntime_medium 20
 set g_pickup_respawntime_long 30
 set g_pickup_respawntime_powerup 120
 set g_pickup_respawntime_weapon 10
+set g_pickup_respawntime_superweapon 120
 set g_pickup_respawntime_ammo 10
 set g_pickup_respawntimejitter_short 0
 set g_pickup_respawntimejitter_medium 0
 set g_pickup_respawntimejitter_long 0
 set g_pickup_respawntimejitter_powerup 30
 set g_pickup_respawntimejitter_weapon 0
+set g_pickup_respawntimejitter_superweapon 10
 set g_pickup_respawntimejitter_ammo 0
 // }}}
 
index 865d39b10eef9c3369ca63942b29fbd771b09f43..53bfde7ce94bd90d96c8d6f3822a6e99d71387f5 100644 (file)
@@ -27,12 +27,14 @@ float g_ctf_reverse;
 float g_race_qualifying;
 float inWarmupStage;
 float g_pickup_respawntime_weapon;
+float g_pickup_respawntime_superweapon;
 float g_pickup_respawntime_ammo;
 float g_pickup_respawntime_short;
 float g_pickup_respawntime_medium;
 float g_pickup_respawntime_long;
 float g_pickup_respawntime_powerup;
 float g_pickup_respawntimejitter_weapon;
+float g_pickup_respawntimejitter_superweapon;
 float g_pickup_respawntimejitter_ammo;
 float g_pickup_respawntimejitter_short;
 float g_pickup_respawntimejitter_medium;
index 236bea73a2ecda59e3553c7dc91243418b6b804a..7c6c28bf5b361ef6c511ba1702a9ade5e04d6d08 100644 (file)
@@ -1135,12 +1135,14 @@ void readlevelcvars(void)
                inWarmupStage = 0; // these modes cannot work together, sorry
 
        g_pickup_respawntime_weapon = cvar("g_pickup_respawntime_weapon");
+       g_pickup_respawntime_superweapon = cvar("g_pickup_respawntime_superweapon");
        g_pickup_respawntime_ammo = cvar("g_pickup_respawntime_ammo");
        g_pickup_respawntime_short = cvar("g_pickup_respawntime_short");
        g_pickup_respawntime_medium = cvar("g_pickup_respawntime_medium");
        g_pickup_respawntime_long = cvar("g_pickup_respawntime_long");
        g_pickup_respawntime_powerup = cvar("g_pickup_respawntime_powerup");
        g_pickup_respawntimejitter_weapon = cvar("g_pickup_respawntimejitter_weapon");
+       g_pickup_respawntimejitter_superweapon = cvar("g_pickup_respawntimejitter_superweapon");
        g_pickup_respawntimejitter_ammo = cvar("g_pickup_respawntimejitter_ammo");
        g_pickup_respawntimejitter_short = cvar("g_pickup_respawntimejitter_short");
        g_pickup_respawntimejitter_medium = cvar("g_pickup_respawntimejitter_medium");
index 46c7342f4ead3431f4a67995024da8339dab4740..090788a6655661595118c73aa160823099ab0ca4 100644 (file)
@@ -131,7 +131,7 @@ void Item_Show (entity e, float mode)
 
                e.spawnshieldtime = 1;
        }
-       else if((e.flags & FL_WEAPON) && g_weapon_stay)
+       else if((e.flags & FL_WEAPON) && !(get_weaponinfo(e.weapon).items & IT_SUPERWEAPON) && g_weapon_stay)
        {
                // make the item translucent and not touchable
                e.model = e.mdl;
@@ -233,6 +233,15 @@ void Item_RespawnCountdown (void)
                                case IT_FUEL_REGEN:     name = "item-fuelregen"; rgb = '1 0.5 0'; break;
                                case IT_JETPACK:        name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
                        }
+                       if(self.flags & FL_WEAPON)
+                       {
+                               entity wi = get_weaponinfo(self.weapon);
+                               if(wi)
+                               {
+                                       name = wi.model2;
+                                       rgb = '0 0 0';
+                               }
+                       }
                        if(!name)
                        {
                                print("Unknown powerup-marked item is wanting to respawn\n");
@@ -256,7 +265,7 @@ void Item_RespawnCountdown (void)
 
 void Item_ScheduleRespawnIn(entity e, float t)
 {
-       if(e.flags & FL_POWERUP)
+       if((e.flags & FL_POWERUP) || ((e.flags & FL_WEAPON) && (get_weaponinfo(e.weapon).items & IT_SUPERWEAPON)))
        {
                e.think = Item_RespawnCountdown;
                e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
@@ -932,8 +941,8 @@ void weapon_defaultspawnfunc(float wpn)
                e = get_weaponinfo(wpn);
                if(e.items == IT_SUPERWEAPON)
                {
-                       self.respawntime = g_pickup_respawntime_powerup;
-                       self.respawntimejitter = g_pickup_respawntimejitter_powerup;
+                       self.respawntime = g_pickup_respawntime_superweapon;
+                       self.respawntimejitter = g_pickup_respawntimejitter_superweapon;
                }
                else
                {