86 if(!pl.(weaponentity))
88 if(pl.(weaponentity).hook)
89 delete(pl.(weaponentity).hook);
101 if(player.(weaponentity).hook ==
this)
102 player.(weaponentity).hook =
NULL;
116 Send_Effect(EFFECT_HOOK_IMPACT, this.
origin,
'0 0 0', 1);
131 WriteHeader(MSG_ENTITY, ENT_CLIENT_HOOK);
147 WriteVector(MSG_ENTITY, this.
hook_end);
156 float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
159 if(this.
realowner.(weaponentity).hook !=
this)
161 error(
"Owner lost the hook!\n");
166 || ((this.
aiment.flags & FL_PROJECTILE) &&
this.aiment.classname !=
"nade"))
188 float velocity_multiplier = 1;
189 MUTATOR_CALLHOOK(GrappleHookThink,
this, tarzan, pull_entity, velocity_multiplier);
192 velocity_multiplier =
M_ARGV(3,
float);
219 dir = this.
origin - myorg;
231 newlength =
max(newlength - pullspeed *
frametime, minlength);
233 if(newlength < dist - ropestretch)
235 newlength = dist - ropestretch;
237 v = v + frametime * dir * rubberforce_overstretch;
255 v = v * (1 -
frametime * ropeairfriction);
256 v = v +
frametime * dir * spd * rubberforce;
258 dv = ((v - v0) * dir) *
dir;
265 if((frozen_pulling && STAT(FROZEN, this.
aiment)) || !frozen_pulling)
269 if(this.
aiment.flags & FL_PROJECTILE)
272 if(this.
aiment.classname ==
"nade")
283 if(!frozen_pulling && !(this.
aiment.flags & FL_PROJECTILE))
294 end = this.
origin - dir*50;
295 dist =
vlen(end - myorg);
297 spd = dist * (pullspeed / 200);
335 SetMovetypeFollow(
this, toucher);
367 if(actor.vehicle)
return;
369 int s =
W_GunAlign(actor.(weaponentity), STAT(GUNALIGN, actor)) - 1;
372 actor.(weaponentity).
movedir = vs;
374 W_MuzzleFlash(WEP_HOOK, actor, weaponentity,
w_shotorg,
'0 0 0');
375 actor.(weaponentity).
movedir = oldmovedir;
378 missile.owner = missile.realowner = actor;
379 actor.(weaponentity).
hook = missile;
380 missile.weaponentity_fld = weaponentity;
382 missile.classname =
"grapplinghook";
383 missile.flags = FL_PROJECTILE;
391 setsize (missile,
'-3 -3 -3',
'3 3 3');
403 missile.nextthink =
time;
410 missile.damageforcescale = 0;
412 if(missile.damagedbycontents)
415 missile.hook_start = missile.hook_end = missile.origin;
#define round_handler_IsActive()
#define PHYS_INPUT_BUTTON_CHAT(s)
float autocvar_g_balance_grapplehook_airfriction
void GrapplingHookTouch(entity this, entity toucher)
#define PROJECTILE_MAKETRIGGER(e)
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
float autocvar_g_balance_grapplehook_damagedbycontents
float autocvar_g_balance_grapplehook_speed_pull
#define W_SetupShot_ProjectileSize(ent, wepent, mi, ma, antilag, recoil, snd, chan, maxdamage, deathtype)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
float autocvar_g_balance_grapplehook_health
IntrusiveList g_damagedbycontents
const float HOOK_RELEASING
vector hook_shotorigin[4]
float autocvar_g_balance_grapplehook_stretch
void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
int W_GunAlign(entity this, int preferred_align)
#define round_handler_IsRoundStarted()
void WarpZone_RefSys_AddIncrementally(entity me, entity ref)
void GrapplingHook_Stop(entity this)
#define UNSET_ONGROUND(s)
vector WarpZone_RefSys_TransformVelocity(entity from, entity to, vector vel)
float autocvar_g_maxpushtime
IntrusiveList g_bot_dodge
int autocvar_g_grappling_hook_tarzan
bool GrapplingHookSend(entity this, entity to, int sf)
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
int weaponslot(.entity weaponentity)
#define PROJECTILE_TOUCH(e, t)
void WarpZone_RefSys_BeginAddingIncrementally(entity me, entity ref)
float autocvar_g_balance_grapplehook_force_rubber_overstretch
bool weaponLocked(entity player)
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
PRECACHE(GrappleHookInit)
void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute)
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
void UpdateCSQCProjectile(entity e)
const int MAX_WEAPONSLOTS
float autocvar_g_balance_grapplehook_length_min
void GrapplingHookThink(entity this)
entity WarpZone_RefSys_SpawnSameRefSys(entity me)
void RemoveGrapplingHooks(entity pl)
vector CL_Weapon_GetShotOrg(int wpn)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float autocvar_g_balance_grapplehook_force_rubber
void FireGrapplingHook(entity actor,.entity weaponentity)
float autocvar_g_balance_grapplehook_speed_fly
IntrusiveList g_projectiles
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool autocvar_g_balance_grapplehook_gravity
#define MUTATOR_CALLHOOK(id,...)
entity weaponentities[MAX_WEAPONSLOTS]
void GrapplingHookReset(entity this)
int autocvar_g_balance_grapplehook_pull_frozen
#define sound(e, c, s, v, a)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
float autocvar_g_balance_grapplehook_nade_time
void set_movetype(entity this, int mt)
void RemoveHook(entity this)