gibable corpse code

This commit is contained in:
lorderadicator 2002-11-17 08:23:35 +00:00
parent 141a3845f8
commit 541c95c653

63
misc.qc
View file

@ -842,3 +842,66 @@ void() misc_noisemaker =
self.nextthink = time + 0.1 + random();
self.think = noise_think;
};
//Beginning of corpse code - Eradicator
void () corpse_touch =
{
self.velocity = '0 0 0';
if ((!other.flags & FL_ONGROUND) && (other.health) && (other.flags & FL_CLIENT))
other.flags = other.flags + FL_ONGROUND;
};
.string headmdl;
void () corpse_die =
{
sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
if (self.headmdl)
ThrowHead (self.headmdl, self.health);
ThrowGib ("progs/gib1.mdl", self.health);
ThrowGib ("progs/gib2.mdl", self.health);
ThrowGib ("progs/gib3.mdl", self.health);
if (!self.headmdl)
remove (self);
};
void () become_corpse =
{
if (self.classname == "monster_dog")
self.health = 30;
else if (self.classname == "monster_shalrath" || self.classname == "monster_shambler")
self.health = 75;
else
self.health = 45;
self.takedamage = DAMAGE_AIM;
self.solid = SOLID_SLIDEBOX;
self.movetype = MOVETYPE_STEP;
self.flags = self.flags & (!FL_MONSTER);
if (self.classname == "monster_shambler")
setsize (self, '-32 -32 -24', '32 32 -14');
else
setsize (self, '-32 -32 -24', '32 32 -19');
self.classname = "monster_corpse";
self.origin_z = self.origin_z + 3;
self.use = SUB_Null;
self.target = string_null;
self.killtarget = string_null;
self.targetname = string_null;
self.th_die = corpse_die;
self.th_stand = SUB_Null;
self.th_walk = SUB_Null;
self.th_run = SUB_Null;
self.th_missile = SUB_Null;
self.th_melee = SUB_Null;
self.th_pain = SUB_Null;
self.touch = corpse_touch;
};