]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/mage.qc
Weapons: Introduce concept of offhand weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / mage.qc
index b1f5cf1ce8d68012fcd4f5b862abc9b5beec281a..0030a4fa81b0f0b1330bd8ee14bcbf90a4638d12 100644 (file)
@@ -1,9 +1,17 @@
+#ifndef MAGE_H
+#define MAGE_H
+
+#ifndef MENUQC
+MODEL(MON_MAGE, "models/monsters/mage.dpm");
+#endif
+
 CLASS(Mage, Monster)
     ATTRIB(Mage, spawnflags, int, MON_FLAG_MELEE | MON_FLAG_RANGED);
     ATTRIB(Mage, mins, vector, '-36 -36 -24');
     ATTRIB(Mage, maxs, vector, '36 36 50');
-    ATTRIB(Mage, mdl, string, "mage.dpm");
-    ATTRIB(Mage, model, string, strzone(strcat("models/monsters/", this.mdl)));
+#ifndef MENUQC
+    ATTRIB(Mage, m_model, Model, MDL_MON_MAGE);
+#endif
     ATTRIB(Mage, netname, string, "mage");
     ATTRIB(Mage, monster_name, string, _("Mage"));
 ENDCLASS(Mage)
@@ -24,12 +32,16 @@ CLASS(MageSpike, PortoLaunch)
 ENDCLASS(MageSpike)
 REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike));
 
+#endif
+
+#ifdef IMPLEMENTATION
+
 #ifdef SVQC
 
 void M_Mage_Attack_Spike(vector dir);
-METHOD(MageSpike, wr_think, bool(entity thiswep)) {
+METHOD(MageSpike, wr_think, bool(entity thiswep, bool fire1, bool fire2)) {
        SELFPARAM();
-       if (self.BUTTON_ATCK)
+       if (fire1)
        if (weapon_prepareattack(0, WEP_CVAR_PRI(electro, refire))) {
                if (!self.target_range) self.target_range = autocvar_g_monsters_target_range;
                self.enemy = Monster_FindTarget(self);
@@ -445,3 +457,5 @@ void spawnfunc_monster_mage() { Monster_Spawn(MON_MAGE.monsterid); }
                        return true;
                }
                #endif
+
+#endif