UFO: Alien Invasion
q_shared.h File Reference

Common header file. More...

#include "../shared/ufotypes.h"
#include "../shared/shared.h"
#include "../shared/mathlib.h"
#include "../shared/defines.h"
#include "../common/list.h"
#include "inv_shared.h"
#include "chr_shared.h"
#include "q_sizes.h"
Include dependency graph for q_shared.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  cvarlist_t
 
struct  gametype_t
 
class  TerrainDef
 Terrain property table entry Terrain is defined by the file map_earth_terrain.png in pics/geoscape. It is a map of the world where the different terrainTypes are drawn in different colors. The colors used in that map must have the exact RGB values as in the table, or they won't be recognized. More...
 
class  TerrainDefs
 
struct  mapDef_t
 
struct  csi_t
 The csi structure is the client-server-information structure which contains all the static data needed by the server and the client. More...
 

Macros

#define TEAM_NO_ACTIVE   -1
 
#define TEAM_CIVILIAN   0
 
#define TEAM_PHALANX   1
 
#define TEAM_ALIEN   7
 
#define TEAM_MAX_HUMAN   TEAM_ALIEN - 1
 
#define EVENT_INSTANTLY   0x80
 
#define DOOR_ROTATION_ANGLE   90
 
#define ST_RIGHT   0
 The right hand should be used for shooting. More...
 
#define ST_RIGHT_REACTION   1
 The right hand reaction fire should be used for shooting. More...
 
#define ST_LEFT   2
 The left hand should be used for shooting. More...
 
#define ST_LEFT_REACTION   3
 The left hand reaction fire should be used for shooting. More...
 
#define ST_HEADGEAR   4
 The headgear slot item should be used when shooting/using the item in the slot. More...
 
#define ST_NUM_SHOOT_TYPES   5
 Amount of shoottypes available. More...
 
#define IS_SHOT_REACTION(x)   ((x) == ST_RIGHT_REACTION || (x) == ST_LEFT_REACTION)
 Determine whether the selected shoot type is for reaction fire. More...
 
#define IS_SHOT_LEFT(x)   ((x) == ST_LEFT || (x) == ST_LEFT_REACTION)
 Determine whether the selected shoot type is for the item in the left hand, either shooting or reaction fire. More...
 
#define IS_SHOT_RIGHT(x)   ((x) == ST_RIGHT || (x) == ST_RIGHT_REACTION)
 Determine whether the selected shoot type is for the item in the right hand, either shooting or reaction fire. More...
 
#define IS_SHOT_HEADGEAR(x)   ((x) == ST_HEADGEAR)
 Determine whether the selected shoot type is for the item in the headgear slot. More...
 
#define SF_IMPACT   1
 
#define SF_BODY   2
 
#define SF_BOUNCING   4
 
#define SF_BOUNCED   8
 
#define SKIP_LOCAL_ENTITY   (-1)
 
#define MAX_DEATH   3
 
#define STATE_PUBLIC   0x00FF
 
#define STATE_DEAD   0x0003
 
#define STATE_CROUCHED   0x0004
 
#define STATE_PANIC   0x0008
 
#define STATE_RAGE   0x0010
 
#define STATE_INSANE   0x0020
 
#define STATE_STUN   0x0043
 
#define STATE_DAZED   0x0080
 
#define STATE_REACTION   0x0300
 
#define STATE_SHAKEN   0x0400
 
#define STATE_XVI   0x0800
 
#define GRAVITY   500.0
 
#define MAX_SKILL   100
 
#define MAX_MAXHP   255
 
#define MIN_TU   39
 
#define WEIGHT_LIGHT   0.2f
 
#define WEIGHT_HEAVY   0.5f
 
#define WEIGHT_NORMAL_PENALTY   0.3f
 
#define WEIGHT_HEAVY_PENALTY   0.6f
 
#define WEIGHT_FACTOR   1000.0f
 
#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))
 
#define GET_ACC(ab, sk, pn)   ((pn) - (((float)(ab) - 10) / (MAX_SKILL / 2) + ((float)(sk) - 10) / (MAX_SKILL / 2)) / 2)
 
#define GET_MORALE(ab)   (std::min((100 + (ab) * 150/MAX_SKILL), 255))
 
#define GET_TU(ab, md)   (MIN_TU * (md) + (ab) * 20 / MAX_SKILL)
 
#define DOOR_OPEN_REVERSE   4
 
#define GET_SLIDING_DOOR_SHIFT_VECTOR(dir, speed, vecout)    do { const bool reverse = (dir) & DOOR_OPEN_REVERSE; VectorClear(vecout); vecout[dir & 3] = reverse ? -speed : speed; } while (0);
 
#define MAX_TILESTRINGS   8
 
#define MAX_CLIENTS   256 /* absolute limit */
 
#define MAX_GENERAL   (MAX_CLIENTS*2) /* general config strings */
 
#define MAX_ENTITYSTRINGS   2
 
#define CS_NAME   0
 
#define CS_MAPTITLE   1
 
#define CS_MAXCLIENTS   2
 
#define CS_MAPCHECKSUM   3
 
#define CS_MAXSOLDIERSPERTEAM   4
 
#define CS_MAXSOLDIERSPERPLAYER   5
 
#define CS_ENABLEMORALE   6
 
#define CS_MAXTEAMS   7
 
#define CS_PLAYERCOUNT   8
 
#define CS_VERSION   9
 
#define CS_UFOCHECKSUM   10
 
#define CS_OBJECTAMOUNT   11
 
#define CS_LIGHTMAP   12
 
#define CS_MAPZONE   13
 
#define CS_VICTORY_CONDITIONS   14
 
#define CS_ENTITYSTRING   15
 
#define CS_TILES   (CS_ENTITYSTRING+MAX_ENTITYSTRINGS)
 
#define CS_POSITIONS   (CS_TILES+MAX_TILESTRINGS)
 
#define CS_MODELS   (CS_POSITIONS+MAX_TILESTRINGS)
 
#define CS_PLAYERNAMES   (CS_MODELS+MAX_MODELS)
 
#define CS_GENERAL   (CS_PLAYERNAMES+MAX_CLIENTS)
 
#define MAX_CONFIGSTRINGS   (CS_GENERAL+MAX_GENERAL)
 
#define MAX_GAMETYPES   16
 
#define MAX_CVARLISTINGAMETYPE   16
 
#define MAX_TERRAINDEFS   16
 Terrain property table Terrain is defined by the file map_earth_terrain.png in pics/geoscape. It is a map of the world where the different terrainTypes are drawn in different colors. The colors used in that map must have the exact RGB values as in the table, or they won't be recognized. More...
 
#define MapDef_ForeachCondition(var, condition)
 
#define MapDef_Foreach(var)   MapDef_ForeachCondition(var, 1)
 
#define REJ_PASSWORD_REQUIRED_OR_INCORRECT   "Password required or incorrect."
 Reject messages that are send to the client from the game module. More...
 
#define BAD_RCON_PASSWORD   "Bad rcon_password."
 
#define REJ_BANNED   "Banned."
 
#define REJ_SERVER_FULL   "Server is full."
 
#define REJ_SERVER_VERSION_MISMATCH   "The server is running a different version of the game."
 
#define REJ_GAME_ALREADY_STARTED   "Game has started already."
 
#define REJ_CONNECTION_REFUSED   "Connection refused."
 
#define SV_CMD_CONNECT   "connect"
 
#define SV_CMD_RCON   "rcon"
 
#define SV_CMD_STATUS   "status"
 
#define SV_CMD_TEAMINFO   "teaminfo"
 
#define SV_CMD_INFO   "info"
 
#define SV_CMD_PRINT   "print"
 
#define SV_CMD_ACK   "ack"
 
#define CL_CMD_PING   "ping"
 
#define CL_CMD_ECHO   "echo"
 
#define CL_PRECACHE   "precache"
 
#define CL_SPAWNSOLDIERS   "spawnsoldiers"
 
#define CL_STARTMATCH   "startmatch"
 
#define CL_CMD_COMMAND   "cmd"
 
#define CL_CMD_CLIENT_CONNECT   "client_connect"
 
#define NET_STATE_NEW   "new"
 
#define NET_STATE_BEGIN   "begin"
 
#define NET_STATE_STARTMATCH   "startmatch"
 
#define NET_STATE_DISCONNECT   "disconnect"
 
#define NET_STATE_INFO   "info"
 

Typedefs

typedef int32_t shoot_types_t
 Available shoot types - also see the ST_ constants. More...
 

Enumerations

enum  event_t {
  EV_NULL , EV_RESET , EV_START , EV_ENDROUND ,
  EV_ENDROUNDANNOUNCE , EV_RESULTS , EV_CENTERVIEW , EV_MOVECAMERA ,
  EV_ENT_APPEAR , EV_ENT_PERISH , EV_ENT_DESTROY , EV_ADD_BRUSH_MODEL ,
  EV_ADD_EDICT , EV_ACTOR_APPEAR , EV_ACTOR_ADD , EV_ACTOR_TURN ,
  EV_ACTOR_MOVE , EV_ACTOR_REACTIONFIRECHANGE , EV_ACTOR_REACTIONFIREADDTARGET , EV_ACTOR_REACTIONFIREREMOVETARGET ,
  EV_ACTOR_REACTIONFIRETARGETUPDATE , EV_ACTOR_REACTIONFIREABORTSHOT , EV_ACTOR_START_SHOOT , EV_ACTOR_SHOOT ,
  EV_ACTOR_SHOOT_HIDDEN , EV_ACTOR_THROW , EV_ACTOR_END_SHOOT , EV_ACTOR_DIE ,
  EV_ACTOR_REVITALISED , EV_ACTOR_STATS , EV_ACTOR_STATECHANGE , EV_ACTOR_RESERVATIONCHANGE ,
  EV_ACTOR_WOUND , EV_INV_ADD , EV_INV_DEL , EV_INV_AMMO ,
  EV_INV_RELOAD , EV_INV_TRANSFER , EV_MODEL_EXPLODE , EV_MODEL_EXPLODE_TRIGGERED ,
  EV_PARTICLE_APPEAR , EV_PARTICLE_SPAWN , EV_SOUND , EV_DOOR_OPEN ,
  EV_DOOR_CLOSE , EV_CLIENT_ACTION , EV_RESET_CLIENT_ACTION , EV_CAMERA_APPEAR ,
  EV_NUM_EVENTS
}
 Possible event values. More...
 
enum  entity_type_t {
  ET_NULL , ET_ACTORSPAWN , ET_ACTOR , ET_ITEM ,
  ET_BREAKABLE , ET_TRIGGER , ET_TRIGGER_HURT , ET_TRIGGER_TOUCH ,
  ET_TRIGGER_RESCUE , ET_TRIGGER_NEXTMAP , ET_DOOR , ET_DOOR_SLIDING ,
  ET_ROTATING , ET_ACTOR2x2SPAWN , ET_ACTOR2x2 , ET_CIVILIANTARGET ,
  ET_MISSION , ET_ACTORHIDDEN , ET_PARTICLE , ET_SOUND ,
  ET_SOLID , ET_MESSAGE , ET_SMOKE , ET_FIRE ,
  ET_SMOKESTUN , ET_CAMERA , ET_MAX , ENTITY_TYPE_ENSURE_32BIT = 0x7FFFFFFF
}
 
enum  camera_type_t { CAMERA_MOBILE , CAMERA_STATIONARY , CAMERA_MAX , CAMERA_ENSURE_32BIT = 0x7FFFFFFF }
 
enum  player_action_t {
  PA_NULL , PA_TURN , PA_MOVE , PA_STATE ,
  PA_SHOOT , PA_USE , PA_INVMOVE , PA_REACT_SELECT ,
  PA_RESERVE_STATE , PA_NUM_EVENTS
}
 

Functions

void Sys_Error (const char *error,...) __attribute__((noreturn
 
void format (__printf__, 1, 2)))
 
void Com_Printf (const char *msg,...) __attribute__((format(__printf__
 
void void Com_DPrintf (int level, const char *msg,...) __attribute__((format(__printf__
 
int Com_GetMapDefNumber (void)
 
mapDef_tCom_GetMapDefByIDX (int index)
 
mapDef_tCom_GetMapDefinitionByID (const char *mapDefID)
 

Variables

const char * pa_format [PA_NUM_EVENTS]
 Player action format strings for netchannel transfer. More...
 
csi_t csi
 

Detailed Description

Common header file.

Todo:
Apparently included by every file - unnecessary?

Definition in file q_shared.h.

Macro Definition Documentation

◆ BAD_RCON_PASSWORD

#define BAD_RCON_PASSWORD   "Bad rcon_password."

Definition at line 581 of file q_shared.h.

◆ CL_CMD_CLIENT_CONNECT

#define CL_CMD_CLIENT_CONNECT   "client_connect"

Definition at line 606 of file q_shared.h.

◆ CL_CMD_COMMAND

#define CL_CMD_COMMAND   "cmd"

Definition at line 605 of file q_shared.h.

◆ CL_CMD_ECHO

#define CL_CMD_ECHO   "echo"

Definition at line 598 of file q_shared.h.

◆ CL_CMD_PING

#define CL_CMD_PING   "ping"

Definition at line 597 of file q_shared.h.

◆ CL_PRECACHE

#define CL_PRECACHE   "precache"

Definition at line 601 of file q_shared.h.

◆ CL_SPAWNSOLDIERS

#define CL_SPAWNSOLDIERS   "spawnsoldiers"

Definition at line 602 of file q_shared.h.

◆ CL_STARTMATCH

#define CL_STARTMATCH   "startmatch"

Definition at line 603 of file q_shared.h.

◆ CS_ENABLEMORALE

#define CS_ENABLEMORALE   6

enable the morale states in multiplayer

Definition at line 315 of file q_shared.h.

◆ CS_ENTITYSTRING

#define CS_ENTITYSTRING   15

additional worldspawn settings

Definition at line 324 of file q_shared.h.

◆ CS_GENERAL

#define CS_GENERAL   (CS_PLAYERNAMES+MAX_CLIENTS)

Definition at line 329 of file q_shared.h.

◆ CS_LIGHTMAP

#define CS_LIGHTMAP   12

which lightmap to use

Definition at line 321 of file q_shared.h.

◆ CS_MAPCHECKSUM

#define CS_MAPCHECKSUM   3

for catching cheater maps

Definition at line 312 of file q_shared.h.

◆ CS_MAPTITLE

#define CS_MAPTITLE   1

display map title string - translated client side

Definition at line 310 of file q_shared.h.

◆ CS_MAPZONE

#define CS_MAPZONE   13

for terrain texture replacement

Definition at line 322 of file q_shared.h.

◆ CS_MAXCLIENTS

#define CS_MAXCLIENTS   2

Definition at line 311 of file q_shared.h.

◆ CS_MAXSOLDIERSPERPLAYER

#define CS_MAXSOLDIERSPERPLAYER   5

max soldiers per player when in teamplay mode

Definition at line 314 of file q_shared.h.

◆ CS_MAXSOLDIERSPERTEAM

#define CS_MAXSOLDIERSPERTEAM   4

max soldiers per team

Definition at line 313 of file q_shared.h.

◆ CS_MAXTEAMS

#define CS_MAXTEAMS   7

how many multiplayer teams for this map

Definition at line 316 of file q_shared.h.

◆ CS_MODELS

#define CS_MODELS   (CS_POSITIONS+MAX_TILESTRINGS)

Definition at line 327 of file q_shared.h.

◆ CS_NAME

#define CS_NAME   0

config strings are a general means of communication from the server to all connected clients. Each config string can usually be at most MAX_TOKEN_CHARS characters, but some of them (eg. CS_TILES) can span a multiple of that.

Definition at line 309 of file q_shared.h.

◆ CS_OBJECTAMOUNT

#define CS_OBJECTAMOUNT   11

amount of defined objects in the script files

Definition at line 320 of file q_shared.h.

◆ CS_PLAYERCOUNT

#define CS_PLAYERCOUNT   8

amount of already connected players

Definition at line 317 of file q_shared.h.

◆ CS_PLAYERNAMES

#define CS_PLAYERNAMES   (CS_MODELS+MAX_MODELS)

Definition at line 328 of file q_shared.h.

◆ CS_POSITIONS

#define CS_POSITIONS   (CS_TILES+MAX_TILESTRINGS)

Definition at line 326 of file q_shared.h.

◆ CS_TILES

#define CS_TILES   (CS_ENTITYSTRING+MAX_ENTITYSTRINGS)

Definition at line 325 of file q_shared.h.

◆ CS_UFOCHECKSUM

#define CS_UFOCHECKSUM   10

checksum of ufo files

Definition at line 319 of file q_shared.h.

◆ CS_VERSION

#define CS_VERSION   9

what is the servers version

Definition at line 318 of file q_shared.h.

◆ CS_VICTORY_CONDITIONS

#define CS_VICTORY_CONDITIONS   14

a list of msgids seperated by ,

Definition at line 323 of file q_shared.h.

◆ DOOR_OPEN_REVERSE

#define DOOR_OPEN_REVERSE   4

Definition at line 293 of file q_shared.h.

◆ DOOR_ROTATION_ANGLE

#define DOOR_ROTATION_ANGLE   90

Definition at line 187 of file q_shared.h.

◆ EVENT_INSTANTLY

#define EVENT_INSTANTLY   0x80

add this flag for instant event execution

Definition at line 73 of file q_shared.h.

◆ GET_ACC

#define GET_ACC (   ab,
  sk,
  pn 
)    ((pn) - (((float)(ab) - 10) / (MAX_SKILL / 2) + ((float)(sk) - 10) / (MAX_SKILL / 2)) / 2)
Todo:
Skill-influence needs some balancing.

Definition at line 289 of file q_shared.h.

◆ GET_ENCUMBRANCE_PENALTY

#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))

Definition at line 287 of file q_shared.h.

◆ GET_MORALE

#define GET_MORALE (   ab)    (std::min((100 + (ab) * 150/MAX_SKILL), 255))

Definition at line 290 of file q_shared.h.

◆ GET_SLIDING_DOOR_SHIFT_VECTOR

#define GET_SLIDING_DOOR_SHIFT_VECTOR (   dir,
  speed,
  vecout 
)     do { const bool reverse = (dir) & DOOR_OPEN_REVERSE; VectorClear(vecout); vecout[dir & 3] = reverse ? -speed : speed; } while (0);

Definition at line 294 of file q_shared.h.

◆ GET_TU

#define GET_TU (   ab,
  md 
)    (MIN_TU * (md) + (ab) * 20 / MAX_SKILL)

Definition at line 291 of file q_shared.h.

◆ GRAVITY

#define GRAVITY   500.0

Definition at line 276 of file q_shared.h.

◆ IS_SHOT_HEADGEAR

#define IS_SHOT_HEADGEAR (   x)    ((x) == ST_HEADGEAR)

Determine whether the selected shoot type is for the item in the headgear slot.

Definition at line 245 of file q_shared.h.

◆ IS_SHOT_LEFT

#define IS_SHOT_LEFT (   x)    ((x) == ST_LEFT || (x) == ST_LEFT_REACTION)

Determine whether the selected shoot type is for the item in the left hand, either shooting or reaction fire.

Definition at line 241 of file q_shared.h.

◆ IS_SHOT_REACTION

#define IS_SHOT_REACTION (   x)    ((x) == ST_RIGHT_REACTION || (x) == ST_LEFT_REACTION)

Determine whether the selected shoot type is for reaction fire.

Definition at line 239 of file q_shared.h.

◆ IS_SHOT_RIGHT

#define IS_SHOT_RIGHT (   x)    ((x) == ST_RIGHT || (x) == ST_RIGHT_REACTION)

Determine whether the selected shoot type is for the item in the right hand, either shooting or reaction fire.

Definition at line 243 of file q_shared.h.

◆ MapDef_Foreach

#define MapDef_Foreach (   var)    MapDef_ForeachCondition(var, 1)

Definition at line 505 of file q_shared.h.

◆ MapDef_ForeachCondition

#define MapDef_ForeachCondition (   var,
  condition 
)
Value:
for (int var##__loopvar = 0; (var) = nullptr, var##__loopvar < Com_GetMapDefNumber(); var##__loopvar++) \
if ((var) = Com_GetMapDefByIDX(var##__loopvar), !(condition)) {} else
int Com_GetMapDefNumber(void)
mapDef_t * Com_GetMapDefByIDX(int index)

Definition at line 501 of file q_shared.h.

◆ MAX_CLIENTS

#define MAX_CLIENTS   256 /* absolute limit */

Definition at line 299 of file q_shared.h.

◆ MAX_CONFIGSTRINGS

#define MAX_CONFIGSTRINGS   (CS_GENERAL+MAX_GENERAL)

Definition at line 330 of file q_shared.h.

◆ MAX_CVARLISTINGAMETYPE

#define MAX_CVARLISTINGAMETYPE   16

Definition at line 335 of file q_shared.h.

◆ MAX_DEATH

#define MAX_DEATH   3
See also
STATE_DEAD

Definition at line 257 of file q_shared.h.

◆ MAX_ENTITYSTRINGS

#define MAX_ENTITYSTRINGS   2

Definition at line 301 of file q_shared.h.

◆ MAX_GAMETYPES

#define MAX_GAMETYPES   16

game types

Definition at line 333 of file q_shared.h.

◆ MAX_GENERAL

#define MAX_GENERAL   (MAX_CLIENTS*2) /* general config strings */

Definition at line 300 of file q_shared.h.

◆ MAX_MAXHP

#define MAX_MAXHP   255

Definition at line 279 of file q_shared.h.

◆ MAX_SKILL

#define MAX_SKILL   100

Definition at line 278 of file q_shared.h.

◆ MAX_TERRAINDEFS

#define MAX_TERRAINDEFS   16

Terrain property table Terrain is defined by the file map_earth_terrain.png in pics/geoscape. It is a map of the world where the different terrainTypes are drawn in different colors. The colors used in that map must have the exact RGB values as in the table, or they won't be recognized.

See also
GEO_GetColor

Definition at line 388 of file q_shared.h.

◆ MAX_TILESTRINGS

#define MAX_TILESTRINGS   8

Definition at line 298 of file q_shared.h.

◆ MIN_TU

#define MIN_TU   39

Definition at line 280 of file q_shared.h.

◆ NET_STATE_BEGIN

#define NET_STATE_BEGIN   "begin"

Definition at line 609 of file q_shared.h.

◆ NET_STATE_DISCONNECT

#define NET_STATE_DISCONNECT   "disconnect"

Definition at line 611 of file q_shared.h.

◆ NET_STATE_INFO

#define NET_STATE_INFO   "info"

Definition at line 612 of file q_shared.h.

◆ NET_STATE_NEW

#define NET_STATE_NEW   "new"

Definition at line 608 of file q_shared.h.

◆ NET_STATE_STARTMATCH

#define NET_STATE_STARTMATCH   "startmatch"

Definition at line 610 of file q_shared.h.

◆ REJ_BANNED

#define REJ_BANNED   "Banned."

Definition at line 582 of file q_shared.h.

◆ REJ_CONNECTION_REFUSED

#define REJ_CONNECTION_REFUSED   "Connection refused."

Definition at line 586 of file q_shared.h.

◆ REJ_GAME_ALREADY_STARTED

#define REJ_GAME_ALREADY_STARTED   "Game has started already."

Definition at line 585 of file q_shared.h.

◆ REJ_PASSWORD_REQUIRED_OR_INCORRECT

#define REJ_PASSWORD_REQUIRED_OR_INCORRECT   "Password required or incorrect."

Reject messages that are send to the client from the game module.

Definition at line 580 of file q_shared.h.

◆ REJ_SERVER_FULL

#define REJ_SERVER_FULL   "Server is full."

Definition at line 583 of file q_shared.h.

◆ REJ_SERVER_VERSION_MISMATCH

#define REJ_SERVER_VERSION_MISMATCH   "The server is running a different version of the game."

Definition at line 584 of file q_shared.h.

◆ SF_BODY

#define SF_BODY   2

impact on actors

Definition at line 249 of file q_shared.h.

◆ SF_BOUNCED

#define SF_BOUNCED   8

at least hit the ground once and can now start to bounce

Definition at line 251 of file q_shared.h.

◆ SF_BOUNCING

#define SF_BOUNCING   4

item should bounce around (like grenades)

Definition at line 250 of file q_shared.h.

◆ SF_IMPACT

#define SF_IMPACT   1

impact on none actor objects

Definition at line 248 of file q_shared.h.

◆ SKIP_LOCAL_ENTITY

#define SKIP_LOCAL_ENTITY   (-1)

Definition at line 255 of file q_shared.h.

◆ ST_HEADGEAR

#define ST_HEADGEAR   4

The headgear slot item should be used when shooting/using the item in the slot.

Note
shoot_types_t value

Definition at line 231 of file q_shared.h.

◆ ST_LEFT

#define ST_LEFT   2

The left hand should be used for shooting.

Note
shoot_types_t value

Definition at line 221 of file q_shared.h.

◆ ST_LEFT_REACTION

#define ST_LEFT_REACTION   3

The left hand reaction fire should be used for shooting.

Note
shoot_types_t value

Definition at line 226 of file q_shared.h.

◆ ST_NUM_SHOOT_TYPES

#define ST_NUM_SHOOT_TYPES   5

Amount of shoottypes available.

Note
shoot_types_t value

Definition at line 236 of file q_shared.h.

◆ ST_RIGHT

#define ST_RIGHT   0

The right hand should be used for shooting.

Note
shoot_types_t value

Definition at line 211 of file q_shared.h.

◆ ST_RIGHT_REACTION

#define ST_RIGHT_REACTION   1

The right hand reaction fire should be used for shooting.

Note
shoot_types_t value

Definition at line 216 of file q_shared.h.

◆ STATE_CROUCHED

#define STATE_CROUCHED   0x0004

Definition at line 263 of file q_shared.h.

◆ STATE_DAZED

#define STATE_DAZED   0x0080

dazed and unable to move

Definition at line 269 of file q_shared.h.

◆ STATE_DEAD

#define STATE_DEAD   0x0003

0 alive, 1-3 different deaths

See also
MAX_DEATH

Definition at line 262 of file q_shared.h.

◆ STATE_INSANE

#define STATE_INSANE   0x0020

Definition at line 267 of file q_shared.h.

◆ STATE_PANIC

#define STATE_PANIC   0x0008

Definition at line 264 of file q_shared.h.

◆ STATE_PUBLIC

#define STATE_PUBLIC   0x00FF

mask to separate private flags from events

Definition at line 261 of file q_shared.h.

◆ STATE_RAGE

#define STATE_RAGE   0x0010

pretty self-explaining

Definition at line 266 of file q_shared.h.

◆ STATE_REACTION

#define STATE_REACTION   0x0300

reaction fire

Definition at line 272 of file q_shared.h.

◆ STATE_SHAKEN

#define STATE_SHAKEN   0x0400

forced reaction fire

Definition at line 273 of file q_shared.h.

◆ STATE_STUN

#define STATE_STUN   0x0043

stunned - includes death

Definition at line 268 of file q_shared.h.

◆ STATE_XVI

#define STATE_XVI   0x0800

controlled by the other team

Definition at line 274 of file q_shared.h.

◆ SV_CMD_ACK

#define SV_CMD_ACK   "ack"

Definition at line 596 of file q_shared.h.

◆ SV_CMD_CONNECT

#define SV_CMD_CONNECT   "connect"

Definition at line 588 of file q_shared.h.

◆ SV_CMD_INFO

#define SV_CMD_INFO   "info"

Definition at line 592 of file q_shared.h.

◆ SV_CMD_PRINT

#define SV_CMD_PRINT   "print"

Definition at line 593 of file q_shared.h.

◆ SV_CMD_RCON

#define SV_CMD_RCON   "rcon"

Definition at line 589 of file q_shared.h.

◆ SV_CMD_STATUS

#define SV_CMD_STATUS   "status"

Definition at line 590 of file q_shared.h.

◆ SV_CMD_TEAMINFO

#define SV_CMD_TEAMINFO   "teaminfo"

Definition at line 591 of file q_shared.h.

◆ TEAM_ALIEN

#define TEAM_ALIEN   7

Definition at line 63 of file q_shared.h.

◆ TEAM_CIVILIAN

#define TEAM_CIVILIAN   0

Definition at line 61 of file q_shared.h.

◆ TEAM_MAX_HUMAN

#define TEAM_MAX_HUMAN   TEAM_ALIEN - 1

Definition at line 64 of file q_shared.h.

◆ TEAM_NO_ACTIVE

#define TEAM_NO_ACTIVE   -1

Definition at line 60 of file q_shared.h.

◆ TEAM_PHALANX

#define TEAM_PHALANX   1

Definition at line 62 of file q_shared.h.

◆ WEIGHT_FACTOR

#define WEIGHT_FACTOR   1000.0f

Definition at line 285 of file q_shared.h.

◆ WEIGHT_HEAVY

#define WEIGHT_HEAVY   0.5f

Definition at line 282 of file q_shared.h.

◆ WEIGHT_HEAVY_PENALTY

#define WEIGHT_HEAVY_PENALTY   0.6f

Definition at line 284 of file q_shared.h.

◆ WEIGHT_LIGHT

#define WEIGHT_LIGHT   0.2f

Definition at line 281 of file q_shared.h.

◆ WEIGHT_NORMAL_PENALTY

#define WEIGHT_NORMAL_PENALTY   0.3f

Definition at line 283 of file q_shared.h.

Typedef Documentation

◆ shoot_types_t

typedef int32_t shoot_types_t

Available shoot types - also see the ST_ constants.

Definition at line 206 of file q_shared.h.

Enumeration Type Documentation

◆ camera_type_t

Enumerator
CAMERA_MOBILE 
CAMERA_STATIONARY 
CAMERA_MAX 
CAMERA_ENSURE_32BIT 

Definition at line 178 of file q_shared.h.

◆ entity_type_t

Enumerator
ET_NULL 
ET_ACTORSPAWN 
ET_ACTOR 
ET_ITEM 
ET_BREAKABLE 
ET_TRIGGER 
ET_TRIGGER_HURT 
ET_TRIGGER_TOUCH 
ET_TRIGGER_RESCUE 
ET_TRIGGER_NEXTMAP 
ET_DOOR 
ET_DOOR_SLIDING 
ET_ROTATING 
ET_ACTOR2x2SPAWN 
ET_ACTOR2x2 
ET_CIVILIANTARGET 
ET_MISSION 
ET_ACTORHIDDEN 
ET_PARTICLE 
ET_SOUND 
ET_SOLID 
ET_MESSAGE 
ET_SMOKE 
ET_FIRE 
ET_SMOKESTUN 
ET_CAMERA 
ET_MAX 
ENTITY_TYPE_ENSURE_32BIT 

Definition at line 145 of file q_shared.h.

◆ event_t

enum event_t

Possible event values.

See also
cl_parse.c for event bindings
Enumerator
EV_NULL 
EV_RESET 
EV_START 
EV_ENDROUND 

ends the current team's turn CL_DoEndRound

EV_ENDROUNDANNOUNCE 
EV_RESULTS 
EV_CENTERVIEW 
EV_MOVECAMERA 
EV_ENT_APPEAR 
EV_ENT_PERISH 

empty container or destroy inventory - set le invis to true see CL_EntPerish

EV_ENT_DESTROY 
EV_ADD_BRUSH_MODEL 
EV_ADD_EDICT 
EV_ACTOR_APPEAR 
EV_ACTOR_ADD 
EV_ACTOR_TURN 

turn an actor around

EV_ACTOR_MOVE 
EV_ACTOR_REACTIONFIRECHANGE 
EV_ACTOR_REACTIONFIREADDTARGET 
EV_ACTOR_REACTIONFIREREMOVETARGET 
EV_ACTOR_REACTIONFIRETARGETUPDATE 
EV_ACTOR_REACTIONFIREABORTSHOT 
EV_ACTOR_START_SHOOT 
EV_ACTOR_SHOOT 
EV_ACTOR_SHOOT_HIDDEN 
EV_ACTOR_THROW 
EV_ACTOR_END_SHOOT 
EV_ACTOR_DIE 
EV_ACTOR_REVITALISED 
EV_ACTOR_STATS 
EV_ACTOR_STATECHANGE 

set an actor to crouched or reaction fire

EV_ACTOR_RESERVATIONCHANGE 
EV_ACTOR_WOUND 
EV_INV_ADD 
EV_INV_DEL 
EV_INV_AMMO 
EV_INV_RELOAD 
EV_INV_TRANSFER 
EV_MODEL_EXPLODE 

delay the event execution by the impact time

EV_MODEL_EXPLODE_TRIGGERED 

don't delay the model explode event

EV_PARTICLE_APPEAR 
EV_PARTICLE_SPAWN 
EV_SOUND 
EV_DOOR_OPEN 
EV_DOOR_CLOSE 
EV_CLIENT_ACTION 
EV_RESET_CLIENT_ACTION 
EV_CAMERA_APPEAR 
EV_NUM_EVENTS 

Definition at line 79 of file q_shared.h.

◆ player_action_t

Enumerator
PA_NULL 
PA_TURN 
PA_MOVE 
PA_STATE 
PA_SHOOT 
PA_USE 
PA_INVMOVE 
PA_REACT_SELECT 
PA_RESERVE_STATE 
PA_NUM_EVENTS 

Definition at line 189 of file q_shared.h.

Function Documentation

◆ Com_DPrintf()

void void Com_DPrintf ( int  level,
const char *  msg,
  ... 
)

◆ Com_GetMapDefByIDX()

mapDef_t * Com_GetMapDefByIDX ( int  index)

◆ Com_GetMapDefinitionByID()

mapDef_t * Com_GetMapDefinitionByID ( const char *  mapDefID)

Definition at line 3598 of file scripts.cpp.

◆ Com_GetMapDefNumber()

int Com_GetMapDefNumber ( void  )

Definition at line 60 of file cl_game_campaign.cpp.

References cgi, cgame_import_t::csi, csi, and csi_t::numMDs.

◆ Com_Printf()

void Com_Printf ( const char *  msg,
  ... 
)

◆ format()

◆ Sys_Error()

void Sys_Error ( const char *  error,
  ... 
)

Variable Documentation

◆ csi

csi_t csi
extern

Definition at line 39 of file common.cpp.

Referenced by CL_ActorAdd(), CL_ActorAppear(), CL_CanMultiplayerStart(), CL_InitAfter(), CL_PrecacheCharacterModels(), CL_TeamDefInitMenu(), CL_ViewLoadMedia(), CL_ViewPrecacheModels(), Com_AddObjectLinks(), Com_GameTypeList_f(), Com_GetBodyTemplateByID(), Com_GetCharacterTemplateByID(), Com_GetMapDefByIDX(), Com_GetMapDefNumber(), Com_GetNameListByID(), Com_GetTeamDefinitionByID(), Com_GetUGVByID(), Com_GetUGVByIDSilent(), Com_ParseActorNames(), Com_ParseArmourOrResistance(), Com_ParseBodyTemplate(), Com_ParseCharacterTemplate(), Com_ParseDamageTypes(), Com_ParseEquipment(), Com_ParseGameTypes(), Com_ParseImplant(), Com_ParseInventory(), Com_ParseItem(), Com_ParseMapDefinition(), Com_ParseScripts(), Com_ParseTeam(), Com_ParseTerrainDefinition(), Com_ParseUGVs(), Com_ParseValue(), Com_SetGameType(), Com_ValueToStr(), GAME_ChangeEquip(), GAME_GetImportData(), GAME_LoadItem(), GAME_SaveTeam(), GAME_SetMode(), GAME_Spawn(), GAME_SwitchCurrentSelectedMap(), INV_EquipmentDefSanityCheck(), INV_GetEquipmentDefinitionByID(), INV_ItemDescription(), INV_UpdateObject_f(), LE_AddProjectile(), LET_Projectile(), PR_UpdateProductionList(), Qcommon_Init(), ResetInventoryList(), RS_InitTree(), S_PrecacheSamples(), SV_InitGameProgs(), SV_Map(), TEST_F(), TEST_Init(), GameTest::testCountSpawnpointsForMapInMultiplayerMode(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), UI_ContainerItemIteratorNext(), UI_ContainerNodeUpdateEquipment(), UI_MapInfo(), UI_MapInfoGetNext(), UI_RequestMapList_f(), and UI_SelectMap_f().

◆ pa_format

const char* pa_format[PA_NUM_EVENTS]
extern

Player action format strings for netchannel transfer.

Note
They all have a prefix
See also
MSG_Write_PA

Definition at line 34 of file q_shared.cpp.

Referenced by G_ClientAction(), and MSG_Write_PA().