r4308 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Sep 3 09:58:00 EDT 2008
Author: div0
Date: 2008-09-03 09:58:00 -0400 (Wed, 03 Sep 2008)
New Revision: 4308
Modified:
trunk/data/qcsrc/server/cl_client.qc
trunk/data/qcsrc/server/cl_impulse.qc
trunk/data/qcsrc/server/cl_weapons.qc
trunk/data/qcsrc/server/cl_weaponsystem.qc
trunk/data/qcsrc/server/defs.qh
trunk/data/qcsrc/server/g_damage.qc
trunk/data/qcsrc/server/havocbot.qc
trunk/data/qcsrc/server/miscfunctions.qc
trunk/data/qcsrc/server/portals.qc
trunk/data/qcsrc/server/progs.src
trunk/data/qcsrc/server/t_items.qc
trunk/data/qcsrc/server/teamplay.qc
trunk/data/qcsrc/server/w_nex.qc
trunk/data/qcsrc/server/w_porto.qc
Log:
make the minstagib Nex a separate weapon
Modified: trunk/data/qcsrc/server/cl_client.qc
===================================================================
--- trunk/data/qcsrc/server/cl_client.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/cl_client.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -2156,7 +2156,7 @@
}
if(!zoomstate_set)
- SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && !g_minstagib && self.weapon == WEP_NEX));
+ SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX));
float oldspectatee_status;
oldspectatee_status = self.spectatee_status;
Modified: trunk/data/qcsrc/server/cl_impulse.qc
===================================================================
--- trunk/data/qcsrc/server/cl_impulse.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/cl_impulse.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -112,20 +112,7 @@
{
// weapon switching impulses
if(self.deadflag == DEAD_NO)
- {
- switch(imp)
- {
- case 1: W_CycleWeapon("1", +1); break;
- case 2: W_CycleWeapon("2", +1); break;
- case 3: W_CycleWeapon("3", +1); break;
- case 4: W_CycleWeapon("4", +1); break;
- case 5: W_CycleWeapon("5", +1); break;
- case 6: W_CycleWeapon("6", +1); break;
- case 7: W_CycleWeapon("7", +1); break;
- case 8: W_CycleWeapon("8", +1); break;
- case 9: W_CycleWeapon("9", +1); break;
- }
- }
+ W_NextWeaponOnImpulse(imp);
else
self.impulse = imp; // retry in next frame
}
Modified: trunk/data/qcsrc/server/cl_weapons.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weapons.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/cl_weapons.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -6,7 +6,7 @@
W_SwitchWeapon_Force(self, imp);
};
-float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float complain)
+float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain)
{
float n, i, weaponwant, first_valid, prev_valid, switchtonext, switchtolast;
n = tokenize(weaponorder);
@@ -19,6 +19,11 @@
for(i = 0; i < n; ++i)
{
weaponwant = stof(argv(i));
+
+ if(imp)
+ if((get_weaponinfo(weaponwant)).impulse != imp)
+ continue;
+
if(client_hasweapon(pl, weaponwant, TRUE, FALSE))
{
if(switchtonext)
@@ -50,6 +55,9 @@
for(i = 0; i < n; ++i)
{
weaponwant = stof(argv(i));
+ if(imp)
+ if((get_weaponinfo(weaponwant)).impulse != imp)
+ continue;
client_hasweapon(pl, weaponwant, TRUE, TRUE);
}
}
@@ -59,11 +67,19 @@
void W_CycleWeapon(string weaponorder, float dir)
{
float w;
- w = W_GetCycleWeapon(self, weaponorder, dir, 1);
+ w = W_GetCycleWeapon(self, weaponorder, dir, 0, 1);
if(w > 0)
W_SwitchWeapon(w);
}
+void W_NextWeaponOnImpulse(float imp)
+{
+ float w;
+ w = W_GetCycleWeapon(self, self.cvar_cl_weaponpriority, +1, imp, 1);
+ if(w > 0)
+ W_SwitchWeapon(w);
+}
+
// next weapon
void W_NextWeapon()
{
@@ -98,7 +114,7 @@
if(stof(argv(i)) == w)
break;
if(i == n) // not found
- neworder = strcat(neworder, ftos(w), " ");
+ neworder = strcat(ftos(w), " ", neworder);
}
}
@@ -117,7 +133,7 @@
float w_getbestweapon(entity e)
{
- return W_GetCycleWeapon(e, e.cvar_cl_weaponpriority, 0, 0);
+ return W_GetCycleWeapon(e, e.cvar_cl_weaponpriority, 0, 0, 0);
};
// generic weapons table
@@ -163,8 +179,6 @@
return; // just in case
if (w == WEP_LASER)
return;
- if (g_instagib)
- return;
if (g_rocketarena)
return;
if (g_lms)
@@ -435,14 +449,15 @@
void RegisterWeapons()
{
// %weaponaddpoint
- register_weapon(WEP_LASER, w_laser, 0, "laser", "laser", "Laser");
- register_weapon(WEP_SHOTGUN, w_shotgun, IT_SHELLS, "shotgun", "shotgun", "Shotgun");
- register_weapon(WEP_UZI, w_uzi, IT_NAILS, "uzi", "uzi", "Machine Gun");
- register_weapon(WEP_GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, "gl", "grenadelauncher", "Mortar");
- register_weapon(WEP_ELECTRO, w_electro, IT_CELLS, "electro", "electro", "Electro");
- register_weapon(WEP_CRYLINK, w_crylink, IT_CELLS, "crylink", "crylink", "Crylink");
- register_weapon(WEP_NEX, w_nex, IT_CELLS, "nex", "nex", "Nex");
- register_weapon(WEP_HAGAR, w_hagar, IT_ROCKETS, "hagar", "hagar", "Hagar");
- register_weapon(WEP_ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, "rl", "rocketlauncher", "Rocket Launcher");
- register_weapon(WEP_PORTO, w_porto, IT_SUPERWEAPON, "porto" , "porto", "Port-O-Launch");
+ register_weapon(WEP_LASER, w_laser, 0, 1, 1, "laser", "laser", "Laser");
+ register_weapon(WEP_SHOTGUN, w_shotgun, IT_SHELLS, 2, 1, "shotgun", "shotgun", "Shotgun");
+ register_weapon(WEP_UZI, w_uzi, IT_NAILS, 3, 1, "uzi", "uzi", "Machine Gun");
+ register_weapon(WEP_GRENADE_LAUNCHER, w_glauncher, IT_ROCKETS, 4, 1, "gl", "grenadelauncher", "Mortar");
+ register_weapon(WEP_ELECTRO, w_electro, IT_CELLS, 5, 1, "electro", "electro", "Electro");
+ register_weapon(WEP_CRYLINK, w_crylink, IT_CELLS, 6, 1, "crylink", "crylink", "Crylink");
+ register_weapon(WEP_NEX, w_nex, IT_CELLS, 7, 1, "nex", "nex", "Nex");
+ register_weapon(WEP_HAGAR, w_hagar, IT_ROCKETS, 8, 1, "hagar", "hagar", "Hagar");
+ register_weapon(WEP_ROCKET_LAUNCHER, w_rlauncher, IT_ROCKETS, 9, 1, "rl", "rocketlauncher", "Rocket Launcher");
+ register_weapon(WEP_PORTO, w_porto, IT_SUPERWEAPON, 1, 0, "porto" , "porto", "Port-O-Launch");
+ register_weapon(WEP_MINSTANEX, w_minstanex, IT_CELLS, 7, 0, "nex", "minstanex", "MinstaNex");
}
Modified: trunk/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- trunk/data/qcsrc/server/cl_weaponsystem.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/cl_weaponsystem.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -588,7 +588,7 @@
entity weapon_info[24];
entity dummy_weapon_info;
.float(float) weapon_func;
-void register_weapon(float id, float(float) func, float ammotype, string modelname, string shortname, string name)
+void register_weapon(float id, float(float) func, float ammotype, float i, float normalweapon, string modelname, string shortname, string name)
{
entity e;
weapon_info[id - 1] = e = spawn();
@@ -601,6 +601,8 @@
e.weapon_func = func;
e.mdl = modelname;
e.model = strzone(strcat("models/weapons/g_", modelname, ".md3"));
+ e.spawnflags = normalweapon;
+ e.impulse = i;
}
float w_null(float dummy)
{
@@ -617,6 +619,8 @@
dummy_weapon_info.weapon_func = w_null;
dummy_weapon_info.mdl = "";
dummy_weapon_info.model = "";
+ dummy_weapon_info.spawnflags = 0;
+ dummy_weapon_info.impulse = 0;
}
entity get_weaponinfo(float id)
{
Modified: trunk/data/qcsrc/server/defs.qh
===================================================================
--- trunk/data/qcsrc/server/defs.qh 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/defs.qh 2008-09-03 13:58:00 UTC (rev 4308)
@@ -17,7 +17,7 @@
// Globals
float g_dm, g_domination, g_ctf, g_tdm, g_keyhunt, g_onslaught, g_assault, g_arena, g_lms, g_runematch, g_race;
-float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_instagib, g_laserguided_missile, g_midair, g_minstagib, g_nixnex, g_nixnex_with_laser, g_norecoil, g_rocketarena, g_vampire, g_minstagib_invis_alpha;
+float g_cloaked, g_footsteps, g_jump_grunt, g_grappling_hook, g_laserguided_missile, g_midair, g_minstagib, g_nixnex, g_nixnex_with_laser, g_norecoil, g_rocketarena, g_vampire, g_minstagib_invis_alpha;
float g_tourney;
float g_ctf_win_mode;
float g_race_qualifying;
Modified: trunk/data/qcsrc/server/g_damage.qc
===================================================================
--- trunk/data/qcsrc/server/g_damage.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/g_damage.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -564,14 +564,14 @@
(deathtype == DEATH_SLIME) ||
(deathtype == DEATH_LAVA))
return;
- if (targ.armorvalue && (deathtype == WEP_NEX) && damage)
+ if (targ.armorvalue && (deathtype == WEP_MINSTANEX) && damage)
{
targ.armorvalue -= 1;
centerprint(targ, strcat("^3Remaining extra lives: ",ftos(targ.armorvalue),"\n"));
damage = 0;
targ.hitsound += 1;
}
- else if (deathtype == WEP_NEX && targ.items & IT_STRENGTH)
+ else if (deathtype == WEP_MINSTANEX && targ.items & IT_STRENGTH)
{
if(clienttype(attacker) == CLIENTTYPE_REAL)
if(IsDifferentTeam(targ, attacker))
@@ -663,7 +663,6 @@
// Savage: vampire mode
if (g_vampire)
if (!g_minstagib)
- if (!g_instagib)
if (time > self.spawnshieldtime)
{
attacker.health += damage;
Modified: trunk/data/qcsrc/server/havocbot.qc
===================================================================
--- trunk/data/qcsrc/server/havocbot.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/havocbot.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -340,6 +340,7 @@
local float uzi ; uzi =-1000;
local float shotgun ; shotgun =-1000;
local float laser ; laser =-1000;
+ local float minstanex ; minstanex =-1000;
local float currentscore;
local float bestscore; bestscore = 0;
local float bestweapon; bestweapon=self.switchweapon;
@@ -355,6 +356,9 @@
// *(Spread change of hit) // if it applies
// *(Penality for target beeing in air)
// %weaponaddpoint
+ if (client_hasweapon(self, WEP_MINSTANEX, TRUE, FALSE))
+ minstanex = (1000/cvar("g_balance_minstanex_refire")*1.0)
+ * (0.5);
if (client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE))
rocket = (cvar("g_balance_rocketlauncher_damage")/cvar("g_balance_rocketlauncher_refire")*0.75)
* bound(0,(cvar("g_balance_rocketlauncher_speed")/distance*maxdelaytime),1)*1.5;
@@ -401,15 +405,16 @@
dprint("Laser :", ftos(laser ), "\n\n");
*/
currentscore = -1;
- w = WEP_ROCKET_LAUNCHER ;s = rocket ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_NEX ;s = nex ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_HAGAR ;s = hagar ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_GRENADE_LAUNCHER ;s = grenade;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_ELECTRO ;s = electro;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_CRYLINK ;s = crylink;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_UZI ;s = uzi ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_SHOTGUN ;s = shotgun;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
- w = WEP_LASER ;s = laser ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_MINSTANEX ;s = minstanex;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_ROCKET_LAUNCHER ;s = rocket ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_NEX ;s = nex ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_HAGAR ;s = hagar ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_GRENADE_LAUNCHER ;s = grenade ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_ELECTRO ;s = electro ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_CRYLINK ;s = crylink ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_UZI ;s = uzi ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_SHOTGUN ;s = shotgun ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+ w = WEP_LASER ;s = laser ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
// switch if the best weapon would provide a significant damage increase
if (bestscore > currentscore*1.5)
Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/miscfunctions.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -720,7 +720,6 @@
g_jump_grunt = cvar("g_jump_grunt");
g_footsteps = cvar("g_footsteps");
g_grappling_hook = cvar("g_grappling_hook");
- g_instagib = cvar("g_instagib");
g_laserguided_missile = cvar("g_laserguided_missile");
g_midair = cvar("g_midair");
g_minstagib = cvar("g_minstagib");
@@ -735,7 +734,6 @@
sv_pogostick = cvar("sv_pogostick");
sv_doublejump = cvar("sv_doublejump");
- if(g_instagib) g_minstagib = g_nixnex = g_rocketarena = 0;
if(g_minstagib) g_nixnex = g_rocketarena = 0;
if(g_nixnex) g_rocketarena = 0;
@@ -772,15 +770,8 @@
start_health = cvar("g_balance_health_start");
start_armorvalue = cvar("g_balance_armor_start");
- if(g_instagib)
+ if(g_rocketarena)
{
- start_weapons = WEPBIT_NEX;
- start_switchweapon = WEP_NEX;
- weapon_action(start_switchweapon, WR_PRECACHE);
- start_ammo_cells = 999;
- }
- else if(g_rocketarena)
- {
start_weapons = WEPBIT_ROCKET_LAUNCHER;
start_switchweapon = WEP_ROCKET_LAUNCHER;
weapon_action(start_switchweapon, WR_PRECACHE);
@@ -795,8 +786,8 @@
{
start_health = 100;
start_armorvalue = 0;
- start_weapons = WEPBIT_NEX;
- start_switchweapon = WEP_NEX;
+ start_weapons = WEPBIT_MINSTANEX;
+ start_switchweapon = WEP_MINSTANEX;
weapon_action(start_switchweapon, WR_PRECACHE);
start_ammo_cells = cvar("g_minstagib_ammo_start");
g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
@@ -837,7 +828,7 @@
e = get_weaponinfo(i);
if(!(e.weapon))
continue;
- if((e.items != IT_SUPERWEAPON && (g_lms || g_tourney)) || cvar(strcat("g_start_weapon_", e.netname)))
+ if(!(e.items & IT_SUPERWEAPON && (g_lms || g_tourney)) || cvar(strcat("g_start_weapon_", e.netname)))
{
start_weapons |= e.weapons;
start_switchweapon = e.weapon;
@@ -1396,4 +1387,4 @@
self.use = assault_destructible_use; // shared use function, b/c they woudl do the same thing anyways
self.event_damage = func_breakable_damage;
-}
\ No newline at end of file
+}
Modified: trunk/data/qcsrc/server/portals.qc
===================================================================
--- trunk/data/qcsrc/server/portals.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/portals.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -1,7 +1,6 @@
.vector portal_transform;
.vector portal_safe_origin;
.float portal_wants_to_vanish;
-.float portal_id;
.float portal_activatetime;
.entity portal_in, portal_out;
Modified: trunk/data/qcsrc/server/progs.src
===================================================================
--- trunk/data/qcsrc/server/progs.src 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/progs.src 2008-09-03 13:58:00 UTC (rev 4308)
@@ -78,6 +78,7 @@
w_electro.qc
w_crylink.qc
w_nex.qc
+w_minstanex.qc
w_hagar.qc
w_rocketlauncher.qc
w_porto.qc
Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/t_items.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -91,8 +91,8 @@
// else if(self.items == IT_CELLS)
// play2(other, "announce/robotic/ammo.ogg");
- if (self.weapons & WEPBIT_NEX)
- W_GiveWeapon (other, WEP_NEX, "Nex");
+ if (self.weapons & WEPBIT_MINSTANEX)
+ W_GiveWeapon (other, WEP_MINSTANEX, "Nex");
if (self.ammo_cells)
other.ammo_cells = min (other.ammo_cells + cvar("g_minstagib_ammo_drop"), 999);
other.health = 100;
@@ -403,7 +403,7 @@
weaponsInMap |= weaponid;
- if(g_lms || g_instagib || g_rocketarena)
+ if(g_lms || g_rocketarena)
{
startitem_failed = TRUE;
remove(self);
@@ -476,7 +476,7 @@
self.ammo_cells = 25;
StartItem ("models/weapons/g_nex.md3",
"weapons/weaponpickup.wav", 15,
- "Nex Gun", 0, WEPBIT_NEX, FL_WEAPON, generic_pickupevalfunc, 1000);
+ "MinstaNex", 0, WEPBIT_MINSTANEX, FL_WEAPON, generic_pickupevalfunc, 1000);
return;
}
@@ -593,6 +593,18 @@
weapon_defaultspawnfunc(WEP_NEX, 10000);
}
+void spawnfunc_weapon_minstanex (void)
+{
+ if (g_minstagib)
+ {
+ minstagib_items(IT_CELLS);
+ self.think = minst_remove_item;
+ self.nextthink = time + cvar("sys_ticrate");
+ return;
+ }
+ weapon_defaultspawnfunc(WEP_MINSTANEX, 10000);
+}
+
void spawnfunc_weapon_rocketlauncher (void)
{
if (g_minstagib)
Modified: trunk/data/qcsrc/server/teamplay.qc
===================================================================
--- trunk/data/qcsrc/server/teamplay.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/teamplay.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -383,8 +383,6 @@
if(g_minstagib)
mutator = "^2Minstagib ^1";
- else if(g_instagib)
- mutator = "^2Instagib ^1";
else if(g_rocketarena)
mutator = "^2Rocketarena ^1";
else if(g_nixnex)
Modified: trunk/data/qcsrc/server/w_nex.qc
===================================================================
--- trunk/data/qcsrc/server/w_nex.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/w_nex.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -1,25 +1,16 @@
-
void W_Nex_Attack (void)
{
float flying;
- if not(g_minstagib || g_instagib)
- flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
+ flying = IsFlying(self); // do this BEFORE to make the trace values from FireRailgunBullet last
W_SetupShot (self, '25 4 -4', TRUE, 5, "weapons/nexfire.wav");
- //W_SetupShot (self, '25 8 -8', TRUE, 2, "weapons/nexfire.wav"); // TODO: move model down a little
- // assure that nexdamage is high enough in minstagib
- if (g_minstagib || g_instagib)
- FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 1000, 800, WEP_NEX);
- else
- {
- yoda = 0;
- FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), WEP_NEX);
+ yoda = 0;
+ FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, cvar("g_balance_nex_damage"), cvar("g_balance_nex_force"), WEP_NEX);
- if(yoda)
- if(flying)
- announce(self, "announcer/male/yoda.ogg");
- }
+ if(yoda)
+ if(flying)
+ announce(self, "announcer/male/yoda.ogg");
pointparticles(particleeffectnum("nex_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
@@ -31,94 +22,12 @@
// play a sound
soundat (self, trace_endpos, CHAN_PROJECTILE, "weapons/neximpact.wav", VOL_BASE, ATTN_NORM);
- if (cvar("g_use_ammunition") && !g_instagib)
+ if (cvar("g_use_ammunition"))
{
- if (g_minstagib)
- self.ammo_cells = self.ammo_cells - 1;
- else
- self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
+ self.ammo_cells = self.ammo_cells - cvar("g_balance_nex_ammo");
}
}
-
-.float minstagib_nextthink;
-void minstagib_ammocheck (void)
-{
- if (time < self.minstagib_nextthink || self.deadflag || gameover)
- return;
-
- if (self.ammo_cells <= 0)
- {
- if (self.health == 5)
- {
- centerprint(self, "you're dead now...\n");
- Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/terminated.ogg");
- }
- if (self.health == 10)
- {
- centerprint(self, "^11^7 second left to find some ammo\n");
- Damage(self, self, self, 5, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/1.ogg");
- }
- if (self.health == 20)
- {
- centerprint(self, "^12^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/2.ogg");
- }
- if (self.health == 30)
- {
- centerprint(self, "^13^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/3.ogg");
- }
- if (self.health == 40)
- {
- centerprint(self, "^14^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/4.ogg");
- }
- if (self.health == 50)
- {
- centerprint(self, "^15^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/5.ogg");
- }
- if (self.health == 60)
- {
- centerprint(self, "^36^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/6.ogg");
- }
- if (self.health == 70)
- {
- centerprint(self, "^37^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/7.ogg");
- }
- if (self.health == 80)
- {
- centerprint(self, "^38^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/8.ogg");
- }
- if (self.health == 90)
- {
- centerprint(self, "^39^7 seconds left to find some ammo\n");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/9.ogg");
- }
- if (self.health == 100)
- {
- centerprint(self, "get some ammo or\nyou'll be dead in ^310^7 seconds...");
- Damage(self, self, self, 10, DEATH_NOAMMO, self.origin, '0 0 0');
- announce(self, "announcer/robotic/10.ogg");
- }
- }
- self.minstagib_nextthink = time + 1;
-}
-
void spawnfunc_weapon_nex (void); // defined in t_items.qc
float w_nex(float req)
@@ -129,34 +38,12 @@
{
if (self.BUTTON_ATCK)
{
- if(g_minstagib)
+ if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
{
- if (weapon_prepareattack(0, cvar("g_balance_minstagib_nex_refire")))
- {
- W_Nex_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_minstagib_nex_animtime"), w_ready);
- }
+ W_Nex_Attack();
+ weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
}
- else
- {
- if (weapon_prepareattack(0, cvar("g_balance_nex_refire")))
- {
- W_Nex_Attack();
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_nex_animtime"), w_ready);
- }
- }
}
- else if (self.BUTTON_ATCK2)
- {
- if (g_minstagib)
- {
- if (self.jump_interval <= time)
- {
- self.jump_interval = time + 0.9;
- W_Laser_Attack(FALSE);
- }
- }
- }
}
else if (req == WR_PRECACHE)
{
@@ -166,18 +53,11 @@
precache_model ("models/weapons/w_nex.zym");
precache_sound ("weapons/nexfire.wav");
precache_sound ("weapons/neximpact.wav");
- if(g_minstagib)
- w_laser(WR_PRECACHE);
}
else if (req == WR_SETUP)
weapon_setup(WEP_NEX);
else if (req == WR_CHECKAMMO1)
- {
- if (g_minstagib)
- return self.ammo_cells >= 1;
- else
- return self.ammo_cells >= cvar("g_balance_nex_ammo");
- }
+ return self.ammo_cells >= cvar("g_balance_nex_ammo");
else if (req == WR_CHECKAMMO2)
return FALSE;
else if (req == WR_SUICIDEMESSAGE)
Modified: trunk/data/qcsrc/server/w_porto.qc
===================================================================
--- trunk/data/qcsrc/server/w_porto.qc 2008-09-03 12:20:00 UTC (rev 4307)
+++ trunk/data/qcsrc/server/w_porto.qc 2008-09-03 13:58:00 UTC (rev 4308)
@@ -130,6 +130,7 @@
precache_model ("models/weapons/v_porto.md3");
precache_model ("models/weapons/w_porto.zym");
precache_sound ("weapons/grenade_fire.wav");
+ precache_model ("models/portal.md3");
}
else if (req == WR_SETUP)
weapon_setup(WEP_PORTO);
More information about the nexuiz-commits
mailing list