f = self.dmg_last - dmg_remaining_next;
self.dmg_last = dmg_remaining_next;
- RadiusDamage (self, self.owner, self.dmg * f, self.dmg_edge * f, self.dmg_radius, self.owner, self.dmg_force * f, self.projectiledeathtype, world);
+ RadiusDamage (self, self.realowner, self.dmg * f, self.dmg_edge * f, self.dmg_radius, self.realowner, self.dmg_force * f, self.projectiledeathtype, world);
self.projectiledeathtype |= HITTYPE_BOUNCE;
//RadiusDamage (self, world, self.dmg * f, self.dmg_edge * f, self.dmg_radius, world, self.dmg_force * f, self.projectiledeathtype, world);
{
local entity gren;
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - autocvar_g_balance_hook_secondary_ammo;
- W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CHAN_WEAPON, autocvar_g_balance_hook_secondary_damage);
+ W_DecreaseAmmo(ammo_cells, autocvar_g_balance_hook_secondary_ammo, FALSE);
+ W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", CH_WEAPON_A, autocvar_g_balance_hook_secondary_damage);
gren = spawn ();
- gren.owner = self;
+ gren.owner = gren.realowner = self;
gren.classname = "hookbomb";
gren.bot_dodge = TRUE;
gren.bot_dodgerating = autocvar_g_balance_hook_secondary_damage;
if (time > self.hook_refire)
if (weapon_prepareattack(0, -1))
{
- if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_hook_primary_fuel;
+ W_DecreaseAmmo(ammo_fuel, autocvar_g_balance_hook_primary_fuel, FALSE);
self.hook_state |= HOOK_FIRING;
weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready);
}
if(self.hook)
{
// if hooked, no bombs, and increase the timer
- self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire);
+ self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire * W_WeaponRateFactor());
// hook also inhibits health regeneration, but only for 1 second
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
{
if ( self.ammo_fuel >= (time - self.hook_time_fueldecrease) * hooked_fuel )
{
- self.ammo_fuel -= (time - self.hook_time_fueldecrease) * hooked_fuel;
+ W_DecreaseAmmo(ammo_fuel, (time - self.hook_time_fueldecrease) * hooked_fuel, FALSE);
self.hook_time_fueldecrease = time;
// decrease next frame again
}
else if (req == WR_SETUP)
{
weapon_setup(WEP_HOOK);
+ self.current_ammo = ammo_fuel;
self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
}
else if (req == WR_CHECKAMMO1)
org2 = w_org + w_backoff * 2;
pointparticles(particleeffectnum("hookbomb_explode"), org2, '0 0 0', 1);
if(!w_issilent)
- sound(self, CHAN_PROJECTILE, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
+ sound(self, CH_SHOTS, "weapons/hookbomb_impact.wav", VOL_BASE, ATTN_NORM);
}
else if(req == WR_PRECACHE)
{