UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_mission_rescue.cpp File Reference

Campaign mission code. More...

#include "../../../cl_shared.h"
#include "../cp_campaign.h"
#include "../cp_missions.h"
#include "../cp_time.h"
#include "../cp_ufo.h"
#include "cp_mission_rescue.h"

Go to the source code of this file.

Functions

static void CP_BeginRescueMission (mission_t *mission)
 Actions to be done when UFO arrived at rescue mission location. More...
 
void CP_EndRescueMission (mission_t *mission, aircraft_t *aircraft, bool won)
 Actions to be done when rescue mission finished/expired. More...
 
static void CP_LeaveRescueMission (mission_t *mission)
 Rescue mission expired, UFO leave earth. More...
 
void CP_RescueNextStage (mission_t *mission)
 Determine what action should be performed when a Rescue mission stage ends. More...
 

Detailed Description

Campaign mission code.

Definition in file cp_mission_rescue.cpp.

Function Documentation

static void CP_BeginRescueMission ( mission_t mission)
static

Actions to be done when UFO arrived at rescue mission location.

Parameters
[in,out]missionPointer to the finished mission

Definition at line 36 of file cp_mission_rescue.cpp.

References ccs, cgi, cgame_import_s::Com_GetMapDefinitionByID(), CP_MissionAddToGeoscape(), CP_MissionRemove(), ccs_s::date, Date_Add(), Date_Random(), ERR_DROP, mission_s::finalDate, aircraft_s::landed, mission_s::mapDef, mission_s::posAssigned, mission_s::stage, STAGE_RECON_GROUND, and mission_s::ufo.

Referenced by CP_RescueNextStage().

void CP_EndRescueMission ( mission_t mission,
aircraft_t aircraft,
bool  won 
)

Actions to be done when rescue mission finished/expired.

Parameters
[in,out]missionPointer to the finished mission
[in,out]aircraftPointer to the dropship done the mission
[in]wonBoolean flag if thew mission was successful (from PHALANX's PoV)
Todo:
it should be dumped to the cargo loot of the dropship done the rescue mission not the base directly

Definition at line 65 of file cp_mission_rescue.cpp.

References aircraft_s::acTeam, AIR_DestroyAircraft(), AIR_RemoveEmployee(), mission_s::missionData_t::aircraft, B_DumpAircraftToHomeBase(), ccs, CP_CheckMissionLimitedInTime(), mission_s::data, ccs_s::date, Date_LaterThan(), mission_s::finalDate, LIST_Foreach, and aircraft_s::pilot.

Referenced by CP_LeaveRescueMission(), and CP_MissionEndActions().

static void CP_LeaveRescueMission ( mission_t mission)
static

Rescue mission expired, UFO leave earth.

Parameters
[in,out]missionPointer to the mission

Definition at line 94 of file cp_mission_rescue.cpp.

References ccs, CP_EndRescueMission(), CP_MissionDisableTimeLimit(), CP_MissionRemoveFromGeoscape(), ccs_s::date, mission_s::finalDate, aircraft_s::landed, mission_s::stage, STAGE_RETURN_TO_ORBIT, mission_s::ufo, and UFO_SetRandomDest().

Referenced by CP_RescueNextStage().

void CP_RescueNextStage ( mission_t mission)

Determine what action should be performed when a Rescue mission stage ends.

Parameters
[in,out]missionPointer to the mission which stage ended.

Definition at line 115 of file cp_mission_rescue.cpp.

References cgi, CP_BeginRescueMission(), CP_LeaveRescueMission(), CP_MissionRemove(), mission_s::stage, STAGE_MISSION_GOTO, STAGE_RECON_GROUND, and STAGE_RETURN_TO_ORBIT.

Referenced by CP_MissionStageEnd().