From 541c95c65340c62982cc13e6a9a062d425a8b4bb Mon Sep 17 00:00:00 2001 From: lorderadicator <> Date: Sun, 17 Nov 2002 08:23:35 +0000 Subject: [PATCH] gibable corpse code --- misc.qc | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/misc.qc b/misc.qc index c5f81a7..4f71454 100644 --- a/misc.qc +++ b/misc.qc @@ -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; +}; \ No newline at end of file