2003-10-22 09:24:50 +00:00
|
|
|
|
#include "paroxysm.rh"
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// called by worldspawn - POX - added lots'o'junk here...
|
|
|
|
|
void() W_Precache =
|
|
|
|
|
{
|
|
|
|
|
precache_model ("progs/plasma.mdl");
|
|
|
|
|
precache_model ("progs/laser.mdl");
|
|
|
|
|
|
|
|
|
|
precache_sound ("weapons/r_exp3.wav"); // new rocket explosion
|
|
|
|
|
precache_sound ("weapons/rocket1i.wav"); // spike gun
|
|
|
|
|
precache_sound ("weapons/sgun1.wav");
|
|
|
|
|
precache_sound ("weapons/ric1.wav"); // ricochet (used in c code)
|
|
|
|
|
precache_sound ("weapons/ric2.wav"); // ricochet (used in c code)
|
|
|
|
|
precache_sound ("weapons/ric3.wav"); // ricochet (used in c code)
|
|
|
|
|
precache_sound ("weapons/spike2.wav"); // super spikes
|
|
|
|
|
precache_sound ("weapons/hog.wav"); // new nailgun sound
|
|
|
|
|
precache_sound ("weapons/tink1.wav"); // spikes tink (used in c code)
|
|
|
|
|
precache_sound ("weapons/tink2.wav");
|
|
|
|
|
precache_sound ("weapons/gren.wav"); // grenade launcher
|
|
|
|
|
precache_sound ("weapons/gren2.wav"); // second trigger grenades
|
|
|
|
|
precache_sound ("weapons/bounce.wav"); // grenade bounce
|
|
|
|
|
precache_sound ("weapons/bounce2.wav"); // grenade bounce alt
|
|
|
|
|
precache_sound ("weapons/shotgn2.wav"); // super shotgun
|
|
|
|
|
|
|
|
|
|
precache_sound ("weapons/mfire1.wav"); // misfire
|
|
|
|
|
precache_sound ("weapons/mfire2.wav"); // megaplasma burst misfire
|
|
|
|
|
precache_sound ("weapons/plasma.wav"); // plasmagun fire
|
|
|
|
|
precache_sound ("weapons/mplasma.wav"); // megaplasmagun fire
|
|
|
|
|
precache_sound ("weapons/mplasex.wav"); // megaplasmagun explosion
|
|
|
|
|
precache_sound ("weapons/gren.wav"); // super shotgun grenade fire
|
|
|
|
|
precache_sound ("weapons/armed.wav"); // mine armed sound
|
|
|
|
|
precache_sound ("weapons/minedet.wav"); //mine detonate click
|
|
|
|
|
|
|
|
|
|
precache_sound ("weapons/rhino.wav"); //rhino firing sound
|
|
|
|
|
precache_sound ("weapons/rhinore.wav"); //rhino reload sound
|
|
|
|
|
precache_sound ("weapons/error.wav"); //weapon error sound
|
|
|
|
|
|
|
|
|
|
precache_sound ("weapons/tsload.wav"); //t-shot load
|
|
|
|
|
precache_sound ("weapons/tsfire.wav"); //t-shot single fire
|
|
|
|
|
precache_sound ("weapons/ts3fire.wav"); //t-shot triple fire
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
precache_sound ("weapons/shrapdet.wav"); //ShrapnelBomb detonation-confirmation beep
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
Precached models
|
|
|
|
|
*/
|
|
|
|
|
precache_model ("progs/mwrub1.mdl"); //Shrapnel Model
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
// VisWeap - Player
|
|
|
|
|
precache_model ("progs/bsaw_p.mdl");
|
|
|
|
|
precache_model ("progs/tshot_p.mdl");
|
|
|
|
|
precache_model ("progs/combo_p.mdl");
|
|
|
|
|
precache_model ("progs/plasma_p.mdl");
|
|
|
|
|
precache_model ("progs/nail_p.mdl");
|
|
|
|
|
precache_model ("progs/gren_p.mdl");
|
|
|
|
|
precache_model ("progs/rhino_p.mdl");
|
|
|
|
|
|
|
|
|
|
// VisWeap - Weapon drop
|
|
|
|
|
precache_model ("progs/d_bsaw.mdl");
|
|
|
|
|
precache_model ("progs/d_tshot.mdl");
|
|
|
|
|
precache_model ("progs/d_combo.mdl");
|
|
|
|
|
precache_model ("progs/d_plasma.mdl");
|
|
|
|
|
precache_model ("progs/d_nail.mdl");
|
|
|
|
|
precache_model ("progs/d_gren.mdl");
|
|
|
|
|
precache_model ("progs/d_rhino.mdl");
|
|
|
|
|
|
|
|
|
|
// No weapon Death Model (weapons are dropped)
|
|
|
|
|
precache_model ("progs/death_p.mdl");
|
|
|
|
|
*/
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
W_FireAxe
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void() W_FireAxe =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local vector org, source;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
|
|
|
|
source = @self.origin + '0 0 16';
|
2004-02-12 05:38:54 +00:00
|
|
|
|
traceline (source, source + v_forward * 64, FALSE, @self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
if (trace_fraction == 1.0)
|
|
|
|
|
return;
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
org = trace_endpos - v_forward * 4;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (trace_ent.takedamage) {
|
|
|
|
|
trace_ent.axhitme = 1;
|
|
|
|
|
SpawnBlood (org, 20);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
// if (deathmatch > 3)
|
|
|
|
|
// T_Damage (trace_ent, @self, @self, 75);
|
|
|
|
|
// else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_Damage (trace_ent, @self, @self, 20);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else { // hit wall
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_WEAPON, "player/axhit2.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_GUNSHOT, 3.0);
|
|
|
|
|
WriteCoordV (MSG_MULTICAST, org);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
multicast (org, MULTICAST_PVS);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
SpawnMeatSpray
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void(vector org, vector vel) SpawnMeatSpray =
|
|
|
|
|
{
|
|
|
|
|
local entity missile;
|
|
|
|
|
|
|
|
|
|
missile = spawn ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
missile.owner = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
missile.movetype = MOVETYPE_BOUNCE;
|
|
|
|
|
missile.solid = SOLID_NOT;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.angles);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
missile.velocity = vel;
|
2004-02-12 05:38:54 +00:00
|
|
|
|
missile.velocity_z = missile.velocity_z + 250 + 50 * random();
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
missile.avelocity = '3000 1000 2000';
|
2004-02-12 05:38:54 +00:00
|
|
|
|
|
|
|
|
|
// set missile duration
|
2003-10-22 09:24:50 +00:00
|
|
|
|
missile.nextthink = time + 1;
|
|
|
|
|
missile.think = SUB_Remove;
|
|
|
|
|
|
|
|
|
|
setmodel (missile, "progs/zom_gib.mdl");
|
|
|
|
|
setsize (missile, '0 0 0', '0 0 0');
|
|
|
|
|
setorigin (missile, org);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
SpawnBlood
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void(vector org, float damage) SpawnBlood =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local float type, count;
|
|
|
|
|
|
2003-10-22 09:24:50 +00:00
|
|
|
|
if (trace_ent.nobleed) {
|
2004-02-12 05:38:54 +00:00
|
|
|
|
type = TE_GUNSHOT;
|
2004-02-12 22:15:37 +00:00
|
|
|
|
count = 5.0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else {
|
2004-02-12 05:38:54 +00:00
|
|
|
|
type = TE_BLOOD;
|
|
|
|
|
count = 1.0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
2004-02-12 22:15:37 +00:00
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, type, count);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
WriteCoordV (MSG_MULTICAST, org);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
multicast (org, MULTICAST_PVS);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
spawn_touchblood
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void(float damage) spawn_touchblood =
|
|
|
|
|
{
|
|
|
|
|
local vector vel;
|
|
|
|
|
|
|
|
|
|
vel = wall_velocity () * 0.2;
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
SpawnBlood (@self.origin + vel * 0.01, damage);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
|
|
MULTI-DAMAGE
|
|
|
|
|
|
|
|
|
|
Collects multiple small damages into a single damage
|
|
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
entity multi_ent;
|
|
|
|
|
float multi_damage;
|
|
|
|
|
|
|
|
|
|
vector blood_org;
|
|
|
|
|
float blood_count;
|
|
|
|
|
|
|
|
|
|
vector puff_org;
|
|
|
|
|
float puff_count;
|
|
|
|
|
|
|
|
|
|
void() ClearMultiDamage =
|
|
|
|
|
{
|
|
|
|
|
multi_ent = world;
|
|
|
|
|
multi_damage = 0;
|
|
|
|
|
blood_count = 0;
|
|
|
|
|
puff_count = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() ApplyMultiDamage =
|
|
|
|
|
{
|
|
|
|
|
if (!multi_ent)
|
|
|
|
|
return;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_Damage (multi_ent, @self, @self, multi_damage);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(entity hit, float damage) AddMultiDamage =
|
|
|
|
|
{
|
|
|
|
|
if (!hit)
|
|
|
|
|
return;
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (hit != multi_ent) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
ApplyMultiDamage ();
|
|
|
|
|
multi_damage = damage;
|
|
|
|
|
multi_ent = hit;
|
2004-02-12 05:38:54 +00:00
|
|
|
|
} else
|
|
|
|
|
multi_damage += damage;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() Multi_Finish =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (puff_count) {
|
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_GUNSHOT, puff_count);
|
|
|
|
|
WriteCoordV (MSG_MULTICAST, puff_org);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (blood_count) {
|
2004-02-12 22:15:37 +00:00
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_BLOOD, blood_count);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
WriteCoordV (MSG_MULTICAST, blood_org);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
2004-02-12 05:38:54 +00:00
|
|
|
|
multicast (puff_org, MULTICAST_PVS);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
==============================================================================
|
|
|
|
|
BULLETS
|
|
|
|
|
==============================================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
TraceAttack
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void(float damage, vector dir) TraceAttack =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local vector org, vel;
|
|
|
|
|
|
|
|
|
|
vel = normalize (dir + v_up * crandom () + v_right * crandom ());
|
|
|
|
|
vel += 2 * trace_plane_normal;
|
|
|
|
|
vel *= 200;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
org = trace_endpos - dir * 4;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
// + POX - added nobleed check
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (trace_ent.takedamage && !trace_ent.nobleed) {
|
|
|
|
|
blood_count++;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
blood_org = org;
|
|
|
|
|
AddMultiDamage (trace_ent, damage);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
} else if (trace_ent.takedamage && trace_ent.nobleed) {
|
|
|
|
|
puff_count++;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
puff_org = org;
|
|
|
|
|
AddMultiDamage (trace_ent, damage);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
} else { // - POX
|
|
|
|
|
puff_count++;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* POX - for the tShot second trigger, half the bullets twice the damage
|
|
|
|
|
================
|
|
|
|
|
FireBullets2
|
|
|
|
|
|
|
|
|
|
Used by shotgun, super shotgun, and enemy soldier firing
|
|
|
|
|
Go to the trouble of combining multiple pellets into a single damage call.
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void(float shotcount, vector dir, vector spread) FireBullets2 =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local vector direction, src;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
|
|
|
|
|
|
|
|
|
src = @self.origin + v_forward * 10;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
src_z = @self.absmin_z + @self.size_z * 0.7;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
ClearMultiDamage ();
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
traceline (src, src + dir * 2048, FALSE, @self);
|
|
|
|
|
puff_org = trace_endpos - dir * 4;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
while (shotcount > 0) {
|
|
|
|
|
direction = dir + crandom () * spread_x * v_right + crandom () * spread_y * v_up;
|
|
|
|
|
traceline (src, src + direction * 2048, FALSE, @self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
if (trace_fraction != 1.0)
|
|
|
|
|
TraceAttack (8, direction); //POX 4*2
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
shotcount--;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
ApplyMultiDamage ();
|
|
|
|
|
Multi_Finish ();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
FireBullets
|
|
|
|
|
|
|
|
|
|
Used by shotgun, super shotgun, and enemy soldier firing
|
|
|
|
|
Go to the trouble of combining multiple pellets into a single damage call.
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void(float shotcount, vector dir, vector spread) FireBullets =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local vector direction, src;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
src = @self.origin + v_forward*10;
|
|
|
|
|
src_z = @self.absmin_z + @self.size_z * 0.7;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
ClearMultiDamage ();
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
traceline (src, src + dir * 2048, FALSE, @self);
|
|
|
|
|
puff_org = trace_endpos - dir * 4;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
while (shotcount > 0) {
|
|
|
|
|
direction = dir + crandom () * spread_x * v_right + crandom () * spread_y * v_up;
|
|
|
|
|
traceline (src, src + direction * 2048, FALSE, @self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
if (trace_fraction != 1.0)
|
|
|
|
|
TraceAttack (4, direction);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
shotcount--;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
ApplyMultiDamage ();
|
|
|
|
|
Multi_Finish ();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
W_FireShotgun
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void() W_FireShotgun =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local vector dir;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_WEAPON, "weapons/tsfire.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
msg_entity = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
|
|
|
|
|
|
|
|
|
//POX - May not need this (SVC_SMALLKICK?)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.flags & FL_ONGROUND)
|
2004-02-12 05:38:54 +00:00
|
|
|
|
@self.velocity = @self.velocity + v_forward * -35;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
@self.currentammo = @self.ammo_shells -= 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
dir = aim (@self, 100000);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
FireBullets (6, dir, '0.04 0.04 0');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
W_FireSuperShotgun
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void() W_FireSuperShotgun =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local float bullets, used;
|
|
|
|
|
local vector dir;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
bullets = 14;
|
|
|
|
|
used = 2;
|
|
|
|
|
|
|
|
|
|
//POX v1.1 don't plat tShot sound...
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (@self.currentammo == 1) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
bullets = 6;
|
|
|
|
|
used = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self ,CHAN_WEAPON, "weapons/shotgn2.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
msg_entity = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
WriteByte (MSG_ONE, SVC_BIGKICK);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.flags & FL_ONGROUND)
|
|
|
|
|
@self.velocity = @self.velocity + v_forward* -60;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
//if (deathmatch != 4)
|
2004-02-12 05:38:54 +00:00
|
|
|
|
@self.currentammo = @self.ammo_shells -= used;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
dir = aim (@self, 100000);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
FireBullets (14, dir, '0.14 0.08 0');
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
==============================================================================
|
|
|
|
|
|
|
|
|
|
ROCKETS
|
|
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
void() T_MissileTouch =
|
|
|
|
|
{
|
|
|
|
|
local float damg;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (other == @self.owner)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return; // don't explode on owner
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.voided) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.voided = 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (pointcontents(@self.origin) == CONTENT_SKY) {
|
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
damg = 20 + random() * 10;
|
|
|
|
|
|
|
|
|
|
if (other.health) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
other.deathtype = "rocket";
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_Damage (other, @self, @self.owner, damg );
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// don't do radius damage to the other, because all the damage
|
|
|
|
|
// was done in the impact
|
|
|
|
|
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_RadiusDamage (@self, @self.owner, 90, other, "rocket");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
// sound (@self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.origin = @self.origin - 8 * normalize (@self.velocity);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_EXPLOSION);
|
|
|
|
|
WriteCoordV (MSG_MULTICAST, @self.origin);
|
2003-10-22 21:54:29 +00:00
|
|
|
|
multicast (@self.origin, MULTICAST_PHS);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
W_FireRocket
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void(vector barrel) W_FireRocket =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
@self.currentammo = @self.ammo_rockets -= 0.5;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
// if player fired last rocket reset the reload bit
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets == 0)
|
|
|
|
|
@self.reload_rocket = 0;
|
2004-02-12 05:38:54 +00:00
|
|
|
|
else // player has rockets left so add 1 to reload count
|
|
|
|
|
@self.reload_rocket += 1;
|
|
|
|
|
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis = spawn ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
newmis.owner = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.movetype = MOVETYPE_TOSS;
|
|
|
|
|
newmis.solid = SOLID_BBOX;
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
// set newmis speed
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
newmis.velocity = v_forward * 1100 + v_up * 220 + v_right * -22;
|
|
|
|
|
newmis.angles = vectoangles (newmis.velocity);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
newmis.touch = T_MissileTouch;
|
|
|
|
|
newmis.voided = 0;
|
2004-02-12 05:38:54 +00:00
|
|
|
|
|
|
|
|
|
// set newmis duration
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.nextthink = time + 5;
|
|
|
|
|
newmis.think = SUB_Remove;
|
|
|
|
|
newmis.classname = "rocket";
|
|
|
|
|
|
|
|
|
|
setmodel (newmis, "progs/grenade.mdl");
|
|
|
|
|
setsize (newmis, '0 0 0', '0 0 0');
|
2004-02-12 05:38:54 +00:00
|
|
|
|
setorigin (newmis, @self.origin + v_forward * 8 + v_right * 12 + barrel);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
|
|
void() GrenadeExplode =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.voided) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.voided = 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_RadiusDamage (@self, @self.owner, 120, world, "grenade");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_EXPLOSION);
|
|
|
|
|
WriteCoordV (MSG_MULTICAST, @self.origin);
|
2003-10-22 21:54:29 +00:00
|
|
|
|
multicast (@self.origin, MULTICAST_PHS);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() GrenadeTouch =
|
|
|
|
|
{
|
2004-02-12 05:38:54 +00:00
|
|
|
|
local float r;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
r = random ();
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (other == @self.owner)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return; // don't explode on owner
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (other.takedamage == DAMAGE_AIM) {
|
|
|
|
|
GrenadeExplode ();
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//pick a bounce sound
|
|
|
|
|
if (r < 0.75)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_VOICE, "weapons/bounce2.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.velocity == '0 0 0')
|
|
|
|
|
@self.avelocity = '0 0 0';
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
================
|
|
|
|
|
W_FireGrenade
|
|
|
|
|
================
|
|
|
|
|
*/
|
|
|
|
|
void() W_FireGrenade =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.currentammo = @self.ammo_rockets = @self.ammo_rockets - 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_WEAPON, "weapons/gren.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
msg_entity = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.flags & FL_ONGROUND)
|
2004-02-12 05:38:54 +00:00
|
|
|
|
@self.velocity += v_forward * -75;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
newmis = spawn ();
|
|
|
|
|
newmis.voided=0;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
newmis.owner = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.movetype = MOVETYPE_BOUNCE;
|
|
|
|
|
newmis.solid = SOLID_BBOX;
|
|
|
|
|
newmis.classname = "grenade";
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
// set newmis speed
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (@self.v_angle_x) {
|
|
|
|
|
newmis.velocity = v_forward * 600 + v_up * 200 + crandom () * v_right * 10 + crandom () * v_up * 10;
|
|
|
|
|
} else {
|
|
|
|
|
newmis.velocity = aim (@self, 10000);
|
|
|
|
|
newmis.velocity *= 600;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.velocity_z = 200;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
newmis.avelocity = '300 300 300';
|
|
|
|
|
|
|
|
|
|
newmis.angles = vectoangles(newmis.velocity);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.touch = GrenadeTouch;
|
|
|
|
|
|
|
|
|
|
newmis.nextthink = time + 2.5;
|
|
|
|
|
|
|
|
|
|
newmis.think = GrenadeExplode;
|
|
|
|
|
|
|
|
|
|
setmodel (newmis, "progs/grenade.mdl");
|
|
|
|
|
setsize (newmis, '0 0 0', '0 0 0');
|
2003-10-22 21:54:29 +00:00
|
|
|
|
setorigin (newmis, @self.origin);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
|
// + POX - Plasma
|
|
|
|
|
|
|
|
|
|
void() plasma_touch =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (other == @self.owner)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.voided) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.voided = 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (other.solid == SOLID_TRIGGER)
|
|
|
|
|
return; // trigger field, do nothing
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (pointcontents(@self.origin) == CONTENT_SKY) {
|
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// hit something that bleeds
|
2004-02-12 05:38:54 +00:00
|
|
|
|
if (other.takedamage) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
spawn_touchblood (7);
|
|
|
|
|
other.deathtype = "plasma";
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_Damage (other, @self, @self.owner, 7);
|
2004-02-12 05:38:54 +00:00
|
|
|
|
} else {
|
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_SPIKE);
|
|
|
|
|
WriteCoordV (MSG_MULTICAST, @self.origin);
|
2003-10-22 21:54:29 +00:00
|
|
|
|
multicast (@self.origin, MULTICAST_PHS);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(vector org, vector dir) launch_plasma =
|
|
|
|
|
{
|
|
|
|
|
newmis = spawn ();
|
|
|
|
|
newmis.voided=0;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
newmis.owner = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.movetype = MOVETYPE_FLYMISSILE;
|
|
|
|
|
newmis.solid = SOLID_BBOX;
|
|
|
|
|
|
|
|
|
|
newmis.angles = vectoangles(dir);
|
|
|
|
|
|
|
|
|
|
newmis.touch = plasma_touch;
|
|
|
|
|
newmis.classname = "plasma";
|
|
|
|
|
newmis.think = SUB_Remove;
|
|
|
|
|
newmis.nextthink = time + 5;
|
|
|
|
|
setmodel (newmis, "progs/laser.mdl");
|
|
|
|
|
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
|
|
|
|
|
setorigin (newmis, org);
|
|
|
|
|
|
|
|
|
|
newmis.velocity = dir * 1400;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(float ox) W_FirePlasma =
|
|
|
|
|
{
|
|
|
|
|
local vector dir;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_WEAPON, "weapons/plasma.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.currentammo = @self.ammo_cells = @self.ammo_cells - 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
dir = aim (@self, 1000);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
launch_plasma (@self.origin + v_forward * 12 + '0 0 12' + v_right * ox, dir);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
msg_entity = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// - POX - Plasma
|
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
|
|
void() spike_touch =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.voided) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.voided = 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (other.solid == SOLID_TRIGGER)
|
|
|
|
|
return; // trigger field, do nothing
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (pointcontents (@self.origin) == CONTENT_SKY) {
|
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// hit something that bleeds
|
|
|
|
|
if (other.takedamage) {
|
|
|
|
|
spawn_touchblood (9);
|
|
|
|
|
other.deathtype = "nail";
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_Damage (other, @self, @self.owner, 9);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else {
|
2004-02-12 05:38:54 +00:00
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_SPIKE);
|
|
|
|
|
WriteCoordV (MSG_MULTICAST, @self.origin);
|
2003-10-22 21:54:29 +00:00
|
|
|
|
multicast (@self.origin, MULTICAST_PHS);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() superspike_touch =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.voided) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.voided = 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (other.solid == SOLID_TRIGGER)
|
|
|
|
|
return; // trigger field, do nothing
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (pointcontents (@self.origin) == CONTENT_SKY) {
|
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// hit something that bleeds
|
|
|
|
|
if (other.takedamage) {
|
|
|
|
|
spawn_touchblood (18);
|
|
|
|
|
other.deathtype = "supernail";
|
2003-10-22 21:54:29 +00:00
|
|
|
|
T_Damage (other, @self, @self.owner, 18);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else {
|
2004-02-12 05:38:54 +00:00
|
|
|
|
WriteBytes (MSG_MULTICAST, SVC_TEMPENTITY, TE_SUPERSPIKE);
|
|
|
|
|
WriteCoordV (MSG_MULTICAST, @self.origin);
|
2003-10-22 21:54:29 +00:00
|
|
|
|
multicast (@self.origin, MULTICAST_PHS);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
remove (@self);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
===============
|
|
|
|
|
launch_spike
|
|
|
|
|
|
|
|
|
|
Used for both the player and the ogre
|
|
|
|
|
===============
|
|
|
|
|
*/
|
|
|
|
|
void(vector org, vector dir) launch_spike =
|
|
|
|
|
{
|
|
|
|
|
newmis = spawn ();
|
|
|
|
|
newmis.voided=0;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
newmis.owner = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.movetype = MOVETYPE_FLYMISSILE;
|
|
|
|
|
newmis.solid = SOLID_BBOX;
|
|
|
|
|
|
|
|
|
|
newmis.angles = vectoangles(dir);
|
|
|
|
|
|
|
|
|
|
newmis.touch = spike_touch;
|
|
|
|
|
newmis.classname = "spike";
|
|
|
|
|
newmis.think = SUB_Remove;
|
|
|
|
|
newmis.nextthink = time + 6;
|
|
|
|
|
setmodel (newmis, "progs/spike.mdl");
|
|
|
|
|
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
|
|
|
|
|
setorigin (newmis, org);
|
|
|
|
|
|
|
|
|
|
newmis.velocity = dir * 1000;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(float ox) W_FireNails =
|
|
|
|
|
{
|
|
|
|
|
local vector dir;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_nailgl.mdl"; // light up nailgun barrels
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_WEAPON, "weapons/hog.wav", 0.8, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2004-02-12 05:38:54 +00:00
|
|
|
|
@self.currentammo = @self.ammo_nails -= 1;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
dir = aim (@self, 1000);
|
|
|
|
|
launch_spike (@self.origin + '0 0 16' + v_right*ox, dir);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
msg_entity = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// POX - not used by players...but maybe traps (?)
|
|
|
|
|
void() W_FireSuperSpikes =
|
|
|
|
|
{
|
|
|
|
|
local vector dir;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.attack_finished = time + 0.2;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
//if (deathmatch != 4)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.currentammo = @self.ammo_nails = @self.ammo_nails - 2;
|
|
|
|
|
dir = aim (@self, 1000);
|
|
|
|
|
launch_spike (@self.origin + '0 0 16', dir);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
newmis.touch = superspike_touch;
|
|
|
|
|
setmodel (newmis, "progs/s_spike.mdl");
|
|
|
|
|
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
|
2003-10-22 21:54:29 +00:00
|
|
|
|
msg_entity = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(float ox) W_FireSpikes =
|
|
|
|
|
{
|
|
|
|
|
local vector dir;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.v_angle);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_nails >= 2 && @self.weapon == IT_SUPER_NAILGUN) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
W_FireSuperSpikes ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_nails < 1) {
|
|
|
|
|
@self.weapon = W_BestWeapon ();
|
2003-10-22 09:24:50 +00:00
|
|
|
|
W_SetCurrentAmmo ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sound (@self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.attack_finished = time + 0.2;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.currentammo = --@self.ammo_nails;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
dir = aim (@self, 1000);
|
|
|
|
|
launch_spike (@self.origin + '0 0 16' + v_right * ox, dir);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
msg_entity = @self;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
WriteByte (MSG_ONE, SVC_SMALLKICK);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// - POX ?
|
|
|
|
|
//.float hit_z;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
|
|
PLAYER WEAPON USE
|
|
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
*/
|
|
|
|
|
// + POX - changed weapon models, added ammo check for ComboGun
|
|
|
|
|
void() W_SetCurrentAmmo =
|
|
|
|
|
{
|
|
|
|
|
player_run (); // get out of any weapon firing states
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.items &= ~(IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS);
|
|
|
|
|
@self.weaponframe = 0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
switch (@self.weapon) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
case IT_AXE:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_axe.mdl";
|
|
|
|
|
@self.currentammo = 0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
break;
|
|
|
|
|
case IT_TSHOT:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_tshot.mdl";
|
|
|
|
|
@self.currentammo = @self.ammo_shells;
|
|
|
|
|
@self.items |= IT_SHELLS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
break;
|
|
|
|
|
case IT_COMBOGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_combo.mdl";
|
2003-10-22 09:24:50 +00:00
|
|
|
|
// ammo depends on last active trigger
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.which_ammo == 1 && @self.ammo_rockets > 0) {
|
|
|
|
|
@self.currentammo = @self.ammo_rockets;
|
|
|
|
|
@self.items |= IT_ROCKETS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else {
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.which_ammo = 0;
|
|
|
|
|
@self.currentammo = @self.ammo_shells;
|
|
|
|
|
@self.items |= IT_SHELLS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case IT_PLASMAGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_plasma.mdl";
|
|
|
|
|
@self.currentammo = @self.ammo_cells;
|
|
|
|
|
@self.items |= IT_CELLS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
break;
|
|
|
|
|
case IT_SUPER_NAILGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_nailg.mdl";
|
|
|
|
|
@self.currentammo = @self.ammo_nails;
|
|
|
|
|
@self.items |= IT_NAILS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
break;
|
|
|
|
|
case IT_GRENADE_LAUNCHER:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_gren.mdl";
|
|
|
|
|
@self.currentammo = @self.ammo_rockets;
|
|
|
|
|
@self.items |= IT_ROCKETS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
break;
|
|
|
|
|
case IT_ROCKET_LAUNCHER:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "progs/v_rhino.mdl";
|
|
|
|
|
@self.currentammo = @self.ammo_rockets;
|
|
|
|
|
@self.items |= IT_ROCKETS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
break;
|
|
|
|
|
default:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weaponmodel = "";
|
|
|
|
|
@self.currentammo = 0;
|
2004-02-12 05:38:54 +00:00
|
|
|
|
break;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
float() W_BestWeapon =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
local float it = @self.items;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
// A hacky way to keep Super Shotgun active when out of rockets
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if ((@self.weapon == IT_COMBOGUN) && (@self.ammo_shells >= 2 && (@self.ammo_rockets < 1)))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return IT_COMBOGUN;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets > 0 && (it & IT_ROCKET_LAUNCHER))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return IT_ROCKET_LAUNCHER;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_cells > 0 && (it & IT_PLASMAGUN))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return IT_PLASMAGUN;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_nails > 0 && (it & IT_SUPER_NAILGUN))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return IT_SUPER_NAILGUN;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_shells > 1 && (it & IT_COMBOGUN))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return IT_COMBOGUN;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_shells > 0 && (it & IT_TSHOT))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return IT_TSHOT;
|
|
|
|
|
|
|
|
|
|
return IT_AXE;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
float() W_CheckNoAmmo =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.currentammo > 0)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.weapon == IT_AXE)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = W_BestWeapon ();
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
W_SetCurrentAmmo ();
|
|
|
|
|
|
|
|
|
|
// drop the weapon down
|
|
|
|
|
return FALSE;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* POX - in sync with Paroxysm v1.1
|
|
|
|
|
============
|
|
|
|
|
W_Attack
|
|
|
|
|
|
|
|
|
|
An attack impulse can be triggered now
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
void() W_Attack =
|
|
|
|
|
{
|
|
|
|
|
local float r;
|
|
|
|
|
|
|
|
|
|
if (intermission_running)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (deathmatch & DM_AUTOSWITCH) {
|
|
|
|
|
if (!W_CheckNoAmmo ())
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
makevectors (@self.v_angle); // calculate forward angle for velocity
|
|
|
|
|
@self.show_hostile = time + 1; // wake monsters up
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
switch (@self.weapon) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
case IT_AXE:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.attack_finished = time + 0.5;
|
|
|
|
|
sound (@self, CHAN_WEAPON, "weapons/ax1.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
r = random ();
|
|
|
|
|
if (r < 0.25)
|
|
|
|
|
player_axe1 ();
|
|
|
|
|
else if (r < 0.5)
|
|
|
|
|
player_axeb1 ();
|
|
|
|
|
else if (r < 0.75)
|
|
|
|
|
player_axec1 ();
|
|
|
|
|
else
|
|
|
|
|
player_axed1 ();
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case IT_TSHOT:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_shells < 1) {
|
|
|
|
|
sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.attack_finished = time + 0.5;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.st_tshotload > time) // T-Shot still priming
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if ((@self.prime_tshot) && (@self.ammo_shells > 2)) { // OK for triple
|
2003-10-22 09:24:50 +00:00
|
|
|
|
player_tshot1 ();
|
|
|
|
|
W_FireTShot ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.attack_finished = time + 0.7;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else { // Normal shot
|
|
|
|
|
player_shot1 ();
|
|
|
|
|
W_FireShotgun ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.attack_finished = time + 0.5;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// reset prime
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.prime_tshot = FALSE;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case IT_COMBOGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.st_sshotgun > time)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.items &= ~IT_ROCKETS;
|
|
|
|
|
@self.items |= IT_SHELLS;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.currentammo = @self.ammo_shells;
|
|
|
|
|
@self.which_ammo = 0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_shells < 1) { // misfire
|
|
|
|
|
sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.st_sshotgun = time + 0.7;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player_shot1 ();
|
|
|
|
|
W_FireSuperShotgun ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.st_sshotgun = time + 0.7;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case IT_PLASMAGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if ((@self.st_plasma > time) || (@self.st_mplasma > time))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_cells < 1) {
|
|
|
|
|
sound (@self, CHAN_AUTO, "weapons/mfire2.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (!@self.LorR) // which barrel is supposed to fire?
|
2003-10-22 09:24:50 +00:00
|
|
|
|
player_plasma1 ();
|
|
|
|
|
else
|
|
|
|
|
player_plasma2 ();
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case IT_SUPER_NAILGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.st_nailgun > time)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_nails < 1) {
|
|
|
|
|
sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player_nail1 ();
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case IT_GRENADE_LAUNCHER:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.st_grenade > time)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets < 1) {
|
|
|
|
|
sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.st_grenade = time + 0.6;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player_grenade1 ();
|
|
|
|
|
W_FireGrenade ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.st_grenade = time + 0.6;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case IT_ROCKET_LAUNCHER:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.st_rocketload > time) // still reloading
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets < 1) { // no ammo
|
|
|
|
|
sound (@self, CHAN_AUTO, "weapons/mfire1.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.attack_finished = time + 0.4;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.reload_rocket > 6) {
|
|
|
|
|
sound (@self, CHAN_AUTO, "weapons/error.wav", 1, ATTN_NORM);
|
|
|
|
|
@self.attack_finished = time + 0.42;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
player_rocket1 ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.attack_finished = time + 0.4;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* POX - in sync with Paroxysm v1.1
|
|
|
|
|
============
|
|
|
|
|
W_ChangeWeapon
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
void() W_ChangeWeapon =
|
|
|
|
|
{
|
|
|
|
|
local float no_ammo = 0;
|
2011-03-20 08:27:47 +00:00
|
|
|
|
local float selected = nil;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.which_ammo = 0; // Default ammo to shells for SuperShotgun
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
switch (@self.impulse) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
case 1:
|
|
|
|
|
selected = IT_AXE;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
selected = IT_TSHOT;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_shells < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
no_ammo = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
selected = IT_COMBOGUN;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_shells < 2) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
no_ammo = 1;
|
|
|
|
|
// allow player to still select SuperShotgun if he has rockets
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets > 0 && (!(deathmatch & DM_AUTOSWITCH))) {
|
|
|
|
|
@self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets, not shells
|
2003-10-22 09:24:50 +00:00
|
|
|
|
no_ammo = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
selected = IT_PLASMAGUN;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_cells < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
no_ammo = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
selected = IT_SUPER_NAILGUN;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_nails < 2)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
no_ammo = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
selected = IT_GRENADE_LAUNCHER;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
no_ammo = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
selected = IT_ROCKET_LAUNCHER;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
no_ammo = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.impulse = 0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (!(@self.items & selected)) { // don't have the weapon or the ammo
|
|
|
|
|
sprint (@self, PRINT_HIGH, "no weapon.\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (no_ammo) { // don't have the ammo
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "not enough ammo.\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// set weapon, set ammo
|
|
|
|
|
//
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = selected;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
W_SetCurrentAmmo ();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
============
|
|
|
|
|
CheatCommand
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
void() CheatCommand =
|
|
|
|
|
{
|
|
|
|
|
// if (deathmatch || coop)
|
|
|
|
|
return;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* + POX - in sync with Paroxysm v1.1 - changed BONESAW back to AXE
|
|
|
|
|
============
|
|
|
|
|
CycleWeaponCommand
|
|
|
|
|
|
|
|
|
|
Go to the next weapon with ammo
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
void () CycleWeaponCommand =
|
|
|
|
|
{
|
|
|
|
|
local float am;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.impulse = 0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
|
am = 0;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.which_ammo = 0; // Default ammo to shells for SuperShotgun
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
switch (@self.weapon) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
case IT_ROCKET_LAUNCHER:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = IT_AXE;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
break;
|
|
|
|
|
case IT_AXE:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = IT_TSHOT;
|
|
|
|
|
if (@self.ammo_shells < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
|
|
|
|
break;
|
|
|
|
|
case IT_TSHOT:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = IT_COMBOGUN;
|
|
|
|
|
if (@self.ammo_shells < 2) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
|
|
|
|
// allow player to select SuperShotgun if he has rockets
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets > 0 && (!(deathmatch & DM_AUTOSWITCH))) {
|
|
|
|
|
@self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets, not shells
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case IT_COMBOGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = IT_PLASMAGUN;
|
|
|
|
|
if (@self.ammo_cells < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
|
|
|
|
break;
|
|
|
|
|
case IT_PLASMAGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = IT_SUPER_NAILGUN;
|
|
|
|
|
if (@self.ammo_nails < 2)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
|
|
|
|
break;
|
|
|
|
|
case IT_SUPER_NAILGUN:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = IT_GRENADE_LAUNCHER;
|
|
|
|
|
if (@self.ammo_rockets < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
|
|
|
|
break;
|
|
|
|
|
case IT_GRENADE_LAUNCHER:
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.weapon = IT_ROCKET_LAUNCHER;
|
|
|
|
|
if (@self.ammo_rockets < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if ((@self.items & @self.weapon) && am == 0) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
W_SetCurrentAmmo ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* + POX - in sync with Paroxysm v1.1 - *went back to AXE for QW
|
|
|
|
|
============
|
|
|
|
|
CycleWeaponReverseCommand
|
|
|
|
|
|
|
|
|
|
Go to the prev weapon with ammo
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
void() CycleWeaponReverseCommand =
|
|
|
|
|
{
|
|
|
|
|
local float am;
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.impulse = 0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
|
am = 0;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.which_ammo = 0; // Default ammo to shells for SuperShotgun
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.weapon == IT_ROCKET_LAUNCHER) {
|
|
|
|
|
@self.weapon = IT_GRENADE_LAUNCHER;
|
|
|
|
|
if (@self.ammo_rockets < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
} else if (@self.weapon == IT_GRENADE_LAUNCHER) {
|
|
|
|
|
@self.weapon = IT_SUPER_NAILGUN;
|
|
|
|
|
if (@self.ammo_nails < 2)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
} else if (@self.weapon == IT_SUPER_NAILGUN) {
|
|
|
|
|
@self.weapon = IT_PLASMAGUN;
|
|
|
|
|
if (@self.ammo_cells < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
} else if (@self.weapon == IT_PLASMAGUN) {
|
|
|
|
|
@self.weapon = IT_COMBOGUN;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
// allow player to select ComboGun if he has rockets
|
|
|
|
|
// BUT NOT IF DM_AUTOSWITCH!!
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_shells < 2) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.ammo_rockets > 0 && !(deathmatch & DM_AUTOSWITCH)) {
|
|
|
|
|
@self.which_ammo = 1; // tell W_SetCurrentAmmo to use rockets - not shells
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-10-22 21:54:29 +00:00
|
|
|
|
} else if (@self.weapon == IT_COMBOGUN) {
|
|
|
|
|
@self.weapon = IT_TSHOT;
|
|
|
|
|
if (@self.ammo_shells < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
2003-10-22 21:54:29 +00:00
|
|
|
|
} else if (@self.weapon == IT_TSHOT) {
|
|
|
|
|
@self.weapon = IT_AXE;
|
|
|
|
|
} else if (@self.weapon == IT_AXE) {
|
|
|
|
|
@self.weapon = IT_ROCKET_LAUNCHER;
|
|
|
|
|
if (@self.ammo_rockets < 1)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
am = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if ((@self.items & @self.weapon) && am == 0) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
W_SetCurrentAmmo ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
============
|
|
|
|
|
ServerflagsCommand
|
|
|
|
|
|
|
|
|
|
Just for development
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
void() ServerflagsCommand =
|
|
|
|
|
{
|
|
|
|
|
serverflags = serverflags * 2 + 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// + POX - Displays the server rules
|
|
|
|
|
void() DisplayRules =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "\n<><6E><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>\n----------------------\n |\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (deathmatch & DM_PREDATOR)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "on | Predator Mode\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD> | Predator Mode\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (deathmatch & DM_DARK)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "on | Dark Mode\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD> | Dark Mode\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (deathmatch & DM_LMS)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "on | Last Man Standing\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD> | Last Man Standing\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (deathmatch & DM_FFA)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "on | Free For All\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD> | Free For All\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (deathmatch & DM_GIB)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "on | Gib\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD> | Gib\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
if (deathmatch & DM_AUTOSWITCH)
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "on | Weapon Autoswitch\n |\n----------------------\n\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "<EFBFBD><EFBFBD><EFBFBD> | Weapon Autoswitch\n |\n----------------------\n\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
============
|
|
|
|
|
ImpulseCommands
|
|
|
|
|
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
void() ImpulseCommands =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
switch (@self.impulse) {
|
2003-10-22 09:24:50 +00:00
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
|
|
|
|
case 3:
|
|
|
|
|
case 4:
|
|
|
|
|
case 5:
|
|
|
|
|
case 6:
|
|
|
|
|
case 7:
|
|
|
|
|
case 8:
|
|
|
|
|
W_ChangeWeapon ();
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
CheatCommand ();
|
|
|
|
|
break;
|
|
|
|
|
case 10:
|
|
|
|
|
CycleWeaponCommand ();
|
|
|
|
|
break;
|
|
|
|
|
case 11:
|
|
|
|
|
ServerflagsCommand ();
|
|
|
|
|
break;
|
|
|
|
|
case 12:
|
|
|
|
|
CycleWeaponReverseCommand ();
|
|
|
|
|
break;
|
|
|
|
|
case 16: // target identifier
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.target_id_temp = TRUE; // Make it work across level change
|
|
|
|
|
stuffcmd (@self, "play misc/talk.wav\n"); // audio confirmation
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.target_id_toggle) {
|
|
|
|
|
@self.target_id_toggle = FALSE;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
// don't centerprint if a message is up
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.target_id_finished < time)
|
|
|
|
|
centerprint (@self, "Target Identifier OFF\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "Target Identifier OFF\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else {
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.target_id_toggle = TRUE;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
// don't centerprint if a message is up
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.target_id_finished < time)
|
|
|
|
|
centerprint (@self, "Target Identifier ON\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
else
|
2003-10-22 21:54:29 +00:00
|
|
|
|
sprint (@self, PRINT_HIGH, "Target Identifier ON\n");
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.target_id_finished = time + 3;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 17: // FIXME - Toggle dlights vs lightglows
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if(@self.gl_fix) {
|
|
|
|
|
stuffcmd (@self, "gl_flashblend 1\n");
|
|
|
|
|
@self.gl_fix = FALSE;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
} else {
|
2003-10-22 21:54:29 +00:00
|
|
|
|
stuffcmd (@self, "gl_flashblend 0\n");
|
|
|
|
|
@self.gl_fix = TRUE;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 253: // Display Server Game Modes
|
|
|
|
|
DisplayRules ();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.impulse = 0;
|
2003-10-22 09:24:50 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
============
|
|
|
|
|
W_WeaponFrame
|
|
|
|
|
|
|
|
|
|
Called every frame so impulse events can be handled as well as possible
|
|
|
|
|
============
|
|
|
|
|
*/
|
|
|
|
|
void() W_WeaponFrame =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (time < @self.attack_finished)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
//POX - v1.1 target identifier
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.target_id_toggle && (time > @self.target_id_finished))
|
2003-10-22 09:24:50 +00:00
|
|
|
|
ID_CheckTarget ();
|
|
|
|
|
|
|
|
|
|
//POX - Don't swap nailgun skins if player is invisible or chascam is active!
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.weapon == IT_SUPER_NAILGUN && @self.st_nailgun < time)
|
|
|
|
|
@self.weaponmodel = "progs/v_nailg.mdl"; // cool off nailgun barrels
|
2003-10-22 09:24:50 +00:00
|
|
|
|
|
|
|
|
|
// + POX - only check these if necessary (thanks to URQW patch)
|
|
|
|
|
// 1998-08-14 Constantly checking all impulses fix by Perged
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.impulse == SECOND_TRIGGER)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
W_SecondTrigger ();
|
2003-10-22 21:54:29 +00:00
|
|
|
|
else if (@self.impulse)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
ImpulseCommands ();
|
|
|
|
|
// - POX
|
|
|
|
|
|
|
|
|
|
// check for attack
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.button0)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
{
|
|
|
|
|
SuperDamageSound ();
|
|
|
|
|
W_Attack ();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
========
|
|
|
|
|
SuperDamageSound
|
|
|
|
|
|
|
|
|
|
Plays sound if needed
|
|
|
|
|
========
|
|
|
|
|
*/
|
|
|
|
|
void() SuperDamageSound =
|
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.super_damage_finished > time)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
if (@self.super_sound < time)
|
2003-10-22 09:24:50 +00:00
|
|
|
|
{
|
2003-10-22 21:54:29 +00:00
|
|
|
|
@self.super_sound = time + 1;
|
|
|
|
|
sound (@self, CHAN_BODY, "items/damage3.wav", 1, ATTN_NORM);
|
2003-10-22 09:24:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|