cp_mission_harvest.c File Reference

Campaign mission. More...

#include "../../cl_shared.h"
#include "../cp_campaign.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_harvest.c:

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 qboolean 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.
int CP_HarvestMissionAvailableUFOs (const mission_t const *mission, ufoType_t *ufoTypes)
 Fill an array with available UFOs for Harvesting mission type.
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.c.


Function Documentation

static qboolean CP_ChooseNation ( const mission_t mission,
linkedList_t **  nationList 
) [static]

Choose nation if needed for given mission.

Parameters:
[in] mission Pointer to the mission we are creating.
[out] nationList linkedList 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 94 of file cp_mission_harvest.c.

References ccs, frand(), nation_s::id, int(), LIST_AddString(), ccs_s::nations, ccs_s::numNations, qfalse, qtrue, nation_s::stats, mission_s::ufo, and nationInfo_s::xviInfection.

Referenced by CP_HarvestMissionGo().

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

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

Definition at line 184 of file cp_mission_harvest.c.

References UFO_HARVESTER.

Referenced by CP_MissionChooseUFO().

void CP_HarvestMissionGo ( mission_t mission  ) 
void CP_HarvestMissionIsFailure ( mission_t mission  ) 

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

Note:
Harvesting mission

Definition at line 54 of file cp_mission_harvest.c.

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

Referenced by CP_MissionIsOver().

static void CP_HarvestMissionIsSuccess ( mission_t mission  )  [static]

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

Note:
Harvesting mission

Definition at line 39 of file cp_mission_harvest.c.

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

Referenced by CP_HarvestMissionNextStage().

void CP_HarvestMissionNextStage ( mission_t mission  ) 

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

Parameters:
[in] mission Pointer to the mission which stage ended.

Definition at line 197 of file cp_mission_harvest.c.

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

Referenced by CP_MissionStageEnd().

static void CP_HarvestMissionStart ( mission_t mission  )  [static]

Start Harvesting mission.

Note:
Harvesting mission -- Stage 2

Definition at line 67 of file cp_mission_harvest.c.

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

Referenced by CP_HarvestMissionNextStage().


Generated by  doxygen 1.6.2