Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
items.qh
Go to the documentation of this file.
1#pragma once
2
5
12#define autocvar_g_weapon_stay cvar("g_weapon_stay")
13
15
16bool ItemSend(entity this, entity to, int sf);
17
18const float ITEM_RESPAWN_TICKS = 10;
19
20// string overrides entity
24
27.int count;
28
33
35
36.bool noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
37
38.float superweapons_finished; // NOTE: this field is used only by map entities, it does not directly apply the superweapons stat
39
40// delay before this item can be picked up
42
43void Item_Show (entity e, int mode);
44
45void Item_Respawn (entity this);
46
48void Item_ScheduleRespawnIn(entity e, float t);
49
51
53
60void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names, entity ammo_entity);
61
62bool Item_GiveAmmoTo(entity item, entity player, Resource res_type, float ammomax);
63
64bool Item_GiveTo(entity item, entity player);
65
67
68void Item_Reset(entity this);
69
70void Item_FindTeam(entity this);
71
72void Item_CopyFields(entity this, entity to);
73
74bool ItemSend(entity this, entity to, int sf);
75void ItemUpdate(entity this);
76
78
79void RemoveItem(entity this);
80
81// pickup evaluation functions
82// these functions decide how desirable an item is to the bots
83
84float generic_pickupevalfunc(entity player, entity item);// {return item.bot_pickupbasevalue;} // WEAPONTODO
85
86float weapon_pickupevalfunc(entity player, entity item);
87float ammo_pickupevalfunc(entity player, entity item);
88float healtharmor_pickupevalfunc(entity player, entity item);
89
90.bool is_item;
91.entity itemdef;
92void StartItem(entity this, entity def);
93
96void setItemGroup(entity this);
98
99float GiveWeapon(entity e, float wpn, float op, float val);
100
101float GiveBit(entity e, .float fld, float bit, float op, float val);
102
103float GiveValue(entity e, .float fld, float op, float val);
104
105void GiveSound(entity e, float v0, float v1, float t, Sound snd_incr, Sound snd_decr);
106
107void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .float regenfield, float regentime);
108
109spawnfunc(target_items);
110
111#define PREGIVE_WEAPONS(e) WepSet save_weapons; save_weapons = STAT(WEAPONS, e)
112#define PREGIVE(e,f) float save_##f; save_##f = (e).f
113#define PREGIVE_STATUSEFFECT(e,f) bool save_##f = StatusEffects_active(f, (e))
114#define PREGIVE_RESOURCE(e,f) float save_##f = GetResource((e), (f))
115#define POSTGIVE_WEAPON(e,b,snd_incr,snd_decr) GiveSound((e), !!(save_weapons & WepSet_FromWeapon(b)), !!(STAT(WEAPONS, e) & WepSet_FromWeapon(b)), 0, snd_incr, snd_decr)
116#define POSTGIVE_BIT(e,f,b,snd_incr,snd_decr) GiveSound((e), save_##f & (b), (e).f & (b), 0, snd_incr, snd_decr)
117#define POSTGIVE_STATUSEFFECT(e,f,snd_incr,snd_decr) GiveSound((e), save_##f, StatusEffects_active(f, (e)), 0, snd_incr, snd_decr)
118#define POSTGIVE_RESOURCE(e,f,t,snd_incr,snd_decr) GiveSound((e), save_##f, GetResource((e), (f)), t, snd_incr, snd_decr)
119#define POSTGIVE_RES_ROT(e,f,t,rotfield,rottime,regenfield,regentime,snd_incr,snd_decr) GiveRot((e),save_##f,GetResource((e),(f)),rotfield,rottime,regenfield,regentime);GiveSound((e),save_##f,GetResource((e),(f)),t,snd_incr,snd_decr)
120#define POSTGIVE_VALUE(e,f,t,snd_incr,snd_decr) GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
121#define POSTGIVE_VALUE_ROT(e,f,t,rotfield,rottime,regenfield,regentime,snd_incr,snd_decr) GiveRot((e), save_##f, (e).f, rotfield, rottime, regenfield, regentime); GiveSound((e), save_##f, (e).f, t, snd_incr, snd_decr)
122
123float GiveItems(entity e, float beginarg, float endarg);
124
127
128#define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY))
129#define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id))
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
float count
Definition powerups.qc:22
#define IL_NEW()
entity entity toucher
Definition self.qh:72
float generic_pickupevalfunc(entity player, entity item)
Definition items.qc:884
float ammo_pickupevalfunc(entity player, entity item)
Definition items.qc:908
float autocvar_g_balance_superweapons_time
Definition items.qh:6
entity item_pickupsound_ent
Definition items.qh:22
float respawntimestart
Definition items.qh:32
int autocvar_g_pickup_items
Definition items.qh:10
float respawntimejitter
Definition items.qh:31
float item_respawncounter
Definition items.qh:34
IntrusiveList g_items
Definition items.qh:125
void GiveRot(entity e, float v0, float v1,.float rotfield, float rottime,.float regenfield, float regentime)
Definition items.qc:1536
void Item_ScheduleRespawn(entity e)
Definition items.qc:391
void Item_CopyFields(entity this, entity to)
Definition items.qc:850
float autocvar_sv_simple_items
Definition items.qh:14
entity itemdef
Definition items.qh:91
float max_armorvalue
Definition items.qh:25
int item_group
Definition items.qh:94
entity item_model_ent
Definition items.qh:23
bool ItemSend(entity this, entity to, int sf)
Definition items.qc:32
bool Item_GiveAmmoTo(entity item, entity player, Resource res_type, float ammomax)
Definition items.qc:491
void setItemGroupCount()
Definition items.qc:1294
void ItemUpdate(entity this)
Definition items.qc:101
void StartItem(entity this, entity def)
Definition items.qc:1004
void Item_ScheduleInitialRespawn(entity e)
Definition items.qc:411
void Item_ScheduleRespawnIn(entity e, float t)
Definition items.qc:326
void UpdateItemAfterTeleport(entity this)
Definition items.qc:107
int item_group_count
Definition items.qh:95
void RemoveItem(entity this)
Definition items.qc:864
float weapon_pickupevalfunc(entity player, entity item)
Definition items.qc:886
bool autocvar_g_fullbrightitems
Definition items.qh:7
float GiveWeapon(entity e, float wpn, float op, float val)
Definition items.qc:1453
void Item_RespawnCountdown(entity this)
Definition items.qc:258
float superweapons_finished
Definition items.qh:38
const float ITEM_RESPAWN_TICKS
Definition items.qh:18
void Item_Show(entity e, int mode)
Definition items.qc:131
bool noalign
Definition items.qh:36
void setItemGroup(entity this)
Definition items.qc:1260
float GiveValue(entity e,.float fld, float op, float val)
float GiveBit(entity e,.float fld, float bit, float op, float val)
float scheduledrespawntime
Definition items.qh:29
float pickup_anyway
Definition items.qh:26
void Item_FindTeam(entity this)
Definition items.qc:812
float GiveItems(entity e, float beginarg, float endarg)
Definition items.qc:1593
void Item_Reset(entity this)
Definition items.qc:791
float autocvar_g_items_maxdist
Definition items.qh:8
bool autocvar_g_nodepthtestitems
Definition items.qh:11
float item_spawnshieldtime
Definition items.qh:41
string item_pickupsound
Definition items.qh:21
float healtharmor_pickupevalfunc(entity player, entity item)
Definition items.qc:956
void GiveSound(entity e, float v0, float v1, float t, Sound snd_incr, Sound snd_decr)
Definition items.qc:1520
bool is_item
Definition items.qh:90
void GiveRandomWeapons(entity receiver, int num_weapons, string weapon_names, entity ammo_entity)
Give several random weapons and ammo to the entity.
Definition items.qc:446
float respawntime
Definition items.qh:30
bool Item_GiveTo(entity item, entity player)
Definition items.qc:528
void Item_Respawn(entity this)
Definition items.qc:242
void Item_Touch(entity this, entity toucher)
Definition items.qc:692
float autocvar_g_items_dropped_lifetime
Definition items.qh:9
#define spawnfunc(id)
Definition spawnfunc.qh:96
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32