UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_mission_harvest.cpp File Reference

Campaign mission. More...

#include "../../../DateTime.h"
#include "../../../cl_shared.h"
#include "../cp_campaign.h"
#include "../cp_geoscape.h"
#include "../cp_ufo.h"
#include "../cp_missions.h"
#include "../cp_time.h"
#include "../cp_xvi.h"
#include "../cp_alien_interest.h"
#include "cp_mission_harvest.h"
#include "cp_mission_recon.h"
Include dependency graph for cp_mission_harvest.cpp:

Go to the source code of this file.

Functions

static void CP_HarvestMissionIsSuccess (mission_t *mission)
 Harvesting mission is over and is a success: change interest values.
void CP_HarvestMissionIsFailure (mission_t *mission)
 Harvesting mission is over and is a failure: change interest values.
static void CP_HarvestMissionStart (mission_t *mission)
 Start Harvesting mission.
static bool CP_ChooseNation (const mission_t *mission, linkedList_t **nationList)
 Choose nation if needed for given mission.
void CP_HarvestMissionGo (mission_t *mission)
 Set Harvest mission, and go to mission pos.
void CP_HarvestMissionNextStage (mission_t *mission)
 Determine what action should be performed when a Harvesting mission stage ends.

Detailed Description

Campaign mission.

Definition in file cp_mission_harvest.cpp.

Function Documentation

◆ CP_ChooseNation()

bool CP_ChooseNation ( const mission_t * mission,
linkedList_t ** nationList )
static

Choose nation if needed for given mission.

Parameters
[in]missionPointer to the mission we are creating.
[out]nationListlinkedList that will contain the name of the nation where the mission should take place.
Note
nationList should be empty if no nation should be favoured.
Returns
True if nationList has been filled, false else.

Definition at line 97 of file cp_mission_harvest.cpp.

References cgi, frand(), int(), NAT_Foreach, NAT_GetCurrentMonthInfo(), mission_t::ufo, and nationInfo_t::xviInfection.

Referenced by CP_HarvestMissionGo().

◆ CP_HarvestMissionGo()

void CP_HarvestMissionGo ( mission_t * mission)

Set Harvest mission, and go to mission pos.

Note
Harvesting attack mission – Stage 1
Todo
Remove me when CP_XVIMissionGo will be implemented This function should take a location close to an XVI infection point see gameplay proposal on wiki

Definition at line 135 of file cp_mission_harvest.cpp.

References ccs, cgi, CP_ChooseMap(), CP_ChooseNation(), CP_GetRandomPosOnGeoscapeWithParameters(), CP_MissionDisableTimeLimit(), CP_MissionRemove(), mapDef_t::cultures, mission_t::finalDate, GEO_PositionCloseToBase(), mission_t::mapDef, MAX_POS_LOOP, mapDef_t::populations, mission_t::pos, mission_t::posAssigned, mission_t::stage, STAGE_MISSION_GOTO, mapDef_t::terrains, mission_t::ufo, and UFO_SendToDestination().

Referenced by CP_HarvestMissionNextStage(), and CP_XVIMissionNextStage().

◆ CP_HarvestMissionIsFailure()

void CP_HarvestMissionIsFailure ( mission_t * mission)

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

Note
Harvesting mission

Definition at line 57 of file cp_mission_harvest.cpp.

References CP_MissionRemove(), INT_ChangeIndividualInterest(), INTERESTCATEGORY_BASE_ATTACK, INTERESTCATEGORY_INTERCEPT, and INTERESTCATEGORY_TERROR_ATTACK.

Referenced by CP_MissionIsOver().

◆ CP_HarvestMissionIsSuccess()

void CP_HarvestMissionIsSuccess ( mission_t * mission)
static

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

Note
Harvesting mission

Definition at line 42 of file cp_mission_harvest.cpp.

References CP_IsXVIStarted, CP_MissionRemove(), INT_ChangeIndividualInterest(), INTERESTCATEGORY_BUILDING, INTERESTCATEGORY_HARVEST, INTERESTCATEGORY_RECON, and INTERESTCATEGORY_XVI.

Referenced by CP_HarvestMissionNextStage().

◆ CP_HarvestMissionNextStage()

void CP_HarvestMissionNextStage ( mission_t * mission)

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

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

Definition at line 177 of file cp_mission_harvest.cpp.

References cgi, CP_HarvestMissionGo(), CP_HarvestMissionIsSuccess(), CP_HarvestMissionStart(), CP_MissionBegin(), CP_MissionRemove(), CP_ReconMissionLeave(), mission_t::stage, STAGE_COME_FROM_ORBIT, STAGE_HARVEST, STAGE_MISSION_GOTO, STAGE_NOT_ACTIVE, and STAGE_RETURN_TO_ORBIT.

Referenced by CP_MissionStageEnd().

◆ CP_HarvestMissionStart()

void CP_HarvestMissionStart ( mission_t * mission)
static

Start Harvesting mission.

Note
Harvesting mission – Stage 2

Definition at line 70 of file cp_mission_harvest.cpp.

References ccs, CP_MissionAddToGeoscape(), CP_UFORemoveFromGeoscape(), Date_Random(), mission_t::finalDate, mission_t::stage, STAGE_HARVEST, and mission_t::ufo.

Referenced by CP_HarvestMissionNextStage().