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

Go to the source code of this file.

Classes

class  Health
class  HealthBig
class  HealthMedium
class  HealthMega
class  HealthSmall

Functions

void item_healthbig_init (Pickup this, entity item)
void item_healthmedium_init (Pickup this, entity item)
void item_healthmega_init (Pickup this, entity item)
void item_healthsmall_init (Pickup this, entity item)
 MODEL (HealthBig_ITEM, Item_Model("g_h50.md3"))
 MODEL (HealthMedium_ITEM, Item_Model("g_h25.md3"))
 MODEL (HealthMega_ITEM, Item_Model("g_h100.md3"))
 MODEL (HealthSmall_ITEM, Item_Model("g_h1.md3"))
 REGISTER_ITEM (HealthBig, NEW(HealthBig))
 REGISTER_ITEM (HealthMedium, NEW(HealthMedium))
 REGISTER_ITEM (HealthMega, NEW(HealthMega))
 REGISTER_ITEM (HealthSmall, NEW(HealthSmall))
 SOUND (HealthBig, Item_Sound("mediumhealth"))
 SOUND (HealthMedium, Item_Sound("mediumhealth"))
 SOUND (HealthMega, Item_Sound("megahealth"))
 SOUND (HealthSmall, Item_Sound("minihealth"))

Variables

int autocvar_g_pickup_healthbig
bool autocvar_g_pickup_healthbig_anyway
int autocvar_g_pickup_healthbig_max
int autocvar_g_pickup_healthmedium
bool autocvar_g_pickup_healthmedium_anyway
int autocvar_g_pickup_healthmedium_max
int autocvar_g_pickup_healthmega
bool autocvar_g_pickup_healthmega_anyway
int autocvar_g_pickup_healthmega_max
int autocvar_g_pickup_healthsmall
bool autocvar_g_pickup_healthsmall_anyway
int autocvar_g_pickup_healthsmall_max
float autocvar_g_pickup_respawntime_health_big
float autocvar_g_pickup_respawntime_health_medium
float autocvar_g_pickup_respawntime_health_mega
float autocvar_g_pickup_respawntime_health_small
float autocvar_g_pickup_respawntimejitter_health_big
float autocvar_g_pickup_respawntimejitter_health_medium
float autocvar_g_pickup_respawntimejitter_health_mega
float autocvar_g_pickup_respawntimejitter_health_small

Function Documentation

◆ item_healthbig_init()

void item_healthbig_init ( Pickup this,
entity item )

Definition at line 131 of file health.qh.

132{
133 if(!item.max_health)
134 item.max_health = autocvar_g_pickup_healthbig_max;
135 if(!GetResource(item, RES_HEALTH))
136 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : autocvar_g_pickup_healthbig);
137}
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
int autocvar_g_pickup_healthbig_max
Definition health.qh:128
int autocvar_g_pickup_healthbig
Definition health.qh:127
q3compat
Definition quake3.qc:59

References autocvar_g_pickup_healthbig, autocvar_g_pickup_healthbig_max, entity(), GetResource(), q3compat, and SetResourceExplicit().

Referenced by HealthBig::void().

◆ item_healthmedium_init()

void item_healthmedium_init ( Pickup this,
entity item )

Definition at line 79 of file health.qh.

80{
81 if(!item.max_health)
82 item.max_health = autocvar_g_pickup_healthmedium_max;
83 if(!GetResource(item, RES_HEALTH))
84 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : autocvar_g_pickup_healthmedium);
85}
int autocvar_g_pickup_healthmedium
Definition health.qh:75
int autocvar_g_pickup_healthmedium_max
Definition health.qh:76

References autocvar_g_pickup_healthmedium, autocvar_g_pickup_healthmedium_max, entity(), GetResource(), q3compat, and SetResourceExplicit().

Referenced by HealthMedium::void().

◆ item_healthmega_init()

void item_healthmega_init ( Pickup this,
entity item )

Definition at line 182 of file health.qh.

183{
184 if(!item.max_health)
185 item.max_health = autocvar_g_pickup_healthmega_max;
186 if(!GetResource(item, RES_HEALTH))
187 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : autocvar_g_pickup_healthmega);
188}
int autocvar_g_pickup_healthmega
Definition health.qh:178
int autocvar_g_pickup_healthmega_max
Definition health.qh:179

References autocvar_g_pickup_healthmega, autocvar_g_pickup_healthmega_max, entity(), GetResource(), q3compat, and SetResourceExplicit().

Referenced by HealthMega::void().

◆ item_healthsmall_init()

void item_healthsmall_init ( Pickup this,
entity item )

Definition at line 27 of file health.qh.

28{
29 if(!item.max_health)
30 item.max_health = autocvar_g_pickup_healthsmall_max;
31 if(!GetResource(item, RES_HEALTH))
32 SetResourceExplicit(item, RES_HEALTH, q3compat && item.count ? item.count : autocvar_g_pickup_healthsmall);
33}
int autocvar_g_pickup_healthsmall_max
Definition health.qh:24
int autocvar_g_pickup_healthsmall
Definition health.qh:23

References autocvar_g_pickup_healthsmall, autocvar_g_pickup_healthsmall_max, entity(), GetResource(), q3compat, and SetResourceExplicit().

Referenced by HealthSmall::void().

◆ MODEL() [1/4]

MODEL ( HealthBig_ITEM ,
Item_Model("g_h50.md3")  )

◆ MODEL() [2/4]

MODEL ( HealthMedium_ITEM ,
Item_Model("g_h25.md3")  )

◆ MODEL() [3/4]

MODEL ( HealthMega_ITEM ,
Item_Model("g_h100.md3")  )

◆ MODEL() [4/4]

MODEL ( HealthSmall_ITEM ,
Item_Model("g_h1.md3")  )

◆ REGISTER_ITEM() [1/4]

REGISTER_ITEM ( HealthBig ,
NEW(HealthBig)  )

References NEW, REGISTER_ITEM, and SPAWNFUNC_ITEM.

◆ REGISTER_ITEM() [2/4]

REGISTER_ITEM ( HealthMedium ,
NEW(HealthMedium)  )

References NEW, REGISTER_ITEM, and SPAWNFUNC_ITEM.

◆ REGISTER_ITEM() [3/4]

REGISTER_ITEM ( HealthMega ,
NEW(HealthMega)  )

References NEW, REGISTER_ITEM, and SPAWNFUNC_ITEM.

◆ REGISTER_ITEM() [4/4]

REGISTER_ITEM ( HealthSmall ,
NEW(HealthSmall)  )

References NEW, REGISTER_ITEM, and SPAWNFUNC_ITEM.

◆ SOUND() [1/4]

SOUND ( HealthBig ,
Item_Sound("mediumhealth")  )

◆ SOUND() [2/4]

SOUND ( HealthMedium ,
Item_Sound("mediumhealth")  )

◆ SOUND() [3/4]

SOUND ( HealthMega ,
Item_Sound("megahealth")  )

◆ SOUND() [4/4]

SOUND ( HealthSmall ,
Item_Sound("minihealth")  )

Variable Documentation

◆ autocvar_g_pickup_healthbig

int autocvar_g_pickup_healthbig

Definition at line 127 of file health.qh.

Referenced by item_healthbig_init().

◆ autocvar_g_pickup_healthbig_anyway

bool autocvar_g_pickup_healthbig_anyway

Definition at line 126 of file health.qh.

◆ autocvar_g_pickup_healthbig_max

int autocvar_g_pickup_healthbig_max

Definition at line 128 of file health.qh.

Referenced by item_healthbig_init().

◆ autocvar_g_pickup_healthmedium

int autocvar_g_pickup_healthmedium

Definition at line 75 of file health.qh.

Referenced by item_healthmedium_init().

◆ autocvar_g_pickup_healthmedium_anyway

bool autocvar_g_pickup_healthmedium_anyway

Definition at line 74 of file health.qh.

◆ autocvar_g_pickup_healthmedium_max

int autocvar_g_pickup_healthmedium_max

Definition at line 76 of file health.qh.

Referenced by item_healthmedium_init().

◆ autocvar_g_pickup_healthmega

int autocvar_g_pickup_healthmega

Definition at line 178 of file health.qh.

Referenced by item_healthmega_init().

◆ autocvar_g_pickup_healthmega_anyway

bool autocvar_g_pickup_healthmega_anyway

Definition at line 177 of file health.qh.

◆ autocvar_g_pickup_healthmega_max

int autocvar_g_pickup_healthmega_max

Definition at line 179 of file health.qh.

Referenced by item_healthmega_init(), and nade_heal_touch().

◆ autocvar_g_pickup_healthsmall

int autocvar_g_pickup_healthsmall

Definition at line 23 of file health.qh.

Referenced by item_healthsmall_init().

◆ autocvar_g_pickup_healthsmall_anyway

bool autocvar_g_pickup_healthsmall_anyway

Definition at line 22 of file health.qh.

◆ autocvar_g_pickup_healthsmall_max

int autocvar_g_pickup_healthsmall_max

Definition at line 24 of file health.qh.

Referenced by item_healthsmall_init(), and MUTATOR_HOOKFUNCTION().

◆ autocvar_g_pickup_respawntime_health_big

float autocvar_g_pickup_respawntime_health_big

Definition at line 129 of file health.qh.

◆ autocvar_g_pickup_respawntime_health_medium

float autocvar_g_pickup_respawntime_health_medium

Definition at line 77 of file health.qh.

◆ autocvar_g_pickup_respawntime_health_mega

float autocvar_g_pickup_respawntime_health_mega

Definition at line 180 of file health.qh.

◆ autocvar_g_pickup_respawntime_health_small

float autocvar_g_pickup_respawntime_health_small

Definition at line 25 of file health.qh.

◆ autocvar_g_pickup_respawntimejitter_health_big

float autocvar_g_pickup_respawntimejitter_health_big

Definition at line 130 of file health.qh.

◆ autocvar_g_pickup_respawntimejitter_health_medium

float autocvar_g_pickup_respawntimejitter_health_medium

Definition at line 78 of file health.qh.

◆ autocvar_g_pickup_respawntimejitter_health_mega

float autocvar_g_pickup_respawntimejitter_health_mega

Definition at line 181 of file health.qh.

◆ autocvar_g_pickup_respawntimejitter_health_small

float autocvar_g_pickup_respawntimejitter_health_small

Definition at line 26 of file health.qh.