REGISTER_MUTATOR(hmg_nadesupport, true);
MUTATOR_HOOKFUNCTION(hmg_nadesupport, Nade_Damage)
{
- SELFPARAM();
- if (M_ARGV(0, entity) != WEP_HMG) return;
+ if (M_ARGV(1, entity) != WEP_HMG) return;
return = true;
- M_ARGV(2, float) /* damage */ = self.max_health * 0.1;
+ M_ARGV(3, float) /* damage */ = (M_ARGV(0, entity)).max_health * 0.1;
}
spawnfunc(weapon_hmg) { weapon_defaultspawnfunc(this, WEP_HMG); }
void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
- SELFPARAM();
if (!PHYS_INPUT_BUTTON_ATCK(actor))
{
w_ready(thiswep, actor, weaponentity, fire);
return;
}
- W_DecreaseAmmo(WEP_HMG, self, WEP_CVAR(hmg, ammo));
+ W_DecreaseAmmo(WEP_HMG, actor, WEP_CVAR(hmg, ammo));
W_SetupShot (actor, true, 0, SND_UZI_FIRE, CH_WEAPON_A, WEP_CVAR(hmg, damage));
METHOD(HeavyMachineGun, wr_aim, void(entity thiswep, entity actor))
{
- 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);
+ if(vdist(actor.origin - actor.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
+ PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
else
- PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(self, 1000000, 0, 0.001, false);
+ PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, 1000000, 0, 0.001, false);
}
METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
METHOD(HeavyMachineGun, wr_reload, void(entity thiswep, entity actor, .entity weaponentity))
{
- SELFPARAM();
- W_Reload(self, WEP_CVAR(hmg, ammo), SND_RELOAD);
+ W_Reload(actor, WEP_CVAR(hmg, ammo), SND_RELOAD);
}
METHOD(HeavyMachineGun, wr_suicidemessage, Notification(entity thiswep))
METHOD(HeavyMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
{
- entity this = actor;
vector org2;
org2 = w_org + w_backoff * 2;
pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
if(!w_issilent)
- sound(self, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
+ sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
}
#endif