void W_FireSpikes( float ox ) { vec3_t dir, tmp; // gedict_t* old; makevectors( self->s.v.v_angle ); if ( self->s.v.ammo_nails >= 2 && self->s.v.weapon == IT_SUPER_NAILGUN ) { W_FireSuperSpikes(); return; } if ( self->s.v.ammo_nails < 1 ) { self->s.v.weapon = W_BestWeapon(); W_SetCurrentAmmo(); return; } sound( self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM ); self->attack_finished = g_globalvars.time + 0.2; if ( deathmatch != 4 ) self->s.v.currentammo = self->s.v.ammo_nails = self->s.v.ammo_nails - 1; aim( dir ); // dir = aim (self, 1000); VectorScale( g_globalvars.v_right, ox, tmp ); VectorAdd( tmp, self->s.v.origin, tmp ); tmp[2] += 16; launch_spike( tmp, dir ); g_globalvars.msg_entity = EDICT_TO_PROG( self ); trap_WriteByte( MSG_ONE, SVC_SMALLKICK ); }
void spikeshooter_use( ) { if ( ( int ) ( self->s.v.spawnflags ) & SPAWNFLAG_LASER ) { sound( self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM ); LaunchLaser( self->s.v.origin, self->s.v.movedir ); } else { sound( self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM ); launch_spike( self->s.v.origin, self->s.v.movedir ); VectorScale( self->s.v.movedir, 500, PROG_TO_EDICT( g_globalvars.newmis )->s.v.velocity ); // newmis->s.v.velocity = self->s.v.movedir * 500; if ( ( int ) ( self->s.v.spawnflags ) & SPAWNFLAG_SUPERSPIKE ) PROG_TO_EDICT( g_globalvars.newmis )->s.v.touch = ( func_t ) superspike_touch; } }
void W_FireSuperSpikes() { vec3_t dir, tmp; // gedict_t* old; sound( self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM ); self->attack_finished = g_globalvars.time + 0.2; if ( deathmatch != 4 ) self->s.v.currentammo = self->s.v.ammo_nails = self->s.v.ammo_nails - 2; aim( dir ); //dir = aim (self, 1000); VectorCopy( self->s.v.origin, tmp ); tmp[2] += 16; launch_spike( tmp, dir ); newmis->s.v.touch = ( func_t ) superspike_touch; setmodel( newmis, "progs/s_spike.mdl" ); setsize( newmis, 0, 0, 0, 0, 0, 0 ); g_globalvars.msg_entity = EDICT_TO_PROG( self ); trap_WriteByte( MSG_ONE, SVC_SMALLKICK ); }