cp_mission_buildbase.c File Reference

Campaign mission code for alien bases. More...

#include "../../cl_shared.h"
#include "../cp_campaign.h"
#include "../cp_alienbase.h"
#include "../cp_map.h"
#include "../cp_ufo.h"
#include "../cp_missions.h"
#include "../cp_time.h"
#include "../cp_xvi.h"
#include "../cp_alien_interest.h"
Include dependency graph for cp_mission_buildbase.c:

Go to the source code of this file.

Functions

qboolean CP_BasemissionIsSubvertingGovernmentMission (const mission_t *mission)
void CP_BuildBaseMissionIsSuccess (mission_t *mission)
 Build Base mission is over and is a success (from an alien point of view): change interest values.
void CP_BuildBaseMissionIsFailure (mission_t *mission)
 Build Base mission is over and is a failure (from an alien point of view): change interest values.
void CP_BuildBaseMissionOnSpawn (void)
 Run when the mission is spawned.
void CP_BuildBaseMissionBaseDestroyed (mission_t *mission)
 Alien base has been destroyed: change interest values.
static void CP_BuildBaseMissionLeave (mission_t *mission)
 Build Base mission ends: UFO leave earth.
static void CP_BuildBaseSetUpBase (mission_t *mission)
 UFO arrived on new base destination: build base.
static void CP_BuildBaseGoToBase (mission_t *mission)
 Go to new base position.
static void CP_BuildBaseGovernmentLeave (mission_t *mission)
 Subverting Mission ends: UFO leave earth.
static void CP_BuildBaseSubvertGovernment (mission_t *mission)
 Start Subverting Mission.
static void CP_BuildBaseChooseMission (mission_t *mission)
 Choose if the mission should be an alien infiltration or a build base mission.
int CP_BuildBaseMissionAvailableUFOs (const mission_t const *mission, ufoType_t *ufoTypes)
 Fill an array with available UFOs for build base mission type.
void CP_BuildBaseMissionNextStage (mission_t *mission)
 Determine what action should be performed when a Build Base mission stage ends.

Variables

const int STARTING_BASEBUILD_INTEREST = 300

Detailed Description

Campaign mission code for alien bases.

Definition in file cp_mission_buildbase.c.


Function Documentation

qboolean CP_BasemissionIsSubvertingGovernmentMission ( const mission_t mission  ) 

This mission type has no alienbase set

Parameters:
mission The mission to check
Returns:

Definition at line 44 of file cp_mission_buildbase.c.

References mission_s::initialOverallInterest, and STARTING_BASEBUILD_INTEREST.

Referenced by CP_BuildBaseChooseMission(), CP_BuildBaseMissionAvailableUFOs(), CP_BuildBaseMissionIsSuccess(), CP_BuildBaseMissionNextStage(), and CP_LoadMissionsXML().

static void CP_BuildBaseChooseMission ( mission_t mission  )  [static]

Choose if the mission should be an alien infiltration or a build base mission.

Note:
Build Base mission -- Stage 1

Definition at line 225 of file cp_mission_buildbase.c.

References CP_BasemissionIsSubvertingGovernmentMission(), CP_BuildBaseGoToBase(), and CP_ReconMissionGroundGo().

Referenced by CP_BuildBaseMissionNextStage().

static void CP_BuildBaseGoToBase ( mission_t mission  )  [static]

Go to new base position.

Parameters:
[in,out] mission Pointer to the mission
Note:
Build Base mission -- Stage 1

Definition at line 163 of file cp_mission_buildbase.c.

References AB_SetAlienBasePosition(), mission_s::pos, mission_s::stage, STAGE_MISSION_GOTO, mission_s::ufo, and UFO_SendToDestination().

Referenced by CP_BuildBaseChooseMission().

static void CP_BuildBaseGovernmentLeave ( mission_t mission  )  [static]

Subverting Mission ends: UFO leave earth.

Note:
Build Base mission -- Stage 3

Todo:
when the mission is created, we should select a position where nation exists, otherwise subverting a government is meaningless

Definition at line 178 of file cp_mission_buildbase.c.

References CP_MissionDisableTimeLimit(), nationInfo_s::happiness, HAPPINESS_SUBVERSION_LOSS, aircraft_s::landed, MAP_GetNation(), NAT_SetHappiness(), mission_s::pos, qfalse, mission_s::stage, STAGE_RETURN_TO_ORBIT, nation_s::stats, mission_s::ufo, and UFO_SetRandomDest().

Referenced by CP_BuildBaseMissionNextStage().

int CP_BuildBaseMissionAvailableUFOs ( const mission_t const *  mission,
ufoType_t ufoTypes 
)

Fill an array with available UFOs for build base mission type.

Parameters:
[in] mission Pointer to the mission we are currently creating.
[out] ufoTypes Array of ufoType_t that may be used for this mission.
Note:
Base Attack mission -- Stage 0
Returns:
number of elements written in ufoTypes

Definition at line 240 of file cp_mission_buildbase.c.

References CP_BasemissionIsSubvertingGovernmentMission(), UFO_SCOUT, and UFO_SUPPLY.

Referenced by CP_MissionChooseUFO().

void CP_BuildBaseMissionBaseDestroyed ( mission_t mission  ) 

Alien base has been destroyed: change interest values.

Note:
Build Base mission

Definition at line 97 of file cp_mission_buildbase.c.

References AB_DestroyBase(), CL_ChangeIndividualInterest(), CP_MissionRemove(), mission_s::data, f, INTERESTCATEGORY_BUILDING, and INTERESTCATEGORY_INTERCEPT.

Referenced by CP_MissionIsOver().

void CP_BuildBaseMissionIsFailure ( mission_t mission  ) 

Build Base mission is over and is a failure (from an alien point of view): change interest values.

Note:
Build Base mission

Definition at line 76 of file cp_mission_buildbase.c.

References CL_ChangeIndividualInterest(), CP_MissionRemove(), f, INTERESTCATEGORY_BASE_ATTACK, and INTERESTCATEGORY_BUILDING.

Referenced by CP_MissionIsOver().

void CP_BuildBaseMissionIsSuccess ( mission_t mission  ) 

Build Base mission is over and is a success (from an alien point of view): change interest values.

Note:
Build Base mission

Definition at line 53 of file cp_mission_buildbase.c.

References CL_ChangeIndividualInterest(), CP_BasemissionIsSubvertingGovernmentMission(), CP_MissionRemove(), CP_SpreadXVIAtPos(), mission_s::data, f, INTERESTCATEGORY_HARVEST, INTERESTCATEGORY_SUPPLY, INTERESTCATEGORY_TERROR_ATTACK, INTERESTCATEGORY_XVI, and alienBase_s::pos.

Referenced by CP_BuildBaseMissionNextStage(), and CP_MissionIsOver().

static void CP_BuildBaseMissionLeave ( mission_t mission  )  [static]

Build Base mission ends: UFO leave earth.

Note:
Build Base mission -- Stage 3

Definition at line 115 of file cp_mission_buildbase.c.

References CP_MissionDisableTimeLimit(), mission_s::data, aircraft_s::landed, qfalse, mission_s::stage, STAGE_RETURN_TO_ORBIT, mission_s::ufo, and UFO_SetRandomDest().

Referenced by CP_BuildBaseMissionNextStage().

void CP_BuildBaseMissionNextStage ( mission_t mission  ) 
void CP_BuildBaseMissionOnSpawn ( void   ) 

Run when the mission is spawned.

Definition at line 88 of file cp_mission_buildbase.c.

References CL_ChangeIndividualInterest(), f, and INTERESTCATEGORY_BUILDING.

Referenced by CP_CreateNewMission().

static void CP_BuildBaseSetUpBase ( mission_t mission  )  [static]

UFO arrived on new base destination: build base.

Parameters:
[in,out] mission Pointer to the mission
Note:
Build Base mission -- Stage 2

< Minimum time needed to start a new base construction

< Maximum time needed to start a new base construction

Definition at line 134 of file cp_mission_buildbase.c.

References AB_BuildBase(), ccs, Com_DPrintf(), CP_MissionRemove(), CP_UFORemoveFromGeoscape(), mission_s::data, ccs_s::date, Date_Add(), Date_Random(), DEBUG_CLIENT, mission_s::finalDate, mission_s::pos, qfalse, mission_s::stage, STAGE_BUILD_BASE, and mission_s::ufo.

Referenced by CP_BuildBaseMissionNextStage().

static void CP_BuildBaseSubvertGovernment ( mission_t mission  )  [static]

Start Subverting Mission.

Note:
Build Base mission -- Stage 2

Definition at line 204 of file cp_mission_buildbase.c.

References ccs, CP_MissionAddToGeoscape(), CP_UFORemoveFromGeoscape(), ccs_s::date, Date_Add(), Date_Random(), mission_s::finalDate, qfalse, mission_s::stage, STAGE_SUBVERT_GOV, and mission_s::ufo.

Referenced by CP_BuildBaseMissionNextStage().


Variable Documentation

const int STARTING_BASEBUILD_INTEREST = 300

Overall alien interest value for starting constructing alien bases.

Definition at line 37 of file cp_mission_buildbase.c.

Referenced by CP_BasemissionIsSubvertingGovernmentMission().


Generated by  doxygen 1.6.2