Header file for single player campaign control. More...
#include "cp_rank.h"
#include "cp_save.h"
#include "cp_parse.h"
#include "cp_event.h"
#include "cp_ufopedia.h"
#include "cp_research.h"
#include "cp_radar.h"
#include "cp_aircraft.h"
#include "cp_base.h"
#include "cp_employee.h"
#include "cp_transfer.h"
#include "cp_nation.h"
#include "cp_installation.h"
#include "cp_produce.h"
#include "cp_uforecovery.h"
#include "cp_airfight.h"
#include "cp_messageoptions.h"
#include "cp_alienbase.h"
#include "cp_market.h"
#include "cp_statistics.h"
Go to the source code of this file.
Data Structures | |
struct | alienTeamGroup_s |
alien team group definition. More... | |
struct | alienTeamCategory_s |
alien team category definition More... | |
struct | mission_s |
mission definition More... | |
struct | battleParam_s |
struct | missionResults_s |
Structure with mission info needed to create results summary at menu won. More... | |
struct | campaign_s |
struct | salary_s |
struct | ccs_s |
client campaign structure More... | |
struct | dateLong_s |
Human readable time information in the game. More... | |
struct | screenPoint_t |
Defines | |
#define | MAX_CAMPAIGNS 16 |
#define | MAX_ASSEMBLIES 16 |
#define | BYTES_NONE 0xFF |
#define | MapIsWater(color) (color[0] == 0 && color[1] == 0 && color[2] == 64) |
#define | MapIsArctic(color) (color[0] == 128 && color[1] == 255 && color[2] == 255) |
#define | MapIsDesert(color) (color[0] == 255 && color[1] == 128 && color[2] == 0) |
#define | MapIsMountain(color) (color[0] == 255 && color[1] == 0 && color[2] == 0) |
#define | MapIsTropical(color) (color[0] == 128 && color[1] == 128 && color[2] == 255) |
#define | MapIsGrass(color) (color[0] == 128 && color[1] == 255 && color[2] == 0) |
#define | MapIsWasted(color) (color[0] == 128 && color[1] == 0 && color[2] == 128) |
#define | MapIsCold(color) (color[0] == 0 && color[1] == 0 && color[2] == 255) |
#define | MapIsWestern(color) (color[0] == 128 && color[1] == 255 && color[2] == 255) |
#define | MapIsEastern(color) (color[0] == 255 && color[1] == 128 && color[2] == 0) |
#define | MapIsOriental(color) (color[0] == 255 && color[1] == 0 && color[2] == 0) |
#define | MapIsAfrican(color) (color[0] == 128 && color[1] == 128 && color[2] == 255) |
#define | MapIsUrban(color) (color[0] == 128 && color[1] == 255 && color[2] == 255) |
#define | MapIsSuburban(color) (color[0] == 255 && color[1] == 128 && color[2] == 0) |
#define | MapIsVillage(color) (color[0] == 255 && color[1] == 0 && color[2] == 0) |
#define | MapIsRural(color) (color[0] == 128 && color[1] == 128 && color[2] == 255) |
#define | MapIsNopopulation(color) (color[0] == 128 && color[1] == 255 && color[2] == 0) |
#define | RASTER 2 |
#define | HAPPINESS_SUBVERSION_LOSS -0.15 |
#define | HAPPINESS_ALIEN_MISSION_LOSS -0.02 |
#define | HAPPINESS_UFO_SALE_GAIN 0.02 |
#define | HAPPINESS_UFO_SALE_LOSS 0.005 |
#define | HAPPINESS_MAX_MISSION_IMPACT 0.07 |
#define | MAX_ALIEN_GROUP_PER_CATEGORY 4 |
#define | ALIENCATEGORY_MAX 8 |
#define | BID_FACTOR 0.9 |
#define | MAX_PROJECTILESONGEOSCAPE 32 |
#define | HOURS_PER_ONE_INTEREST 22 |
The amount of time (in hours) it takes for the interest to increase by 1. Is later affected by difficulty. | |
#define | INITIAL_OVERALL_INTEREST 20 |
Determines the interest interval for a single campaign. | |
#define | FINAL_OVERALL_INTEREST 1000 |
#define | DELAY_BETWEEN_MISSION_SPAWNING 4 |
The length of a single mission spawn cycle. | |
#define | MINIMUM_MISSIONS_PER_CYCLE 5 |
The minimum and maximum amount of missions per mission cycle. | |
#define | MAXIMUM_MISSIONS_PER_CYCLE 40 |
#define | NON_OCCURRENCE_PROBABILITY 0.65 |
The probability that any new alien mission will be a non-occurrence mission. | |
#define | SALARY_AIRCRAFT_FACTOR ccs.salaries[ccs.curCampaign->idx].aircraftFactor |
#define | SALARY_AIRCRAFT_DIVISOR ccs.salaries[ccs.curCampaign->idx].aircraftDivisor |
#define | SALARY_BASE_UPKEEP ccs.salaries[ccs.curCampaign->idx].baseUpkeep |
#define | SALARY_ADMIN_INITIAL ccs.salaries[ccs.curCampaign->idx].adminInitial |
#define | SALARY_DEBT_INTEREST ccs.salaries[ccs.curCampaign->idx].debtInterest |
Typedefs | |
typedef enum mapType_s | mapType_t |
typedef enum missionDetectionStatus_s | missionDetectionStatus_t |
possible mission detection status | |
typedef enum interestCategory_s | interestCategory_t |
typedef enum missionStage_s | missionStage_t |
typedef struct alienTeamGroup_s | alienTeamGroup_t |
alien team group definition. | |
typedef struct alienTeamCategory_s | alienTeamCategory_t |
alien team category definition | |
typedef struct mission_s | mission_t |
mission definition | |
typedef struct battleParam_s | battleParam_t |
typedef struct missionResults_s | missionResults_t |
Structure with mission info needed to create results summary at menu won. | |
typedef struct campaign_s | campaign_t |
typedef struct salary_s | salary_t |
typedef enum mapAction_s | mapAction_t |
typedef struct ccs_s | ccs_t |
client campaign structure | |
typedef struct dateLong_s | dateLong_t |
Human readable time information in the game. | |
Enumerations | |
enum | mapType_s { MAPTYPE_TERRAIN, MAPTYPE_CULTURE, MAPTYPE_POPULATION, MAPTYPE_NATIONS, MAPTYPE_MAX } |
enum | missionDetectionStatus_s { MISDET_CANT_BE_DETECTED, MISDET_ALWAYS_DETECTED, MISDET_MAY_BE_DETECTED } |
possible mission detection status More... | |
enum | interestCategory_s { INTERESTCATEGORY_NONE, INTERESTCATEGORY_RECON, INTERESTCATEGORY_TERROR_ATTACK, INTERESTCATEGORY_BASE_ATTACK, INTERESTCATEGORY_BUILDING, INTERESTCATEGORY_SUPPLY, INTERESTCATEGORY_XVI, INTERESTCATEGORY_INTERCEPT, INTERESTCATEGORY_HARVEST, INTERESTCATEGORY_ALIENBASE, INTERESTCATEGORY_RESCUE, INTERESTCATEGORY_MAX } |
enum | missionStage_s { STAGE_NOT_ACTIVE, STAGE_COME_FROM_ORBIT, STAGE_RECON_AIR, STAGE_MISSION_GOTO, STAGE_RECON_GROUND, STAGE_TERROR_MISSION, STAGE_BUILD_BASE, STAGE_BASE_ATTACK, STAGE_SUBVERT_GOV, STAGE_SUPPLY, STAGE_SPREAD_XVI, STAGE_INTERCEPT, STAGE_BASE_DISCOVERED, STAGE_HARVEST, STAGE_RETURN_TO_ORBIT, STAGE_OVER } |
enum | mapAction_s { MA_NONE, MA_NEWBASE, MA_NEWINSTALLATION, MA_INTERCEPT, MA_BASEATTACK, MA_UFORADAR } |
Functions | |
int | CP_GetSalaryBaseEmployee (employeeType_t type) |
int | CP_GetSalaryAdminEmployee (employeeType_t type) |
int | CP_GetSalaryRankBonusEmployee (employeeType_t type) |
int | CP_GetSalaryAdministrative (void) |
int | CP_GetSalaryUpKeepBase (const base_t *base) |
void | CP_ParseCharacterData (struct dbuffer *msg) |
Parses the character data which was send by G_MatchSendResults using G_SendCharacterData. | |
qboolean | CP_CheckNextStageDestination (aircraft_t *ufo) |
Check if a stage mission is over when UFO reached destination. | |
void | CP_InitStartup (void) |
void | CL_ResetSinglePlayerData (void) |
Will clear most of the parsed singleplayer data. | |
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. | |
void | CL_DateConvertLong (const date_t *date, dateLong_t *dateLong) |
Converts a date from the engine in a (longer) human-readable format. | |
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_CampaignRun (void) |
Called every frame when we are in geoscape view. | |
void | CP_EndCampaign (qboolean won) |
Function to handle the campaign end. | |
void | CL_UpdateCredits (int credits) |
Sets credits and update mn_credits cvar. | |
aircraft_t * | AIR_NewAircraft (base_t *base, const char *name) |
Places a new aircraft in the given base. | |
const char * | CL_SecondConvert (int second) |
Converts a number of second into a char to display. | |
void | CL_ReadSinglePlayerData (void) |
Read the data for singleplayer campaigns. | |
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. | |
campaign_t * | CL_GetCampaign (const char *name) |
Returns the campaign pointer from global campaign array. | |
void | CL_GameAutoGo (mission_t *mission) |
Handles the auto mission for none storyrelated missions. | |
void | CP_InitMissionResults (qboolean won) |
void | CP_CampaignInit (campaign_t *campaign, qboolean load) |
Called at new game and load game. | |
void | CP_CampaignExit (void) |
qboolean | CP_OnGeoscape (void) |
int | CP_CountMission (void) |
Count the number of mission created. | |
int | CP_CountMissionActive (void) |
Count the number of mission created and active. | |
int | CP_CountMissionOnGeoscape (void) |
Count the number of mission active and displayed on geoscape. | |
void | CP_UpdateMissionVisibleOnGeoscape (void) |
Update all mission visible on geoscape (in base radar range). | |
int | CP_TerrorMissionAvailableUFOs (const mission_t const *mission, ufoType_t *ufoTypes) |
Fill an array with available UFOs for Terror attack mission type. | |
qboolean | AIR_SendAircraftToMission (aircraft_t *aircraft, mission_t *mission) |
Sends the specified aircraft to specified mission. | |
void | AIR_AircraftsNotifyMissionRemoved (const mission_t *mission) |
Notify that a mission has been removed. | |
void | CP_UFOProceedMission (aircraft_t *ufocraft) |
Make UFO proceed with its mission when the fight with another aircraft is over (and UFO survived). | |
qboolean | CP_IsRunning (void) |
Checks whether a campaign mode game is running. | |
mission_t * | CP_CreateNewMission (interestCategory_t category, qboolean beginNow) |
Create a new mission of given category. | |
qboolean | CP_ChooseMap (mission_t *mission, const vec2_t pos) |
Choose a map for given mission. | |
void | CP_StartSelectedMission (void) |
Starts a selected mission. | |
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. | |
void | CP_CheckLostCondition (void) |
Checks whether the player has lost the campaign. | |
void | CL_UpdateCharacterStats (const base_t *base, const aircraft_t *aircraft) |
Update employees stats after mission. | |
Variables | |
memPool_t * | cp_campaignPool |
ccs_t | ccs |
const int | DETECTION_INTERVAL |
delay between actions that must be executed independently of time scale | |
cvar_t * | cp_campaign |
cvar_t * | cp_missiontest |
cvar_t * | cp_start_employees |
Header file for single player campaign control.
Definition in file cp_campaign.h.
#define ALIENCATEGORY_MAX 8 |
Definition at line 105 of file cp_campaign.h.
Referenced by CL_ParseAlienTeam().
#define BID_FACTOR 0.9 |
Definition at line 106 of file cp_campaign.h.
Referenced by BS_InitMarket().
#define BYTES_NONE 0xFF |
Definition at line 42 of file cp_campaign.h.
Referenced by CP_LoadMissionsXML(), and TR_LoadXML().
#define DELAY_BETWEEN_MISSION_SPAWNING 4 |
The length of a single mission spawn cycle.
Definition at line 123 of file cp_campaign.h.
Referenced by CP_InitializeSpawningDelay(), and CP_SpawnNewMissions().
#define FINAL_OVERALL_INTEREST 1000 |
Definition at line 118 of file cp_campaign.h.
Referenced by CP_SpawnNewMissions().
#define HAPPINESS_ALIEN_MISSION_LOSS -0.02 |
Definition at line 97 of file cp_campaign.h.
Referenced by NAT_UpdateHappinessForAllNations().
#define HAPPINESS_MAX_MISSION_IMPACT 0.07 |
Definition at line 100 of file cp_campaign.h.
Referenced by CL_HandleNationData().
#define HAPPINESS_SUBVERSION_LOSS -0.15 |
Definition at line 96 of file cp_campaign.h.
Referenced by CP_BuildBaseGovernmentLeave().
#define HAPPINESS_UFO_SALE_GAIN 0.02 |
Definition at line 98 of file cp_campaign.h.
Referenced by UR_DialogStartSell_f().
#define HAPPINESS_UFO_SALE_LOSS 0.005 |
Definition at line 99 of file cp_campaign.h.
Referenced by UR_DialogStartSell_f().
#define HOURS_PER_ONE_INTEREST 22 |
The amount of time (in hours) it takes for the interest to increase by 1. Is later affected by difficulty.
Definition at line 112 of file cp_campaign.h.
Referenced by CP_IncreaseAlienInterest().
#define INITIAL_OVERALL_INTEREST 20 |
Determines the interest interval for a single campaign.
Definition at line 117 of file cp_campaign.h.
Referenced by CL_ResetAlienInterest(), and CP_SpawnNewMissions().
#define MapIsAfrican | ( | color | ) | (color[0] == 128 && color[1] == 128 && color[2] == 255) |
Definition at line 82 of file cp_campaign.h.
Referenced by MAP_GetCultureType().
#define MapIsArctic | ( | color | ) | (color[0] == 128 && color[1] == 255 && color[2] == 255) |
Definition at line 70 of file cp_campaign.h.
Referenced by MAP_GetTerrainType().
#define MapIsCold | ( | color | ) | (color[0] == 0 && color[1] == 0 && color[2] == 255) |
Definition at line 76 of file cp_campaign.h.
Referenced by MAP_GetTerrainType().
#define MapIsDesert | ( | color | ) | (color[0] == 255 && color[1] == 128 && color[2] == 0) |
Definition at line 71 of file cp_campaign.h.
Referenced by MAP_GetTerrainType().
#define MapIsEastern | ( | color | ) | (color[0] == 255 && color[1] == 128 && color[2] == 0) |
Definition at line 80 of file cp_campaign.h.
Referenced by MAP_GetCultureType().
#define MapIsGrass | ( | color | ) | (color[0] == 128 && color[1] == 255 && color[2] == 0) |
Definition at line 74 of file cp_campaign.h.
#define MapIsMountain | ( | color | ) | (color[0] == 255 && color[1] == 0 && color[2] == 0) |
Definition at line 72 of file cp_campaign.h.
Referenced by MAP_GetTerrainType().
#define MapIsNopopulation | ( | color | ) | (color[0] == 128 && color[1] == 255 && color[2] == 0) |
Definition at line 89 of file cp_campaign.h.
Referenced by MAP_GetCivilianNumberByPosition(), and MAP_GetPopulationType().
#define MapIsOriental | ( | color | ) | (color[0] == 255 && color[1] == 0 && color[2] == 0) |
Definition at line 81 of file cp_campaign.h.
Referenced by MAP_GetCultureType().
#define MapIsRural | ( | color | ) | (color[0] == 128 && color[1] == 128 && color[2] == 255) |
Definition at line 88 of file cp_campaign.h.
Referenced by MAP_GetCivilianNumberByPosition(), and MAP_GetPopulationType().
#define MapIsSuburban | ( | color | ) | (color[0] == 255 && color[1] == 128 && color[2] == 0) |
Definition at line 86 of file cp_campaign.h.
Referenced by MAP_GetCivilianNumberByPosition(), and MAP_GetPopulationType().
#define MapIsTropical | ( | color | ) | (color[0] == 128 && color[1] == 128 && color[2] == 255) |
Definition at line 73 of file cp_campaign.h.
Referenced by MAP_GetTerrainType().
#define MapIsUrban | ( | color | ) | (color[0] == 128 && color[1] == 255 && color[2] == 255) |
Definition at line 85 of file cp_campaign.h.
Referenced by MAP_GetCivilianNumberByPosition(), and MAP_GetPopulationType().
#define MapIsVillage | ( | color | ) | (color[0] == 255 && color[1] == 0 && color[2] == 0) |
Definition at line 87 of file cp_campaign.h.
Referenced by MAP_GetCivilianNumberByPosition(), and MAP_GetPopulationType().
#define MapIsWasted | ( | color | ) | (color[0] == 128 && color[1] == 0 && color[2] == 128) |
Definition at line 75 of file cp_campaign.h.
Referenced by MAP_GetTerrainType().
#define MapIsWater | ( | color | ) | (color[0] == 0 && color[1] == 0 && color[2] == 64) |
Definition at line 67 of file cp_campaign.h.
Referenced by AIRFIGHT_ActionsAfterAirfight(), CP_ChooseMap(), CP_GetRandomPosOnGeoscape(), MAP_GetCivilianNumberByPosition(), MAP_GetCultureType(), MAP_GetPopulationType(), MAP_GetTerrainType(), MAP_MapClick(), and MAP_PositionFitsTCPNTypes().
#define MapIsWestern | ( | color | ) | (color[0] == 128 && color[1] == 255 && color[2] == 255) |
Definition at line 79 of file cp_campaign.h.
Referenced by MAP_GetCultureType().
#define MAX_ALIEN_GROUP_PER_CATEGORY 4 |
Definition at line 103 of file cp_campaign.h.
Referenced by CL_ParseAlienTeam().
#define MAX_ASSEMBLIES 16 |
Definition at line 39 of file cp_campaign.h.
Referenced by CL_ParseComponents().
#define MAX_CAMPAIGNS 16 |
Definition at line 37 of file cp_campaign.h.
Referenced by CL_ParseCampaign(), and CL_ParseCampaignEvents().
#define MAX_PROJECTILESONGEOSCAPE 32 |
Definition at line 107 of file cp_campaign.h.
Referenced by AIRFIGHT_AddProjectile(), and AIRFIGHT_LoadXML().
#define MAXIMUM_MISSIONS_PER_CYCLE 40 |
Definition at line 130 of file cp_campaign.h.
Referenced by CP_SpawnNewMissions().
#define MINIMUM_MISSIONS_PER_CYCLE 5 |
The minimum and maximum amount of missions per mission cycle.
Definition at line 129 of file cp_campaign.h.
Referenced by CP_SpawnNewMissions().
#define NON_OCCURRENCE_PROBABILITY 0.65 |
The probability that any new alien mission will be a non-occurrence mission.
Definition at line 135 of file cp_campaign.h.
Referenced by CP_SpawnNewMissions().
#define RASTER 2 |
Definition at line 93 of file cp_campaign.h.
Referenced by CP_GetRandomPosOnGeoscapeWithParameters().
#define SALARY_ADMIN_INITIAL ccs.salaries[ccs.curCampaign->idx].adminInitial |
Definition at line 339 of file cp_campaign.h.
Referenced by CP_GetSalaryAdministrative().
#define SALARY_AIRCRAFT_DIVISOR ccs.salaries[ccs.curCampaign->idx].aircraftDivisor |
Definition at line 337 of file cp_campaign.h.
Referenced by CL_StatsUpdate_f(), and CP_NationHandleBudget().
#define SALARY_AIRCRAFT_FACTOR ccs.salaries[ccs.curCampaign->idx].aircraftFactor |
Definition at line 336 of file cp_campaign.h.
Referenced by CL_StatsUpdate_f(), and CP_NationHandleBudget().
#define SALARY_BASE_UPKEEP ccs.salaries[ccs.curCampaign->idx].baseUpkeep |
Definition at line 338 of file cp_campaign.h.
Referenced by CP_GetSalaryUpKeepBase().
#define SALARY_DEBT_INTEREST ccs.salaries[ccs.curCampaign->idx].debtInterest |
Definition at line 340 of file cp_campaign.h.
Referenced by CL_StatsUpdate_f(), and CP_NationHandleBudget().
typedef struct alienTeamCategory_s alienTeamCategory_t |
alien team category definition
typedef struct alienTeamGroup_s alienTeamGroup_t |
alien team group definition.
typedef struct battleParam_s battleParam_t |
battlescape parameters that were used
typedef struct campaign_s campaign_t |
campaign definition
typedef struct dateLong_s dateLong_t |
Human readable time information in the game.
typedef enum interestCategory_s interestCategory_t |
possible campaign interest categories: type of missions that aliens can undertake
typedef enum mapAction_s mapAction_t |
possible geoscape actions
mission definition
typedef enum missionDetectionStatus_s missionDetectionStatus_t |
possible mission detection status
typedef struct missionResults_s missionResults_t |
Structure with mission info needed to create results summary at menu won.
typedef enum missionStage_s missionStage_t |
possible stage for campaign missions (i.e. possible actions for UFO)
enum interestCategory_s |
possible campaign interest categories: type of missions that aliens can undertake
Definition at line 155 of file cp_campaign.h.
enum mapAction_s |
possible geoscape actions
MA_NONE | |
MA_NEWBASE |
build a new base |
MA_NEWINSTALLATION |
build a new installation |
MA_INTERCEPT |
intercept |
MA_BASEATTACK |
base attacking |
MA_UFORADAR |
ufos are in our radar |
Definition at line 349 of file cp_campaign.h.
enum mapType_s |
possible map types
Definition at line 138 of file cp_campaign.h.
possible mission detection status
Definition at line 148 of file cp_campaign.h.
enum missionStage_s |
possible stage for campaign missions (i.e. possible actions for UFO)
Definition at line 174 of file cp_campaign.h.
void AIR_AircraftsNotifyMissionRemoved | ( | const mission_t *const | mission | ) |
Notify that a mission has been removed.
[in] | mission | Pointer to the mission that has been removed. |
Definition at line 1810 of file cp_aircraft.c.
References AIR_AircraftReturnToBase(), AIR_GetNextFromBase(), AIR_MISSION, B_GetFoundedBaseByIDX(), ccs, aircraft_s::mission, ccs_s::numBases, and aircraft_s::status.
Referenced by CP_MissionRemoveFromGeoscape().
aircraft_t* AIR_NewAircraft | ( | base_t * | base, | |
const char * | name | |||
) |
Places a new aircraft in the given base.
[in] | base | Pointer to base where aircraft should be added. |
[in] | name | Id of aircraft to add (aircraft->id). |
< set a unique index to this aircraft.
Definition at line 786 of file cp_aircraft.c.
References _, AII_SetAircraftInSlots(), AII_UpdateAircraftStats(), AIR_Add(), AIR_GetAircraft(), AIR_ResetAircraftTeam(), AIR_STATS_DAMAGE, AIR_STATS_FUELSIZE, AIR_UpdateHangarCapForOne(), AIRCRAFT_HANGAR_ERROR, base_s::aircraftCurrent, stats_s::aircraftHad, ccs_s::campaignStats, ccs, Cmd_ExecuteString(), Com_DPrintf(), Com_Printf(), Com_sprintf(), cp_messageBuffer, aircraft_s::damage, DEBUG_CLIENT, aircraft_s::defaultName, aircraft_s::direction, aircraft_s::fuel, aircraft_s::hangar, aircraft_s::homebase, aircraft_s::id, aircraft_s::idx, lengthof, MS_AddNewMessage(), MSG_STANDARD, base_s::name, aircraft_s::name, aircraft_s::pos, base_s::pos, Q_strncpyz(), qfalse, aircraft_s::radar, RADAR_AIRCRAFTRANGE, RADAR_AIRCRAFTTRACKINGRANGE, RADAR_Initialise(), aircraft_s::size, aircraft_s::stats, aircraft_s::tpl, Vector2Copy, and VectorSet.
Referenced by B_SetUpFirstBase(), BS_BuyAircraft_f(), and PR_ProductionFrame().
qboolean AIR_SendAircraftToMission | ( | aircraft_t * | aircraft, | |
mission_t * | mission | |||
) |
Sends the specified aircraft to specified mission.
[in] | aircraft | Pointer to aircraft to send to mission. |
[in] | mission | Pointer to given mission. |
Definition at line 1350 of file cp_aircraft.c.
References _, mission_s::active, AII_ReloadAircraftWeapons(), AIR_AircraftHasEnoughFuel(), AIR_GetTeamSize(), AIR_IsAircraftInBase(), AIR_MISSION, BASE_UNDER_ATTACK, base_s::baseStatus, ccs, aircraft_s::homebase, ccs_s::interceptAircraft, MAP_MapCalcLine(), aircraft_s::mission, MS_AddNewMessage(), MSG_STANDARD, aircraft_s::point, aircraft_s::pos, mission_s::pos, qfalse, qtrue, aircraft_s::route, aircraft_s::status, aircraft_s::time, UI_Popup(), and UI_PushWindow().
Referenced by CL_PopupAircraftClick_f(), and CL_PopupInterceptClick_f().
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_ReadSinglePlayerData | ( | void | ) |
Read the data for singleplayer campaigns.
Definition at line 788 of file cp_parse.c.
References ccs, CHRSH_IsTeamDefAlien(), CL_ParseScriptFirst(), CL_ParseScriptSecond(), Com_DPrintf(), Com_Error(), Com_Printf(), csi, DEBUG_CLIENT, ERR_DROP, FS_BuildFileList(), FS_NextScriptHeader(), i, teamDef_s::id, teamDef_s::idx, name, ccs_s::numBuildingTemplates, ccs_s::numCities, ccs_s::numNations, ccs_s::numRanks, csi_s::numTeamDefs, ccs_s::numTechnologies, RS_GetTechByID(), RS_RequiredLinksAssign(), csi_s::teamDef, ccs_s::teamDefTechs, teamDef_s::tech, type, and UFO_SIZE_T.
Referenced by GAME_CP_InitStartup().
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().
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().
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().
qboolean CP_CheckNextStageDestination | ( | aircraft_t * | ufocraft | ) |
Check if a stage mission is over when UFO reached destination.
[in] | ufocraft | Pointer to the ufo that reached destination. |
Definition at line 1288 of file cp_missions.c.
References CP_MissionStageEnd(), aircraft_s::mission, qfalse, qtrue, mission_s::stage, STAGE_COME_FROM_ORBIT, STAGE_MISSION_GOTO, and STAGE_RETURN_TO_ORBIT.
Referenced by UFO_CampaignRunUFOs().
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().
int CP_CountMission | ( | void | ) |
Count the number of mission created.
Definition at line 562 of file cp_missions.c.
References ccs, Com_Printf(), linkedList_s::data, ccs_s::missions, linkedList_s::next, mission_s::stage, and STAGE_OVER.
Referenced by CP_MissionRemove().
int CP_CountMissionActive | ( | void | ) |
Count the number of mission created and active.
Definition at line 593 of file cp_missions.c.
References ccs, Com_DPrintf(), linkedList_s::data, DEBUG_CLIENT, ccs_s::missions, linkedList_s::next, mission_s::stage, STAGE_NOT_ACTIVE, and STAGE_OVER.
int CP_CountMissionOnGeoscape | ( | void | ) |
Count the number of mission active and displayed on geoscape.
Definition at line 618 of file cp_missions.c.
References ccs, linkedList_s::data, ccs_s::missions, linkedList_s::next, mission_s::onGeoscape, mission_s::stage, STAGE_NOT_ACTIVE, and STAGE_OVER.
Referenced by MAP_GetGeoscapeAngle().
mission_t* CP_CreateNewMission | ( | interestCategory_t | category, | |
qboolean | beginNow | |||
) |
Create a new mission of given category.
[in] | category | category of the mission |
[in] | beginNow | true if the mission should begin now |
Definition at line 1605 of file cp_missions.c.
References byte, ccs_s::campaignStats, mission_s::category, ccs, CP_BaseAttackMissionOnSpawn(), CP_BuildBaseMissionOnSpawn(), CP_SetMissionName(), CP_TerrorMissionOnSpawn(), linkedList_s::data, ccs_s::date, Date_Add(), Date_Random(), date_s::day, mission_s::finalDate, mission_s::idx, mission_s::initialIndividualInterest, mission_s::initialOverallInterest, ccs_s::interest, INTERESTCATEGORY_BASE_ATTACK, INTERESTCATEGORY_BUILDING, INTERESTCATEGORY_MAX, INTERESTCATEGORY_TERROR_ATTACK, LIST_Add(), ccs_s::missions, stats_s::missions, ccs_s::overallInterest, date_s::sec, mission_s::stage, STAGE_NOT_ACTIVE, mission_s::startDate, and mission_s::ufo.
Referenced by CP_SpawnAlienBaseMission(), CP_SpawnNewMissions(), CP_SpawnRescueMission(), and CP_StartXVISpreading_f().
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().
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().
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().
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().
Fill an array with available UFOs for Terror attack mission type.
[in] | mission | Pointer to the mission we are currently creating (may be NULL if we want to know what UFO types will be needed during the whole game). |
[out] | ufoTypes | Array of ufoType_t that may be used for this mission. |
ufoTypes
<
Definition at line 179 of file cp_mission_terror.c.
References UFO_BOMBER, UFO_CORRUPTER, UFO_HARVESTER, and UFO_ShouldAppearOnGeoscape().
Referenced by CP_MissionChooseUFO(), and NAT_ScriptSanityCheck().
void CP_UFOProceedMission | ( | aircraft_t * | ufo | ) |
Make UFO proceed with its mission when the fight with another aircraft is over (and UFO survived).
[in] | ufo | Pointer to the ufo that should proceed a mission. |
Definition at line 1313 of file cp_missions.c.
References AIR_TRANSIT, AIRFIGHT_ChooseWeapon(), AIRFIGHT_WEAPON_CAN_NEVER_SHOOT, mission_s::category, CP_MissionStageEnd(), mission_s::data, INTERESTCATEGORY_INTERCEPT, aircraft_s::maxWeapons, aircraft_s::mission, mission_s::pos, aircraft_s::pos, mission_s::stage, STAGE_MISSION_GOTO, STAGE_RETURN_TO_ORBIT, aircraft_s::status, UFO_SendToDestination(), UFO_SetRandomDest(), and aircraft_s::weapons.
Referenced by AIRFIGHT_ActionsAfterAirfight(), AIRFIGHT_ExecuteActions(), and UFO_CheckShootBack().
void CP_UpdateMissionVisibleOnGeoscape | ( | void | ) |
Update all mission visible on geoscape (in base radar range).
Definition at line 859 of file cp_missions.c.
References ccs, CP_CheckMissionVisibleOnGeoscape(), CP_MissionAddToGeoscape(), CP_MissionRemoveFromGeoscape(), linkedList_s::data, MISDET_ALWAYS_DETECTED, MISDET_CANT_BE_DETECTED, ccs_s::missions, linkedList_s::next, mission_s::onGeoscape, and qfalse.
Referenced by RADAR_UpdateBaseRadarCoverage_f(), and RADAR_UpdateInstallationRadarCoverage().
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().
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 |
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().