]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/mage.qc
Merge branch 'master' into samual/weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / mage.qc
index 83924ab7d613e5dc426671be2b1f4d336c4a801b..ffc62ea56cbddf8de58e259a6cd28071e8755c7a 100644 (file)
@@ -1,12 +1,12 @@
 #ifdef REGISTER_MONSTER
 REGISTER_MONSTER(
 #ifdef REGISTER_MONSTER
 REGISTER_MONSTER(
-/* MON_##id      */ MAGE,
-/* function      */ m_mage,
+/* MON_##id   */ MAGE,
+/* function   */ m_mage,
 /* spawnflags */ MON_FLAG_MELEE | MON_FLAG_RANGED,
 /* mins,maxs  */ '-36 -36 -24', '36 36 50',
 /* spawnflags */ MON_FLAG_MELEE | MON_FLAG_RANGED,
 /* mins,maxs  */ '-36 -36 -24', '36 36 50',
-/* model         */ "mage.dpm",
-/* netname       */ "mage",
-/* fullname      */ _("Mage")
+/* model      */ "mage.dpm",
+/* netname    */ "mage",
+/* fullname   */ _("Mage")
 );
 
 #else
 );
 
 #else
@@ -60,10 +60,10 @@ float friend_needshelp(entity e)
                return FALSE;
        if(DIFF_TEAM(e, self) && e != self.monster_owner)
                return FALSE;
                return FALSE;
        if(DIFF_TEAM(e, self) && e != self.monster_owner)
                return FALSE;
-       if(e.frozen)
+       if(e.freezetag_frozen)
                return FALSE;
        if(!IS_PLAYER(e))
                return FALSE;
        if(!IS_PLAYER(e))
-               return (e.flags & FL_MONSTER && e.health < e.max_health);
+               return ((e.flags & FL_MONSTER) && e.health < e.max_health);
        if(e.items & IT_INVINCIBLE)
                return FALSE;
 
        if(e.items & IT_INVINCIBLE)
                return FALSE;
 
@@ -87,7 +87,7 @@ void mage_spike_explode()
        self.realowner.mage_spike = world;
 
        pointparticles(particleeffectnum("explosion_small"), self.origin, '0 0 0', 1);
        self.realowner.mage_spike = world;
 
        pointparticles(particleeffectnum("explosion_small"), self.origin, '0 0 0', 1);
-       RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, 0, DEATH_MONSTER_MAGE, other);
+       RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE, other);
 
        remove (self);
 }
 
        remove (self);
 }
@@ -147,7 +147,7 @@ void mage_spike_think()
                        self.wait = bound((autocvar_g_monster_mage_attack_spike_smart_trace_min), vlen(self.origin - trace_endpos), self.wait = (autocvar_g_monster_mage_attack_spike_smart_trace_max));
 
                        // Calc how important it is that we turn and add this to the desierd (enemy) dir.
                        self.wait = bound((autocvar_g_monster_mage_attack_spike_smart_trace_min), vlen(self.origin - trace_endpos), self.wait = (autocvar_g_monster_mage_attack_spike_smart_trace_max));
 
                        // Calc how important it is that we turn and add this to the desierd (enemy) dir.
-                       desireddir      = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
+                       desireddir = normalize(((trace_plane_normal * (1 - trace_fraction)) + (desireddir * trace_fraction)) * 0.5);
                }
 
                newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
                }
 
                newdir = normalize(olddir + desireddir * turnrate); // take the average of the 2 directions; not the best method but simple & easy
@@ -233,7 +233,8 @@ void mage_heal()
                {
                        pointparticles(particleeffectnum("healing_fx"), head.origin, '0 0 0', 1);
                        head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health);
                {
                        pointparticles(particleeffectnum("healing_fx"), head.origin, '0 0 0', 1);
                        head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health);
-                       WaypointSprite_UpdateHealth(head.sprite, head.health);
+                       if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE))
+                               WaypointSprite_UpdateHealth(head.sprite, head.health);
                }
        }
 
                }
        }
 
@@ -247,7 +248,7 @@ void mage_heal()
 void mage_push()
 {
        sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
 void mage_push()
 {
        sound(self, CH_SHOTS, "weapons/tagexp1.wav", 1, ATTEN_NORM);
-       RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
+       RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
        pointparticles(particleeffectnum("TE_EXPLOSION"), self.origin, '0 0 0', 1);
 
        self.frame = mage_anim_attack;
        pointparticles(particleeffectnum("TE_EXPLOSION"), self.origin, '0 0 0', 1);
 
        self.frame = mage_anim_attack;
@@ -335,12 +336,7 @@ void spawnfunc_monster_mage()
 {
        self.classname = "monster_mage";
 
 {
        self.classname = "monster_mage";
 
-       self.monster_spawnfunc = spawnfunc_monster_mage;
-
-       if(Monster_CheckAppearFlags(self))
-               return;
-
-       if(!monster_initialize(MON_MAGE, FALSE)) { remove(self); return; }
+       if(!monster_initialize(MON_MAGE)) { remove(self); return; }
 }
 
 // compatibility with old spawns
 }
 
 // compatibility with old spawns
@@ -397,7 +393,7 @@ float m_mage(float req)
                }
                case MR_PRECACHE:
                {
                }
                case MR_PRECACHE:
                {
-                       precache_model ("models/monsters/mage.dpm");
+                       precache_model("models/monsters/mage.dpm");
                        precache_sound ("weapons/grenade_impact.wav");
                        precache_sound ("weapons/tagexp1.wav");
                        return TRUE;
                        precache_sound ("weapons/grenade_impact.wav");
                        precache_sound ("weapons/tagexp1.wav");
                        return TRUE;
@@ -415,7 +411,6 @@ float m_mage(float req)
        {
                case MR_PRECACHE:
                {
        {
                case MR_PRECACHE:
                {
-                       precache_model ("models/monsters/mage.dpm");
                        return TRUE;
                }
        }
                        return TRUE;
                }
        }