Shared game type headers. More...
#include "client.h"
#include "ui/ui_nodes.h"
#include "cl_game_campaign.h"
#include "cl_game_skirmish.h"
#include "cl_game_multiplayer.h"
Go to the source code of this file.
Defines | |
#define | GAME_NONE 0 |
#define | GAME_SINGLEPLAYER (1 << 0) |
#define | GAME_MULTIPLAYER (1 << 1) |
#define | GAME_CAMPAIGN (GAME_SINGLEPLAYER | (1 << 2)) |
#define | GAME_SKIRMISH (GAME_SINGLEPLAYER | (1 << 3)) |
#define | GAME_MAX GAME_SKIRMISH |
#define | GAME_IsSingleplayer() (cls.gametype & GAME_SINGLEPLAYER) |
#define | GAME_IsMultiplayer() (cls.gametype == GAME_MULTIPLAYER) |
Functions | |
void | GAME_InitStartup (void) |
void | GAME_SetMode (int gametype) |
void | GAME_ReloadMode (void) |
void | GAME_Init (qboolean load) |
void | GAME_DisplayItemInfo (uiNode_t *node, const char *string) |
Shows game type specific item information (if it's not resolvable via objDef_t ). | |
qboolean | GAME_ItemIsUseable (const objDef_t *od) |
void | GAME_HandleResults (struct dbuffer *msg, int winner, int *numSpawned, int *numAlive, int numKilled[][MAX_TEAMS], int numStunned[][MAX_TEAMS]) |
After a mission was finished this function is called. | |
void | GAME_SpawnSoldiers (void) |
Called during startup of mission to send team info. | |
int | GAME_GetCurrentTeam (void) |
equipDef_t * | GAME_GetEquipmentDefinition (void) |
void | GAME_CharacterCvars (const character_t *chr) |
character_t * | GAME_GetCharacter (int index) |
Returns a character that can be used to store the game type specific character values. | |
size_t | GAME_GetCharacterArraySize (void) |
void | GAME_ResetCharacters (void) |
Will reset (memset) all characters in the static character array. | |
void | GAME_GenerateTeam (const char *teamDefID, const equipDef_t *ed, int teamMembers) |
void | GAME_AppendTeamMember (int memberIndex, const char *teamDefID, const equipDef_t *ed) |
void | GAME_StartBattlescape (qboolean isTeamPlay) |
Called when the server sends the EV_START event. | |
void | GAME_EndBattlescape (void) |
This is called when a client quits the battlescape. | |
void | GAME_EndRoundAnnounce (int playerNum, int team) |
Send end round announcements. | |
qboolean | GAME_TeamIsKnown (const teamDef_t *teamDef) |
const char * | GAME_GetTeamDef (void) |
void | GAME_Drop (void) |
void | GAME_Frame (void) |
Called every frame and allows us to hook into the current running game mode. | |
const char * | GAME_GetModelForItem (const objDef_t *od, struct uiModel_s **menuModel) |
Get a model for an item. |
Shared game type headers.
Definition in file cl_game.h.
#define GAME_IsMultiplayer | ( | ) | (cls.gametype == GAME_MULTIPLAYER) |
Definition at line 41 of file cl_game.h.
Referenced by CL_FixCustomSkinIDX(), CL_GenerateCharacter(), CL_Reset(), CL_SendCommand(), and SP_worldspawn().
#define GAME_IsSingleplayer | ( | ) | (cls.gametype & GAME_SINGLEPLAYER) |
Definition at line 40 of file cl_game.h.
Referenced by CL_FixCustomSkinIDX(), Con_MessageModeSay_f(), and Con_MessageModeSayTeam_f().
#define GAME_MAX GAME_SKIRMISH |
Definition at line 38 of file cl_game.h.
Referenced by GAME_SetMode().
#define GAME_NONE 0 |
Definition at line 32 of file cl_game.h.
Referenced by CL_Shutdown(), GAME_Drop(), GAME_Exit_f(), GAME_GetCurrentType(), and GAME_ReloadMode().
void GAME_AppendTeamMember | ( | int | memberIndex, | |
const char * | teamDefID, | |||
const equipDef_t * | ed | |||
) |
Definition at line 87 of file cl_game.c.
References chr_list_s::chr, chrDisplayList, CL_GenerateCharacter(), cls, Com_Error(), inventoryInterface_s::EquipActor, ERR_DROP, GAME_GetCharacter(), character_s::i, client_static_s::i, chr_list_s::num, and character_s::teamDef.
Referenced by GAME_GenerateTeam(), and GAME_SK_Start_f().
void GAME_CharacterCvars | ( | const character_t * | chr | ) |
Definition at line 741 of file cl_game.c.
References GAME_GetCurrentType().
Referenced by CL_UpdateCharacterValues().
void GAME_DisplayItemInfo | ( | uiNode_t * | node, | |
const char * | string | |||
) |
Shows game type specific item information (if it's not resolvable via objDef_t
).
[in] | node | The menu node to show the information in. |
[in] | string | The id of the 'thing' to show information for. |
Definition at line 191 of file cl_game.c.
References GAME_GetCurrentType().
Referenced by UI_ItemNodeDraw().
void GAME_Drop | ( | void | ) |
Definition at line 757 of file cl_game.c.
References GAME_GetCurrentType(), GAME_NONE, GAME_SetMode(), qfalse, qtrue, SV_Shutdown(), and UI_InitStack().
Referenced by CL_Drop().
void GAME_EndBattlescape | ( | void | ) |
This is called when a client quits the battlescape.
Definition at line 168 of file cl_game.c.
References cls, Com_Printf(), inventoryInterface_s::GetUsedSlots, and client_static_s::i.
Referenced by CL_Disconnect().
void GAME_EndRoundAnnounce | ( | int | playerNum, | |
int | team | |||
) |
Send end round announcements.
playerNum | The server player number of the player that has ended the round | |
team | The team the player is in |
Definition at line 178 of file cl_game.c.
References GAME_GetCurrentType().
Referenced by CL_EndRoundAnnounce().
void GAME_Frame | ( | void | ) |
Called every frame and allows us to hook into the current running game mode.
Definition at line 781 of file cl_game.c.
References GAME_GetCurrentType().
Referenced by CL_Frame().
void GAME_GenerateTeam | ( | const char * | teamDefID, | |
const equipDef_t * | ed, | |||
int | teamMembers | |||
) |
Definition at line 104 of file cl_game.c.
References Com_Error(), ERR_DROP, GAME_AppendTeamMember(), GAME_GetCharacterArraySize(), GAME_ResetCharacters(), and i.
Referenced by GAME_MP_AutoTeam(), GAME_SK_Start_f(), and GAME_Spawn().
character_t* GAME_GetCharacter | ( | int | index | ) |
Returns a character that can be used to store the game type specific character values.
index | The index of the character array. This value must be greater than 0 and not bigger than the value GAME_GetCharacterArraySize returned |
Definition at line 58 of file cl_game.c.
References Com_Error(), ERR_DROP, and lengthof.
Referenced by GAME_AppendTeamMember(), and MP_LoadTeamMultiplayerInfo().
size_t GAME_GetCharacterArraySize | ( | void | ) |
Definition at line 71 of file cl_game.c.
References lengthof.
Referenced by GAME_GenerateTeam(), GAME_MP_AutoTeam(), GAME_SK_Start_f(), GAME_Spawn(), and MP_LoadTeamMultiplayerInfo().
int GAME_GetCurrentTeam | ( | void | ) |
Definition at line 710 of file cl_game.c.
References GAME_GetCurrentType(), and TEAM_DEFAULT.
equipDef_t* GAME_GetEquipmentDefinition | ( | void | ) |
Definition at line 720 of file cl_game.c.
References GAME_GetCurrentType(), and cgame_export_t::GetEquipmentDefinition().
Referenced by CL_InvReload(), MP_GetEquipment(), MP_LoadTeamMultiplayer(), and MP_SaveTeamMultiplayer().
Get a model for an item.
[in] | od | The object definition to get the model from. |
[out] | menuModel | The menu model pointer. |
NULL
. Definition at line 796 of file cl_game.c.
References GAME_GetCurrentType(), cgame_export_t::GetModelForItem(), objDef_s::model, and UI_GetUIModel().
Referenced by UI_DrawItem(), and UI_ItemNodeDraw().
const char* GAME_GetTeamDef | ( | void | ) |
Definition at line 629 of file cl_game.c.
References Cvar_GetString().
Referenced by E_CreateEmployeeAtIndex(), GAME_ItemIsUseable(), GAME_MP_AutoTeam(), GAME_SK_Start_f(), and GAME_Spawn().
void GAME_HandleResults | ( | struct dbuffer * | msg, | |
int | winner, | |||
int * | numSpawned, | |||
int * | numAlive, | |||
int | numKilled[][MAX_TEAMS], | |||
int | numStunned[][MAX_TEAMS] | |||
) |
After a mission was finished this function is called.
msg | The network message buffer | |
winner | The winning team | |
numSpawned | The amounts of all spawned actors per team | |
numAlive | The amount of survivors per team | |
numKilled | The amount of killed actors for all teams. The first dimension contains the attacker team, the second the victim team | |
numStunned | The amount of stunned actors for all teams. The first dimension contains the attacker team, the second the victim team |
Definition at line 512 of file cl_game.c.
References CL_Drop(), and GAME_GetCurrentType().
Referenced by CL_ParseResults().
void GAME_Init | ( | qboolean | load | ) |
void GAME_InitStartup | ( | void | ) |
Definition at line 834 of file cl_game.c.
References Cmd_AddCommand(), GAME_Abort_f(), GAME_Exit_f(), GAME_SetMode_f(), UI_ChangeMap_f(), UI_GetMaps_f(), and UI_SelectMap_f().
Referenced by CL_InitLocal().
Definition at line 485 of file cl_game.c.
References Com_GetTeamDefinitionByID(), GAME_GetCurrentType(), GAME_GetTeamDef(), GAME_IsArmourUseableForTeam(), qfalse, and qtrue.
Referenced by CL_ActorGetContainerForReload(), CL_ActorReload(), HUD_ShotReserve_f(), HUD_UpdateActorFireMode(), HUD_UpdateReactionFiremodes(), INV_DecreaseItem_f(), INV_IncreaseItem_f(), INV_ItemDescription(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), UI_ContainerItemIteratorNext(), UI_ContainerNodeUpdateEquipment(), and UI_GetItemTooltip().
void GAME_ReloadMode | ( | void | ) |
Definition at line 136 of file cl_game.c.
References GAME_GetCurrentType(), GAME_NONE, GAME_SetMode(), and cgame_export_t::gametype.
Referenced by GAME_SK_Restart_f(), SAV_GameLoad(), and VID_Restart_f().
void GAME_ResetCharacters | ( | void | ) |
Will reset (memset) all characters in the static character array.
Definition at line 81 of file cl_game.c.
References chrDisplayList, and chr_list_s::num.
Referenced by GAME_GenerateTeam(), and MP_LoadTeamMultiplayerInfo().
void GAME_SetMode | ( | int | gametype | ) |
Definition at line 293 of file cl_game.c.
References CL_Disconnect(), cls, Com_Printf(), csi, GAME_GetCurrentType(), GAME_MAX, client_static_s::gametype, client_static_s::i, INV_DestroyInventory(), INV_InitInventory(), cgame_export_t::name, qtrue, UI_InitStack(), and UI_IsWindowOnStack().
Referenced by CL_Shutdown(), GAME_Drop(), GAME_Exit_f(), GAME_ReloadMode(), and GAME_SetMode_f().
void GAME_SpawnSoldiers | ( | void | ) |
Called during startup of mission to send team info.
Definition at line 682 of file cl_game.c.
References cl, clc_stringcmd, cls, GAME_GetCurrentType(), GAME_InitializeBattlescape(), GAME_SendCurrentTeamSpawningInfo(), GAME_Spawn(), NET_WriteByte(), NET_WriteMsg(), NET_WriteString(), client_static_s::netStream, and new_dbuffer().
Referenced by CL_SpawnSoldiers_f().
void GAME_StartBattlescape | ( | qboolean | isTeamPlay | ) |
Called when the server sends the EV_START
event.
isTeamPlay | true if the game is a teamplay round. This can be interesting for multiplayer based game types |
Definition at line 152 of file cl_game.c.
References cls, Com_Printf(), GAME_GetCurrentType(), inventoryInterface_s::GetUsedSlots, client_static_s::i, mn_hud, qtrue, cvar_s::string, and UI_InitStack().
Referenced by CL_StartGame().
Definition at line 729 of file cl_game.c.
References GAME_GetCurrentType(), qfalse, and qtrue.
Referenced by CL_ActorAppear(), and CL_AddTargetingBox().