Xonotic
constants.qh
Go to the documentation of this file.
1 #pragma once
2 
3 const int FRAGS_PLAYER = 0;
4 const int FRAGS_SPECTATOR = -666;
5 const int FRAGS_PLAYER_OUT_OF_GAME = -616;
6 
8 // cvar constants
9 
10 const int CVAR_SAVE = BIT(0);
11 const int CVAR_NOTIFY = BIT(1);
12 const int CVAR_READONLY = BIT(2);
13 
14 // server flags
16 const int SERVERFLAG_TEAMPLAY = BIT(1);
17 const int SERVERFLAG_PLAYERSTATS = BIT(2);
19 
20 const int SPECIES_HUMAN = 0;
21 const int SPECIES_ROBOT_SOLID = 1;
22 const int SPECIES_ALIEN = 2;
23 const int SPECIES_ANIMAL = 3;
24 const int SPECIES_ROBOT_RUSTY = 4;
25 const int SPECIES_ROBOT_SHINY = 5;
26 const int SPECIES_RESERVED = 15;
27 
28 #ifdef GAMEQC
29 const int RANKINGS_CNT = 99;
30 
32 // keys pressed
33 const int KEY_FORWARD = BIT(0);
34 const int KEY_BACKWARD = BIT(1);
35 const int KEY_LEFT = BIT(2);
36 const int KEY_RIGHT = BIT(3);
37 const int KEY_JUMP = BIT(4);
38 const int KEY_CROUCH = BIT(5);
39 const int KEY_ATCK = BIT(6);
40 const int KEY_ATCK2 = BIT(7);
41 
43 // csqc communication stuff
44 
45 const int HUD_NORMAL = 0;
46 const int HUD_BUMBLEBEE_GUN = 25;
47 
48 // moved that here so the client knows the max.
49 // # of maps, I'll use arrays for them :P
50 const int MAPVOTE_COUNT = 30;
51 
52 // a bit more constant
53 const vector PL_MAX_CONST = '16 16 45';
54 const vector PL_MIN_CONST = '-16 -16 -24';
55 const vector PL_CROUCH_MAX_CONST = '16 16 25';
56 const vector PL_CROUCH_MIN_CONST = '-16 -16 -24';
57 
58 // gametype vote flags
59 const int GTV_FORBIDDEN = 0; // Cannot be voted
60 const int GTV_AVAILABLE = 1; // Can be voted
61 const int GTV_CUSTOM = 2; // Custom entry
62 
63 // generic entity flags
64 // engine flags can't be redefined as they are used by the engine (unfortunately), they are listed here for posterity
65 #ifdef CSQC
66 const int FL_FLY = 1; /* BIT(0) */
67 const int FL_SWIM = 2; /* BIT(1) */
68 const int FL_CLIENT = 8; /* BIT(2) */ // set for all client edicts
69 const int FL_INWATER = 16; /* BIT(3) */ // for enter / leave water splash
70 const int FL_MONSTER = 32; /* BIT(4) */
71 const int FL_GODMODE = 64; /* BIT(5) */ // player cheat
72 const int FL_NOTARGET = 128; /* BIT(6) */ // player cheat
73 const int FL_ITEM = 256; /* BIT(7) */ // extra wide size for bonus items
74 const int FL_ONGROUND = 512; /* BIT(8) */ // standing on something
75 const int FL_PARTIALGROUND = 1024; /* BIT(9) */ // not all corners are valid
76 const int FL_WATERJUMP = 2048; /* BIT(10) */ // player jumping out of water
77 const int FL_JUMPRELEASED = 4096; /* BIT(11) */ // for jump debouncing
78 #endif
79 const int FL_WEAPON = BIT(12);
80 const int FL_POWERUP = BIT(13);
81 const int FL_PROJECTILE = BIT(14);
82 const int FL_TOSSED = BIT(15);
83 const int FL_SPAWNING = BIT(16);
84 const int FL_PICKUPITEMS = BIT(17);
85 const int FL_DUCKED = BIT(18);
86 const int FL_ONSLICK = BIT(19);
87 
88 // initialization stages
89 const int INITPRIO_FIRST = 0;
90 const int INITPRIO_GAMETYPE = 0;
91 const int INITPRIO_GAMETYPE_FALLBACK = 1;
92 const int INITPRIO_FINDTARGET = 10;
93 const int INITPRIO_DROPTOFLOOR = 20;
94 const int INITPRIO_SETLOCATION = 90;
95 const int INITPRIO_LINKDOORS = 91;
96 const int INITPRIO_LAST = 99;
97 #endif
98 
99 #if defined(SVQC)
100  #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT)
101 #elif defined(CSQC)
102  #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOSHADOW | EF_SELECTABLE | EF_TELEPORT_BIT)
103 #endif
const int SPECIES_ALIEN
Definition: constants.qh:22
const int SPECIES_HUMAN
Definition: constants.qh:20
const int SPECIES_ROBOT_RUSTY
Definition: constants.qh:24
const int SPECIES_ANIMAL
Definition: constants.qh:23
float FL_ONGROUND
Definition: progsdefs.qc:240
const int SERVERFLAG_ALLOW_FULLBRIGHT
Definition: constants.qh:15
float FL_GODMODE
Definition: progsdefs.qc:237
float FL_PARTIALGROUND
Definition: progsdefs.qc:241
float FL_ITEM
Definition: progsdefs.qc:239
float FL_FLY
Definition: progsdefs.qc:232
const int SERVERFLAG_PLAYERSTATS
Definition: constants.qh:17
const int SERVERFLAG_TEAMPLAY
Definition: constants.qh:16
const int SERVERFLAG_PLAYERSTATS_CUSTOM
Definition: constants.qh:18
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
const int FRAGS_PLAYER
Definition: constants.qh:3
const int CVAR_NOTIFY
Definition: constants.qh:11
float FL_JUMPRELEASED
Definition: progsdefs.qc:243
const int SPECIES_ROBOT_SHINY
Definition: constants.qh:25
vector(float skel, float bonenum) _skel_get_boneabs_hidden
const int SPECIES_RESERVED
Definition: constants.qh:26
const int FRAGS_PLAYER_OUT_OF_GAME
Definition: constants.qh:5
const int SPECIES_ROBOT_SOLID
Definition: constants.qh:21
const int FRAGS_SPECTATOR
Definition: constants.qh:4
const int CVAR_SAVE
Definition: constants.qh:10
float FL_SWIM
Definition: progsdefs.qc:233
float FL_NOTARGET
Definition: progsdefs.qc:238
float FL_MONSTER
Definition: progsdefs.qc:236
const int CVAR_READONLY
Definition: constants.qh:12
float FL_CLIENT
Definition: progsdefs.qc:234
float FL_WATERJUMP
Definition: progsdefs.qc:242
float FL_INWATER
Definition: progsdefs.qc:235