61 entity gren =
new(hookbomb);
62 gren.owner = gren.realowner = actor;
63 gren.bot_dodge =
true;
68 gren.weaponentity_fld = weaponentity;
70 setsize(gren,
'0 0 0',
'0 0 0');
81 gren.damagedbycontents =
true;
87 gren.velocity += actor.velocity;
92 gren.angles =
'0 0 0';
106 if (!actor.(weaponentity).hook
108 && actor.(weaponentity).hook_refire <
time
130 if (actor.(weaponentity).hook)
140 if (actor.(weaponentity).hook && actor.(weaponentity).hook.state == 1)
142 float hooked_time_max =
WEP_CVAR_PRI(WEP_HOOK, hooked_time_max);
143 if (hooked_time_max > 0 &&
time > actor.(weaponentity).hook_time_hooked + hooked_time_max)
146 float hooked_fuel = thiswep.ammo_factor *
WEP_CVAR_PRI(WEP_HOOK, hooked_ammo);
148 &&
time > actor.(weaponentity).hook_time_fueldecrease
151 if (
GetResource(actor, RES_FUEL) >= (
time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel)
153 W_DecreaseAmmo(thiswep, actor, (
time - actor.(weaponentity).hook_time_fueldecrease) * hooked_fuel, weaponentity);
161 if (actor.(weaponentity).m_weapon != WEP_Null)
176 if (actor.(weaponentity).hook)
184 if (actor.(weaponentity).hook)
199 if (actor.(weaponentity).hook)
224 return WEAPON_HOOK_MURDER;
260 Draw_CylindricLine(hit, start, 8,
Draw_GrapplingHook_trace_callback_tex, 0.25,
Draw_GrapplingHook_trace_callback_rnd,
Draw_GrapplingHook_trace_callback_rgb,
min(1,
Draw_GrapplingHook_trace_callback_a - i),
DRAWFLAG_NORMAL, vorg);
301 case NUM_TEAM_1: tex =
"particles/hook_red";
break;
302 case NUM_TEAM_2: tex =
"particles/hook_blue";
break;
303 case NUM_TEAM_3: tex =
"particles/hook_yellow";
break;
304 case NUM_TEAM_4: tex =
"particles/hook_pink";
break;
305 default: tex =
"particles/hook_white";
break;
338 if (wep.hook ==
this)
347 this.HookSilent = sf & 0x80;
365 setorigin(
this, this.
origin);
397 PAR(_(
"The %s is a unique weapon, firing a chain forwards which pulls you in once it latches onto something."),
COLORED_NAME(
this));
398 PAR(_(
"The secondary fire usually drops a gravity bomb that affects enemies, also releasing light and smoke sort of like a flashbang."));
399 PAR(_(
"It usually requires %s ammo to work, consuming it both when initially firing the hook, and after a couple seconds as it reels you in."),
COLORED_NAME(ITEM_Fuel));
400 PAR(_(
"The %s allows reaching previously unreachable places on maps and zooming around the map at high speeds, "
401 "making both surprise ambushes and miraculous escapes possible."),
COLORED_NAME(
this));
402 PAR(_(
"It isn't available very often on maps, unless the %s mutator is active, in which all players have it on their offhand, used with %s."),
COLORED_NAME(MUTATOR_hook),
strcat(
"^3", _(
"hook"),
"^7"));
IntrusiveList g_bot_dodge
#define MUTATOR_CALLHOOK(id,...)
#define BITSET(var, mask, flag)
int W_GunAlign(entity this, int preferred_align)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
IntrusiveList g_drawables
vector hook_shotorigin[4]
#define colormapPaletteColor(c, isPants)
#define COLORED_NAME(this)
const int IT_UNLIMITED_AMMO
#define setmodel(this, m)
#define PHYS_INPUT_BUTTON_CROUCH(s)
float W_WeaponRateFactor(entity this)
const float HOOK_SECONDARY_DELAY
void Draw_GrapplingHook(entity this)
void W_Hook_Explode2(entity this)
void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
string Draw_GrapplingHook_trace_callback_tex
void W_Hook_Explode2_use(entity this, entity actor, entity trigger)
float Draw_GrapplingHook_trace_callback_a
void Draw_GrapplingHook_trace_callback(vector start, vector hit, vector end)
void Remove_GrapplingHook(entity this)
vector Draw_GrapplingHook_trace_callback_rgb
float autocvar_cl_grapplehook_alpha
void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
void W_Hook_ExplodeThink(entity this)
float Draw_GrapplingHook_trace_callback_rnd
void W_Hook_Attack2(Weapon thiswep, entity actor,.entity weaponentity)
void W_Hook_Touch2(entity this, entity toucher)
float hook_time_fueldecrease
const float DRAWFLAG_NORMAL
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
IntrusiveList g_damagedbycontents
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
const int HITTYPE_SECONDARY
#define pointparticles(effect, org, vel, howmany)
SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
int entcs_GetTeamColor(int i)
int entcs_GetClientColors(int i)
void InterpolateOrigin_Undo(entity this)
snap origin to iorigin2 (actual origin)
void InterpolateOrigin_Note(entity this)
void InterpolateOrigin_Do(entity this)
set origin based on iorigin1 (old pos), iorigin2 (desired pos), and time
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
ERASEABLE bool IL_CONTAINS(IntrusiveList this, entity it)
#define NET_HANDLE(id, param)
vector WarpZone_TransformOrigin(entity wz, vector org)
Transforms origin org across warpzone wz.
#define WarpZone_TraceLine_ThroughZone(org, end, nomonsters, forent, zone, cb)
entity WarpZone_trace_transform
Transform accumulator during a trace.
void set_movetype(entity this, int mt)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
entity Notification
always last
#define METHOD(cname, name, prototype)
const int PROJECTILE_HOOKBOMB
float health
Legacy fields for the resources. To be removed.
#define w_getbestweapon(ent, wepent)
void RemoveHook(entity this)
void RemoveGrapplingHooks(entity pl)
void FireGrapplingHook(entity actor,.entity weaponentity)
const float HOOK_WAITING_FOR_RELEASE
bool autocvar_g_balance_grapplehook_crouchslide
const float HOOK_REMOVING
float autocvar_g_balance_grapplehook_refire
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
void W_DamageOverTime_Think(entity this, float duration, float duration_power, float damage, float edgedamage, float rad, float force, entity cantbe, float think_delay)
Applies damage over time, called within a think function.
void adaptor_think2use_hittype_splash(entity this)
#define PROJECTILE_TOUCH(e, t)
IntrusiveList g_projectiles
#define PROJECTILE_MAKETRIGGER(e)
const int CH_SHOTS_SINGLE
#define sound(e, c, s, v, a)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
float autocvar_g_balance_pause_fuel_regen
int autocvar_g_projectiles_newton_style
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
int autocvar_chase_active
entity viewmodels[MAX_WEAPONSLOTS]
string W_Guide_Keybinds(Weapon wep)
string W_Guide_DPS_onlySecondary(string name, string sec)
#define WEP_CVAR_PRI(wep, name)
#define WEP_CVAR_SEC(wep, name)
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)