X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fmonster%2Fmage.qc;h=9952063f60133e5fe4845ffd5f76e66ae7065d30;hb=7bd8f8562a392fda3ac881b1fbe2a35a5ef0f5c8;hp=4de03d7380018b83891f269a8b947ba0484690ed;hpb=45419c41b4da92340152d6fffe1fa429769b6d6a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 4de03d738..9952063f6 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -18,14 +18,14 @@ ENDCLASS(Mage) 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")); @@ -40,23 +40,21 @@ REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike)); 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(); @@ -362,7 +360,7 @@ float M_Mage_Attack(float attack_type, entity targ) if(random() <= 0.7) { Weapon wep = WEP_MAGE_SPIKE; - wep.wr_think(wep, false, true); + wep.wr_think(wep, self, false, true); return true; } @@ -384,7 +382,7 @@ float M_Mage_Attack(float attack_type, entity targ) 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; } } @@ -399,7 +397,7 @@ float M_Mage_Attack(float attack_type, entity targ) return false; } -void spawnfunc_monster_mage() { Monster_Spawn(MON_MAGE.monsterid); } +spawnfunc(monster_mage) { Monster_Spawn(MON_MAGE.monsterid); } #endif // SVQC