]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/monsters/monster/wizard.qc
Fix hell-knight .think usage
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / monsters / monster / wizard.qc
index 58c0fe0ed2689c121df181388f8c378fd35c6d6d..f584e8411e797c43e6b8470ebed6449a02ad9ff9 100644 (file)
@@ -37,14 +37,10 @@ void Wiz_FastExplode()
 
 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);
        
@@ -53,17 +49,10 @@ void Wiz_FastTouch ()
 
 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);
@@ -116,9 +105,9 @@ void wizard_die ()
 {
        Monster_CheckDropCvars ("wizard");
        
-       self.think                      = Monster_Fade;
-       self.nextthink          = time + 5;
-       self.flags                      = FL_ONGROUND;
+       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();
@@ -146,7 +135,8 @@ void wizard_spawn ()
        self.movetype                   = MOVETYPE_FLY; // TODO: make it fly up/down
        self.flags                         |= FL_FLY;
        self.think                              = wizard_think;
-       self.sprite_height              = 30;
+       
+       monster_setupsounds("wizard");
        
        monster_hook_spawn(); // for post-spawn mods
 }
@@ -164,7 +154,6 @@ void spawnfunc_monster_wizard ()
        
        if not (monster_initialize(
                         "Scrag", MONSTER_SCRAG,
-                        WIZARD_MODEL,
                         WIZARD_MIN, WIZARD_MAX,
                         TRUE,
                         wizard_die, wizard_spawn))
@@ -172,9 +161,6 @@ void spawnfunc_monster_wizard ()
                remove(self);
                return;
        }
-       
-       precache_model ("models/spike.mdl");
-       precache_sound ("weapons/spike.wav");
 }
 
 // compatibility with old spawns