Singleplayer campaign game type code. More...
#include "client.h"
#include "cl_game.h"
#include "cl_team.h"
#include "campaign/cp_campaign.h"
#include "campaign/cp_missions.h"
#include "campaign/cp_mission_triggers.h"
#include "campaign/cp_team.h"
#include "ui/ui_main.h"
#include "ui/ui_nodes.h"
#include "ui/node/ui_node_model.h"
#include "ui/node/ui_node_text.h"
Go to the source code of this file.
Defines | |
#define | MAXCAMPAIGNTEXT 4096 |
Functions | |
static void | GAME_CP_MissionAutoGo_f (void) |
static void | GAME_CP_MissionAutoCheck_f (void) |
Checks whether you have to play this mission You can mark a mission as story related. If a mission is story related the cvar cp_mission_autogo_available is set to 0 If this cvar is 1 - the mission dialog will have a auto mission button. | |
static void | GAME_CP_Results_f (void) |
static const char * | CP_ToDifficultyName (int difficulty) |
Translate the difficulty int to a translated string. | |
static void | GAME_CP_GetCampaigns_f (void) |
Fill the campaign list with available campaigns. | |
static void | GAME_CP_CampaignListClick_f (void) |
Script function to select a campaign from campaign list. | |
static void | GAME_CP_Start_f (void) |
Starts a new single-player game. | |
void | GAME_CP_Results (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. | |
qboolean | GAME_CP_Spawn (void) |
const mapDef_t * | GAME_CP_MapInfo (int step) |
qboolean | GAME_CP_ItemIsUseable (const objDef_t *od) |
int | GAME_CP_GetTeam (void) |
qboolean | GAME_CP_TeamIsKnown (const teamDef_t *teamDef) |
Checks whether the team is known at this stage already. | |
void | GAME_CP_Drop (void) |
void | GAME_CP_Frame (void) |
const char * | GAME_CP_GetModelForItem (const objDef_t *od) |
Sets the item model for an object assigned technology. If no technology is set or the technology has no model assigned, this function is returning NULL to tell the caller to use the default object model. | |
void | GAME_CP_InitializeBattlescape (const chrList_t *team) |
Changes some actor states for a campaign game. | |
equipDef_t * | GAME_CP_GetEquipmentDefinition (void) |
void | GAME_CP_CharacterCvars (const character_t *chr) |
void | GAME_CP_DisplayItemInfo (uiNode_t *node, const char *string) |
void | GAME_CP_InitStartup (void) |
void | GAME_CP_Shutdown (void) |
Variables | |
static char | campaignDesc [MAXCAMPAIGNTEXT] |
Singleplayer campaign game type code.
Definition in file cl_game_campaign.c.
#define MAXCAMPAIGNTEXT 4096 |
Definition at line 135 of file cl_game_campaign.c.
static const char* CP_ToDifficultyName | ( | int | difficulty | ) | [inline, static] |
Translate the difficulty int to a translated string.
difficulty | the difficulty integer value |
Definition at line 111 of file cl_game_campaign.c.
References _, Com_Error(), and ERR_DROP.
Referenced by GAME_CP_CampaignListClick_f().
static void GAME_CP_CampaignListClick_f | ( | void | ) | [static] |
Script function to select a campaign from campaign list.
Definition at line 170 of file cl_game_campaign.c.
References _, campaignDesc, ccs_s::campaigns, ccs, Cmd_Argc(), Cmd_Argv(), Com_Printf(), Com_sprintf(), CP_ToDifficultyName(), campaign_s::credits, Cvar_Set(), campaign_s::difficulty, campaign_s::id, campaign_s::minhappiness, campaign_s::name, campaign_s::negativeCreditsUntilLost, ngettext, ccs_s::numCampaigns, campaign_s::scientists, campaign_s::soldiers, campaign_s::team, TEAM_PHALANX, campaign_s::text, TEXT_STANDARD, UI_GetNodeByPath(), UI_RegisterText(), UI_TextNodeSelectLine(), campaign_s::visible, and campaign_s::workers.
Referenced by GAME_CP_InitStartup().
void GAME_CP_CharacterCvars | ( | const character_t * | chr | ) |
Definition at line 450 of file cl_game_campaign.c.
References _, chrScoreGlobal_s::assignedMissions, CL_GetRankByIdx(), Com_sprintf(), Cvar_Set(), rank_s::image, KILLED_CIVILIANS, KILLED_ENEMIES, KILLED_TEAM, chrScoreGlobal_s::kills, MAX_VAR, rank_s::name, chrScoreGlobal_s::rank, character_s::score, and va().
void GAME_CP_DisplayItemInfo | ( | uiNode_t * | node, | |
const char * | string | |||
) |
Definition at line 470 of file cl_game_campaign.c.
References AIR_GetAircraftSilent(), Com_Printf(), technology_s::mdl, RS_GetTechByProvided(), aircraft_s::tech, and UI_DrawModelNode().
void GAME_CP_Drop | ( | void | ) |
Definition at line 386 of file cl_game_campaign.c.
References CL_Disconnect(), qfalse, qtrue, SV_Shutdown(), and UI_InitStack().
void GAME_CP_Frame | ( | void | ) |
Definition at line 395 of file cl_game_campaign.c.
References CL_CampaignRun(), cls, key_console, and client_static_s::keyDest.
static void GAME_CP_GetCampaigns_f | ( | void | ) | [static] |
Fill the campaign list with available campaigns.
Definition at line 140 of file cl_game_campaign.c.
References _, campaignDesc, ccs_s::campaigns, ccs, Cmd_ExecuteString(), i, campaign_s::id, LIST_AddString(), campaign_s::name, ccs_s::numCampaigns, TEXT_CAMPAIGN_LIST, TEXT_STANDARD, UI_RegisterLinkedListText(), UI_RegisterText(), va(), and campaign_s::visible.
Referenced by GAME_CP_InitStartup().
equipDef_t* GAME_CP_GetEquipmentDefinition | ( | void | ) |
Definition at line 445 of file cl_game_campaign.c.
References ccs, and ccs_s::eMission.
const char* GAME_CP_GetModelForItem | ( | const objDef_t * | od | ) |
Sets the item model for an object assigned technology. If no technology is set or the technology has no model assigned, this function is returning NULL
to tell the caller to use the default object model.
[in] | od | The object definition to get the model from. |
[out] | menuModel | The menu model pointer. |
NULL
. Definition at line 413 of file cl_game_campaign.c.
References technology_s::mdl, and RS_GetTechForItem().
int GAME_CP_GetTeam | ( | void | ) |
Definition at line 364 of file cl_game_campaign.c.
References ccs, ccs_s::curCampaign, and campaign_s::team.
void GAME_CP_InitializeBattlescape | ( | const chrList_t * | team | ) |
Changes some actor states for a campaign game.
team | The team to change the states for |
Definition at line 428 of file cl_game_campaign.c.
References chr_list_s::chr, clc_initactorstates, cls, i, NET_WriteByte(), NET_WriteMsg(), NET_WriteShort(), client_static_s::netStream, new_dbuffer(), chr_list_s::num, character_s::state, and character_s::ucn.
void GAME_CP_InitStartup | ( | void | ) |
Definition at line 485 of file cl_game_campaign.c.
References CL_ReadSinglePlayerData(), CL_ResetSinglePlayerData(), Cmd_AddCommand(), cp_campaign, CP_InitStartup(), cp_start_employees, CVAR_ARCHIVE, Cvar_ForceSet(), Cvar_Get(), GAME_CP_CampaignListClick_f(), GAME_CP_GetCampaigns_f(), GAME_CP_MissionAutoCheck_f(), GAME_CP_MissionAutoGo_f(), GAME_CP_Results_f(), and GAME_CP_Start_f().
Definition at line 358 of file cl_game_campaign.c.
References RS_GetTechForItem(), and RS_IsResearched_ptr().
const mapDef_t* GAME_CP_MapInfo | ( | int | step | ) |
Definition at line 353 of file cl_game_campaign.c.
References cls, Com_GetMapDefByIDX(), and client_static_s::currentSelectedMap.
static void GAME_CP_MissionAutoCheck_f | ( | void | ) | [static] |
Checks whether you have to play this mission You can mark a mission as story related. If a mission is story related the cvar cp_mission_autogo_available
is set to 0
If this cvar is 1
- the mission dialog will have a auto mission button.
Definition at line 65 of file cl_game_campaign.c.
References ccs, Com_DPrintf(), Cvar_Set(), DEBUG_CLIENT, ccs_s::interceptAircraft, mission_s::mapDef, ccs_s::selectedMission, and mapDef_s::storyRelated.
Referenced by GAME_CP_InitStartup().
static void GAME_CP_MissionAutoGo_f | ( | void | ) | [static] |
Definition at line 42 of file cl_game_campaign.c.
References ccs, CL_GameAutoGo(), Com_DPrintf(), Com_Printf(), DEBUG_CLIENT, ccs_s::missionAircraft, and ccs_s::selectedMission.
Referenced by GAME_CP_InitStartup().
void GAME_CP_Results | ( | 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 246 of file cl_game_campaign.c.
References AII_CollectingItems(), AL_CollectingAliens(), missionResults_s::aliensKilled, ccs_s::aliensKilled, missionResults_s::aliensStunned, missionResults_s::aliensSurvived, ccs, missionResults_s::civiliansKilled, missionResults_s::civiliansKilledFriendlyFire, missionResults_s::civiliansSurvived, CL_Disconnect(), cls, CP_ExecuteMissionTrigger(), CP_InitMissionResults(), CP_ParseCharacterData(), i, ccs_s::missionAircraft, ccs_s::missionResults, missionResults_s::ownKilled, missionResults_s::ownKilledFriendlyFire, missionResults_s::ownStunned, missionResults_s::ownSurvived, qfalse, qtrue, ccs_s::selectedMission, SV_Shutdown(), client_static_s::team, TEAM_CIVILIAN, UI_InitStack(), and UI_PushWindow().
static void GAME_CP_Results_f | ( | void | ) | [static] |
Definition at line 86 of file cl_game_campaign.c.
References ccs, Cmd_Argc(), Cmd_Argv(), Com_ParseBoolean(), Com_Printf(), CP_MissionEnd(), CP_StartSelectedMission(), Cvar_GetInteger(), and ccs_s::selectedMission.
Referenced by GAME_CP_InitStartup().
void GAME_CP_Shutdown | ( | void | ) |
Definition at line 507 of file cl_game_campaign.c.
References CL_ResetSinglePlayerData(), Cmd_RemoveCommand(), CP_CampaignExit(), qfalse, and SV_Shutdown().
qboolean GAME_CP_Spawn | ( | void | ) |
Definition at line 326 of file cl_game_campaign.c.
References aircraft_s::acTeam, ccs, employee_s::chr, cl, CL_CleanTempInventory(), linkedList_s::data, aircraft_s::homebase, ccs_s::missionAircraft, mn_hud, linkedList_s::next, qfalse, qtrue, cvar_s::string, and UI_InitStack().
static void GAME_CP_Start_f | ( | void | ) | [static] |
Starts a new single-player game.
Definition at line 222 of file cl_game_campaign.c.
References Cbuf_AddText(), CL_GetCampaign(), cp_campaign, CP_CampaignInit(), qfalse, and cvar_s::string.
Referenced by GAME_CP_InitStartup().
Checks whether the team is known at this stage already.
[in] | teamDef | The team definition of the alien team |
true
if known, false
otherwise. Definition at line 375 of file cl_game_campaign.c.
References ccs, CHRSH_IsTeamDefAlien(), Com_Error(), ERR_DROP, teamDef_s::id, teamDef_s::idx, qtrue, RS_IsResearched_ptr(), and ccs_s::teamDefTechs.
char campaignDesc[MAXCAMPAIGNTEXT] [static] |
Definition at line 136 of file cl_game_campaign.c.
Referenced by GAME_CP_CampaignListClick_f(), and GAME_CP_GetCampaigns_f().