Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
vampire.qc File Reference
#include "vampire.qh"
#include "vengeance.qh"
Include dependency graph for vampire.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (buffs, PlayerDamage_SplitHealthArmor)

Function Documentation

◆ MUTATOR_HOOKFUNCTION()

MUTATOR_HOOKFUNCTION ( buffs ,
PlayerDamage_SplitHealthArmor  )

Definition at line 4 of file vampire.qc.

5{
6 // NOTE: vampire PlayerDamage_SplitHealthArmor code is similar
7 entity frag_attacker = M_ARGV(1, entity);
9 if (!StatusEffects_active(BUFF_VAMPIRE, frag_attacker))
10 return;
11 float health_take = bound(0, M_ARGV(4, float), GetResource(frag_target, RES_HEALTH));
12
13 if (!StatusEffects_active(STATUSEFFECT_SpawnShield, frag_target)
14 && frag_target != frag_attacker
15 && IS_PLAYER(frag_attacker) && !IS_DEAD(frag_target) && !STAT(FROZEN, frag_target))
16 {
17 GiveResource(frag_attacker, RES_HEALTH, autocvar_g_buffs_vampire_damage_steal * health_take);
18 }
19}
float autocvar_g_buffs_vampire_damage_steal
Definition vampire.qh:6
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define M_ARGV(x, type)
Definition events.qh:17
#define IS_DEAD(s)
Definition player.qh:245
#define IS_PLAYER(s)
Definition player.qh:243
#define STAT(...)
Definition stats.qh:82
float bound(float min, float value, float max)
bool StatusEffects_active(StatusEffect this, entity actor)
entity frag_target
Definition sv_ctf.qc:2321
void GiveResource(entity receiver, Resource res_type, float amount)
Gives an entity some resource.

References autocvar_g_buffs_vampire_damage_steal, bound(), entity(), frag_target, GetResource(), GiveResource(), IS_DEAD, IS_PLAYER, M_ARGV, STAT, and StatusEffects_active().