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 = M_ARGV(4, float);
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 float regen = autocvar_g_buffs_vampire_damage_steal * health_take;
18 GiveResource(frag_attacker, RES_HEALTH, regen);
19 buff_Effect(frag_attacker, EFFECT_VAMPIRE, CENTER_OF_ENT(frag_attacker), vec2(frag_attacker.velocity), min(ceil(regen), 50), false);
20 }
21}
float autocvar_g_buffs_vampire_damage_steal
Definition vampire.qh:6
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
#define IS_DEAD(s)
Definition player.qh:244
#define IS_PLAYER(s)
Definition player.qh:242
#define CENTER_OF_ENT(ent)
Definition util.qh:10
#define STAT(...)
Definition stats.qh:94
float ceil(float f)
float min(float f,...)
bool StatusEffects_active(StatusEffect this, entity actor)
void buff_Effect(entity player, entity eff, vector eff_loc, vector eff_vel, int eff_cnt, bool hide)
Spawn effects on a player with a buff.
Definition sv_buffs.qc:103
entity frag_target
Definition sv_ctf.qc:2315
void GiveResource(entity receiver, Resource res_type, float amount)
Gives an entity some resource.
#define vec2(...)
Definition vector.qh:95

References autocvar_g_buffs_vampire_damage_steal, buff_Effect(), ceil(), CENTER_OF_ENT, entity(), frag_target, GiveResource(), IS_DEAD, IS_PLAYER, M_ARGV, min(), STAT, StatusEffects_active(), and vec2.