MUTATOR_HOOKFUNCTION(hmg_nadesupport, Nade_Damage)
{
SELFPARAM();
- if (MUTATOR_ARGV(0, entity) != WEP_HMG) return;
+ if (M_ARGV(0, entity) != WEP_HMG) return;
return = true;
- MUTATOR_ARGV(0, float) /* damage */ = self.max_health * 0.1;
+ M_ARGV(2, float) /* damage */ = self.max_health * 0.1;
}
spawnfunc(weapon_hmg) { weapon_defaultspawnfunc(this, WEP_HMG); }
return;
}
- if(!thiswep.wr_checkammo1(thiswep))
+ if(!thiswep.wr_checkammo1(thiswep, actor))
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
{
W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
Send_Effect(EFFECT_MACHINEGUN_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
- W_MachineGun_MuzzleFlash();
+ W_MachineGun_MuzzleFlash(actor);
W_AttachToShotorg(actor, actor.muzzle_flash, '5 0 0');
if (autocvar_g_casings >= 2) // casing code
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR(hmg, refire), W_HeavyMachineGun_Attack_Auto);
}
-METHOD(HeavyMachineGun, wr_aim, void(entity thiswep))
+METHOD(HeavyMachineGun, wr_aim, void(entity thiswep, entity actor))
{
- SELFPARAM();
+ entity this = actor;
if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(self, 1000000, 0, 0.001, false);
else
}
}
-METHOD(HeavyMachineGun, wr_checkammo1, bool(entity thiswep))
+METHOD(HeavyMachineGun, wr_checkammo1, bool(entity thiswep, entity actor))
{
- SELFPARAM();
- float ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo);
+ float ammo_amount = actor.ammo_nails >= WEP_CVAR(hmg, ammo);
if(autocvar_g_balance_hmg_reload_ammo)
- ammo_amount += self.(weapon_load[WEP_HMG.m_id]) >= WEP_CVAR(hmg, ammo);
+ ammo_amount += actor.(weapon_load[WEP_HMG.m_id]) >= WEP_CVAR(hmg, ammo);
return ammo_amount;
}
-METHOD(HeavyMachineGun, wr_checkammo2, bool(entity thiswep))
+METHOD(HeavyMachineGun, wr_checkammo2, bool(entity thiswep, entity actor))
{
- SELFPARAM();
- float ammo_amount = self.ammo_nails >= WEP_CVAR(hmg, ammo);
+ float ammo_amount = actor.ammo_nails >= WEP_CVAR(hmg, ammo);
if(autocvar_g_balance_hmg_reload_ammo)
- ammo_amount += self.(weapon_load[WEP_HMG.m_id]) >= WEP_CVAR(hmg, ammo);
+ ammo_amount += actor.(weapon_load[WEP_HMG.m_id]) >= WEP_CVAR(hmg, ammo);
return ammo_amount;
}
#endif
#ifdef CSQC
-METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep))
+METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
{
- SELFPARAM();
+ entity this = actor;
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);