#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(HOOK, w_hook, IT_CELLS|IT_FUEL, 0, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "hookgun", "hook", "Grappling Hook");
+REGISTER_WEAPON(HOOK, w_hook, IT_CELLS|IT_FUEL, 0, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH, 0, "hookgun", "hook", _("Grappling Hook"))
#else
#ifdef SVQC
.float dmg;
.float hook_time_hooked;
.float hook_time_fueldecrease;
+void W_Hook_SetAmmoCounter()
+{
+ // this weapon doesn't have a reload system, so always set the clip to 0 when switching to it
+ self.clip_load = self.clip_size = 0; // also keeps crosshair ammo from displaying
+}
+
void W_Hook_ExplodeThink (void)
{
float dt, dmg_remaining_next, f;
self.think = W_Hook_ExplodeThink;
self.nextthink = time;
- self.dmg = cvar("g_balance_hook_secondary_damage");
- self.dmg_edge = cvar("g_balance_hook_secondary_edgedamage");
- self.dmg_radius = cvar("g_balance_hook_secondary_radius");
- self.dmg_force = cvar("g_balance_hook_secondary_force");
- self.dmg_power = cvar("g_balance_hook_secondary_power");
- self.dmg_duration = cvar("g_balance_hook_secondary_duration");
+ self.dmg = autocvar_g_balance_hook_secondary_damage;
+ self.dmg_edge = autocvar_g_balance_hook_secondary_edgedamage;
+ self.dmg_radius = autocvar_g_balance_hook_secondary_radius;
+ self.dmg_force = autocvar_g_balance_hook_secondary_force;
+ self.dmg_power = autocvar_g_balance_hook_secondary_power;
+ self.dmg_duration = autocvar_g_balance_hook_secondary_duration;
self.teleport_time = time;
self.dmg_last = 1;
self.movetype = MOVETYPE_NONE;
local entity gren;
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_cells = self.ammo_cells - cvar("g_balance_hook_secondary_ammo");
- W_SetupShot (self, FALSE, 4, "weapons/hookbomb_fire.wav", cvar("g_balance_hook_secondary_damage"));
+ 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);
gren = spawn ();
gren.owner = self;
gren.classname = "hookbomb";
gren.bot_dodge = TRUE;
- gren.bot_dodgerating = cvar("g_balance_hook_secondary_damage");
+ gren.bot_dodgerating = autocvar_g_balance_hook_secondary_damage;
gren.movetype = MOVETYPE_TOSS;
PROJECTILE_MAKETRIGGER(gren);
gren.projectiledeathtype = WEP_HOOK | HITTYPE_SECONDARY;
setorigin(gren, w_shotorg);
setsize(gren, '0 0 0', '0 0 0');
- gren.nextthink = time + cvar("g_balance_hook_secondary_lifetime");
+ gren.nextthink = time + autocvar_g_balance_hook_secondary_lifetime;
gren.think = adaptor_think2use_hittype_splash;
gren.use = W_Hook_Explode2;
gren.touch = W_Hook_Touch2;
- gren.velocity = '0 0 1' * cvar("g_balance_hook_secondary_speed");
- if(cvar("g_projectiles_newton_style"))
+ gren.velocity = '0 0 1' * autocvar_g_balance_hook_secondary_speed;
+ if(autocvar_g_projectiles_newton_style)
gren.velocity = gren.velocity + self.velocity;
- gren.gravity = cvar("g_balance_hook_secondary_gravity");
+ gren.gravity = autocvar_g_balance_hook_secondary_gravity;
//W_SetupProjectileVelocity(gren); // just falling down!
gren.angles = '0 0 0';
if (weapon_prepareattack(0, -1))
{
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.ammo_fuel = self.ammo_fuel - cvar("g_balance_hook_primary_fuel");
+ self.ammo_fuel = self.ammo_fuel - autocvar_g_balance_hook_primary_fuel;
self.hook_state |= HOOK_FIRING;
- weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_hook_primary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hook_primary_animtime, w_ready);
}
}
if (self.BUTTON_ATCK2)
{
- if (weapon_prepareattack(1, cvar("g_balance_hook_secondary_refire")))
+ if (weapon_prepareattack(1, autocvar_g_balance_hook_secondary_refire))
{
W_Hook_Attack2();
- weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_hook_secondary_animtime"), w_ready);
+ weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hook_secondary_animtime, w_ready);
}
}
if(self.hook)
{
// if hooked, no bombs, and increase the timer
- self.hook_refire = max(self.hook_refire, time + cvar("g_balance_hook_primary_refire"));
+ self.hook_refire = max(self.hook_refire, time + autocvar_g_balance_hook_primary_refire);
// hook also inhibits health regeneration, but only for 1 second
if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
- self.pauseregen_finished = max(self.pauseregen_finished, time + cvar("g_balance_pause_fuel_regen"));
+ self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_pause_fuel_regen);
}
if(self.hook && self.hook.state == 1)
{
- hooked_time_max = cvar("g_balance_hook_primary_hooked_time_max");
+ hooked_time_max = autocvar_g_balance_hook_primary_hooked_time_max;
if (hooked_time_max > 0)
{
if ( time > self.hook_time_hooked + hooked_time_max )
self.hook_state |= HOOK_REMOVING;
}
- hooked_fuel = cvar("g_balance_hook_primary_hooked_fuel");
+ hooked_fuel = autocvar_g_balance_hook_primary_hooked_fuel;
if (hooked_fuel > 0)
{
if ( time > self.hook_time_fueldecrease )
else
{
self.hook_time_hooked = time;
- self.hook_time_fueldecrease = time + cvar("g_balance_hook_primary_hooked_time_free");
+ self.hook_time_fueldecrease = time + autocvar_g_balance_hook_primary_hooked_time_free;
}
if (self.BUTTON_CROUCH)
else if (req == WR_SETUP)
{
weapon_setup(WEP_HOOK);
+ W_Hook_SetAmmoCounter();
self.hook_state &~= HOOK_WAITING_FOR_RELEASE;
}
else if (req == WR_CHECKAMMO1)
if(self.hook)
return self.ammo_fuel > 0;
else
- return self.ammo_fuel >= cvar("g_balance_hook_primary_fuel");
+ return self.ammo_fuel >= autocvar_g_balance_hook_primary_fuel;
}
else if (req == WR_CHECKAMMO2)
{
- return self.ammo_cells >= cvar("g_balance_hook_secondary_ammo");
+ return self.ammo_cells >= autocvar_g_balance_hook_secondary_ammo;
}
else if (req == WR_RESETPLAYER)
{
precache_sound("weapons/hookbomb_impact.wav");
}
else if (req == WR_SUICIDEMESSAGE)
- w_deathtypestring = "%s did the impossible";
+ w_deathtypestring = _("%s did the impossible");
else if (req == WR_KILLMESSAGE)
- w_deathtypestring = "%s has run into %s's gravity bomb";
+ w_deathtypestring = _("%s has run into %s's gravity bomb");
return TRUE;
}
#endif