+#include "hook.qh"
#ifndef IMPLEMENTATION
CLASS(Hook, Weapon)
-/* ammotype */ ATTRIB(Hook, ammo_field, .int, ammo_fuel)
-/* impulse */ ATTRIB(Hook, impulse, int, 0)
+/* ammotype */ ATTRIB(Hook, ammo_field, .int, ammo_fuel);
+/* impulse */ ATTRIB(Hook, impulse, int, 0);
/* flags */ ATTRIB(Hook, spawnflags, int, WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH);
/* rating */ ATTRIB(Hook, bot_pickupbasevalue, float, 0);
/* color */ ATTRIB(Hook, wpcolor, vector, '0 0.5 0');
/* modelname */ ATTRIB(Hook, mdl, string, "hookgun");
-#ifndef MENUQC
+#ifdef GAMEQC
/* model */ ATTRIB(Hook, m_model, Model, MDL_HOOK_ITEM);
#endif
/* crosshair */ ATTRIB(Hook, w_crosshair, string, "gfx/crosshairhook");
/* wepimg */ ATTRIB(Hook, model2, string, "weaponhook");
/* refname */ ATTRIB(Hook, netname, string, "hook");
/* wepname */ ATTRIB(Hook, m_name, string, _("Grappling Hook"));
- ATTRIB(Hook, ammo_factor, float, 1)
+ ATTRIB(Hook, ammo_factor, float, 1);
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
gren.angles = '0 0 0';
gren.flags = FL_PROJECTILE;
IL_PUSH(g_projectiles, gren);
+ IL_PUSH(g_bot_dodge, gren);
CSQCProjectile(gren, true, PROJECTILE_HOOKBOMB, true);
if(time > actor.hook_refire)
if(weapon_prepareattack(thiswep, actor, weaponentity, false, -1))
{
- W_DecreaseAmmo(thiswep, actor, thiswep.ammo_factor * WEP_CVAR_PRI(hook, ammo));
+ W_DecreaseAmmo(thiswep, actor, thiswep.ammo_factor * WEP_CVAR_PRI(hook, ammo), weaponentity);
actor.hook_state |= HOOK_FIRING;
actor.hook_state |= HOOK_WAITING_FOR_RELEASE;
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(hook, animtime), w_ready);
{
if( actor.ammo_fuel >= (time - actor.hook_time_fueldecrease) * hooked_fuel )
{
- W_DecreaseAmmo(thiswep, actor, (time - actor.hook_time_fueldecrease) * hooked_fuel);
+ W_DecreaseAmmo(thiswep, actor, (time - actor.hook_time_fueldecrease) * hooked_fuel, weaponentity);
actor.hook_time_fueldecrease = time;
// decrease next frame again
}
{
actor.ammo_fuel = 0;
actor.hook_state |= HOOK_REMOVING;
- W_SwitchWeapon_Force(actor, w_getbestweapon(actor));
+ W_SwitchWeapon_Force(actor, w_getbestweapon(actor), weaponentity);
}
}
}