26 #include "../../../cl_shared.h"
27 #include "../cp_campaign.h"
28 #include "../cp_geoscape.h"
29 #include "../cp_ufo.h"
30 #include "../cp_missions.h"
31 #include "../cp_time.h"
32 #include "../cp_xvi.h"
33 #include "../cp_alien_interest.h"
71 const date_t minMissionDelay = {2, 0};
72 const date_t missionDelay = {3, 0};
98 int randomNumber, max = 0;
101 const int OFFSET = 1;
112 randomNumber = (
int) (
frand() * (float) max);
118 if (randomNumber < 0) {
119 cgi->LIST_AddString(nationList, nation->id);
151 if (counter >= MAX_POS_LOOP) {
152 cgi->Com_Printf(
"CP_HarvestMissionGo: Error, could not set position.\n");
156 cgi->LIST_Delete(&nationList);
158 cgi->Com_Printf(
"CP_HarvestMissionGo: No map found, remove mission.\n");
178 switch (mission->
stage) {
200 cgi->Com_Printf(
"CP_HarvestMissionNextStage: Unknown stage: %i, removing mission.\n", mission->
stage);
static void CP_HarvestMissionStart(mission_t *mission)
Start Harvesting mission.
const nationInfo_t * NAT_GetCurrentMonthInfo(const nation_t *const nation)
Get the current month nation stats.
static void CP_HarvestMissionIsSuccess(mission_t *mission)
Harvesting mission is over and is a success: change interest values.
Campaign mission headers.
bool CP_ChooseMap(mission_t *mission, const vec2_t pos)
Choose a map for given mission.
void CP_HarvestMissionNextStage(mission_t *mission)
Determine what action should be performed when a Harvesting mission stage ends.
linkedList_t * populations
void INT_ChangeIndividualInterest(float interestFactor, interestCategory_t category)
Change individual interest value.
void CP_HarvestMissionIsFailure(mission_t *mission)
Harvesting mission is over and is a failure: change interest values.
void CP_ReconMissionLeave(mission_t *mission)
Recon mission ends: UFO leave earth.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define NAT_Foreach(var)
iterates trough nations
base_t * GEO_PositionCloseToBase(const vec2_t pos)
Check if given pos is close to an existing base.
void CP_HarvestMissionGo(mission_t *mission)
Set Harvest mission, and go to mission pos.
const cgame_import_t * cgi
bool CP_MissionBegin(mission_t *mission)
mission begins: UFO arrive on earth.
void CP_MissionRemove(mission_t *mission)
Removes a mission from mission global array.
void CP_MissionAddToGeoscape(mission_t *mission, bool force)
Add a mission to geoscape: make it visible and stop time.
Engine-side time information in the game.
date_t Date_Add(date_t a, const date_t &b)
Add two dates and return the result.
bool CP_GetRandomPosOnGeoscapeWithParameters(vec2_t pos, const linkedList_t *terrainTypes, const linkedList_t *cultureTypes, const linkedList_t *populationTypes, const linkedList_t *nations)
Determines a random position on geoscape that fulfills certain criteria given via parameters...
static bool CP_ChooseNation(const mission_t *mission, linkedList_t **nationList)
Choose nation if needed for given mission.
Campaign mission headers.
float frand(void)
Return random values between 0 and 1.
void CP_UFORemoveFromGeoscape(mission_t *mission, bool destroyed)
Removes (temporarily or permanently) a UFO from geoscape: make it land and call notify functions...
void UFO_SendToDestination(aircraft_t *ufo, const vec2_t dest)
Make the specified UFO go to destination.
date_t Date_Random(date_t minFrame, date_t maxFrame)
Return a random relative date which lies between a lower and upper limit.
void CP_MissionDisableTimeLimit(mission_t *mission)
Disable time limit for given mission.
#define CP_IsXVIStarted()
Detailed information about the nation relationship (currently per month, but could be used elsewhere)...