72 const DateTime minMissionDelay(2, 0);
73 const DateTime maxMissionDelay(3, 0);
99 int randomNumber, max = 0;
102 const int OFFSET = 1;
113 randomNumber = (
int) (
frand() * (
float) max);
119 if (randomNumber < 0) {
120 cgi->LIST_AddString(nationList, nation->id);
153 cgi->Com_Printf(
"CP_HarvestMissionGo: Error, could not set position.\n");
157 cgi->LIST_Delete(&nationList);
159 cgi->Com_Printf(
"CP_HarvestMissionGo: No map found, remove mission.\n");
179 switch (mission->
stage) {
201 cgi->Com_Printf(
"CP_HarvestMissionNextStage: Unknown stage: %i, removing mission.\n", mission->
stage);
DateTime class definition.
Share stuff between the different cgame implementations.
Class describing a point of time.
void INT_ChangeIndividualInterest(float interestFactor, interestCategory_t category)
Change individual interest value.
@ INTERESTCATEGORY_BASE_ATTACK
@ INTERESTCATEGORY_BUILDING
@ INTERESTCATEGORY_TERROR_ATTACK
@ INTERESTCATEGORY_INTERCEPT
@ INTERESTCATEGORY_HARVEST
Header file for single player campaign control.
const cgame_import_t * cgi
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.
base_t * GEO_PositionCloseToBase(const vec2_t pos)
Check if given pos is close to an existing base.
Header for Geoscape management.
static bool CP_ChooseNation(const mission_t *mission, linkedList_t **nationList)
Choose nation if needed for given mission.
static void CP_HarvestMissionStart(mission_t *mission)
Start Harvesting mission.
void CP_HarvestMissionNextStage(mission_t *mission)
Determine what action should be performed when a Harvesting mission stage ends.
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.
void CP_HarvestMissionGo(mission_t *mission)
Set Harvest mission, and go to mission pos.
Campaign mission headers.
void CP_ReconMissionLeave(mission_t *mission)
Recon mission ends: UFO leave earth.
Campaign mission headers.
bool CP_MissionBegin(mission_t *mission)
mission begins: UFO arrive on earth.
void CP_UFORemoveFromGeoscape(mission_t *mission, bool destroyed)
Removes (temporarily or permanently) a UFO from geoscape: make it land and call notify functions.
void CP_MissionRemove(mission_t *mission)
Removes a mission from mission global array.
bool CP_ChooseMap(mission_t *mission, const vec2_t pos)
Choose a map for given mission.
void CP_MissionAddToGeoscape(mission_t *mission, bool force)
Add a mission to geoscape: make it visible and stop time.
void CP_MissionDisableTimeLimit(mission_t *mission)
Disable time limit for given mission.
Campaign missions headers.
const nationInfo_t * NAT_GetCurrentMonthInfo(const nation_t *const nation)
Get the current month nation stats.
#define NAT_Foreach(var)
iterates trough nations
DateTime Date_Random(const DateTime &minFrame, const DateTime &maxFrame)
Return a random relative date which lies between a lower and upper limit.
Campaign geoscape time header.
void UFO_SendToDestination(aircraft_t *ufo, const vec2_t dest)
Make the specified UFO go to destination.
#define CP_IsXVIStarted()
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
float frand(void)
Return random values between 0 and 1.
linkedList_t * populations
Detailed information about the nation relationship (currently per month, but could be used elsewhere)...