]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/monster/mage.qc
Weapons: pass weapon index
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / monster / mage.qc
index fd1c9bb85212d136bcee44aebabbad3cb8c1e3f1..f38bd791293a3844c353ea7a9fbba2f3d6e6e9fe 100644 (file)
@@ -41,8 +41,8 @@ REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike));
 
 void M_Mage_Attack_Spike(vector dir);
 void M_Mage_Attack_Push();
-METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, bool fire1, bool fire2)) {
-    if (fire1)
+METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, int slot, int fire)) {
+    if (fire & 1)
     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);
@@ -51,7 +51,7 @@ METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, bool fire1, bo
         M_Mage_Attack_Spike(w_shotdir);
         weapon_thinkf(actor, WFRAME_FIRE1, 0, w_ready);
     }
-    if (fire2)
+    if (fire & 2)
     if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, true, 0.5)) {
         M_Mage_Attack_Push();
         weapon_thinkf(actor, WFRAME_FIRE2, 0, w_ready);
@@ -151,7 +151,7 @@ void M_Mage_Attack_Spike_Explode()
        self.realowner.mage_spike = world;
 
        Send_Effect(EFFECT_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, 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.m_id, other);
 
        remove (self);
 }
@@ -305,7 +305,7 @@ void M_Mage_Defend_Heal()
 void M_Mage_Attack_Push()
 {SELFPARAM();
        sound(self, CH_SHOTS, SND_TAGEXP1, 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, 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.m_id, self.enemy);
        Send_Effect(EFFECT_TE_EXPLOSION, self.origin, '0 0 0', 1);
 
        setanim(self, self.anim_shoot, true, true, true);
@@ -363,7 +363,7 @@ float M_Mage_Attack(float attack_type, entity targ)
                        if(random() <= 0.7)
                        {
                                Weapon wep = WEP_MAGE_SPIKE;
-                               wep.wr_think(wep, self, false, true);
+                               wep.wr_think(wep, self, 0, 2);
                                return true;
                        }
 
@@ -385,7 +385,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, self, true, false);
+                                       wep.wr_think(wep, self, 0, 1);
                                        return true;
                                }
                        }