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

Go to the source code of this file.

Functions

void nade_heal_boom (entity this)
void nade_heal_touch (entity this, entity toucher)

Function Documentation

◆ nade_heal_boom()

void nade_heal_boom ( entity this)

Definition at line 34 of file heal.qc.

35{
37
39 orb.colormod = '1 0 0';
40}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
entity owner
Definition main.qh:87
vector origin
void nade_heal_touch(entity this, entity toucher)
Definition heal.qc:4
float autocvar_g_nades_heal_time
Definition heal.qh:7
#define settouch(e, f)
Definition self.qh:73
entity nades_spawn_orb(entity own, entity realown, vector org, float orb_ltime, float orb_rad)
Definition sv_nades.qc:75
float autocvar_g_nades_nade_radius
Definition sv_nades.qh:21
entity realowner

References autocvar_g_nades_heal_time, autocvar_g_nades_nade_radius, entity(), nade_heal_touch(), nades_spawn_orb(), origin, owner, realowner, and settouch.

Referenced by nade_boom().

◆ nade_heal_touch()

void nade_heal_touch ( entity this,
entity toucher )

Definition at line 4 of file heal.qc.

5{
6 float maxhealth;
7 float health_factor;
8
10 if(!IS_DEAD(toucher))
11 if(!STAT(FROZEN, toucher))
12 {
13 health_factor = autocvar_g_nades_heal_rate*frametime/2;
14 if ( toucher != this.realowner )
16
17 if ( health_factor > 0 )
18 {
19 maxhealth = (IS_MONSTER(toucher)) ? toucher.max_health : autocvar_g_pickup_healthmega_max;
20 float hp = GetResource(toucher, RES_HEALTH);
21 if (hp < maxhealth)
22 {
23 if (this.nade_show_particles)
24 Send_Effect(EFFECT_HEALING, toucher.origin, '0 0 0', 1);
25
26 GiveResourceWithLimit(toucher, RES_HEALTH, health_factor, maxhealth);
27 }
28 }
29 else if ( health_factor < 0 )
30 Damage(toucher,this,this.realowner,-health_factor,DEATH_NADE_HEAL.m_id,DMG_NOWEP,toucher.origin,'0 0 0');
31 }
32}
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define IS_DEAD(s)
Definition player.qh:245
#define IS_PLAYER(s)
Definition player.qh:243
float frametime
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:503
#define DMG_NOWEP
Definition damage.qh:104
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
Definition all.qc:124
int autocvar_g_pickup_healthmega_max
Definition health.qh:179
#define STAT(...)
Definition stats.qh:82
float autocvar_g_nades_heal_friend
Definition heal.qh:9
float autocvar_g_nades_heal_rate
Definition heal.qh:8
float autocvar_g_nades_heal_foe
Definition heal.qh:10
entity entity toucher
Definition self.qh:72
float nade_show_particles
Definition sv_nades.qh:53
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
#define SAME_TEAM(a, b)
Definition teams.qh:241
#define IS_MONSTER(v)
Definition utils.qh:21
#define IS_VEHICLE(v)
Definition utils.qh:22

References autocvar_g_nades_heal_foe, autocvar_g_nades_heal_friend, autocvar_g_nades_heal_rate, autocvar_g_pickup_healthmega_max, Damage(), DMG_NOWEP, entity(), frametime, GetResource(), GiveResourceWithLimit(), IS_DEAD, IS_MONSTER, IS_PLAYER, IS_VEHICLE, nade_show_particles, realowner, SAME_TEAM, Send_Effect(), STAT, and toucher.

Referenced by nade_heal_boom().