
void () BecomeExplosion;

void () DevastatorPrecache = {

   precache_sound ("catfire.wav");
   precache_sound ("rpg.wav");
   precache_sound ("explo.wav");
   precache_model ("progs/v_dev.mdl");
   precache_model ("progs/missile2.mdl");

};

/*
float () crandom = {

   return ( (FL_SWIM * (random () - 0.500)) );

};
*/

/*
void () dev_touch = {

   local float damg;

   if ( (other == self.owner) ) {

      return ;

   }
   if ( (pointcontents (self.origin) == CONTENT_SKY) ) {

      remove (self);
      return ;

   }
		damg = (40 + (random() * 20));

	if (other.classname == "monster_zombie")
		damg = damg * 5;
		
	if (other.classname == "monster_shambler")
		damg = damg * 0.5;

   if ( other.health )
   {
      T_Damage (other,self,self.owner,damg);
   }
	   T_RadiusDamage (self,self.owner,60.000,world); //world was other
	   
	if (self.classname == "devspik")
   	sound (self,CHAN_VOICE,"explo.wav",1.000,ATTN_NORM);
	else
		sound (self,CHAN_WEAPON,"rpodhit.wav",TRUE,ATTN_NORM);
		
   self.origin = (self.origin - (8.000 * normalize (self.velocity)));
   self.effects = (self.effects | EF_MUZZLEFLASH);
   BecomeExplosion ();

};

void () Dev1 = {

   local entity missile;

   self.ammo_rockets = (self.ammo_rockets - 0.500);
   self.currentammo = (self.ammo_rockets - 0.500);
   self.effects = (self.effects | EF_MUZZLEFLASH);
   missile = spawn ();
   missile.owner = self;
   missile.movetype = MOVETYPE_FLYMISSILE;
   missile.solid = SOLID_BBOX;
   missile.classname = "devspik";
   makevectors (self.v_angle);
   missile.velocity = aim (self,800.000);
   missile.velocity = (missile.velocity * 800.000);
   missile.velocity = (missile.velocity + ((crandom () * 30.000) * v_right));
   missile.velocity = (missile.velocity + ((crandom () * 30.000) * v_up));
   missile.angles = vectoangles (missile.velocity);
   self.punchangle_x = -1.000;
   self.punchangle_y = 1.000;
   missile.nextthink = (time + 5.000);
   missile.think = SUB_Remove;
   missile.touch = dev_touch;
   setmodel (missile,"progs/missile2.mdl");
   setsize (missile,'0.000 0.000 0.000','0.000 0.000 0.000');
  	setorigin (missile,((((self.origin + (v_forward * 4.000)) + '0.000 0.000 16.000') + (v_right * 6.000)) + (v_up * 0.000)));

};

void () Dev2 = {

   local entity missile;

   self.ammo_rockets = (self.ammo_rockets - 0.500);
   self.currentammo = (self.ammo_rockets - 0.500);
   self.effects = (self.effects | EF_MUZZLEFLASH);
   missile = spawn ();
   missile.owner = self;
   missile.movetype = MOVETYPE_FLYMISSILE;
   missile.solid = SOLID_BBOX;
   missile.classname = "devspik";
   makevectors (self.v_angle);
   missile.velocity = aim (self,500.000);
   missile.velocity = (missile.velocity * 500.000);
   missile.velocity = (missile.velocity + ((crandom () * 30.000) * v_right));
   missile.velocity = (missile.velocity + ((crandom () * 30.000) * v_up));
   missile.angles = vectoangles (missile.velocity);
   self.punchangle_x = -1.000;
   self.punchangle_y = -1.000;
   missile.nextthink = (time + 5.000);
   missile.think = SUB_Remove;
   missile.touch = dev_touch;
   setmodel (missile,"progs/missile2.mdl");
   setsize (missile,'0.000 0.000 0.000','0.000 0.000 0.000');
   setorigin (missile,((((self.origin + (v_forward * 4.000)) + '0.000 0.000 16.000') + (v_right * -6.000)) + (v_up * 0.000)));

};

void () player_deva1 = [ 108.000, player_deva2 ] {

   self.weaponframe = 1.000;
	   sound (self,CHAN_WEAPON,"rpg.wav",1.000,ATTN_NORM);
   	sound (self,CHAN_VOICE,"catfire.wav",1.000,ATTN_NORM);
   Dev1 ();

};

void () player_deva2 = [ 109.000, player_deva3 ] {

   self.weaponframe = 2.000;
	   sound (self,CHAN_WEAPON,"rpg.wav",1.000,ATTN_NORM);
   Dev1 ();
   self.bondoflag = self.bondoflag - B_DEVASTATOR;

};

void () player_deva3 = [ 110.000, player_deva4 ] {

   self.weaponframe = 3.000;

};

void () player_deva4 = [ 111.000, player_run ] {

   self.weaponframe = 4.000;

};

void () player_devb1 = [ 108.000, player_devb2 ] {

   self.weaponframe = 5.000;
	   sound (self,CHAN_WEAPON,"rpg.wav",1.000,ATTN_NORM);
   	sound (self,CHAN_VOICE,"catfire.wav",1.000,ATTN_NORM);
   Dev2 ();

};

void () player_devb2 = [ 109.000, player_devb3 ] {

   self.weaponframe = 6.000;
	   sound (self,CHAN_WEAPON,"rpg.wav",1.000,ATTN_NORM);
   Dev2 ();
	self.bondoflag = self.bondoflag | B_DEVASTATOR;

};

void () player_devb3 = [ 110.000, player_devb4 ] {

   self.weaponframe = 7.000;

};

void () player_devb4 = [ 111.000, player_run ] {

   self.weaponframe = 8.000;

};
*/
