UFO: Alien Invasion
Loading...
Searching...
No Matches
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"
Include dependency graph for cl_game_skirmish.cpp:

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.
static void GAME_SK_Start_f (void)
 Starts a new skirmish game.
static void GAME_SK_Restart_f (void)
static void GAME_SK_ChangeEquip_f (void)
 Changed the given cvar to the next/prev equipment definition.
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.
static void GAME_SK_HideDropships (const linkedList_t *dropships)
 Hide the dropship selection or show it with the dropship given in the parameter.
static void GAME_SK_HideUFOs (const linkedList_t *ufos)
 Hide the ufo selection or show it with the ufos given in the parameter.
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

◆ GAME_InitMenuOptions()

void GAME_InitMenuOptions ( void )
static

◆ GAME_SK_ChangeEquip_f()

void GAME_SK_ChangeEquip_f ( void )
static

Changed the given cvar to the next/prev equipment definition.

Definition at line 133 of file cl_game_skirmish.cpp.

References BACKWARD, cgi, Com_sprintf(), FORWARD, equipDef_t::id, INIT, MAX_VAR, equipDef_t::name, Q_streq, and type.

◆ GAME_SK_GetRandomMapAssemblyNameForCraft()

const char * GAME_SK_GetRandomMapAssemblyNameForCraft ( const char * name)
inlinestatic

Definition at line 50 of file cl_game_skirmish.cpp.

References cgi, and name.

Referenced by GAME_InitMenuOptions(), GAME_SK_HideDropships(), and GAME_SK_HideUFOs().

◆ GAME_SK_HideDropships()

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 cgi, linkedList_t::data, GAME_SK_GetRandomMapAssemblyNameForCraft(), and OPTION_DROPSHIPS.

Referenced by GAME_SK_MapInfo().

◆ GAME_SK_HideUFOs()

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 cgi, linkedList_t::data, GAME_SK_GetRandomMapAssemblyNameForCraft(), and OPTION_UFOS.

Referenced by GAME_SK_MapInfo().

◆ GAME_SK_InitMissionBriefing()

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

◆ GAME_SK_InitStartup()

void GAME_SK_InitStartup ( void )
static

Definition at line 325 of file cl_game_skirmish.cpp.

References cgi, cl_equip, GAME_InitMenuOptions(), and skirmishCmds.

Referenced by GetCGameAPI().

◆ GAME_SK_MapInfo()

const mapDef_t * GAME_SK_MapInfo ( int step)
static

◆ GAME_SK_Restart_f()

void GAME_SK_Restart_f ( void )
static

Definition at line 124 of file cl_game_skirmish.cpp.

References cgi, and GAME_SK_Start_f().

◆ GAME_SK_Results()

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 _, cgi, Com_sprintf(), i, MAX_TEAMS, TEAM_ALIEN, and TEAM_CIVILIAN.

Referenced by GetCGameAPI().

◆ GAME_SK_SetMissionParameters()

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 cgi, CHRSH_IsTeamDefAlien(), mapDef_t::civTeam, i, and MAX_TEAMS_PER_MISSION.

Referenced by GAME_SK_Start_f().

◆ GAME_SK_Shutdown()

void GAME_SK_Shutdown ( void )
static

Definition at line 335 of file cl_game_skirmish.cpp.

References cgi, OPTION_DROPSHIPS, OPTION_UFOS, and skirmishCmds.

Referenced by GetCGameAPI().

◆ GAME_SK_Start_f()

void GAME_SK_Start_f ( void )
static

Starts a new skirmish game.

Todo
make the teamdef configurable

Definition at line 86 of file cl_game_skirmish.cpp.

References cgi, GAME_SK_SetMissionParameters(), i, mapDef_t::mapTheme, name, and mapDef_t::params.

Referenced by GAME_SK_Restart_f().

◆ GetCGameAPI()

Variable Documentation

◆ cgi

const cgame_import_t* cgi
static

Definition at line 32 of file cl_game_skirmish.cpp.

◆ cl_equip

cvar_t* cl_equip
static

Definition at line 31 of file cl_game_skirmish.cpp.

Referenced by GAME_SK_InitStartup().

◆ skirmishCmds

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.

Referenced by GAME_SK_InitStartup(), and GAME_SK_Shutdown().