void SlugExplode() { sound(self, CHAN_BODY, "slug/slug.wav", 1, ATTN_NORM); muzzleflash(); RadiusEffects(self, self.owner, 20, "acid", self, self.owner); if(other.health) { other.deathtype = "slug"; T_Damage(other, self, self.owner, 20); other.deathtype = "acid"; T_Damage(other, self, self.owner, 5); other.acider = self.owner; if(!(other.acid)) other.acid = time + 0.5; } remove(self); } void SlugBounce() { if(other == self.owner) return; if(other.takedamage == 2) SlugExplode(); float BounceSound; BounceSound = rint(random()*2); if(BounceSound == 0) sound(self, CHAN_BODY, "weapons/ric1.wav", 1, ATTN_NORM); if(BounceSound == 1) sound(self, CHAN_BODY, "weapons/ric2.wav", 1, ATTN_NORM); if(BounceSound == 2) sound(self, CHAN_BODY, "weapons/ric3.wav", 1, ATTN_NORM); } void FireSlug() { if(self.ammo_shells < 5 || self.ammo_nails < 5) { sound(self, CHAN_WEAPON, "slug/slugout.wav", 1, ATTN_NORM); return; } self.ammo_shells = self.ammo_shells - 5; self.ammo_nails = self.ammo_nails - 5; sound(self, CHAN_WEAPON, "slug/slugthrower.wav", 1, ATTN_NORM); entity slug; vector SlugStart; vector SlugDir; vector SlugVel; float randright; makevectors(self.v_angle); SlugStart = ((self.origin + '0 0 16') + (v_forward * 16)); // had to use this hack with the randright variable as the compiler was having a bird with this expression all on one line // have no idea why randright = (random()*40); randright = randright - 20; SlugDir = SlugStart + (v_forward*500) + (v_right*randright); SlugVel = normalize(SlugDir - SlugStart); slug = spawn (); slug.owner = self; slug.movetype = MOVETYPE_FLYMISSILE; slug.solid = SOLID_BBOX; slug.velocity = (SlugVel * 800); slug.touch = SlugBounce; randright = random(); if(randright > 0) randright = randright / 2; slug.nextthink = time + 1 + randright; slug.think = SlugExplode; setmodel (slug, "progsslug/pellet.mdl"); setsize (slug, VEC_ORIGIN, VEC_ORIGIN); setorigin (slug, SlugStart); slug.effects = slug.effects | EF_BRIGHTLIGHT; }