Xonotic
sv_resources.qh
Go to the documentation of this file.
1 #pragma once
2 
7 
9 
10 // TODO: split resources into their own files, registry based
37 
38 // ============================ Public API ====================================
39 
44 float GetResourceLimit(entity e, Resource res_type);
45 
50 float GetResource(entity e, Resource res_type);
51 
57 bool SetResourceExplicit(entity e, Resource res_type, float amount);
58 
65 void SetResource(entity e, Resource res_type, float amount);
66 
72 void GiveResource(entity receiver, Resource res_type, float amount);
73 
80 void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit);
81 
87 void TakeResource(entity receiver, Resource res_type, float amount);
88 
95 void TakeResourceWithLimit(entity receiver, Resource res_type, float amount, float limit);
float autocvar_g_balance_armor_rotlinear
Definition: sv_resources.qh:18
float autocvar_g_balance_pause_armor_rot
Definition: sv_resources.qh:32
float autocvar_g_balance_pause_health_regen
Definition: sv_resources.qh:35
float autocvar_g_balance_health_rot
Definition: sv_resources.qh:29
int autocvar_g_balance_fuel_rotstable
Definition: sv_resources.qh:25
entity() spawn
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
Definition: cl_resources.qc:10
float autocvar_g_balance_armor_regenlinear
Definition: sv_resources.qh:15
float autocvar_g_balance_pause_fuel_regen
Definition: sv_resources.qh:33
float autocvar_g_balance_fuel_rotlinear
Definition: sv_resources.qh:24
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have but limited to the max amount allowed ...
Definition: cl_resources.qc:26
float autocvar_g_balance_fuel_limit
Definition: sv_resources.qh:13
void GiveResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Gives an entity some resource but not more than a limit.
float autocvar_g_balance_fuel_rot
Definition: sv_resources.qh:23
float autocvar_g_balance_health_rotlinear
Definition: sv_resources.qh:30
float autocvar_g_balance_armor_rot
Definition: sv_resources.qh:17
float autocvar_g_balance_health_regenstable
Definition: sv_resources.qh:28
int autocvar_g_balance_armor_regenstable
Definition: sv_resources.qh:16
void TakeResource(entity receiver, Resource res_type, float amount)
Takes an entity some resource.
Definition: cl_resources.qc:31
float autocvar_g_balance_fuel_regen
Definition: sv_resources.qh:20
float GetResourceLimit(entity e, Resource res_type)
Returns the maximum amount of the given resource.
Definition: sv_resources.qc:12
int autocvar_g_balance_armor_rotstable
Definition: sv_resources.qh:19
float autocvar_g_balance_fuel_regenlinear
Definition: sv_resources.qh:21
void TakeResourceWithLimit(entity receiver, Resource res_type, float amount, float limit)
Takes an entity some resource but not less than a limit.
Definition: cl_resources.qc:40
bool SetResourceExplicit(entity e, Resource res_type, float amount)
Sets the resource amount of an entity without calling any hooks.
Definition: cl_resources.qc:15
int autocvar_g_balance_armor_limit
Definition: sv_resources.qh:12
int autocvar_g_balance_fuel_regenstable
Definition: sv_resources.qh:22
float autocvar_g_balance_health_regen
Definition: sv_resources.qh:26
float autocvar_g_balance_pause_health_rot
Definition: sv_resources.qh:36
float autocvar_g_balance_health_limit
Definition: sv_resources.qh:11
float autocvar_g_balance_health_regenlinear
Definition: sv_resources.qh:27
float autocvar_g_balance_armor_regen
Definition: sv_resources.qh:14
float autocvar_g_balance_health_rotstable
Definition: sv_resources.qh:31
void GiveResource(entity receiver, Resource res_type, float amount)
Gives an entity some resource.
float autocvar_g_balance_pause_fuel_rot
Definition: sv_resources.qh:34