Single player campaign control. More...
#include "../client.h"
#include "../ui/ui_main.h"
#include "cp_campaign.h"
#include "cp_overlay.h"
#include "cp_mapfightequip.h"
#include "cp_hospital.h"
#include "cp_hospital_callbacks.h"
#include "cp_base_callbacks.h"
#include "cp_basedefence_callbacks.h"
#include "cp_team.h"
#include "cp_team_callbacks.h"
#include "cp_popup.h"
#include "cp_map.h"
#include "cp_ufo.h"
#include "cp_installation_callbacks.h"
#include "cp_alien_interest.h"
#include "cp_missions.h"
#include "cp_mission_triggers.h"
#include "cp_nations.h"
#include "cp_statistics.h"
#include "cp_time.h"
#include "cp_xvi.h"
#include "cp_aircraft_callbacks.h"
#include "cp_fightequip_callbacks.h"
#include "cp_produce_callbacks.h"
#include "cp_transfer_callbacks.h"
#include "cp_employee_callbacks.h"
#include "cp_market_callbacks.h"
#include "cp_research_callbacks.h"
#include "cp_uforecovery_callbacks.h"
#include "save/save_campaign.h"
Go to the source code of this file.
Data Structures | |
struct | updateCharacter_t |
Defines | |
#define | XVI_LOST_START_PERCENTAGE 0.20f |
#define | XVI_WON_START_PERCENTAGE 0.05f |
#define | MAX_CREDITS 10000000 |
Functions | |
void | CP_ParseCharacterData (struct dbuffer *msg) |
Parses the character data which was send by G_MatchSendResults using G_SendCharacterData. | |
qboolean | CP_IsRunning (void) |
Checks whether a campaign mode game is running. | |
static qboolean | CP_MapIsSelectable (mission_t *mission, int mapIdx, const vec2_t pos) |
Check if a map may be selected for mission. | |
qboolean | CP_ChooseMap (mission_t *mission, const vec2_t pos) |
Choose a map for given mission. | |
void | CP_EndCampaign (qboolean won) |
Function to handle the campaign end. | |
void | CP_CheckLostCondition (void) |
Checks whether the player has lost the campaign. | |
void | CL_HandleNationData (qboolean won, mission_t *mis) |
Updates each nation's happiness and mission win/loss stats. Should be called at the completion or expiration of every mission. The nation where the mission took place will be most affected, surrounding nations will be less affected. | |
static void | CP_CheckMissionEnd (void) |
Check for missions that have a timeout defined. | |
const char * | CL_SecondConvert (int second) |
Converts a number of second into a char to display. | |
void | CL_DateConvert (const date_t *date, byte *day, byte *month, short *year) |
Converts a number of days into the number of the current month and the current day in this month. | |
int | CL_DateCreateDay (const short years, const byte months, const byte days) |
Converts a number of years+months+days into an "day" integer as used in date_t. | |
int | CL_DateCreateSeconds (byte hours, byte minutes, byte seconds) |
Converts a number of hours+minutes+seconds into an "sec" integer as used in date_t. | |
void | CL_DateConvertLong (const date_t *date, dateLong_t *dateLong) |
Converts a date from the engine in a (longer) human-readable format. | |
static void | CL_CampaignFunctionPeriodicCall (int dt, qboolean updateRadarOverlay) |
Functions that should be called with a minimum time lapse (will be called at least every DETECTION_INTERVAL). | |
qboolean | CP_OnGeoscape (void) |
void | CL_CampaignRun (void) |
Called every frame when we are in geoscape view. | |
void | CL_UpdateCredits (int credits) |
Sets credits and update mn_credits cvar. | |
static qboolean | CP_LoadMapDefStatXML (mxml_node_t *parent) |
Load mapDef statistics. | |
qboolean | CP_LoadXML (mxml_node_t *parent) |
Load callback for savegames in XML Format. | |
static qboolean | CP_SaveMapDefStatXML (mxml_node_t *parent) |
Save mapDef statistics. | |
qboolean | CP_SaveXML (mxml_node_t *parent) |
Save callback for savegames in XML Format. | |
void | CP_StartSelectedMission (void) |
Starts a selected mission. | |
static float | CP_GetWinProbabilty (const mission_t *mis, const base_t *base, const aircraft_t *aircraft) |
Calculates the win probability for an auto mission. | |
static void | CL_AutoMissionAlienCollect (aircraft_t *aircraft) |
Collect alien bodies for auto missions. | |
void | CL_GameAutoGo (mission_t *mission) |
Handles the auto mission for none storyrelated missions. | |
void | CP_InitMissionResults (qboolean won) |
static qboolean | CL_ShouldUpdateSoldierRank (const rank_t *rank, const character_t *chr) |
Checks whether a soldier should be promoted. | |
void | CL_UpdateCharacterStats (const base_t *base, const aircraft_t *aircraft) |
Update employees stats after mission. | |
static void | CP_AddCampaignCallbackCommands (void) |
registers callback commands that are used by campaign | |
static void | CP_AddCampaignCommands (void) |
static void | CP_RemoveCampaignCallbackCommands (void) |
registers callback commands that are used by campaign | |
static void | CP_RemoveCampaignCommands (void) |
void | CP_CampaignInit (campaign_t *campaign, qboolean load) |
Called at new game and load game. | |
void | CP_CampaignExit (void) |
campaign_t * | CL_GetCampaign (const char *name) |
Returns the campaign pointer from global campaign array. | |
void | CL_ResetSinglePlayerData (void) |
Will clear most of the parsed singleplayer data. | |
void | CP_GetRandomPosOnGeoscape (vec2_t pos, qboolean noWater) |
Determines a random position on geoscape. | |
qboolean | CP_GetRandomPosOnGeoscapeWithParameters (vec2_t pos, const linkedList_t *terrainTypes, const linkedList_t *cultureTypes, const linkedList_t *populationTypes, const linkedList_t *nations) |
Determines a random position on geoscape that fulfills certain criteria given via parameters. | |
int | CP_GetSalaryAdministrative (void) |
int | CP_GetSalaryBaseEmployee (employeeType_t type) |
int | CP_GetSalaryAdminEmployee (employeeType_t type) |
int | CP_GetSalaryRankBonusEmployee (employeeType_t type) |
int | CP_GetSalaryUpKeepBase (const base_t *base) |
void | CP_InitStartup (void) |
Variables | |
struct memPool_s * | cp_campaignPool |
ccs_t | ccs |
cvar_t * | cp_campaign |
cvar_t * | cp_start_employees |
cvar_t * | cp_missiontest |
static const int | monthLength [MONTHS_PER_YEAR] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
const int | DETECTION_INTERVAL = (SECONDS_PER_HOUR / 2) |
delay between actions that must be executed independently of time scale | |
static const cmdList_t | game_commands [] |
Single player campaign control.
Definition in file cp_campaign.c.
#define MAX_CREDITS 10000000 |
Definition at line 736 of file cp_campaign.c.
Referenced by CL_UpdateCredits().
#define XVI_LOST_START_PERCENTAGE 0.20f |
Definition at line 385 of file cp_campaign.c.
#define XVI_WON_START_PERCENTAGE 0.05f |
Definition at line 386 of file cp_campaign.c.
static void CL_AutoMissionAlienCollect | ( | aircraft_t * | aircraft | ) | [static] |
Collect alien bodies for auto missions.
Definition at line 1072 of file cp_campaign.c.
References _, AL_AddAlienTypeToAircraftCargo(), battleParam_s::aliens, battleParam_s::alienTeamGroup, alienTeamGroup_s::alienTeams, ccs_s::battleParameters, i, MAX_CARGO, MS_AddNewMessage(), MSG_STANDARD, alienTeamGroup_s::numAlienTeams, qfalse, and qtrue.
Referenced by CL_GameAutoGo().
static void CL_CampaignFunctionPeriodicCall | ( | int | dt, | |
qboolean | updateRadarOverlay | |||
) | [static] |
Functions that should be called with a minimum time lapse (will be called at least every DETECTION_INTERVAL).
[in] | dt | Ellapsed second since last call. |
[in] | updateRadarOverlay | true if radar overlay should be updated (only for drawing purpose) |
Definition at line 586 of file cp_campaign.c.
References AB_UpdateStealthForAllBase(), AIRFIGHT_CampaignRunBaseDefence(), AIRFIGHT_CampaignRunProjectiles(), CL_CampaignRunAircraft(), CP_CheckNewMissionDetectedOnGeoscape(), UFO_CampaignCheckEvents(), UFO_CampaignRunUFOs(), and UFO_UpdateAlienInterestForAllBasesAndInstallations().
Referenced by CL_CampaignRun().
void CL_CampaignRun | ( | void | ) |
Called every frame when we are in geoscape view.
Definition at line 624 of file cp_campaign.c.
References AB_BaseSearchedByNations(), AII_RepairAircraft(), AII_UpdateInstallationDelay(), B_UpdateBaseData(), BDEF_AutoSelectTarget(), CL_CampaignFunctionPeriodicCall(), CL_CampaignRunMarket(), CL_DateConvertLong(), CL_IsTimeStopped(), CL_UpdateTime(), cls, Cmd_ExecuteString(), CP_CheckCampaignEvents(), CP_CheckLostCondition(), CP_CheckMissionEnd(), CP_IncreaseAlienInterest(), CP_IsRunning(), CP_NationBackupMonthlyData(), CP_NationHandleBudget(), CP_OnGeoscape(), CP_ReduceXVIEverywhere(), CP_SpawnNewMissions(), CP_SpreadXVI(), CP_UpdateNationXVIInfection(), CP_UpdateXVIMapButton(), ccs_s::date, dateLong_s::day, date_s::day, DETECTION_INTERVAL, client_static_s::frametime, ccs_s::gameTimeScale, HOS_HospitalRun(), i, INS_UpdateInstallationData(), int(), NAT_UpdateHappinessForAllNations(), ccs_s::numBases, ccs_s::paid, PR_ProductionRun(), qfalse, qtrue, RS_ResearchRun(), date_s::sec, SECONDS_PER_DAY, SECONDS_PER_HOUR, SECONDS_PER_MINUTE, ccs_s::timer, TR_TransferCheck(), UP_GetUnreadMails(), and UR_ProcessActive().
Referenced by GAME_CP_Frame().
Converts a number of days into the number of the current month and the current day in this month.
[in] | date | Contains the number of days to be converted. |
[out] | day | The day in the month above. |
[out] | month | The month. [1-12] |
[out] | year | The year. |
< Return month in range [1-12]
Definition at line 494 of file cp_campaign.c.
References byte, date_s::day, DAYS_PER_YEAR, i, monthLength, and MONTHS_PER_YEAR.
Referenced by CL_DateConvertLong().
void CL_DateConvertLong | ( | const date_t * | date, | |
dateLong_t * | dateLong | |||
) |
Converts a date from the engine in a (longer) human-readable format.
[in] | date | Contains the date to be converted. |
[out] | dateLong | The converted date. |
Definition at line 571 of file cp_campaign.c.
References CL_DateConvert(), dateLong_s::day, dateLong_s::hour, dateLong_s::min, dateLong_s::month, dateLong_s::sec, date_s::sec, SECONDS_PER_HOUR, and dateLong_s::year.
Referenced by CL_CampaignRun(), CL_EventAddMail_f(), CL_UpdateTime(), MS_TimestampedText(), SAV_GameSave(), UP_OpenMail_f(), and UP_SetMailHeader().
Converts a number of years+months+days into an "day" integer as used in date_t.
[in] | years | The number of years to sum up. |
[in] | months | The number of months to sum up [1-12] |
[in] | days | The number of days to sum up. |
Definition at line 526 of file cp_campaign.c.
References DAYS_PER_YEAR, i, and monthLength.
Converts a number of hours+minutes+seconds into an "sec" integer as used in date_t.
[in] | hours | The number of hours to sum up. |
[in] | minutes | The number of minutes to sum up. |
[in] | seconds | The number of seconds to sum up. |
Definition at line 550 of file cp_campaign.c.
References SECONDS_PER_HOUR.
void CL_GameAutoGo | ( | mission_t * | mission | ) |
Handles the auto mission for none storyrelated missions.
Definition at line 1107 of file cp_campaign.c.
References _, mission_s::active, AIR_GetTeamSize(), battleParam_s::aliens, missionResults_s::aliensKilled, missionResults_s::aliensStunned, missionResults_s::aliensSurvived, ccs_s::battleParameters, battleParam_s::civilians, missionResults_s::civiliansKilled, missionResults_s::civiliansKilledFriendlyFire, missionResults_s::civiliansSurvived, CL_AutoMissionAlienCollect(), CL_HandleNationData(), Com_DPrintf(), CP_CheckLostCondition(), CP_CreateBattleParameters(), CP_ExecuteMissionTrigger(), CP_GetWinProbabilty(), CP_InitMissionResults(), CP_MissionEndActions(), Cvar_Set(), Cvar_SetValue(), mission_s::data, DEBUG_CLIENT, frand(), aircraft_s::homebase, ccs_s::interceptAircraft, MAP_ResetAction(), mission_s::mapDef, ccs_s::missionResults, MS_AddNewMessage(), MSG_STANDARD, missionResults_s::ownKilled, missionResults_s::ownKilledFriendlyFire, missionResults_s::ownStunned, missionResults_s::ownSurvived, qfalse, missionResults_s::recovery, mission_s::stage, STAGE_BASE_ATTACK, mapDef_s::storyRelated, UI_PopWindow(), and UI_PushWindow().
Referenced by GAME_CP_MissionAutoGo_f().
campaign_t* CL_GetCampaign | ( | const char * | name | ) |
Returns the campaign pointer from global campaign array.
name | Name of the campaign |
Definition at line 1576 of file cp_campaign.c.
References ccs_s::campaigns, Com_Printf(), campaign_s::id, and ccs_s::numCampaigns.
Referenced by CL_ParseResearchableCampaignStates(), CL_ParseResearchedCampaignItems(), CP_LoadXML(), and GAME_CP_Start_f().
Updates each nation's happiness and mission win/loss stats. Should be called at the completion or expiration of every mission. The nation where the mission took place will be most affected, surrounding nations will be less affected.
Definition at line 396 of file cp_campaign.c.
References missionResults_s::aliensKilled, missionResults_s::aliensStunned, missionResults_s::aliensSurvived, ccs_s::battleParameters, ccs_s::campaignStats, missionResults_s::civiliansKilled, missionResults_s::civiliansKilledFriendlyFire, missionResults_s::civiliansSurvived, Com_DPrintf(), DEBUG_CLIENT, nationInfo_s::happiness, HAPPINESS_MAX_MISSION_IMPACT, i, nation_s::id, mission_s::id, ccs_s::missionResults, stats_s::missionsLost, stats_s::missionsWon, NAT_SetHappiness(), battleParam_s::nation, ccs_s::nations, ccs_s::numNations, and nation_s::stats.
Referenced by CL_GameAutoGo(), and CP_MissionEnd().
void CL_ResetSinglePlayerData | ( | void | ) |
Will clear most of the parsed singleplayer data.
Definition at line 1597 of file cp_campaign.c.
References aircraft_s::acTeam, AIR_GetNextFromBase(), base_s::aircraft, ccs_s::alienBases, ccs_s::alienCategories, ccs_s::alienTeams, B_GetBaseByIDX(), CHRSH_IsTeamDefAlien(), ccs_s::cities, CL_FreeDynamicEventMail(), cls, Com_GetMapDefByIDX(), cp_messageStack, csi, E_ResetEmployees(), alienTeamCategory_s::equipment, LIST_Delete(), Mem_FreePool, ccs_s::missions, ccs_s::numAlienCategories, ccs_s::numAliensTD, ccs_s::numBases, client_static_s::numMDs, csi_s::numTeamDefs, RS_ResetTechs(), ccs_s::storedUFOs, td, csi_s::teamDef, and mapDef_s::timesAlreadyUsed.
Referenced by GAME_CP_InitStartup(), and GAME_CP_Shutdown().
const char* CL_SecondConvert | ( | int | second | ) |
Converts a number of second into a char to display.
[in] | second | Number of second. |
Definition at line 474 of file cp_campaign.c.
References Com_sprintf(), and SECONDS_PER_HOUR.
Referenced by CL_DisplayPopupInterceptMission(), and MAP_GetAircraftText().
static qboolean CL_ShouldUpdateSoldierRank | ( | const rank_t * | rank, | |
const character_t * | chr | |||
) | [static] |
Checks whether a soldier should be promoted.
[in] | rank | The rank to check for |
[in] | chr | The character to check a potential promotion for |
Definition at line 1224 of file cp_campaign.c.
References ABILITY_MIND, EMPL_SOLDIER, KILLED_CIVILIANS, KILLED_ENEMIES, KILLED_TEAM, rank_s::killedEnemies, rank_s::killedOthers, chrScoreGlobal_s::kills, rank_s::mind, qfalse, qtrue, character_s::score, chrScoreGlobal_s::skills, and rank_s::type.
Referenced by CL_UpdateCharacterStats().
void CL_UpdateCharacterStats | ( | const base_t * | base, | |
const aircraft_t * | aircraft | |||
) |
Update employees stats after mission.
[in] | base | The base where the team lives. |
[in] | aircraft | The aircraft used for the mission. |
Definition at line 1250 of file cp_campaign.c.
References _, AIR_IsEmployeeInAircraft(), chrScoreGlobal_s::assignedMissions, employee_s::chr, cl, CL_GetRankByIdx(), CL_ShouldUpdateSoldierRank(), Com_DPrintf(), Com_sprintf(), cp_messageBuffer, DEBUG_CLIENT, E_GetNextFromBase(), EMPL_SOLDIER, aircraft_s::homebase, character_s::HP, MS_AddNewMessage(), MSG_PROMOTION, rank_s::name, character_s::name, base_s::name, ccs_s::numRanks, qfalse, chrScoreGlobal_s::rank, and character_s::score.
Referenced by CP_MissionEnd().
void CL_UpdateCredits | ( | int | credits | ) |
Sets credits and update mn_credits cvar.
Checks whether credits are bigger than MAX_CREDITS
Definition at line 742 of file cp_campaign.c.
References _, ccs_s::credits, Cvar_Set(), MAX_CREDITS, and va().
Referenced by B_BaseInit_f(), B_BuildBase_f(), B_ConstructBuilding(), B_InitialEquipment(), B_SellOrAddItems(), B_SetUpFirstBase(), BS_BuyAircraft_f(), BS_BuyItem_f(), BS_BuyType(), BS_CheckAndDoBuyItem(), BS_ProcessCraftItemSale(), BS_SellAircraft_f(), BS_SellItem_f(), CP_CampaignInit(), CP_LoadXML(), CP_NationHandleBudget(), INS_BuildInstallation_f(), PR_ProductionFrame(), and UR_DialogStartSell_f().
static void CP_AddCampaignCallbackCommands | ( | void | ) | [static] |
registers callback commands that are used by campaign
Definition at line 1424 of file cp_campaign.c.
References AIM_InitCallbacks(), AIR_InitCallbacks(), B_InitCallbacks(), BDEF_InitCallbacks(), BS_InitCallbacks(), CP_TEAM_InitCallbacks(), E_InitCallbacks(), HOS_InitCallbacks(), INS_InitCallbacks(), PR_InitCallbacks(), RS_InitCallbacks(), TR_InitCallbacks(), and UR_InitCallbacks().
Referenced by CP_AddCampaignCommands().
static void CP_AddCampaignCommands | ( | void | ) | [static] |
Definition at line 1441 of file cp_campaign.c.
References Cmd_AddCommand(), CP_AddCampaignCallbackCommands(), cmdList_s::description, cmdList_s::function, and cmdList_s::name.
Referenced by CP_CampaignInit().
void CP_CampaignExit | ( | void | ) |
Definition at line 1559 of file cp_campaign.c.
References cl_geoscape_overlay, Com_DPrintf(), CP_IsRunning(), CP_RemoveCampaignCommands(), CP_ShutdownOverlay(), DEBUG_CLIENT, and cvar_s::integer.
Referenced by GAME_CP_Shutdown().
void CP_CampaignInit | ( | campaign_t * | campaign, | |
qboolean | load | |||
) |
Called at new game and load game.
[in] | load | true if we are loading game, false otherwise |
[in] | campaign | Pointer to campaign - it will be set to ccs.curCampaign here. |
< Initialise all data in the research tree.
Definition at line 1492 of file cp_campaign.c.
References ccs_s::angles, B_SelectBase(), BS_InitMarket(), ccs_s::center, CL_GameTimeStop(), CL_PopupInit(), CL_ResetAlienInterest(), CL_ScriptSanityCheck(), CL_UpdateCredits(), CL_UpdateTime(), Cmd_ExecuteString(), CP_AddCampaignCommands(), CP_InitializeSpawningDelay(), CP_InitializeXVIOverlay(), CP_InitOverlay(), CP_XVIInit(), campaign_s::credits, ccs_s::curCampaign, Cvar_SetValue(), campaign_s::date, ccs_s::date, date_s::day, GLOBE_ROTATE, MAP_Init(), PR_ProductionInit(), qtrue, RS_InitTree(), date_s::sec, SECONDS_PER_DAY, UI_InitStack(), ccs_s::XVIShowMap, YAW, and ccs_s::zoom.
Referenced by CP_LoadXML(), and GAME_CP_Start_f().
void CP_CheckLostCondition | ( | void | ) |
Checks whether the player has lost the campaign.
Definition at line 324 of file cp_campaign.c.
References _, campaign_s::basecost, CP_EndCampaign(), CP_GetAverageXVIRate(), ccs_s::credits, ccs_s::curCampaign, Cvar_SetValue(), nationInfo_s::happiness, cvar_s::integer, campaign_s::maxAllowedXVIRateUntilLost, campaign_s::minhappiness, ccs_s::nations, campaign_s::negativeCreditsUntilLost, ccs_s::numBases, ccs_s::numNations, qfalse, qtrue, nation_s::stats, TEXT_STANDARD, and UI_RegisterText().
Referenced by CL_CampaignRun(), CL_GameAutoGo(), and CP_MissionEnd().
static void CP_CheckMissionEnd | ( | void | ) | [static] |
Check for missions that have a timeout defined.
Definition at line 451 of file cp_campaign.c.
References CP_CheckMissionLimitedInTime(), CP_MissionStageEnd(), linkedList_s::data, ccs_s::date, Date_LaterThan(), mission_s::finalDate, ccs_s::missions, linkedList_s::next, and next.
Referenced by CL_CampaignRun().
Choose a map for given mission.
[in,out] | mission | Pointer to the mission where a new map should be added |
[in] | pos | position of the mission (NULL if the position will be chosen afterwards) |
[in] | ufoCrashed | true if the ufo is crashed |
< Total number of maps fulfilling mission conditions.
< Number of maps fulfilling mission conditions and that appeared less often during game.
Definition at line 201 of file cp_campaign.c.
References mission_s::category, cls, Com_DPrintf(), Com_Error(), Com_GetMapDefByIDX(), Com_GetMapDefinitionByID(), Com_Printf(), Com_UFOTypeToShortName(), CP_MapIsSelectable(), mission_s::crashed, DEBUG_CLIENT, ERR_DROP, i, mapDef_s::id, cvar_s::integer, INTERESTCATEGORY_RESCUE, MAP_GetColor(), mission_s::mapDef, MapIsWater, MAPTYPE_TERRAIN, client_static_s::numMDs, qfalse, qtrue, mapDef_s::timesAlreadyUsed, mission_s::ufo, and aircraft_s::ufotype.
Referenced by CP_HarvestMissionGo(), CP_ReconMissionGroundGo(), CP_SpawnCrashSiteMission(), CP_SpawnRescueMission(), and CP_TerrorMissionGo().
void CP_EndCampaign | ( | qboolean | won | ) |
Function to handle the campaign end.
Definition at line 309 of file cp_campaign.c.
References Cmd_ExecuteString(), Com_Drop(), qtrue, and UI_InitStack().
Referenced by CP_CheckLostCondition(), and CP_EndGame_f().
Determines a random position on geoscape.
[out] | pos | The position that will be overwritten. pos[0] is within -180, +180. pos[1] within -90, +90. |
[in] | noWater | True if the position should not be on water |
Definition at line 1692 of file cp_campaign.c.
References Com_DPrintf(), DEBUG_CLIENT, f, frand(), MAP_GetColor(), MapIsWater, MAPTYPE_TERRAIN, and todeg.
Referenced by AB_SetAlienBasePosition(), UFO_SetRandomDest(), and UFO_SetRandomPos().
qboolean CP_GetRandomPosOnGeoscapeWithParameters | ( | vec2_t | pos, | |
const linkedList_t * | terrainTypes, | |||
const linkedList_t * | cultureTypes, | |||
const linkedList_t * | populationTypes, | |||
const linkedList_t * | nations | |||
) |
Determines a random position on geoscape that fulfills certain criteria given via parameters.
[out] | pos | The position that will be overwritten with the random point fulfilling the criteria. pos[0] is within -180, +180. pos[1] within -90, +90. |
[in] | terrainTypes | A linkedList_t containing a list of strings determining the acceptable terrain types (e.g. "grass") May be NULL. |
[in] | cultureTypes | A linkedList_t containing a list of strings determining the acceptable culture types (e.g. "western") May be NULL. |
[in] | populationTypes | A linkedList_t containing a list of strings determining the acceptable population types (e.g. "suburban") May be NULL. |
[in] | nations | A linkedList_t containing a list of strings determining the acceptable nations (e.g. "asia"). May be NULL |
Definition at line 1716 of file cp_campaign.c.
References Com_DPrintf(), DEBUG_CLIENT, frand(), MAP_PositionFitsTCPNTypes(), qfalse, qtrue, RASTER, todeg, and Vector2Set.
Referenced by CP_HarvestMissionGo(), and CP_ReconMissionGroundGo().
int CP_GetSalaryAdminEmployee | ( | employeeType_t | type | ) |
Definition at line 1808 of file cp_campaign.c.
References salary_s::admin, ccs_s::curCampaign, campaign_s::idx, and ccs_s::salaries.
Referenced by CP_GetSalaryAdministrative().
int CP_GetSalaryAdministrative | ( | void | ) |
Definition at line 1794 of file cp_campaign.c.
References CP_GetSalaryAdminEmployee(), MAX_EMPL, ccs_s::numEmployees, and SALARY_ADMIN_INITIAL.
Referenced by CL_StatsUpdate_f(), and CP_NationHandleBudget().
int CP_GetSalaryBaseEmployee | ( | employeeType_t | type | ) |
Definition at line 1802 of file cp_campaign.c.
References salary_s::base, ccs_s::curCampaign, campaign_s::idx, and ccs_s::salaries.
Referenced by CL_StatsUpdate_f(), and CP_NationHandleBudget().
int CP_GetSalaryRankBonusEmployee | ( | employeeType_t | type | ) |
Definition at line 1814 of file cp_campaign.c.
References ccs_s::curCampaign, campaign_s::idx, salary_s::rankBonus, and ccs_s::salaries.
Referenced by CL_StatsUpdate_f(), and CP_NationHandleBudget().
int CP_GetSalaryUpKeepBase | ( | const base_t * | base | ) |
Definition at line 1820 of file cp_campaign.c.
References B_GetNextBuilding(), B_STATUS_CONSTRUCTION_FINISHED, B_STATUS_WORKING, building_s::buildingStatus, SALARY_BASE_UPKEEP, and building_s::varCosts.
Referenced by CL_StatsUpdate_f(), and CP_NationHandleBudget().
static float CP_GetWinProbabilty | ( | const mission_t * | mis, | |
const base_t * | base, | |||
const aircraft_t * | aircraft | |||
) | [static] |
Calculates the win probability for an auto mission.
[in] | mis | The mission we are calculating the probability for |
[in] | base | The base we are trying to defend in case of a base attack mission |
[in] | aircraft | Your aircraft that has reached the mission location in case this is no base attack mission |
Definition at line 976 of file cp_campaign.c.
References AIR_GetTeamSize(), battleParam_s::aliens, chrScoreGlobal_s::assignedMissions, ccs_s::battleParameters, mission_s::category, employee_s::chr, CL_GetRankByIdx(), Com_DPrintf(), ccs_s::curCampaign, linkedList_s::data, DEBUG_CLIENT, campaign_s::difficulty, E_GetHiredEmployees(), E_IsAwayFromBase(), EMPL_ROBOT, EMPL_SOLDIER, chrScoreGlobal_s::experience, rank_s::factor, INTERESTCATEGORY_TERROR_ATTACK, INTERESTCATEGORY_XVI, LIST_Delete(), linkedList_s::next, chrScoreGlobal_s::rank, character_s::score, SKILL_CLOSE, mission_s::stage, and STAGE_BASE_ATTACK.
Referenced by CL_GameAutoGo().
void CP_InitMissionResults | ( | qboolean | won | ) |
Updates mission result menu text with appropriate values
resultCounts | result counts | |
won | Whether we won the battle |
Definition at line 1192 of file cp_campaign.c.
References _, missionResults_s::aliensKilled, missionResults_s::aliensStunned, missionResults_s::aliensSurvived, missionResults_s::civiliansKilled, missionResults_s::civiliansKilledFriendlyFire, missionResults_s::civiliansSurvived, Com_sprintf(), missionResults_s::itemAmount, missionResults_s::itemTypes, ccs_s::missionResults, missionResults_s::ownKilled, missionResults_s::ownKilledFriendlyFire, missionResults_s::ownStunned, missionResults_s::ownSurvived, Q_strcat(), missionResults_s::recovery, TEXT_STANDARD, UFO_MissionResultToString(), UI_RegisterText(), and va().
Referenced by CL_GameAutoGo(), and GAME_CP_Results().
void CP_InitStartup | ( | void | ) |
Definition at line 1833 of file cp_campaign.c.
References AB_InitStartup(), AC_InitStartup(), AIRFIGHT_InitStartup(), B_InitStartup(), Cmd_AddCommand(), CP_CheckBaseAttacks_f(), CP_MissionsInit(), Cvar_Get(), E_InitStartup(), HOS_InitStartup(), INS_InitStartup(), MAP_InitStartup(), Mem_CreatePool, MS_MessageInit(), NAT_InitStartup(), RS_InitStartup(), SAV_Init(), STATS_InitStartup(), TR_InitStartup(), UFO_InitStartup(), and UP_InitStartup().
Referenced by GAME_CP_InitStartup().
qboolean CP_IsRunning | ( | void | ) |
Checks whether a campaign mode game is running.
Definition at line 146 of file cp_campaign.c.
References ccs_s::curCampaign.
Referenced by CL_CampaignRun(), CP_CampaignExit(), SAV_GameContinue_f(), SAV_GameQuickSave_f(), SAV_GameReadGameComments_f(), SAV_GameSave(), SAV_GameSave_f(), and UI_MapNodeDraw().
static qboolean CP_LoadMapDefStatXML | ( | mxml_node_t * | parent | ) | [static] |
Load mapDef statistics.
[in] | parent | XML Node structure, where we get the information from |
Definition at line 755 of file cp_campaign.c.
References Com_GetMapDefinitionByID(), Com_Printf(), map, mxml_GetInt(), mxml_GetNextNode(), mxml_GetNode(), mxml_GetString(), qtrue, SAVE_CAMPAIGN_MAPDEF, SAVE_CAMPAIGN_MAPDEF_COUNT, SAVE_CAMPAIGN_MAPDEF_ID, and mapDef_s::timesAlreadyUsed.
Referenced by CP_LoadXML().
qboolean CP_LoadXML | ( | mxml_node_t * | parent | ) |
Load callback for savegames in XML Format.
[in] | parent | XML Node structure, where we get the information from |
Definition at line 782 of file cp_campaign.c.
References ccs_s::aliensKilled, ccs_s::angles, ccs_s::center, ccs_s::civiliansKilled, cl_geoscape_overlay, CL_GetCampaign(), CL_UpdateCredits(), cls, Com_DPrintf(), Com_Printf(), CP_CampaignInit(), CP_LoadMapDefStatXML(), CP_UpdateXVIMapButton(), ccs_s::date, date_s::day, DEBUG_CLIENT, cvar_s::integer, MAP_Init(), mxml_GetBool(), mxml_GetDate(), mxml_GetFloat(), mxml_GetInt(), mxml_GetLong(), mxml_GetNode(), mxml_GetString(), mxmlDelete(), name, client_static_s::nextUniqueCharacterNumber, ccs_s::paid, qfalse, qtrue, radarOverlayWasSet, SAVE_CAMPAIGN_ALIENSKILLED, SAVE_CAMPAIGN_ANGLES0, SAVE_CAMPAIGN_ANGLES1, SAVE_CAMPAIGN_CAMPAIGN, SAVE_CAMPAIGN_CENTER0, SAVE_CAMPAIGN_CENTER1, SAVE_CAMPAIGN_CIVILIANSKILLED, SAVE_CAMPAIGN_CL_GEOSCAPE_OVERLAY, SAVE_CAMPAIGN_CREDITS, SAVE_CAMPAIGN_DATE, SAVE_CAMPAIGN_ID, SAVE_CAMPAIGN_MAP, SAVE_CAMPAIGN_MAPDEFSTAT, SAVE_CAMPAIGN_NEXTUNIQUECHARACTERNUMBER, SAVE_CAMPAIGN_PAID, SAVE_CAMPAIGN_RADAROVERLAYWASSET, SAVE_CAMPAIGN_XVISHOWMAP, SAVE_CAMPAIGN_ZOOM, date_s::sec, ccs_s::XVIShowMap, and ccs_s::zoom.
Referenced by SAV_Init().
Check if a map may be selected for mission.
[in] | mission | Pointer to the mission where mapDef should be added |
[in] | pos | position of the mission (NULL if the position will be chosen afterwards) |
[in] | mapIdx | idx of the map in the mapdef array |
[in] | ufoCrashed | Search the mission definition for crash ufo id if true |
Definition at line 159 of file cp_campaign.c.
References Com_GetMapDefByIDX(), Com_UFOCrashedTypeToShortName(), Com_UFOTypeToShortName(), mission_s::crashed, mapDef_s::cultures, LIST_ContainsString(), MAP_PositionFitsTCPNTypes(), mapDef_s::populations, qfalse, qtrue, mapDef_s::storyRelated, mapDef_s::terrains, type, mission_s::ufo, mapDef_s::ufos, and aircraft_s::ufotype.
Referenced by CP_ChooseMap().
qboolean CP_OnGeoscape | ( | void | ) |
Definition at line 604 of file cp_campaign.c.
References UI_GetActiveWindowName().
Referenced by CL_AllowTimeScale(), CL_CampaignRun(), and CL_GameTimeStop().
void CP_ParseCharacterData | ( | struct dbuffer * | msg | ) |
Parses the character data which was send by G_MatchSendResults using G_SendCharacterData.
[in] | msg | The network buffer message. If this is NULL the character is updated, if this is not NULL the data is stored in a temp buffer because the player can choose to retry the mission and we have to catch this situation to not update the character data in this case. |
Scores
Definition at line 82 of file cp_campaign.c.
References chrScoreGlobal_s::assignedMissions, byte, updateCharacter_t::chrscore, Com_Error(), Com_Printf(), linkedList_s::data, E_GetEmployeeFromChrUCN(), ERR_DROP, chrScoreGlobal_s::experience, updateCharacter_t::HP, character_s::HP, i, KILLED_NUM_TYPES, chrScoreGlobal_s::kills, LIST_Add(), LIST_Delete(), character_s::maxHP, updateCharacter_t::morale, character_s::morale, NET_ReadByte(), NET_ReadLong(), NET_ReadShort(), linkedList_s::next, character_s::score, SKILL_NUM_TYPES, chrScoreGlobal_s::skills, updateCharacter_t::STUN, character_s::STUN, chrScoreGlobal_s::stuns, and updateCharacter_t::ucn.
Referenced by CP_MissionEnd(), and GAME_CP_Results().
static void CP_RemoveCampaignCallbackCommands | ( | void | ) | [static] |
registers callback commands that are used by campaign
Definition at line 1458 of file cp_campaign.c.
References AIM_ShutdownCallbacks(), AIR_ShutdownCallbacks(), B_ShutdownCallbacks(), BDEF_ShutdownCallbacks(), BS_ShutdownCallbacks(), CP_TEAM_ShutdownCallbacks(), E_ShutdownCallbacks(), HOS_ShutdownCallbacks(), INS_ShutdownCallbacks(), MSO_Shutdown(), PR_ShutdownCallbacks(), RS_ShutdownCallbacks(), TR_ShutdownCallbacks(), UP_Shutdown(), and UR_ShutdownCallbacks().
Referenced by CP_RemoveCampaignCommands().
static void CP_RemoveCampaignCommands | ( | void | ) | [static] |
Definition at line 1477 of file cp_campaign.c.
References Cmd_RemoveCommand(), CP_RemoveCampaignCallbackCommands(), and cmdList_s::name.
Referenced by CP_CampaignExit().
static qboolean CP_SaveMapDefStatXML | ( | mxml_node_t * | parent | ) | [static] |
Save mapDef statistics.
[out] | parent | XML Node structure, where we write the information to |
Definition at line 852 of file cp_campaign.c.
References cls, Com_GetMapDefByIDX(), i, mapDef_s::id, map, mxml_AddInt(), mxml_AddNode(), mxml_AddString(), client_static_s::numMDs, qtrue, SAVE_CAMPAIGN_MAPDEF, SAVE_CAMPAIGN_MAPDEF_COUNT, SAVE_CAMPAIGN_MAPDEF_ID, and mapDef_s::timesAlreadyUsed.
Referenced by CP_SaveXML().
qboolean CP_SaveXML | ( | mxml_node_t * | parent | ) |
Save callback for savegames in XML Format.
[out] | parent | XML Node structure, where we write the information to |
Definition at line 872 of file cp_campaign.c.
References ccs_s::aliensKilled, ccs_s::angles, ccs_s::center, ccs_s::civiliansKilled, cl_geoscape_overlay, cls, CP_SaveMapDefStatXML(), ccs_s::credits, ccs_s::curCampaign, ccs_s::date, date_s::day, campaign_s::id, cvar_s::integer, map, mxml_AddBool(), mxml_AddDate(), mxml_AddFloat(), mxml_AddIntValue(), mxml_AddLong(), mxml_AddNode(), mxml_AddShort(), mxml_AddShortValue(), mxml_AddString(), client_static_s::nextUniqueCharacterNumber, ccs_s::paid, qfalse, qtrue, radarOverlayWasSet, SAVE_CAMPAIGN_ALIENSKILLED, SAVE_CAMPAIGN_ANGLES0, SAVE_CAMPAIGN_ANGLES1, SAVE_CAMPAIGN_CAMPAIGN, SAVE_CAMPAIGN_CENTER0, SAVE_CAMPAIGN_CENTER1, SAVE_CAMPAIGN_CIVILIANSKILLED, SAVE_CAMPAIGN_CL_GEOSCAPE_OVERLAY, SAVE_CAMPAIGN_CREDITS, SAVE_CAMPAIGN_DATE, SAVE_CAMPAIGN_ID, SAVE_CAMPAIGN_MAP, SAVE_CAMPAIGN_MAPDEFSTAT, SAVE_CAMPAIGN_NEXTUNIQUECHARACTERNUMBER, SAVE_CAMPAIGN_PAID, SAVE_CAMPAIGN_RADAROVERLAYWASSET, SAVE_CAMPAIGN_XVISHOWMAP, SAVE_CAMPAIGN_ZOOM, date_s::sec, ccs_s::XVIShowMap, and ccs_s::zoom.
Referenced by SAV_Init().
void CP_StartSelectedMission | ( | void | ) |
Starts a selected mission.
Definition at line 913 of file cp_campaign.c.
References mission_s::active, AIR_GetTeamSize(), ccs_s::battleParameters, CL_CleanTempInventory(), CL_CleanupAircraftCrew(), CL_Disconnect(), Com_Printf(), CP_CreateBattleParameters(), CP_SetMissionVars(), CP_StartMissionMap(), Cvar_SetValue(), ccs_s::eMission, aircraft_s::homebase, aircraft_s::mission, ccs_s::missionAircraft, ccs_s::missionResults, qfalse, ccs_s::selectedMission, base_s::storage, and SV_Shutdown().
Referenced by GAME_CP_Results_f().
Definition at line 59 of file cp_campaign.c.
Referenced by AB_BaseSearchedByNations(), AB_BuildBase(), AB_DestroyBase(), AB_GetAlienBaseNumber(), AB_GetNext(), AB_LoadXML(), AC_AlienClick(), AC_InitCallbacks(), AC_KillAll(), AC_KillOne_f(), AC_LoadXML(), AC_SaveXML(), AC_UpdateMenu(), AII_CarriedItems(), AII_CollectingItems(), AIM_AircraftEquipMenuClick_f(), AIR_Add(), AIR_AircraftGetFromIDX(), AIR_AircraftsNotifyMissionRemoved(), AIR_Delete(), AIR_GetAircraftSilent(), AIR_IsEmployeeInAircraft(), AIR_LoadAircraftXML(), AIR_LoadXML(), AIR_Move(), AIR_NewAircraft(), AIR_ParseAircraft(), AIR_PostLoadInitMissions(), AIR_RemoveEmployee(), AIR_SaveAircraftXML(), AIR_ScriptSanityCheck(), AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), AIRFIGHT_AddProjectile(), AIRFIGHT_BaseShoot(), AIRFIGHT_CampaignRunProjectiles(), AIRFIGHT_ExecuteActions(), AIRFIGHT_InstallationShoot(), AIRFIGHT_LoadXML(), AIRFIGHT_RemoveProjectile(), AIRFIGHT_RemoveProjectileAimingAircraft(), AIRFIGHT_SaveXML(), AIRFIGHT_UpdateProjectileForDestroyedAircraft(), AL_AddAliens(), AL_CountAll(), AL_CountInBase(), AL_FillInContainment(), AL_RemoveAliens(), B_BaseInit_f(), B_BaseResetStatus(), B_BuildBase_f(), B_BuildFromTemplate(), B_BuildingClick_f(), B_BuildingDestroy(), B_BuildingInit(), B_BuildingOpenAfterClick(), B_CheckBuildingConstruction(), B_CheckBuildingStatusForMenu_f(), B_CheckCredits(), B_ConstructBuilding(), B_Destroy(), B_GetBaseByIDX(), B_GetBaseTemplate(), B_GetBuildingTemplate(), B_GetFoundedBaseCount(), B_GetInstallationLimit(), B_GetNextBuilding(), B_InitCallbacks(), B_InitialEquipment(), B_LoadXML(), B_MarkBuildingDestroy(), B_MoveAircraftOnGeoscapeToOtherBases(), B_NextBase_f(), B_ParseBaseTemplate(), B_ParseBuildings(), B_PrevBase_f(), B_ResetBuildingCurrent(), B_SaveXML(), B_ScriptSanityCheck(), B_SelectBase(), B_SellOrAddItems(), B_SetBaseTitle_f(), B_SetBuildingByClick(), B_SetUpBase(), B_SetUpFirstBase(), B_UpdateBaseCapacities(), B_UpdateBaseCount(), B_UpdateBaseData(), BaseSummary_Init(), BaseSummary_SelectBase_f(), BDEF_AddBattery_f(), BDEF_AutoSelectTarget(), BDEF_AutoTarget(), BDEF_RemoveBattery_f(), BS_AddAircraftToMarket(), BS_AddItemToMarket(), BS_Autosell_f(), BS_BuyAircraft_f(), BS_BuyItem_f(), BS_BuyType(), BS_CheckAndDoBuyItem(), BS_GetAircraftBuyingPrice(), BS_GetAircraftOnMarket(), BS_GetAircraftSellingPrice(), BS_GetItemBuyingPrice(), BS_GetItemSellingPrice(), BS_GetMinMaxValueByItemID(), BS_InitMarket(), BS_LoadXML(), BS_MarketScroll_f(), BS_ProcessCraftItemSale(), BS_RemoveAircraftFromMarket(), BS_RemoveItemFromMarket(), BS_SaveXML(), BS_SellAircraft_f(), BS_SellItem_f(), CL_AllowTimeScale(), CL_CampaignRunMarket(), CL_ChangeIndividualInterest(), CL_CleanTempInventory(), CL_DisplayPopupAircraft(), CL_DisplayPopupInterceptMission(), CL_DisplayPopupInterceptUFO(), CL_EventAddMail_f(), CL_GameTimeFast(), CL_GameTimeSlow(), CL_GameTimeStop(), CL_GetComponentsByID(), CL_GetComponentsByItem(), CL_GetEventMail(), CL_GetRankByIdx(), CL_GetRankIdx(), CL_IsTimeStopped(), CL_NationDrawStats(), CL_NationSelect_f(), CL_NationsMaxFunding(), CL_NationStatsUpdate_f(), CL_ParseAlienTeam(), CL_ParseCampaign(), CL_ParseCampaignEvents(), CL_ParseCities(), CL_ParseComponents(), CL_ParseEventMails(), CL_ParseNations(), CL_ParseRanks(), CL_ParseResearchableCampaignStates(), CL_ParseResearchedCampaignItems(), CL_ParseSalary(), CL_PopupChangeHomebase_f(), CL_PopupInterceptBaseClick_f(), CL_ReadSinglePlayerData(), CL_ResetAlienInterest(), CL_SetGameTime(), CL_StatsUpdate_f(), CL_UpdateTime(), CP_BaseAttackChooseBase(), CP_BaseAttackGoToBase(), CP_BaseAttackMissionDestroyBase(), CP_BaseAttackMissionIsFailure(), CP_BaseAttackMissionLeave(), CP_BaseAttackStartMission(), CP_BuildBaseSetUpBase(), CP_BuildBaseSubvertGovernment(), CP_ChangeNationHappiness_f(), CP_CheckBaseAttacks_f(), CP_CheckCampaignEvents(), CP_CheckNewMissionDetectedOnGeoscape(), CP_ChooseCity(), CP_ChooseNation(), CP_CountMission(), CP_CountMissionActive(), CP_CountMissionOnGeoscape(), CP_CreateAlienTeam(), CP_CreateBattleParameters(), CP_CreateCivilianTeam(), CP_CreateNewMission(), CP_GetAverageXVIRate(), CP_GetEventsByID(), CP_GetMissionByIDSilent(), CP_HarvestMissionGo(), CP_HarvestMissionStart(), CP_IncreaseAlienInterest(), CP_InitializeSpawningDelay(), CP_InterceptAircraftMissionSet(), CP_InterceptAttackInstallation(), CP_InterceptMissionSet(), CP_InterceptNextStage(), CP_IsAlienEquipmentSelectable(), CP_LoadInterestsXML(), CP_LoadMissionsXML(), CP_MissionBegin(), CP_MissionEnd(), CP_MissionNotifyBaseDestroyed(), CP_MissionNotifyInstallationDestroyed(), CP_MissionRemove(), CP_MissionStageEnd(), CP_NationBackupMonthlyData(), CP_NationHandleBudget(), CP_NationStatsClick_f(), CP_ReconMissionAerial(), CP_ReconMissionGround(), CP_ReconMissionGroundGo(), CP_ReconMissionLeave(), CP_ReduceXVIEverywhere(), CP_SaveInterestsXML(), CP_SaveMissionsXML(), CP_SelectNewMissionType(), CP_SetAlienEquipmentByInterest(), CP_SetAlienTeamByInterest(), CP_SetMissionName(), CP_SetMissionVars(), CP_SpawnCrashSiteMission(), CP_SpawnNewMissions(), CP_SpawnRescueMission(), CP_SpreadXVI(), CP_StartMissionMap(), CP_StartXVISpreading_f(), CP_SupplySetStayAtBase(), CP_TerrorInCity(), CP_TerrorMissionGo(), CP_TerrorMissionStart(), CP_UFORemoveFromGeoscape(), CP_UpdateMissionVisibleOnGeoscape(), CP_UpdateNationXVIInfection(), CP_UpdateXVIMapButton(), CP_XVIMissionStart(), E_CreateEmployeeAtIndex(), E_DeleteAllEmployees(), E_DeleteEmployee(), E_DeleteEmployeesExceedingCapacity(), E_GetNext(), E_GetUnhiredEmployee(), E_HireForBuilding(), E_InitialEmployees(), E_LoadXML(), E_RandomNation(), E_RefreshUnhiredEmployeeGlobalList(), E_ResetEmployees(), GAME_CP_CampaignListClick_f(), GAME_CP_GetCampaigns_f(), GAME_CP_GetEquipmentDefinition(), GAME_CP_GetTeam(), GAME_CP_MissionAutoCheck_f(), GAME_CP_MissionAutoGo_f(), GAME_CP_Results(), GAME_CP_Results_f(), GAME_CP_Spawn(), GAME_CP_TeamIsKnown(), INS_BuildInstallation_f(), INS_DestroyInstallation(), INS_GetFirstUFOYard(), INS_GetFirstUnfoundedInstallation(), INS_GetInstallationByIDX(), INS_GetInstallationTemplateFromInstallationID(), INS_InitCallbacks(), INS_InitStartup(), INS_LoadXML(), INS_ParseInstallations(), INS_SaveXML(), INS_SelectInstallation(), INS_SelectInstallation_f(), INS_SetInstallationTitle(), INS_SetUpInstallation(), INS_UpdateInstallationData(), MAP3D_ScreenToMap(), MAP3D_SmoothRotate(), MAP_3DMapToScreen(), MAP_Draw3DMarkerIfVisible(), MAP_DrawAircraftHealthBar(), MAP_DrawMap(), MAP_DrawMapMarkers(), MAP_DrawMapOneMission(), MAP_DrawMapOnePhalanxAircraft(), MAP_GetGeoscapeAngle(), MAP_GetMissionByIDX(), MAP_GetNation(), MAP_GetUFOAngle(), MAP_Init(), MAP_IsNight(), MAP_MapClick(), MAP_MapDrawLine(), MAP_MapToScreen(), MAP_MultiSelectExecuteAction_f(), MAP_NotifyAircraftRemoved(), MAP_NotifyMissionRemoved(), MAP_NotifyUFODisappear(), MAP_NotifyUFORemoved(), MAP_ResetAction(), MAP_ScreenToMap(), MAP_Scroll_f(), MAP_SelectAircraft(), MAP_SelectMission(), MAP_SelectUFO(), MAP_SetOverlay(), MAP_SmoothTranslate(), MAP_StartCenter(), MAP_UpdateGeoscapeDock(), MAP_Zoom_f(), MS_AddNewMessageSound(), MSO_InitList(), MSO_ParseCategories(), MSO_Toggle_f(), MSO_UpdateVisibleButtons(), NAT_GetNationByID(), NAT_GetNationByIDX(), NAT_SaveXML(), NAT_ScriptSanityCheck(), NAT_SetHappiness(), NAT_UpdateHappinessForAllNations(), PR_DecreaseProduction(), PR_EmptyQueue(), PR_LoadXML(), PR_ProductionBase(), PR_ProductionDown_f(), PR_ProductionFrame(), PR_ProductionIncrease_f(), PR_ProductionListClick_f(), PR_ProductionListRightClick_f(), PR_ProductionQueueBase(), PR_ProductionRollBottom_f(), PR_ProductionRun(), PR_ProductionStop_f(), PR_ProductionType_f(), PR_ProductionUp_f(), PR_QueueNext(), PR_SaveXML(), PR_UpdateProductionList(), RADAR_SetRadarAfterLoading(), RS_CountScientistsInBase(), RS_GetTechByIDX(), RS_GetTechForItem(), RS_GetTechWithMostScientists(), RS_InitGUIData(), RS_InitTree(), RS_IsResearched_idx(), RS_IsValidTechIndex(), RS_MarkCollected(), RS_MarkOneResearchable(), RS_MarkResearchable(), RS_MarkStoryLineEventResearched(), RS_ParseTechnologies(), RS_RequiredLinksAssign(), RS_ResearchFinish(), RS_ResearchRun(), RS_SaveXML(), RS_ScriptSanityCheck(), SAV_GameSave(), STATS_LoadXML(), STATS_SaveXML(), TR_CargoList(), TR_CargoListSelect_f(), TR_CheckAircraft(), TR_CheckAlien(), TR_CheckEmployee(), TR_EmptyTransferCargo(), TR_GetNext(), TR_Init_f(), TR_InitBaseList(), TR_LoadXML(), TR_NotifyAircraftRemoved(), TR_SaveXML(), TR_TransferAlienAfterMissionStart(), TR_TransferAliensFromMission_f(), TR_TransferCheck(), TR_TransferListClear_f(), TR_TransferListSelect_f(), TR_TransferSelect(), TR_TransferStart(), UFO_AddToGeoscape(), UFO_CampaignCheckEvents(), UFO_CampaignRunUFOs(), UFO_DetectNewUFO(), UFO_GetByIDX(), UFO_GetByType(), UFO_MissionResultToString(), UFO_NotifyPhalanxAircraftRemoved(), UFO_RemoveFromGeoscape(), UFO_ShouldAppearOnGeoscape(), UFO_UpdateAlienInterestForAllBasesAndInstallations(), UI_BaseMapNodeClick(), UI_BaseMapNodeDraw(), UI_MapNodeCapturedMouseMove(), UI_MapNodeZoom(), UP_Click_f(), UP_GenerateSummary(), UP_GetUnreadMails(), UP_ParseChapters(), UP_SetAllMailsRead_f(), UP_SetMailHeader(), UR_DialogFillNations(), UR_DialogGetCurrentNationIndex(), UR_DialogInit_f(), UR_DialogInitSell_f(), UR_DialogInitStore_f(), UR_DialogSelectSellNation_f(), UR_DialogStartSell_f(), UR_DialogStartStore_f(), UR_ProcessActive(), UR_SortNations(), US_GetNext(), US_LoadXML(), US_RemoveStoredUFO(), US_StoredUFOCount(), and US_StoreUFO().
Definition at line 60 of file cp_campaign.c.
Referenced by CL_ParseResearchableCampaignStates(), CL_ParseResearchedCampaignItems(), GAME_CP_InitStartup(), and GAME_CP_Start_f().
struct memPool_s* cp_campaignPool |
reset on every game restart
Definition at line 58 of file cp_campaign.c.
Referenced by AIR_LoadAircraftXML(), B_ParseBaseTemplate(), B_ParseBuildings(), CL_EventAddMail_f(), CL_GetEventMail(), CL_NewEventMail(), CL_ParseCampaignEvents(), CL_ParseCities(), CL_ParseEventMails(), CL_ParseNations(), CL_ParseRanks(), CL_ParseResearchedCampaignItems(), CP_CreateBattleParameters(), INS_ParseInstallations(), MS_AddNewMessageSound(), MSO_ParseCategories(), RS_InitTree(), RS_ParseTechnologies(), and UP_ParseChapters().
Definition at line 62 of file cp_campaign.c.
Referenced by CL_GameTimeStop().
Definition at line 61 of file cp_campaign.c.
Referenced by GAME_CP_InitStartup().
const int DETECTION_INTERVAL = (SECONDS_PER_HOUR / 2) |
delay between actions that must be executed independently of time scale
Definition at line 615 of file cp_campaign.c.
Referenced by AB_UpdateStealthForOneBase(), CL_CampaignRun(), CP_CheckNewMissionDetectedOnGeoscape(), RADAR_CheckUFOSensored(), UFO_UpdateAlienInterestForOneBase(), and UFO_UpdateAlienInterestForOneInstallation().
const cmdList_t game_commands[] [static] |
{ {"update_base_radar_coverage", RADAR_UpdateBaseRadarCoverage_f, "Update base radar coverage"}, {"addeventmail", CL_EventAddMail_f, "Add a new mail (event trigger) - e.g. after a mission"}, {"stats_update", CL_StatsUpdate_f, NULL}, {"game_go", CP_StartSelectedMission, NULL}, {"game_timestop", CL_GameTimeStop, NULL}, {"game_timeslow", CL_GameTimeSlow, NULL}, {"game_timefast", CL_GameTimeFast, NULL}, {"game_settimeid", CL_SetGameTime_f, NULL}, {"map_center", MAP_CenterOnPoint_f, "Centers the geoscape view on items on the geoscape - and cycle through them"}, {"map_zoom", MAP_Zoom_f, NULL}, {"map_scroll", MAP_Scroll_f, NULL}, {"cp_start_xvi_spreading", CP_StartXVISpreading_f, "Start XVI spreading"}, {NULL, NULL, NULL} }
Definition at line 1392 of file cp_campaign.c.
const int monthLength[MONTHS_PER_YEAR] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } [static] |
Definition at line 483 of file cp_campaign.c.
Referenced by CL_DateConvert(), and CL_DateCreateDay().