]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/wyvern.qc
Apply a patch by Melanosuchus, fixing issues noted in http://dev.xonotic.org/issues...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / wyvern.qc
index 69a950852cd3eeb1040b2c2ab9fb95dab4fe0d78..ed4962d061ccd47934bd551d6c336189e1d103d8 100644 (file)
@@ -22,11 +22,11 @@ float autocvar_g_monster_wyvern_speed_stop;
 float autocvar_g_monster_wyvern_speed_run;
 float autocvar_g_monster_wyvern_speed_walk;
 
-const float wyvern_anim_hover  = 0;
-const float wyvern_anim_fly    = 1;
-const float wyvern_anim_magic  = 2;
-const float wyvern_anim_pain   = 3;
-const float wyvern_anim_death  = 4;
+const float wyvern_anim_hover  = 0;
+const float wyvern_anim_fly            = 1;
+const float wyvern_anim_magic  = 2;
+const float wyvern_anim_pain   = 3;
+const float wyvern_anim_death  = 4;
 
 void wyvern_fireball_explode()
 {
@@ -34,12 +34,12 @@ void wyvern_fireball_explode()
        if(self)
        {
                pointparticles(particleeffectnum("fireball_explode"), self.origin, '0 0 0', 1);
-               
+
                RadiusDamage(self, self.realowner, (autocvar_g_monster_wyvern_attack_fireball_damage), (autocvar_g_monster_wyvern_attack_fireball_edgedamage), (autocvar_g_monster_wyvern_attack_fireball_force), world, (autocvar_g_monster_wyvern_attack_fireball_radius), self.projectiledeathtype, world);
-               
+
                for(e = world; (e = findfloat(e, takedamage, DAMAGE_AIM)); ) if(vlen(e.origin - self.origin) <= (autocvar_g_monster_wyvern_attack_fireball_radius))
                        Fire_AddDamage(e, self, 5 * Monster_SkillModifier(), (autocvar_g_monster_wyvern_attack_fireball_damagetime), self.projectiledeathtype);
-               
+
                remove(self);
        }
 }
@@ -47,7 +47,7 @@ void wyvern_fireball_explode()
 void wyvern_fireball_touch()
 {
        PROJECTILE_TOUCH;
-       
+
        wyvern_fireball_explode();
 }
 
@@ -55,14 +55,14 @@ void wyvern_fireball()
 {
        entity missile = spawn();
        vector dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
-       
+
        monster_makevectors(self.enemy);
 
        missile.owner = missile.realowner = self;
        missile.solid = SOLID_TRIGGER;
        missile.movetype = MOVETYPE_FLYMISSILE;
        missile.projectiledeathtype = DEATH_MONSTER_WYVERN;
-       setsize(missile, '-6 -6 -6', '6 6 6');          
+       setsize(missile, '-6 -6 -6', '6 6 6');
        setorigin(missile, self.origin + self.view_ofs + v_forward * 14);
        missile.flags = FL_PROJECTILE;
        missile.velocity = dir * (autocvar_g_monster_wyvern_attack_fireball_speed);
@@ -82,26 +82,21 @@ float wyvern_attack(float attack_type)
                case MONSTER_ATTACK_RANGED:
                {
                        self.attack_finished_single = time + 1.2;
-                       
+
                        wyvern_fireball();
-                       
+
                        return TRUE;
                }
        }
-       
+
        return FALSE;
 }
 
 void spawnfunc_monster_wyvern()
 {
        self.classname = "monster_wyvern";
-       
-       self.monster_spawnfunc = spawnfunc_monster_wyvern;
-       
-       if(Monster_CheckAppearFlags(self))
-               return;
-       
-       if not(monster_initialize(MON_WYVERN, TRUE)) { remove(self); return; }
+
+       if(!monster_initialize(MON_WYVERN)) { remove(self); return; }
 }
 
 // compatibility with old spawns
@@ -126,21 +121,21 @@ float m_wyvern(float req)
                }
                case MR_SETUP:
                {
-                       if not(self.health) self.health = (autocvar_g_monster_wyvern_health);
-                       
+                       if(!self.health) self.health = (autocvar_g_monster_wyvern_health);
+
                        self.monster_loot = spawnfunc_item_cells;
                        self.monster_attackfunc = wyvern_attack;
                        self.frame = wyvern_anim_hover;
-                       
+
                        return TRUE;
                }
                case MR_PRECACHE:
                {
-                       precache_model ("models/monsters/wizard.mdl");
+                       precache_model("models/monsters/wizard.mdl");
                        return TRUE;
                }
        }
-       
+
        return TRUE;
 }
 
@@ -152,11 +147,10 @@ float m_wyvern(float req)
        {
                case MR_PRECACHE:
                {
-                       precache_model ("models/monsters/wizard.mdl");
                        return TRUE;
                }
        }
-       
+
        return TRUE;
 }