UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cl_game_skirmish.cpp File Reference

Skirmish game type implementation. More...

#include "../../cl_shared.h"
#include "../cl_game.h"
#include "cl_game_skirmish.h"
#include "../../ui/ui_data.h"

Go to the source code of this file.

Functions

static
CGAME_HARD_LINKED_FUNCTIONS
void 
GAME_SK_InitMissionBriefing (const char **title, linkedList_t **victoryConditionsMsgIDs, linkedList_t **missionBriefingMsgIDs)
 
static const char * GAME_SK_GetRandomMapAssemblyNameForCraft (const char *name)
 
static void GAME_SK_SetMissionParameters (const mapDef_t *md)
 Register some data in the shared client/server structs to ensure that e.g. every known alien race is used in a skirmish game. More...
 
static void GAME_SK_Start_f (void)
 Starts a new skirmish game. More...
 
static void GAME_SK_Restart_f (void)
 
static void GAME_SK_ChangeEquip_f (void)
 Changed the given cvar to the next/prev equipment definition. More...
 
static void GAME_SK_Results (dbuffer *msg, int winner, int *numSpawned, int *numAlive, int numKilled[][MAX_TEAMS], int numStunned[][MAX_TEAMS], bool nextmap)
 After a mission was finished this function is called. More...
 
static void GAME_SK_HideDropships (const linkedList_t *dropships)
 Hide the dropship selection or show it with the dropship given in the parameter. More...
 
static void GAME_SK_HideUFOs (const linkedList_t *ufos)
 Hide the ufo selection or show it with the ufos given in the parameter. More...
 
static const mapDef_tGAME_SK_MapInfo (int step)
 
static void GAME_InitMenuOptions (void)
 
static void GAME_SK_InitStartup (void)
 
static void GAME_SK_Shutdown (void)
 
const cgame_export_tGetCGameAPI (const cgame_import_t *import)
 

Variables

static cvar_tcl_equip
 
static const cgame_import_tcgi
 
static const cmdList_t skirmishCmds []
 

Detailed Description

Skirmish game type implementation.

Definition in file cl_game_skirmish.cpp.

Function Documentation

static const char* GAME_SK_GetRandomMapAssemblyNameForCraft ( const char *  name)
inlinestatic
static void GAME_SK_HideDropships ( const linkedList_t dropships)
inlinestatic

Hide the dropship selection or show it with the dropship given in the parameter.

Parameters
dropshipsif nullptr, the dropship selection panel will be hidden, otherwise it will be shown with the given list entries as content.

Definition at line 226 of file cl_game_skirmish.cpp.

References cgame_import_s::Cvar_Set(), linkedList_t::data, GAME_SK_GetRandomMapAssemblyNameForCraft(), OPTION_DROPSHIPS, and cgame_import_s::UI_GetOption().

Referenced by GAME_SK_MapInfo().

static void GAME_SK_HideUFOs ( const linkedList_t ufos)
inlinestatic

Hide the ufo selection or show it with the ufos given in the parameter.

Parameters
ufosif nullptr, the ufo selection panel will be hidden, otherwise it will be shown with the given list entries as content.

Definition at line 247 of file cl_game_skirmish.cpp.

References cgame_import_s::Cvar_Set(), linkedList_t::data, GAME_SK_GetRandomMapAssemblyNameForCraft(), OPTION_UFOS, and cgame_import_s::UI_GetOption().

Referenced by GAME_SK_MapInfo().

static CGAME_HARD_LINKED_FUNCTIONS void GAME_SK_InitMissionBriefing ( const char **  title,
linkedList_t **  victoryConditionsMsgIDs,
linkedList_t **  missionBriefingMsgIDs 
)
static
static void GAME_SK_InitStartup ( void  )
static
static void GAME_SK_Restart_f ( void  )
static

Definition at line 124 of file cl_game_skirmish.cpp.

References GAME_SK_Start_f().

static void GAME_SK_Results ( dbuffer msg,
int  winner,
int numSpawned,
int numAlive,
int  numKilled[][MAX_TEAMS],
int  numStunned[][MAX_TEAMS],
bool  nextmap 
)
static

After a mission was finished this function is called.

Parameters
msgThe network message buffer
winnerThe winning team
numSpawnedThe amounts of all spawned actors per team
numAliveThe amount of survivors per team
numKilledThe amount of killed actors for all teams. The first dimension contains the attacker team, the second the victim team
numStunnedThe amount of stunned actors for all teams. The first dimension contains the attacker team, the second the victim team
nextmapIndicates if there is another map to follow within the same msission

Definition at line 173 of file cl_game_skirmish.cpp.

References _, Com_sprintf(), i, MAX_TEAMS, TEAM_ALIEN, and TEAM_CIVILIAN.

Referenced by GetCGameAPI().

static void GAME_SK_SetMissionParameters ( const mapDef_t md)
static

Register some data in the shared client/server structs to ensure that e.g. every known alien race is used in a skirmish game.

Definition at line 59 of file cl_game_skirmish.cpp.

References csi_s::alienChrTemplates, csi_s::alienTeams, CHRSH_IsTeamDefAlien(), mapDef_s::civTeam, cgame_import_s::csi, cgame_import_s::Cvar_Set(), i, MAX_TEAMS_PER_MISSION, csi_s::numAlienTeams, csi_s::numTeamDefs, and csi_s::teamDef.

Referenced by GAME_SK_Start_f().

static void GAME_SK_Shutdown ( void  )
static

Definition at line 335 of file cl_game_skirmish.cpp.

References cgame_import_s::Cvar_ForceSet(), OPTION_DROPSHIPS, and OPTION_UFOS.

Referenced by GetCGameAPI().

Variable Documentation

const cgame_import_t* cgi
static

Definition at line 32 of file cl_game_skirmish.cpp.

cvar_t* cl_equip
static

Definition at line 31 of file cl_game_skirmish.cpp.

const cmdList_t skirmishCmds[]
static
Initial value:
= {
{"sk_start", GAME_SK_Start_f, "Start the new skirmish game"},
{"sk_prevequip", GAME_SK_ChangeEquip_f, "Previous equipment definition"},
{"sk_nextequip", GAME_SK_ChangeEquip_f, "Next equipment definition"},
{"sk_initequip", GAME_SK_ChangeEquip_f, "Init equipment definition"},
{"game_go", GAME_SK_Restart_f, "Restart the skirmish mission"},
{nullptr, nullptr, nullptr}
}
static void GAME_SK_ChangeEquip_f(void)
Changed the given cvar to the next/prev equipment definition.
static void GAME_SK_Restart_f(void)
static void GAME_SK_Start_f(void)
Starts a new skirmish game.

Definition at line 317 of file cl_game_skirmish.cpp.