2004-02-11 03:40:03 +00:00
|
|
|
// bring back qc file, contains all the functions added to create the
|
|
|
|
// 'respawn effect
|
|
|
|
// void bringback (); declared in ogre.qc ( first file its referanced in);
|
|
|
|
// void savecritter (); ""
|
|
|
|
|
2004-02-11 04:00:56 +00:00
|
|
|
@static {
|
|
|
|
|
2004-02-14 10:35:17 +00:00
|
|
|
void () hes_dead_jim = [ self.frame, im_alive, 10 ] { }
|
2004-02-11 04:00:56 +00:00
|
|
|
|
2004-02-19 10:10:15 +00:00
|
|
|
void () im_alive =
|
2004-02-14 10:35:17 +00:00
|
|
|
{
|
|
|
|
self.solid = SOLID_SLIDEBOX;
|
|
|
|
self.movetype = MOVETYPE_STEP;
|
|
|
|
self.takedamage = DAMAGE_AIM;
|
2004-02-11 04:00:56 +00:00
|
|
|
|
2004-02-14 10:35:17 +00:00
|
|
|
if ((mapname != "end") && (random() < 0.5))
|
|
|
|
self.origin = self.oldorigin;
|
2004-02-12 02:48:51 +00:00
|
|
|
|
2004-02-14 10:35:17 +00:00
|
|
|
setmodel(self, self.weaponmodel);
|
|
|
|
self.health = self.max_health;
|
2004-02-11 04:00:56 +00:00
|
|
|
|
2004-02-14 10:35:17 +00:00
|
|
|
switch (self.classname) {
|
|
|
|
case "monster_demon1":
|
|
|
|
case "monster_ogre":
|
|
|
|
case "monster_shalrath":
|
|
|
|
case "monster_shambler":
|
|
|
|
setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
|
|
|
|
break;
|
|
|
|
case "monster_dog":
|
|
|
|
setsize (self, '-32 -32 -24', '32 32 40');
|
|
|
|
break;
|
|
|
|
case "monster_fish":
|
|
|
|
setsize (self, '-16 -16 -24', '16 16 24');
|
2007-04-28 00:39:42 +00:00
|
|
|
self.flags |= FL_SWIM;
|
2004-02-14 10:35:17 +00:00
|
|
|
break;
|
|
|
|
case "monster_wizard":
|
|
|
|
setsize (self, '-16 -16 -24', '16 16 40');
|
2007-04-28 00:39:42 +00:00
|
|
|
self.flags |= FL_FLY;
|
2004-02-14 10:35:17 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
// about 3/4 of quakes critters use this size
|
|
|
|
setsize (self, '-16 -16 -24', '16 16 40');
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
spawn_tdeath (self.origin, self);
|
|
|
|
spawn_tfog (self.origin);
|
|
|
|
|
2007-05-07 15:24:42 +00:00
|
|
|
//Don't stay angry at everyone... All of the time. ;)
|
2004-02-14 10:35:17 +00:00
|
|
|
//Side note. NIL is the same as WORLD.
|
2007-05-07 15:24:42 +00:00
|
|
|
if (random() < 0.5)
|
|
|
|
{
|
|
|
|
//Not PO'd anymore.
|
2011-03-20 08:27:47 +00:00
|
|
|
self.enemy = nil;
|
2007-05-07 15:24:42 +00:00
|
|
|
self.th_walk();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
//Stay PO'd. Player won't know where you are!
|
|
|
|
self.th_run();
|
|
|
|
}
|
2004-02-14 10:35:17 +00:00
|
|
|
|
|
|
|
//We have to set the origin no matter what kind of creature it is, so the
|
|
|
|
//thing becomes solid again. (Maybe, maybe not? Can't hurt anyway...)
|
|
|
|
if (!(self.flags & FL_FLY) && !(self.flags & FL_SWIM)) {
|
|
|
|
setorigin (self, self.origin + '0 0 1');
|
|
|
|
droptofloor ();
|
|
|
|
} else {
|
|
|
|
//Flyer/Fish
|
|
|
|
setorigin (self, self.origin);
|
|
|
|
}
|
2004-02-14 13:29:24 +00:00
|
|
|
if (!walkmove(0,0)) {
|
|
|
|
//Die if we get stuck in a wall/object
|
|
|
|
T_Damage (self, self, self, 50000);
|
|
|
|
}
|
2004-02-14 10:35:17 +00:00
|
|
|
}
|
2004-02-11 04:00:56 +00:00
|
|
|
};
|
2004-02-11 03:40:03 +00:00
|
|
|
|
|
|
|
void () savecritter =
|
|
|
|
{
|
2004-02-14 08:24:25 +00:00
|
|
|
// .max_health was only used by player until now
|
2004-02-11 03:40:03 +00:00
|
|
|
self.max_health = self.health;
|
2004-02-14 08:24:25 +00:00
|
|
|
// .oldorigin only used by secret doors, until now.
|
2004-02-11 03:40:03 +00:00
|
|
|
self.oldorigin = self.origin;
|
2004-02-14 08:24:25 +00:00
|
|
|
// .weaponmodel is only used to show the players current weapon (on the hud)
|
2004-02-11 03:40:03 +00:00
|
|
|
self.weaponmodel = self.model;
|
|
|
|
};
|
|
|
|
|
|
|
|
void () bringback =
|
|
|
|
{
|
|
|
|
if (!respawn_enabled)
|
|
|
|
return;
|
|
|
|
|
2004-02-11 04:00:56 +00:00
|
|
|
hes_dead_jim ();
|
2004-02-11 03:40:03 +00:00
|
|
|
};
|