Step 2
Now, further in weapons.qc, find the line: .float hit_z; . Above it,
add this:
void(float ox, float ox2) W_FireGatSpikes = // this is a slightly modified version of firespikes
{
local vector dir;
local entity old;
makevectors (self.v_angle);
if (self.ammo_nails <1)
{
self.weapon = W_BestWeapon();
W_SetCurrentAmmo ();
return;
}
sound (self, chan_weapon, "weapons/rocket1i.wav", 1, attn_norm);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 1;
dir = aim (self, 1000);
launch_spike (self.origin + '0 0 16' + v_right*ox + v_up*ox2, dir); // sets spike direction
self.punchangle_x = -2;
};
/*
===============
launch_gatling
===============
*/
void(vector org, vector dir) launch_gatling =
{
newmis = spawn ();
newmis.owner = self;
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() W_FireGatling =
{
local vector dir;
local entity old;
sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM);
self.attack_finished = time + 0.2;
self.currentammo = self.ammo_nails = self.ammo_nails - 2;
dir = aim (self, 1000);
launch_gatling (self.origin + '0 0 16', dir);
newmis.touch = superspike_touch;
setmodel (newmis, "progs/s_spike.mdl");
setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);
self.punchangle_x = -2;
};