self.SendFlags |= MSF_MOVE;
}
+void monster_dead_think()
+{
+ self.think = monster_dead_think;
+ self.nextthink = time + 0.3; // don't need to update so often now
+
+ if(time >= self.ltime)
+ {
+ Monster_Fade();
+ return;
+ }
+
+ self.SendFlags |= MSF_MOVE; // keep up to date on the monster's location
+}
+
void monsters_setstatus()
{
self.stat_monsters_total = monsters_total;
void monsters_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
+ string t1, t2;
+
if(self.frozen && deathtype != DEATH_KILL)
return;
if(deathtype == DEATH_KILL)
self.candrop = FALSE; // killed by mobkill command
+ // TODO: fix this?
activator = attacker;
other = self.enemy;
+ t1 = self.target;
+ t2 = self.target2;
self.target = self.target2;
self.target2 = "";
SUB_UseTargets();
+ self.target = t1;
+ self.target2 = t2;
self.monster_die();
{
Monster_CheckDropCvars ("demon");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe(demon_anim_death);
monster_hook_death(); // for post-death mods
{
Monster_CheckDropCvars ("dog");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe(dog_anim_die);
monster_hook_death(); // for post-death mods
{
Monster_CheckDropCvars ("fish");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe(fish_anim_death);
monster_hook_death(); // for post-death mods
float chance = random();
Monster_CheckDropCvars ("hellknight");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe((random() > 0.5) ? hellknight_anim_death1 : hellknight_anim_death2);
if(chance < 0.10 || self.flags & MONSTERFLAG_MINIBOSS)
{
Monster_CheckDropCvars ("knight");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe((random() > 0.5) ? knight_anim_death1 : knight_anim_death2);
monster_hook_death(); // for post-death mods
{
Monster_CheckDropCvars ("ogre");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe(ogre_anim_die);
monster_hook_death(); // for post-death mods
{
Monster_CheckDropCvars ("shalrath");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe(shalrath_anim_death);
monster_hook_death(); // for post-death mods
{
Monster_CheckDropCvars ("shambler");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe(shambler_anim_death);
monster_hook_death(); // for post-death mods
{
Monster_CheckDropCvars ("soldier");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe((random() > 0.5) ? soldier_anim_die1 : soldier_anim_die2);
monster_hook_death(); // for post-death mods
{
Monster_CheckDropCvars ("spider");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe(spider_anim_attack);
self.angles += '180 0 0';
Wiz_StartFast();
}
-void wizard_dead_think()
-{
- self.think = wizard_dead_think;
- self.nextthink = time + self.ticrate;
-
- if(time >= self.ltime)
- {
- Monster_Fade();
- return;
- }
-
- self.SendFlags |= MSF_MOVE; // keep up to date on the monster's location
-}
-
void wizard_die ()
{
Monster_CheckDropCvars ("wizard");
- self.think = wizard_dead_think; // exception for wizard, as it needs to keep moving
- self.ltime = time + 5;
- self.nextthink = time + self.ticrate;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
self.velocity_x = -200 + 400 * random();
self.velocity_y = -200 + 400 * random();
self.velocity_z = 100 + 100 * random();
{
Monster_CheckDropCvars ("zombie");
- self.think = Monster_Fade;
- self.nextthink = time + 5;
+ self.think = monster_dead_think;
+ self.nextthink = time + self.ticrate;
+ self.ltime = time + 5;
monsters_setframe((random() > 0.5) ? zombie_anim_deathback1 : zombie_anim_deathfront1);
monster_hook_death(); // for post-death mods