1 REGISTER_MUTATOR(vh, cvar("g_vampirehook"));
3 bool autocvar_g_vampirehook_teamheal;
4 float autocvar_g_vampirehook_damage;
5 float autocvar_g_vampirehook_damagerate;
6 float autocvar_g_vampirehook_health_steal;
10 MUTATOR_HOOKFUNCTION(vh, GrappleHookThink)
12 entity dmgent = ((SAME_TEAM(self.owner, self.aiment) && autocvar_g_vampirehook_teamheal) ? self.owner : self.aiment);
14 if(IS_PLAYER(self.aiment))
15 if(self.last_dmg < time)
16 if(!self.aiment.frozen)
17 if(time >= game_starttime)
18 if(DIFF_TEAM(self.owner, self.aiment) || autocvar_g_vampirehook_teamheal)
19 if(self.aiment.health > 0)
20 if(autocvar_g_vampirehook_damage)
22 self.last_dmg = time + autocvar_g_vampirehook_damagerate;
23 self.owner.damage_dealt += autocvar_g_vampirehook_damage;
24 Damage(dmgent, self, self.owner, autocvar_g_vampirehook_damage, WEP_HOOK.m_id, self.origin, '0 0 0');
25 if(SAME_TEAM(self.owner, self.aiment))
26 self.aiment.health = min(self.aiment.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
28 self.owner.health = min(self.owner.health + autocvar_g_vampirehook_health_steal, g_pickup_healthsmall_max);
30 if(dmgent == self.owner)
31 dmgent.health -= autocvar_g_vampirehook_damage; // FIXME: friendly fire?!