self.colormap = 1024 + (self.team - 1) * 17;
}
+void monster_die()
+{
+ if(self.monsterid == MONSTER_SPIDER)
+ self.angles += '180 0 0';
+
+ self.solid = SOLID_CORPSE;
+}
+
void monster_draw()
{
float dt;
_tmp = ReadByte();
if(_tmp == 0 && self.health != 0)
- if(self.monsterid == MONSTER_SPIDER)
- self.angles += '180 0 0';
+ monster_die();
self.health = _tmp;
}
frag_target = self;
MUTATOR_CALLHOOK(MonsterDies);
- self.SendFlags |= MSF_MOVE;
-
if(self.health <= -100) // check if we're already gibbed
{
Violence_GibSplash(self, 1, 0.5, attacker);
self.takedamage = DAMAGE_AIM;
self.enemy = world;
self.movetype = MOVETYPE_TOSS;
+ self.moveto = self.origin;
+
+ if not(self.flags & FL_FLY)
+ self.velocity = '0 0 0';
+
+ self.SendFlags |= MSF_MOVE;
totalspawned -= 1;
}
void Wiz_FastTouch ()
{
- PROJECTILE_TOUCH;
-
if(other == self.owner)
return;
- if(teamplay)
- if(other.team == self.owner.team)
- return;
+ PROJECTILE_TOUCH;
pointparticles(particleeffectnum("TE_WIZSPIKE"), self.origin, '0 0 0', 1);
void Wiz_StartFast ()
{
- local entity missile;
- local vector dir = '0 0 0';
- local float dist = 0, flytime = 0;
+ entity missile;
+ vector dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
self.attack_finished_single = time + 0.2;
-
- dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
- dist = vlen (self.enemy.origin - self.origin);
- flytime = dist * 0.002;
- if (flytime < 0.1)
- flytime = 0.1;
self.v_angle = self.angles;
makevectors (self.angles);
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 = Monster_Fade;
- self.nextthink = time + 5;
- self.flags = FL_ONGROUND;
+ self.think = wizard_dead_think; // exception for wizard, as it needs to keep moving
+ self.ltime = time + 5;
+ self.nextthink = time + self.ticrate;
self.velocity_x = -200 + 400 * random();
self.velocity_y = -200 + 400 * random();
self.velocity_z = 100 + 100 * random();