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

Go to the source code of this file.

Classes

class  GameItem

Macros

#define ITEM_HANDLE(signal, ...)
#define SPAWNFUNC_BODY(item)
#define SPAWNFUNC_ITEM(name, item)

Enumerations

enum  { ITEM_FLAG_NORMAL = BIT(0) , ITEM_FLAG_MUTATORBLOCKED = BIT(1) , ITEM_FLAG_RESOURCE = BIT(2) }

Functions

void InitializeEntity (entity e, void(entity this) func, int order)

Variables

float buffs_finished
float fade_end
float fade_start
float invincible_finished
const int ISF_ANGLES = BIT(6)
const int ISF_COLORMAP = BIT(4)
const int ISF_DROP = BIT(5)
const int ISF_LOCATION = BIT(1)
const int ISF_REMOVEFX = BIT(0)
const int ISF_SIZE = BIT(7)
const int ISF_SIZE2 = BIT(2)
const int ISF_STATUS = BIT(3)
const int IT_BUFF = BIT(8)
const float IT_DESPAWNFX_TIME = 1.5
const int IT_FUEL_REGEN = BIT(4)
const int IT_INVINCIBLE = BIT(10)
const int IT_INVISIBILITY = BIT(9)
const int IT_JETPACK = BIT(2)
const int IT_KEY1 = BIT(6)
const int IT_KEY2 = BIT(7)
const int IT_PICKUPMASK = IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS | IT_JETPACK | IT_FUEL_REGEN
const int IT_RESOURCE = BIT(5)
const int IT_SPEED = BIT(13)
const int IT_STRENGTH = BIT(12)
const int IT_SUPERWEAPON = BIT(11)
const int IT_UNLIMITED_AMMO = BIT(0)
const int IT_UNLIMITED_SUPERWEAPONS = BIT(1)
const float IT_UPDATE_INTERVAL = 0.0625
const int IT_USING_JETPACK = BIT(3)
const vector ITEM_D_MAXS = '30 30 48'
const vector ITEM_D_MINS = '-30 -30 0'
const vector ITEM_L_MAXS = '30 30 70'
const vector ITEM_S_MAXS = '24 24 48'
const vector ITEM_S_MINS = '-24 -24 0'
int ItemStatus
const int ITS_ALLOWFB = BIT(4)
const int ITS_ALLOWSI = BIT(5)
const int ITS_ANIMATE1 = BIT(1)
const int ITS_ANIMATE2 = BIT(2)
const int ITS_AVAILABLE = BIT(3)
const int ITS_EXPIRING = BIT(7)
const int ITS_GLOW = BIT(6)
const int ITS_STAYWEP = BIT(0)
string mdl
float strength_finished

Macro Definition Documentation

◆ ITEM_HANDLE

#define ITEM_HANDLE ( signal,
... )
Value:
__Item_Send_##signal(__VA_ARGS__)

Definition at line 126 of file item.qh.

Referenced by ctf_FlagTouch(), Dump_Items(), and Item_Touch().

◆ SPAWNFUNC_BODY

#define SPAWNFUNC_BODY ( item)
Value:
if (item && Item_IsDefinitionAllowed(item)) \
{ \
this.itemdef = item; \
InitializeEntity(this, StartItem, INITPRIO_DROPTOFLOOR); \
} \
else \
delete(this);
const int INITPRIO_DROPTOFLOOR
Definition constants.qh:90
bool Item_IsDefinitionAllowed(entity definition)
Checks whether the items with the specified definition are allowed to spawn.
Definition spawning.qc:17
void StartItem(entity this)
Definition items.qc:1008
entity itemdef
Definition items.qh:92

Definition at line 98 of file item.qh.

98#define SPAWNFUNC_BODY(item) \
99 if (item && Item_IsDefinitionAllowed(item)) \
100 { \
101 this.itemdef = item; \
102 InitializeEntity(this, StartItem, INITPRIO_DROPTOFLOOR); \
103 } \
104 else \
105 delete(this);

◆ SPAWNFUNC_ITEM

#define SPAWNFUNC_ITEM ( name,
item )
Value:
{ \
SPAWNFUNC_BODY((item)) \
}
string name
Definition menu.qh:30
#define spawnfunc(id)
Definition spawnfunc.qh:107

Definition at line 107 of file item.qh.

107#define SPAWNFUNC_ITEM(name, item) \
108 spawnfunc(name) \
109 { \
110 SPAWNFUNC_BODY((item)) \
111 }

Referenced by REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), REGISTER_ITEM(), and REGISTER_ITEM().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ITEM_FLAG_NORMAL 

Item is usable during normal gameplay.

ITEM_FLAG_MUTATORBLOCKED 
ITEM_FLAG_RESOURCE 

Item is is a resource, not a held item.

Definition at line 119 of file item.qh.

120{
121 ITEM_FLAG_NORMAL = BIT(0),
124};
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
@ ITEM_FLAG_MUTATORBLOCKED
Definition item.qh:122
@ ITEM_FLAG_RESOURCE
Item is is a resource, not a held item.
Definition item.qh:123
@ ITEM_FLAG_NORMAL
Item is usable during normal gameplay.
Definition item.qh:121

Function Documentation

◆ InitializeEntity()

void InitializeEntity ( entity e,
void(entity this) func,
int order )

Definition at line 2197 of file world.qc.

2198{
2199 entity prev, cur;
2200
2201 if (!e || e.initialize_entity)
2202 {
2203 // make a proxy initializer entity
2204 entity e_old = e;
2205 e = new(initialize_entity);
2206 e.enemy = e_old;
2207 }
2208
2209 e.initialize_entity = func;
2210 e.initialize_entity_order = order;
2211
2213 prev = NULL;
2214 for (;;)
2215 {
2216 if (!cur || cur.initialize_entity_order > order)
2217 {
2218 // insert between prev and cur
2219 if (prev)
2220 prev.initialize_entity_next = e;
2221 else
2223 e.initialize_entity_next = cur;
2224 return;
2225 }
2226 prev = cur;
2227 cur = cur.initialize_entity_next;
2228 }
2229}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
prev
Definition all.qh:53
#define NULL
Definition post.qh:14
entity initialize_entity_first
Definition world.qh:120

References entity(), initialize_entity_first, NULL, and prev.

Referenced by buffs_Initialize(), ctf_FlagSetup(), ctf_Initialize(), dom_Initialize(), g_clientmodel_init(), g_model_init(), invasion_Initialize(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nb_Initialize(), ons_ControlPoint_Setup(), ons_GeneratorSetup(), ons_Initialize(), REGISTER_MUTATOR(), relocate_spawnpoint(), SetBrushEntityModel(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), StartItem(), target_checkpoint_setup(), tdm_Initialize(), tmayhem_Initialize(), and turret_initialize().

Variable Documentation

◆ buffs_finished

float buffs_finished

Definition at line 95 of file item.qh.

Referenced by buff_Init(), buff_Touch(), and spawnfunc().

◆ fade_end

◆ fade_start

float fade_start

Definition at line 86 of file item.qh.

Referenced by g_clientmodel_genericsendentity(), HUD_Notify(), and ItemDraw().

◆ invincible_finished

float invincible_finished

Definition at line 94 of file item.qh.

Referenced by Item_Touch(), spawnfunc(), and StartItem().

◆ ISF_ANGLES

const int ISF_ANGLES = BIT(6)

Definition at line 55 of file item.qh.

Referenced by ItemSend(), NET_HANDLE(), and StartItem().

◆ ISF_COLORMAP

const int ISF_COLORMAP = BIT(4)

Definition at line 53 of file item.qh.

Referenced by ItemSend(), NET_HANDLE(), and StartItem().

◆ ISF_DROP

const int ISF_DROP = BIT(5)

Definition at line 54 of file item.qh.

Referenced by ItemSend(), and NET_HANDLE().

◆ ISF_LOCATION

const int ISF_LOCATION = BIT(1)

Definition at line 50 of file item.qh.

Referenced by ItemSend(), ItemUpdate(), and NET_HANDLE().

◆ ISF_REMOVEFX

const int ISF_REMOVEFX = BIT(0)

Definition at line 49 of file item.qh.

Referenced by Item_Touch(), NET_HANDLE(), and RemoveItem().

◆ ISF_SIZE

const int ISF_SIZE = BIT(7)

Definition at line 56 of file item.qh.

Referenced by ItemSend(), and NET_HANDLE().

◆ ISF_SIZE2

const int ISF_SIZE2 = BIT(2)

Definition at line 51 of file item.qh.

Referenced by ItemSend(), and NET_HANDLE().

◆ ISF_STATUS

const int ISF_STATUS = BIT(3)

Definition at line 52 of file item.qh.

Referenced by Item_Show(), Item_Think(), ItemSend(), and NET_HANDLE().

◆ IT_BUFF

const int IT_BUFF = BIT(8)

Definition at line 35 of file item.qh.

◆ IT_DESPAWNFX_TIME

const float IT_DESPAWNFX_TIME = 1.5

Definition at line 72 of file item.qh.

Referenced by Item_Think(), and ItemDraw().

◆ IT_FUEL_REGEN

const int IT_FUEL_REGEN = BIT(4)

Definition at line 28 of file item.qh.

Referenced by Item_GiveTo().

◆ IT_INVINCIBLE

const int IT_INVINCIBLE = BIT(10)

Definition at line 40 of file item.qh.

◆ IT_INVISIBILITY

const int IT_INVISIBILITY = BIT(9)

Definition at line 39 of file item.qh.

◆ IT_JETPACK

const int IT_JETPACK = BIT(2)

Definition at line 26 of file item.qh.

Referenced by havocbot_movetogoal(), Item_GiveTo(), and navigation_routetogoal().

◆ IT_KEY1

const int IT_KEY1 = BIT(6)

Definition at line 32 of file item.qh.

◆ IT_KEY2

const int IT_KEY2 = BIT(7)

Definition at line 33 of file item.qh.

◆ IT_PICKUPMASK

Definition at line 46 of file item.qh.

Referenced by Item_GiveTo().

◆ IT_RESOURCE

const int IT_RESOURCE = BIT(5)

Definition at line 30 of file item.qh.

Referenced by Item_Touch().

◆ IT_SPEED

const int IT_SPEED = BIT(13)

Definition at line 43 of file item.qh.

◆ IT_STRENGTH

const int IT_STRENGTH = BIT(12)

Definition at line 42 of file item.qh.

◆ IT_SUPERWEAPON

const int IT_SUPERWEAPON = BIT(11)

Definition at line 41 of file item.qh.

Referenced by player_powerups(), player_powerups_remove_all(), and spawnfunc().

◆ IT_UNLIMITED_AMMO

◆ IT_UNLIMITED_SUPERWEAPONS

◆ IT_UPDATE_INTERVAL

const float IT_UPDATE_INTERVAL = 0.0625

Definition at line 76 of file item.qh.

Referenced by Item_Think(), and StartItem().

◆ IT_USING_JETPACK

const int IT_USING_JETPACK = BIT(3)

◆ ITEM_D_MAXS

const vector ITEM_D_MAXS = '30 30 48'

Definition at line 83 of file item.qh.

Referenced by NET_HANDLE(), and W_Porto_Fail().

◆ ITEM_D_MINS

const vector ITEM_D_MINS = '-30 -30 0'

Definition at line 82 of file item.qh.

Referenced by buff_Init(), buff_Think(), NET_HANDLE(), and W_Porto_Fail().

◆ ITEM_L_MAXS

const vector ITEM_L_MAXS = '30 30 70'

Definition at line 84 of file item.qh.

Referenced by buff_Init(), buff_Think(), ItemSend(), and NET_HANDLE().

◆ ITEM_S_MAXS

const vector ITEM_S_MAXS = '24 24 48'

Definition at line 81 of file item.qh.

Referenced by ItemSend(), and NET_HANDLE().

◆ ITEM_S_MINS

const vector ITEM_S_MINS = '-24 -24 0'

Definition at line 80 of file item.qh.

Referenced by NET_HANDLE().

◆ ItemStatus

int ItemStatus

Definition at line 61 of file item.qh.

Referenced by Item_Think(), ItemDraw(), ItemSend(), NET_HANDLE(), and StartItem().

◆ ITS_ALLOWFB

const int ITS_ALLOWFB = BIT(4)

Definition at line 66 of file item.qh.

Referenced by Item_Show(), and NET_HANDLE().

◆ ITS_ALLOWSI

const int ITS_ALLOWSI = BIT(5)

Definition at line 67 of file item.qh.

Referenced by Item_Show(), and ItemDraw().

◆ ITS_ANIMATE1

const int ITS_ANIMATE1 = BIT(1)

Definition at line 63 of file item.qh.

Referenced by ItemDraw(), and StartItem().

◆ ITS_ANIMATE2

const int ITS_ANIMATE2 = BIT(2)

Definition at line 64 of file item.qh.

Referenced by ItemDraw(), and StartItem().

◆ ITS_AVAILABLE

const int ITS_AVAILABLE = BIT(3)

Definition at line 65 of file item.qh.

Referenced by Item_Show(), ItemDraw(), and NET_HANDLE().

◆ ITS_EXPIRING

const int ITS_EXPIRING = BIT(7)

Definition at line 69 of file item.qh.

Referenced by Item_Think(), and ItemDraw().

◆ ITS_GLOW

const int ITS_GLOW = BIT(6)

Definition at line 68 of file item.qh.

Referenced by Item_Show(), and NET_HANDLE().

◆ ITS_STAYWEP

const int ITS_STAYWEP = BIT(0)

Definition at line 62 of file item.qh.

Referenced by Item_Show(), and ItemDraw().

◆ mdl

◆ strength_finished

float strength_finished

Definition at line 93 of file item.qh.

Referenced by Item_Touch(), spawnfunc(), and StartItem().