cp_mission_terror.c File Reference

Campaign mission code. 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_alien_interest.h"
Include dependency graph for cp_mission_terror.c:

Go to the source code of this file.

Functions

void CP_TerrorMissionIsSuccess (mission_t *mission)
 Terror attack mission is over and is a success: change interest values.
void CP_TerrorMissionIsFailure (mission_t *mission)
 Terror attack mission is over and is a failure: change interest values.
void CP_TerrorMissionOnSpawn (void)
 Run when the mission is spawned.
void CP_TerrorMissionStart (mission_t *mission)
 Start Terror attack mission.
static const city_tCP_ChooseCity (void)
 Choose a city for terror mission.
static const mission_tCP_TerrorInCity (const city_t *city)
static void CP_TerrorMissionGo (mission_t *mission)
 Set Terror attack mission, and go to Terror attack mission pos.
int CP_TerrorMissionAvailableUFOs (const mission_t const *mission, ufoType_t *ufoTypes)
 Fill an array with available UFOs for Terror attack mission type.
void CP_TerrorMissionNextStage (mission_t *mission)
 Determine what action should be performed when a Terror attack mission stage ends.

Detailed Description

Campaign mission code.

Definition in file cp_mission_terror.c.


Function Documentation

static const city_t* CP_ChooseCity ( void   )  [static]

Choose a city for terror mission.

Returns:
chosen city in ccs.cities

Definition at line 95 of file cp_mission_terror.c.

References ccs, ccs_s::cities, LIST_GetByIdx(), and ccs_s::numCities.

Referenced by CP_TerrorMissionGo().

static const mission_t* CP_TerrorInCity ( const city_t city  )  [static]
int CP_TerrorMissionAvailableUFOs ( const mission_t const *  mission,
ufoType_t ufoTypes 
)

Fill an array with available UFOs for Terror attack mission type.

Parameters:
[in] mission Pointer to the mission we are currently creating (may be NULL if we want to know what UFO types will be needed during the whole game).
[out] ufoTypes Array of ufoType_t that may be used for this mission.
Note:
Terror attack mission -- Stage 0
Returns:
number of elements written in ufoTypes

<

Todo:
Add Battleship when maps will be available

Definition at line 179 of file cp_mission_terror.c.

References UFO_BOMBER, UFO_CORRUPTER, UFO_HARVESTER, and UFO_ShouldAppearOnGeoscape().

Referenced by CP_MissionChooseUFO(), and NAT_ScriptSanityCheck().

static void CP_TerrorMissionGo ( mission_t mission  )  [static]

Set Terror attack mission, and go to Terror attack mission pos.

Note:
Terror attack mission -- Stage 1
Terror missions can only take place in city: pick one in ccs.cities.

Definition at line 129 of file cp_mission_terror.c.

References _, ccs, Com_DPrintf(), Com_sprintf(), CP_ChooseCity(), CP_ChooseMap(), CP_MissionDisableTimeLimit(), CP_MissionRemove(), CP_TerrorInCity(), ccs_s::date, DEBUG_CLIENT, mission_s::finalDate, mission_s::location, MAP_PositionCloseToBase(), MAX_POS_LOOP, city_s::name, mission_s::pos, city_s::pos, mission_s::posAssigned, qtrue, mission_s::stage, STAGE_MISSION_GOTO, mission_s::ufo, UFO_SendToDestination(), and Vector2Copy.

Referenced by CP_TerrorMissionNextStage().

void CP_TerrorMissionIsFailure ( mission_t mission  ) 

Terror attack mission is over and is a failure: change interest values.

Note:
Terror attack mission

Definition at line 50 of file cp_mission_terror.c.

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

Referenced by CP_MissionIsOver().

void CP_TerrorMissionIsSuccess ( mission_t mission  ) 

Terror attack mission is over and is a success: change interest values.

Note:
Terror attack mission

Definition at line 38 of file cp_mission_terror.c.

References CL_ChangeIndividualInterest(), CP_MissionRemove(), f, INTERESTCATEGORY_BASE_ATTACK, and INTERESTCATEGORY_HARVEST.

Referenced by CP_TerrorMissionNextStage().

void CP_TerrorMissionNextStage ( mission_t mission  ) 

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

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

Definition at line 197 of file cp_mission_terror.c.

References Com_Printf(), CP_MissionBegin(), CP_MissionRemove(), CP_ReconMissionLeave(), CP_TerrorMissionGo(), CP_TerrorMissionIsSuccess(), CP_TerrorMissionStart(), mission_s::stage, STAGE_COME_FROM_ORBIT, STAGE_MISSION_GOTO, STAGE_NOT_ACTIVE, STAGE_RETURN_TO_ORBIT, and STAGE_TERROR_MISSION.

Referenced by CP_MissionStageEnd().

void CP_TerrorMissionOnSpawn ( void   ) 

Run when the mission is spawned.

Definition at line 64 of file cp_mission_terror.c.

References CL_ChangeIndividualInterest(), f, and INTERESTCATEGORY_TERROR_ATTACK.

Referenced by CP_CreateNewMission().

void CP_TerrorMissionStart ( mission_t mission  ) 

Start Terror attack mission.

Note:
Terror attack mission -- Stage 2

Definition at line 75 of file cp_mission_terror.c.

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

Referenced by CP_TerrorMissionNextStage().


Generated by  doxygen 1.6.2