]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/wyvern.qc
Send effects to client, allows mismatching effectinfo.txt
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / wyvern.qc
index a44f6d9c7ab2fe089dea4c821a8857fa3e98c0c0..849abc36c395dd9ed4bec60788fd64027176b9eb 100644 (file)
@@ -1,15 +1,19 @@
-#ifdef REGISTER_MONSTER
-REGISTER_MONSTER(
+#ifndef MENUQC
+bool m_wyvern(int);
+#endif
+REGISTER_MONSTER_SIMPLE(
 /* MON_##id   */ WYVERN,
-/* function   */ m_wyvern,
 /* spawnflags */ MONSTER_TYPE_FLY | MONSTER_SIZE_BROKEN | MON_FLAG_RANGED,
 /* mins,maxs  */ '-20 -20 -58', '20 20 20',
 /* model      */ "wizard.mdl",
 /* netname    */ "wyvern",
 /* fullname   */ _("Wyvern")
-);
+) {
+#ifndef MENUQC
+       this.monster_func = m_wyvern;
+#endif
+}
 
-#else
 #ifdef SVQC
 float autocvar_g_monster_wyvern_health;
 float autocvar_g_monster_wyvern_attack_fireball_damage;
@@ -33,7 +37,7 @@ void wyvern_fireball_explode()
        entity e;
        if(self)
        {
-               pointparticles(particleeffectnum("fireball_explode"), self.origin, '0 0 0', 1);
+               Send_Effect("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, world, (autocvar_g_monster_wyvern_attack_fireball_radius), self.projectiledeathtype, world);
 
@@ -71,7 +75,7 @@ void wyvern_fireball()
        missile.think = wyvern_fireball_explode;
        missile.enemy = self.enemy;
        missile.touch = wyvern_fireball_touch;
-       CSQCProjectile(missile, TRUE, PROJECTILE_FIREMINE, TRUE);
+       CSQCProjectile(missile, true, PROJECTILE_FIREMINE, true);
 }
 
 float wyvern_attack(float attack_type)
@@ -85,18 +89,18 @@ float wyvern_attack(float attack_type)
 
                        wyvern_fireball();
 
-                       return TRUE;
+                       return true;
                }
        }
 
-       return FALSE;
+       return false;
 }
 
 void spawnfunc_monster_wyvern()
 {
        self.classname = "monster_wyvern";
 
-       if(!monster_initialize(MON_WYVERN)) { remove(self); return; }
+       if(!monster_initialize(MON_WYVERN.monsterid)) { remove(self); return; }
 }
 
 // compatibility with old spawns
@@ -109,7 +113,7 @@ float m_wyvern(float req)
                case MR_THINK:
                {
                        monster_move((autocvar_g_monster_wyvern_speed_run), (autocvar_g_monster_wyvern_speed_walk), (autocvar_g_monster_wyvern_speed_stop), wyvern_anim_fly, wyvern_anim_hover, wyvern_anim_hover);
-                       return TRUE;
+                       return true;
                }
                case MR_DEATH:
                {
@@ -117,7 +121,7 @@ float m_wyvern(float req)
                        self.velocity_x = -200 + 400 * random();
                        self.velocity_y = -200 + 400 * random();
                        self.velocity_z = 100 + 100 * random();
-                       return TRUE;
+                       return true;
                }
                case MR_SETUP:
                {
@@ -127,16 +131,16 @@ float m_wyvern(float req)
                        self.monster_attackfunc = wyvern_attack;
                        self.frame = wyvern_anim_hover;
 
-                       return TRUE;
+                       return true;
                }
                case MR_PRECACHE:
                {
                        precache_model("models/monsters/wizard.mdl");
-                       return TRUE;
+                       return true;
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 #endif // SVQC
@@ -147,12 +151,11 @@ float m_wyvern(float req)
        {
                case MR_PRECACHE:
                {
-                       return TRUE;
+                       return true;
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 #endif // CSQC
-#endif // REGISTER_MONSTER