Inside3D!



QuakeC Pastebin Is Down For The Count, BBL

Posted by Dr. Shadowborg on 2008/05/28

// DRS: Ground Crasher code.  Fires a ground following Firebomb projectile.

// Behavioral parms: can usually traverse any terrain monsters can, but can't deal with

//                   breaks in the ground.

// Usage: groundcrasher(self.origin + '0 0 -22', self.angles_y); 

// Usage Explaination: first is origin, make sure it's near to the ground, or it'll go boom.

//                     second is direction for it to go in.  Always use a float variable, or 

//                     else it will do wierd stuff.

// To test / use stock: Place right before weapons.qc in progs.src, add where you want it,

//                      then compile and test.


.float ccnt;
.float bomdir;

void() GrenadeExplode;
void() BecomeExplosion;

void() GroundBombKaboom =
{
   local entity e;

 if(pointcontents(self.origin) == CONTENT_SOLID || self.cnt >= self.ccnt || !walkmove(self.bomdir, 50))
  {
   GrenadeExplode();
   return;
  }
 if(pointcontents(self.origin) == CONTENT_SKY)
  remove(self);

    self.cnt = self.cnt + 1;
    sound(self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
    self.nextthink = time + 0.2;
    self.think = GroundBombKaboom;

    T_RadiusDamage (self, self.owner, self.dmg, self.owner);

    WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
    WriteByte (MSG_BROADCAST, TE_EXPLOSION);
    WriteCoord (MSG_BROADCAST, self.origin_x);
    WriteCoord (MSG_BROADCAST, self.origin_y);
    WriteCoord (MSG_BROADCAST, self.origin_z);

// DRS Modified: Boom puff.

    e = spawn();
    setorigin(e, self.origin);
    e.think = BecomeExplosion;

    e.nextthink = time + 0.01;
};

void(vector org, float dir) groundcrasher =
{
 newmis = spawn();
 newmis.solid = SOLID_NOT;
 newmis.takedamage = DAMAGE_NO;
 newmis.movetype = MOVETYPE_STEP;

 setorigin(newmis, org);
 setsize(newmis, VEC_ORIGIN, VEC_ORIGIN);

 newmis.bomdir = dir;
 newmis.owner = self;
 newmis.ccnt = 10;
 newmis.dmg = 90;
 newmis.classname = "groundbomb";
 newmis.touch = SUB_Null;
 newmis.think = GroundBombKaboom;
 newmis.nextthink = time + 0.2;
};
Username
Recent Posts Code
    (By clicking this you are making your code public)


Generated in 0.01373s
Copyright 1996-2005 Inside3D.com