cp_mission_intercept.c File Reference

Campaign mission. More...

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

Go to the source code of this file.

Functions

void CP_InterceptMissionIsSuccess (mission_t *mission)
 Intercept mission is over and is a success: change interest values.
void CP_InterceptMissionIsFailure (mission_t *mission)
 Intercept mission is over and is a failure: change interest values.
void CP_InterceptMissionLeave (mission_t *mission, qboolean destroyed)
 Intercept mission ends: UFO leave earth.
static void CP_InterceptAttackInstallation (mission_t *mission)
 UFO starts to attack the installation.
void CP_InterceptAircraftMissionSet (mission_t *mission)
 Set Intercept mission: UFO looks for new aircraft target.
static installation_tCP_InterceptChooseInstallation (const mission_t *mission)
 Choose Base that will be attacked, and add it to mission description.
void CP_InterceptGoToInstallation (mission_t *mission)
 Set Intercept mission: UFO chooses an installation an flies to it.
static void CP_InterceptMissionSet (mission_t *mission)
 Set Intercept mission: choose between attacking aircraft or installations.
int CP_InterceptMissionAvailableUFOs (const mission_t const *mission, ufoType_t *ufoTypes)
 Fill an array with available UFOs for Intercept mission type.
void CP_InterceptNextStage (mission_t *mission)
 Determine what action should be performed when a Intercept mission stage ends.

Detailed Description

Campaign mission.

Definition in file cp_mission_intercept.c.


Function Documentation

void CP_InterceptAircraftMissionSet ( mission_t mission  ) 

Set Intercept mission: UFO looks for new aircraft target.

Note:
Intercept mission -- Stage 1

Definition at line 124 of file cp_mission_intercept.c.

References ccs, ccs_s::date, Date_Add(), Date_Random(), mission_s::finalDate, mission_s::stage, and STAGE_INTERCEPT.

Referenced by CP_InterceptMissionSet().

static void CP_InterceptAttackInstallation ( mission_t mission  )  [static]
static installation_t* CP_InterceptChooseInstallation ( const mission_t mission  )  [static]

Choose Base that will be attacked, and add it to mission description.

Note:
Base attack mission -- Stage 1
Returns:
Pointer to the base, NULL if no base set

Definition at line 138 of file cp_mission_intercept.c.

References installation_s::alienInterest, frand(), INS_GetFoundedInstallationByIDX(), and MAX_INSTALLATIONS.

Referenced by CP_InterceptGoToInstallation().

void CP_InterceptGoToInstallation ( mission_t mission  ) 
int CP_InterceptMissionAvailableUFOs ( const mission_t const *  mission,
ufoType_t ufoTypes 
)

Fill an array with available UFOs for Intercept 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:
Intercept mission -- Stage 0
Returns:
number of elements written in ufoTypes

Definition at line 220 of file cp_mission_intercept.c.

References frand(), UFO_FIGHTER, and UFO_HARVESTER.

Referenced by CP_MissionChooseUFO().

void CP_InterceptMissionIsFailure ( mission_t mission  ) 

Intercept mission is over and is a failure: change interest values.

Note:
Intercept mission

Definition at line 53 of file cp_mission_intercept.c.

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

Referenced by CP_MissionIsOver().

void CP_InterceptMissionIsSuccess ( mission_t mission  ) 

Intercept mission is over and is a success: change interest values.

Note:
Intercept mission

Definition at line 38 of file cp_mission_intercept.c.

References CL_ChangeIndividualInterest(), CP_IsXVIResearched(), CP_MissionRemove(), f, INTERESTCATEGORY_HARVEST, INTERESTCATEGORY_INTERCEPT, INTERESTCATEGORY_RECON, and INTERESTCATEGORY_XVI.

Referenced by CP_InterceptNextStage(), and CP_MissionIsOver().

void CP_InterceptMissionLeave ( mission_t mission,
qboolean  destroyed 
)

Intercept mission ends: UFO leave earth.

Parameters:
[in] mission Pointer to the mission
[in] destroyed true if the UFO actually destroyed the installation, false else
Note:
Intercept mission -- Stage 3

Definition at line 69 of file cp_mission_intercept.c.

References CP_MissionDisableTimeLimit(), CP_MissionRemoveFromGeoscape(), mission_s::data, installation_s::founded, INS_DestroyInstallation(), aircraft_s::landed, installation_s::pos, mission_s::pos, qfalse, mission_s::stage, STAGE_RETURN_TO_ORBIT, mission_s::ufo, UFO_EPSILON, UFO_SetRandomDest(), and VectorCompareEps().

Referenced by CP_InterceptNextStage(), and CP_MissionNotifyInstallationDestroyed().

static void CP_InterceptMissionSet ( mission_t mission  )  [static]

Set Intercept mission: choose between attacking aircraft or installations.

Note:
Intercept mission -- Stage 1

Definition at line 201 of file cp_mission_intercept.c.

References ccs, CP_InterceptAircraftMissionSet(), CP_InterceptGoToInstallation(), ccs_s::numInstallations, mission_s::ufo, UFO_HARVESTER, and aircraft_s::ufotype.

Referenced by CP_InterceptNextStage().

void CP_InterceptNextStage ( mission_t mission  ) 

Generated by  doxygen 1.6.2