REGISTER_MONSTER(MAGE, NEW(Mage)) {
#ifndef MENUQC
- MON_ACTION(this, MR_PRECACHE);
+ this.mr_precache(this);
#endif
}
#include "../../weapons/all.qh"
CLASS(MageSpike, PortoLaunch)
-/* flags */ ATTRIB(MageSpike, spawnflags, int, WEP_TYPE_OTHER);
+/* flags */ ATTRIB(MageSpike, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED);
/* impulse */ ATTRIB(MageSpike, impulse, int, 9);
/* refname */ ATTRIB(MageSpike, netname, string, "magespike");
/* wepname */ ATTRIB(MageSpike, message, string, _("Mage spike"));
void M_Mage_Attack_Spike(vector dir);
void M_Mage_Attack_Push();
-METHOD(MageSpike, wr_think, bool(MageSpike thiswep, bool fire1, bool fire2)) {
- SELFPARAM();
+METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, bool fire1, bool fire2)) {
if (fire1)
- if (!IS_PLAYER(self) || weapon_prepareattack(false, 0.2)) {
- if (!self.target_range) self.target_range = autocvar_g_monsters_target_range;
- self.enemy = Monster_FindTarget(self);
- W_SetupShot_Dir(self, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
- if (!IS_PLAYER(self)) w_shotdir = normalize((self.enemy.origin + '0 0 10') - self.origin);
+ if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, false, 0.2)) {
+ if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range;
+ actor.enemy = Monster_FindTarget(actor);
+ W_SetupShot_Dir(actor, v_forward, false, 0, W_Sound("electro_fire"), CH_WEAPON_B, 0);
+ if (!IS_PLAYER(actor)) w_shotdir = normalize((actor.enemy.origin + '0 0 10') - actor.origin);
M_Mage_Attack_Spike(w_shotdir);
- weapon_thinkf(WFRAME_FIRE1, 0, w_ready);
+ weapon_thinkf(actor, WFRAME_FIRE1, 0, w_ready);
}
if (fire2)
- if (!IS_PLAYER(self) || weapon_prepareattack(true, 0.5)) {
+ if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, true, 0.5)) {
M_Mage_Attack_Push();
- weapon_thinkf(WFRAME_FIRE2, 0, w_ready);
+ weapon_thinkf(actor, WFRAME_FIRE2, 0, w_ready);
}
- return true;
}
void M_Mage_Attack_Teleport();
if(random() <= 0.7)
{
Weapon wep = WEP_MAGE_SPIKE;
- wep.wr_think(wep, false, true);
+ wep.wr_think(wep, self, false, true);
return true;
}
self.attack_finished_single = time + (autocvar_g_monster_mage_attack_spike_delay);
self.anim_finished = time + 1;
Weapon wep = WEP_MAGE_SPIKE;
- wep.wr_think(wep, true, false);
+ wep.wr_think(wep, self, true, false);
return true;
}
}
return false;
}
-void spawnfunc_monster_mage() { Monster_Spawn(MON_MAGE.monsterid); }
+spawnfunc(monster_mage) { Monster_Spawn(MON_MAGE.monsterid); }
#endif // SVQC