45# define _(String) String
46# define ngettext(x, y, cnt) x
60#define TEAM_NO_ACTIVE -1
61#define TEAM_CIVILIAN 0
64#define TEAM_MAX_HUMAN TEAM_ALIEN - 1
73#define EVENT_INSTANTLY 0x80
187#define DOOR_ROTATION_ANGLE 90
216#define ST_RIGHT_REACTION 1
226#define ST_LEFT_REACTION 3
236#define ST_NUM_SHOOT_TYPES 5
239#define IS_SHOT_REACTION(x) ((x) == ST_RIGHT_REACTION || (x) == ST_LEFT_REACTION)
241#define IS_SHOT_LEFT(x) ((x) == ST_LEFT || (x) == ST_LEFT_REACTION)
243#define IS_SHOT_RIGHT(x) ((x) == ST_RIGHT || (x) == ST_RIGHT_REACTION)
245#define IS_SHOT_HEADGEAR(x) ((x) == ST_HEADGEAR)
255#define SKIP_LOCAL_ENTITY (-1)
261#define STATE_PUBLIC 0x00FF
262#define STATE_DEAD 0x0003
263#define STATE_CROUCHED 0x0004
264#define STATE_PANIC 0x0008
266#define STATE_RAGE 0x0010
267#define STATE_INSANE 0x0020
268#define STATE_STUN 0x0043
269#define STATE_DAZED 0x0080
272#define STATE_REACTION 0x0300
273#define STATE_SHAKEN 0x0400
274#define STATE_XVI 0x0800
281#define WEIGHT_LIGHT 0.2f
282#define WEIGHT_HEAVY 0.5f
283#define WEIGHT_NORMAL_PENALTY 0.3f
284#define WEIGHT_HEAVY_PENALTY 0.6f
285#define WEIGHT_FACTOR 1000.0f
287#define GET_ENCUMBRANCE_PENALTY(weight, max) (1.0f - ((weight) > (max) * WEIGHT_FACTOR * WEIGHT_HEAVY ? WEIGHT_HEAVY_PENALTY : (weight) > (max) * WEIGHT_FACTOR * WEIGHT_LIGHT ? WEIGHT_NORMAL_PENALTY : 0.0f))
289#define GET_ACC( ab, sk, pn ) ((pn) - (((float)(ab) - 10) / (MAX_SKILL / 2) + ((float)(sk) - 10) / (MAX_SKILL / 2)) / 2)
290#define GET_MORALE( ab ) (std::min((100 + (ab) * 150/MAX_SKILL), 255))
291#define GET_TU( ab, md ) (MIN_TU * (md) + (ab) * 20 / MAX_SKILL)
293#define DOOR_OPEN_REVERSE 4
294#define GET_SLIDING_DOOR_SHIFT_VECTOR(dir, speed, vecout) \
295 do { const bool reverse = (dir) & DOOR_OPEN_REVERSE; VectorClear(vecout); vecout[dir & 3] = reverse ? -speed : speed; } while (0);
298#define MAX_TILESTRINGS 8
299#define MAX_CLIENTS 256
300#define MAX_GENERAL (MAX_CLIENTS*2)
301#define MAX_ENTITYSTRINGS 2
311#define CS_MAXCLIENTS 2
312#define CS_MAPCHECKSUM 3
313#define CS_MAXSOLDIERSPERTEAM 4
314#define CS_MAXSOLDIERSPERPLAYER 5
315#define CS_ENABLEMORALE 6
317#define CS_PLAYERCOUNT 8
319#define CS_UFOCHECKSUM 10
320#define CS_OBJECTAMOUNT 11
321#define CS_LIGHTMAP 12
323#define CS_VICTORY_CONDITIONS 14
324#define CS_ENTITYSTRING 15
325#define CS_TILES (CS_ENTITYSTRING+MAX_ENTITYSTRINGS)
326#define CS_POSITIONS (CS_TILES+MAX_TILESTRINGS)
327#define CS_MODELS (CS_POSITIONS+MAX_TILESTRINGS)
328#define CS_PLAYERNAMES (CS_MODELS+MAX_MODELS)
329#define CS_GENERAL (CS_PLAYERNAMES+MAX_CLIENTS)
330#define MAX_CONFIGSTRINGS (CS_GENERAL+MAX_GENERAL)
333#define MAX_GAMETYPES 16
335#define MAX_CVARLISTINGAMETYPE 16
336typedef struct cvarlist_s {
341typedef struct gametype_s {
369 TerrainDef(
byte _rgbRed,
byte _rgbGreen,
byte _rgbBlue,
const char* _terrainName,
float _survivalChance,
float _rainChance,
float _snowChance) {
388#define MAX_TERRAINDEFS 16
428 const char*
getWeather (
const byte*
const color);
461typedef struct mapDef_s {
501#define MapDef_ForeachCondition(var, condition) \
502 for (int var##__loopvar = 0; (var) = nullptr, var##__loopvar < Com_GetMapDefNumber(); var##__loopvar++) \
503 if ((var) = Com_GetMapDefByIDX(var##__loopvar), !(condition)) {} else
505#define MapDef_Foreach(var) MapDef_ForeachCondition(var, 1)
515typedef struct csi_s {
580#define REJ_PASSWORD_REQUIRED_OR_INCORRECT "Password required or incorrect."
581#define BAD_RCON_PASSWORD "Bad rcon_password."
582#define REJ_BANNED "Banned."
583#define REJ_SERVER_FULL "Server is full."
584#define REJ_SERVER_VERSION_MISMATCH "The server is running a different version of the game."
585#define REJ_GAME_ALREADY_STARTED "Game has started already."
586#define REJ_CONNECTION_REFUSED "Connection refused."
588#define SV_CMD_CONNECT "connect"
589#define SV_CMD_RCON "rcon"
590#define SV_CMD_STATUS "status"
591#define SV_CMD_TEAMINFO "teaminfo"
592#define SV_CMD_INFO "info"
593#define SV_CMD_PRINT "print"
596#define SV_CMD_ACK "ack"
597#define CL_CMD_PING "ping"
598#define CL_CMD_ECHO "echo"
601#define CL_PRECACHE "precache"
602#define CL_SPAWNSOLDIERS "spawnsoldiers"
603#define CL_STARTMATCH "startmatch"
605#define CL_CMD_COMMAND "cmd"
606#define CL_CMD_CLIENT_CONNECT "client_connect"
608#define NET_STATE_NEW "new"
609#define NET_STATE_BEGIN "begin"
610#define NET_STATE_STARTMATCH "startmatch"
611#define NET_STATE_DISCONNECT "disconnect"
612#define NET_STATE_INFO "info"
#define MAX_CHARACTER_TEMPLATES
Terrain property table entry Terrain is defined by the file map_earth_terrain.png in pics/geoscape....
TerrainDef(byte _rgbRed, byte _rgbGreen, byte _rgbBlue, const char *_terrainName, float _survivalChance, float _rainChance, float _snowChance)
const TerrainDef * findByName(const char *tname) const
float getSnowChance(const byte *const color) const
const char * getTerrainName(const byte *const color) const
Translate color value to terrain type.
bool add(const TerrainDef *tdef)
Translate color value to terrain type to random weather code.
const char * getWeather(const byte *const color)
Translate color value to terrain type to random weather code.
float getSurvivalChance(const byte *const color) const
Translate color value to terrain type and then to survival probability.
const TerrainDef * findByColor(const byte *const color) const
const TerrainDef * terrainDefTable[MAX_TERRAINDEFS]
float getRainChance(const byte *const color) const
const TerrainDef * findByColor(byte red, byte green, byte blue) const
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Printf(const char *const fmt,...)
static const vec4_t green
Defined CONSTANTS (Macros are elsewhere).
common object-, inventory-, container- and firemode-related functions headers.
#define MAX_TEAMS_PER_MISSION
const char * pa_format[]
Player action format strings for netchannel transfer.
event_t
Possible event values.
@ EV_ACTOR_REACTIONFIRECHANGE
@ EV_ACTOR_REACTIONFIRETARGETUPDATE
@ EV_ACTOR_REACTIONFIREABORTSHOT
@ EV_MODEL_EXPLODE_TRIGGERED
@ EV_ACTOR_REACTIONFIREADDTARGET
@ EV_ACTOR_RESERVATIONCHANGE
@ EV_ACTOR_REACTIONFIREREMOVETARGET
int Com_GetMapDefNumber(void)
mapDef_t * Com_GetMapDefByIDX(int index)
mapDef_t * Com_GetMapDefinitionByID(const char *mapDefID)
@ ENTITY_TYPE_ENSURE_32BIT
#define MAX_TERRAINDEFS
Terrain property table Terrain is defined by the file map_earth_terrain.png in pics/geoscape....
int32_t shoot_types_t
Available shoot types - also see the ST_ constants.
void format(__printf__, 1, 2)))
#define MAX_CVARLISTINGAMETYPE
void Sys_Error(const char *error,...) __attribute__((noreturn
The csi structure is the client-server-information structure which contains all the static data neede...
const chrTemplate_t * alienChrTemplates[MAX_TEAMS_PER_MISSION]
mapDef_t mds[MAX_MAPDEFS]
linkedList_t * bodyTemplates
equipDef_t eds[MAX_EQUIPDEFS]
damageType_t dts[MAX_DAMAGETYPES]
teamDef_t teamDef[MAX_TEAMDEFS]
objDef_t ods[MAX_OBJDEFS]
chrTemplate_t chrTemplates[MAX_CHARACTER_TEMPLATES]
const teamDef_t * alienTeams[MAX_TEAMS_PER_MISSION]
invDef_t ids[MAX_INVDEFS]
gametype_t gts[MAX_GAMETYPES]
linkedList_t * actorNames
implantDef_t implants[MAX_IMPLANTS]
cvarlist_t cvars[MAX_CVARLISTINGAMETYPE]
inventory definition for our menus
float victoryBonusPerAlien
linkedList_t * populations
Defines all attributes of objects used in the inventory.
Defines a type of UGV/Robot.
Cross-platform type definitions.