#include "../lib/warpzone/common.qh"
#include "../lib/warpzone/server.qh"
-.int state;
-
/*============================================
Wazat's Xonotic Grappling Hook
============================================*/
-.float hook_length;
-
void RemoveGrapplingHooks(entity pl)
{
if(pl.move_movetype == MOVETYPE_FLY)
void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force)
{
- if(GetResourceAmount(this, RES_HEALTH) <= 0)
+ if(GetResource(this, RES_HEALTH) <= 0)
return;
if (!W_CheckProjectileDamage(inflictor.realowner, this.realowner, deathtype, -1)) // no exceptions
TakeResource(this, RES_HEALTH, damage);
- if (GetResourceAmount(this, RES_HEALTH) <= 0)
+ if (GetResource(this, RES_HEALTH) <= 0)
{
if(attacker != this.realowner)
{
void FireGrapplingHook(entity actor, .entity weaponentity)
{
- if(forbidWeaponUse(actor)) return;
+ if(weaponLocked(actor)) return;
if(actor.vehicle) return;
// TODO: offhand hook shoots from eye
missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION;
- SetResourceAmount(missile, RES_HEALTH, autocvar_g_balance_grapplehook_health);
+ SetResourceExplicit(missile, RES_HEALTH, autocvar_g_balance_grapplehook_health);
missile.event_damage = GrapplingHook_Damage;
missile.takedamage = DAMAGE_AIM;
missile.damageforcescale = 0;