Xonotic
|
Header file that describes the resource system. More...
#include <common/resources/resources.qh>
Go to the source code of this file.
Functions | |
float | GetResource (entity e, Resource res_type) |
Returns the current amount of resource the given entity has. More... | |
float | GetResourceLimit (entity e, Resource res_type) |
Returns the maximum amount of the given resource. More... | |
void | GiveResource (entity receiver, Resource res_type, float amount) |
Gives an entity some resource. More... | |
void | GiveResourceWithLimit (entity receiver, Resource res_type, float amount, float limit) |
Gives an entity some resource but not more than a limit. More... | |
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 for the resource type. More... | |
bool | SetResourceExplicit (entity e, Resource res_type, float amount) |
Sets the resource amount of an entity without calling any hooks. More... | |
void | TakeResource (entity receiver, Resource res_type, float amount) |
Takes an entity some resource. More... | |
void | TakeResourceWithLimit (entity receiver, Resource res_type, float amount, float limit) |
Takes an entity some resource but not less than a limit. More... | |
Header file that describes the resource system.
Definition in file sv_resources.qh.
Returns the current amount of resource the given entity has.
[in] | e | Entity to check. |
[in] | res_type | Type of the resource (a RES_* constant). |
Definition at line 10 of file cl_resources.qc.
Referenced by _StartItem(), ammo_pickupevalfunc(), assault_decreaser_sprite_visible(), assault_objective_decrease_use(), assault_wall_think(), basketball_touch(), bot_cmd_eval(), CheatImpulse(), ClientCommand_kill(), CommonCommand_editmob(), CopyBody(), cpicon_draw(), cpicon_send(), ctf_CheckFlagReturn(), ctf_FlagcarrierWaypoints(), ctf_Handle_Drop(), Damage(), destructible_heal(), dompointtouch(), door_damage(), door_reset(), door_trigger_touch(), Draw_ShowNames(), Draw_ShowNames_All(), football_touch(), formatmessage(), frag_centermessage_override(), freezetag_count_alive_players(), freezetag_LastPlayerForTeam(), generator_draw(), generator_send(), GENERIC_COMMAND(), GiveRandomWeapons(), GiveResource(), GiveResourceValue(), GiveResourceWithLimit(), GrapplingHook_Damage(), havocbot_goalrating_ctf_enemyflag(), havocbot_goalrating_enemyplayers(), havocbot_goalrating_ft_freeplayers(), havocbot_goalrating_item_can_be_left_to_teammate(), havocbot_movetogoal(), healtharmor_pickupevalfunc(), instagib_ammocheck(), instagib_countdown(), Invasion_CheckWinner(), Item_GiveAmmoTo(), LinkDoors(), MapVote_Tick(), Monster_Attack_Leap_Check(), Monster_Damage(), Monster_Dead_Damage(), Monster_Frozen_Think(), Monster_Heal(), Monster_Move_Target(), Monster_Spawn_Setup(), Monster_Think(), Monster_ValidTarget(), MUTATOR_HOOKFUNCTION(), navigation_routerating(), NET_HANDLE(), Obituary(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Damage(), ons_ControlPoint_Icon_Heal(), ons_ControlPoint_Icon_Spawn(), ons_ControlPoint_Icon_Think(), ons_ControlPoint_UpdateSprite(), ons_GeneratorDamage(), ons_GeneratorHeal(), ons_GeneratorReset(), ons_GeneratorSetup(), Onslaught_count_generators(), plat_center_touch(), plat_outside_touch(), player_regen(), PlayerCorpseDamage(), PlayerDamage(), PlayerHeal(), PlayerHealth(), PlayerPostThink(), PlayerPreThink(), Portal_Damage(), powerups_DropItem_Think(), PutObserverInServer(), readplayerstartcvars(), RotRegen(), spawnfunc(), SpectateCopy(), TakeResource(), TakeResourceWithLimit(), target_objective_spawn_evalfunc(), test_weapons_hurt(), turret_draw(), vehicles_damage(), vehicles_heal(), vehicles_painframe(), vehicles_projectile_damage(), vehicles_regen(), vehicles_regen_resource(), W_DecreaseAmmo(), W_Reload(), W_ReloadedAndReady(), W_ThrowNewWeapon(), W_WeaponFrame(), and weapon_defaultspawnfunc().
Returns the maximum amount of the given resource.
[in] | e | Entity to check. |
[in] | res_type | Type of the resource (a RES_* constant). |
Definition at line 12 of file sv_resources.qc.
References autocvar_g_balance_armor_limit, autocvar_g_balance_fuel_limit, autocvar_g_balance_health_limit, error(), g_pickup_cells_max, g_pickup_nails_max, g_pickup_plasma_max, g_pickup_rockets_max, g_pickup_shells_max, GetResourceLimit(), IS_PLAYER, M_ARGV, MUTATOR_CALLHOOK, RES_AMOUNT_HARD_LIMIT, RES_HEALTH, and RES_LIMIT_NONE.
Referenced by GetResourceLimit(), RotRegen(), and SetResource().
Gives an entity some resource.
[in,out] | receiver | Entity to give resource to. |
[in] | res_type | Type of the resource (a RES_* constant). |
[in] | amount | Amount of resource to give. |
Definition at line 120 of file sv_resources.qc.
References autocvar_g_balance_pause_armor_rot, autocvar_g_balance_pause_fuel_rot, autocvar_g_balance_pause_health_rot, entity(), GetResource(), GiveResource(), M_ARGV, max(), MUTATOR_CALLHOOK, RES_HEALTH, SetResource(), and time.
Referenced by GiveRandomWeapons(), GiveResource(), GiveResourceWithLimit(), Monster_Miniboss_Check(), MUTATOR_HOOKFUNCTION(), NIX_GiveCurrentWeapon(), ons_ControlPoint_Icon_BuildThink(), and W_ThrowNewWeapon().
Gives an entity some resource but not more than a limit.
[in,out] | receiver | Entity to give resource to. |
[in] | res_type | Type of the resource (a RES_* constant). |
[in] | amount | Amount of resource to give. |
[in] | limit | Limit of resources to give. |
Definition at line 164 of file sv_resources.qc.
References entity(), GetResource(), GiveResource(), GiveResourceWithLimit(), M_ARGV, MUTATOR_CALLHOOK, and RES_LIMIT_NONE.
Referenced by destructible_heal(), GiveResourceWithLimit(), Item_GiveAmmoTo(), Monster_Heal(), ons_ControlPoint_Icon_Heal(), ons_ControlPoint_Icon_Think(), ons_GeneratorHeal(), PlayerHeal(), and vehicles_heal().
Sets the current amount of resource the given entity will have but limited to the max amount allowed for the resource type.
[in,out] | e | Entity to adjust. |
[in] | res_type | Type of the resource (a RES_* constant). |
[in] | amount | Amount of resource to set. |
Sets the current amount of resource the given entity will have but limited to the max amount allowed for the resource type.
[in,out] | e | Entity to adjust. |
[in] | res_type | Type of the resource (a RES_* constant). |
[in] | amount | Amount of resource to set. |
Definition at line 26 of file cl_resources.qc.
References entity(), GetResourceLimit(), M_ARGV, MUTATOR_CALLHOOK, RES_LIMIT_NONE, and SetResourceExplicit().
Referenced by CheatImpulse(), Damage(), Freeze(), GENERIC_COMMAND(), GiveResource(), MUTATOR_HOOKFUNCTION(), NIX_GiveCurrentWeapon(), PutPlayerInServer(), readplayerstartcvars(), REGISTER_MUTATOR(), RotRegen(), TakeResource(), target_init_use(), Unfreeze(), vehicles_regen_resource(), W_DecreaseAmmo(), W_ReloadedAndReady(), W_ThrowNewWeapon(), and weapon_defaultspawnfunc().
Sets the resource amount of an entity without calling any hooks.
[in,out] | e | Entity to adjust. |
[in] | res_type | Type of the resource (a RES_* constant). |
[in] | amount | Amount of resource to set. |
Definition at line 15 of file cl_resources.qc.
Referenced by assault_objective_decrease_use(), assault_objective_reset(), assault_objective_use(), CheatCommand(), CopyBody(), ctf_FlagDamage(), ctf_FlagSetup(), ctf_FlagThink(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_RespawnFlag(), Damage(), door_damage(), door_go_down(), Draw_ShowNames_All(), FireGrapplingHook(), FixIntermissionClient(), ft_RemovePlayer(), GiveResourceValue(), LinkDoors(), MapVote_Tick(), Monster_Dead_Fade(), Monster_Frozen_Think(), Monster_Reset(), Monster_Spawn_Setup(), MUTATOR_HOOKFUNCTION(), NET_HANDLE(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Spawn(), ons_GeneratorReset(), ons_GeneratorSetup(), PlayerPreThink(), Portal_Spawn(), Portal_TeleportPlayer(), powerups_DropItem(), PutObserverInServer(), SetResource(), spawnfunc(), SpectateCopy(), turret_construct(), and vehicles_projectile().
Takes an entity some resource.
[in,out] | receiver | Entity to take resource from. |
[in] | res_type | Type of the resource (a RES_* constant). |
[in] | amount | Amount of resource to take. |
Definition at line 31 of file cl_resources.qc.
References entity(), GetResource(), M_ARGV, MUTATOR_CALLHOOK, and SetResource().
Referenced by assault_objective_decrease_use(), ctf_FlagDamage(), ctf_FlagThink(), door_damage(), GrapplingHook_Damage(), Monster_Damage(), Monster_Dead_Damage(), MUTATOR_HOOKFUNCTION(), ons_ControlPoint_Icon_Damage(), ons_GeneratorDamage(), PlayerCorpseDamage(), PlayerDamage(), PM_jetpack(), Portal_Damage(), powerups_DropItem_Think(), TakeResourceWithLimit(), vehicles_damage(), and vehicles_projectile_damage().
Takes an entity some resource but not less than a limit.
[in,out] | receiver | Entity to take resource from. |
[in] | res_type | Type of the resource (a RES_* constant). |
[in] | amount | Amount of resource to take. |
[in] | limit | Limit of resources to take. |
Definition at line 40 of file cl_resources.qc.
References entity(), GetResource(), M_ARGV, MUTATOR_CALLHOOK, and TakeResource().
Referenced by Item_GiveAmmoTo().
int autocvar_g_balance_armor_limit |
Definition at line 12 of file sv_resources.qh.
Referenced by GetResourceLimit().
float autocvar_g_balance_armor_regen |
Definition at line 14 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_armor_regenlinear |
Definition at line 15 of file sv_resources.qh.
Referenced by player_regen().
int autocvar_g_balance_armor_regenstable |
Definition at line 16 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_armor_rot |
Definition at line 17 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_armor_rotlinear |
Definition at line 18 of file sv_resources.qh.
Referenced by player_regen().
int autocvar_g_balance_armor_rotstable |
Definition at line 19 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_fuel_limit |
Definition at line 13 of file sv_resources.qh.
Referenced by GetResourceLimit().
float autocvar_g_balance_fuel_regen |
Definition at line 20 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_fuel_regenlinear |
Definition at line 21 of file sv_resources.qh.
Referenced by player_regen().
int autocvar_g_balance_fuel_regenstable |
Definition at line 22 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_fuel_rot |
Definition at line 23 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_fuel_rotlinear |
Definition at line 24 of file sv_resources.qh.
Referenced by player_regen().
int autocvar_g_balance_fuel_rotstable |
Definition at line 25 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_health_limit |
Definition at line 11 of file sv_resources.qh.
Referenced by GetResourceLimit().
float autocvar_g_balance_health_regen |
Definition at line 26 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_health_regenlinear |
Definition at line 27 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_health_regenstable |
Definition at line 28 of file sv_resources.qh.
Referenced by MUTATOR_HOOKFUNCTION(), and player_regen().
float autocvar_g_balance_health_rot |
Definition at line 29 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_health_rotlinear |
Definition at line 30 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_health_rotstable |
Definition at line 31 of file sv_resources.qh.
Referenced by player_regen().
float autocvar_g_balance_pause_armor_rot |
Definition at line 32 of file sv_resources.qh.
Referenced by GiveItems(), GiveResource(), and target_init_use().
float autocvar_g_balance_pause_fuel_regen |
Definition at line 33 of file sv_resources.qh.
Referenced by GiveItems(), and PM_jetpack().
float autocvar_g_balance_pause_fuel_rot |
Definition at line 34 of file sv_resources.qh.
Referenced by GiveItems(), and GiveResource().
float autocvar_g_balance_pause_health_regen |
Definition at line 35 of file sv_resources.qh.
Referenced by GiveItems(), PlayerCorpseDamage(), PlayerDamage(), target_init_use(), and Unfreeze().
float autocvar_g_balance_pause_health_rot |
Definition at line 36 of file sv_resources.qh.
Referenced by GiveItems(), GiveResource(), and target_init_use().