cl_game_campaign.c File Reference

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"
Include dependency graph for cl_game_campaign.c:

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_tGAME_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_tGAME_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]

Detailed Description

Singleplayer campaign game type code.

Definition in file cl_game_campaign.c.


Define Documentation

#define MAXCAMPAIGNTEXT   4096

Definition at line 135 of file cl_game_campaign.c.


Function Documentation

static const char* CP_ToDifficultyName ( int  difficulty  )  [inline, static]

Translate the difficulty int to a translated string.

Parameters:
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]
void GAME_CP_CharacterCvars ( const character_t chr  ) 
void GAME_CP_DisplayItemInfo ( uiNode_t node,
const char *  string 
)
void GAME_CP_Drop ( void   ) 

Todo:
maybe create a savegame?

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]
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.

Parameters:
[in] od The object definition to get the model from.
[out] menuModel The menu model pointer.
Returns:
The model path for the item. Never 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.

Parameters:
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   ) 
qboolean GAME_CP_ItemIsUseable ( const objDef_t od  ) 

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

See also:
GAME_CP_MissionAutoGo_f

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]
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.

Parameters:
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]
void GAME_CP_Shutdown ( void   ) 
qboolean GAME_CP_Spawn ( void   ) 
static void GAME_CP_Start_f ( void   )  [static]

Starts a new single-player game.

See also:
CP_CampaignInit
CP_InitMarket

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().

qboolean GAME_CP_TeamIsKnown ( const teamDef_t teamDef  ) 

Checks whether the team is known at this stage already.

Parameters:
[in] teamDef The team definition of the alien team
Returns:
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.


Variable Documentation

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().


Generated by  doxygen 1.6.2