From: Rudolf Polzer Date: Thu, 12 Jan 2012 12:12:27 +0000 (+0100) Subject: give superweapons a special respawn time (note: we have no weapons declared as such... X-Git-Tag: xonotic-v0.6.0~185^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7dc4c6ee1f6581a922aa18e5cd3edc33d76ec2dc;p=xonotic%2Fxonotic-data.pk3dir.git give superweapons a special respawn time (note: we have no weapons declared as such yet) --- diff --git a/balance25.cfg b/balance25.cfg index 2374897b7..612f6f108 100644 --- a/balance25.cfg +++ b/balance25.cfg @@ -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 // }}} diff --git a/balanceFruitieX.cfg b/balanceFruitieX.cfg index 8a0bbc043..e135c805b 100644 --- a/balanceFruitieX.cfg +++ b/balanceFruitieX.cfg @@ -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 // }}} diff --git a/balanceXPM.cfg b/balanceXPM.cfg index a866d7524..57286d56a 100644 --- a/balanceXPM.cfg +++ b/balanceXPM.cfg @@ -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 // }}} diff --git a/balanceXonotic.cfg b/balanceXonotic.cfg index b4e368a28..13a4f9f6f 100644 --- a/balanceXonotic.cfg +++ b/balanceXonotic.cfg @@ -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 // }}} diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 865d39b10..53bfde7ce 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -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; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 236bea73a..7c6c28bf5 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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"); diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 46c7342f4..090788a66 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -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 {