cp_mission_baseattack.c File Reference

Campaign mission code. More...

#include "../../cl_shared.h"
#include "../../ui/ui_main.h"
#include "../../ui/ui_popup.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_baseattack.c:

Go to the source code of this file.

Functions

void CP_BaseAttackMissionIsSuccess (mission_t *mission)
 Base attack mission is over and is a success (from an alien point of view): change interest values.
void CP_BaseAttackMissionIsFailure (mission_t *mission)
 Base attack mission is over and is a failure (from an alien point of view): change interest values.
void CP_BaseAttackMissionOnSpawn (void)
 Run when the mission is spawned.
void CP_BaseAttackMissionLeave (mission_t *mission)
 Base attack mission ends: UFO leave earth.
void CP_BaseAttackMissionDestroyBase (mission_t *mission)
 Base attack mission ends: UFO leave earth.
void CP_BaseAttackStartMission (mission_t *mission)
 Start Base Attack.
void CP_CheckBaseAttacks_f (void)
 Check and start baseattack missions.
static base_tCP_BaseAttackChooseBase (void)
 Choose Base that will be attacked.
static void CP_BaseAttackGoToBase (mission_t *mission)
 Set base attack mission, and go to base position.
int CP_BaseAttackMissionAvailableUFOs (const mission_t const *mission, ufoType_t *ufoTypes)
 Fill an array with available UFOs for Base Attack mission type.
void CP_BaseAttackMissionNextStage (mission_t *mission)
 Determine what action should be performed when a Base Attack mission stage ends.

Variables

static aircraft_t baseAttackFakeAircraft
 This fake aircraft is used to assign soldiers for a base attack mission.

Detailed Description

Campaign mission code.

Definition in file cp_mission_baseattack.c.


Function Documentation

static base_t* CP_BaseAttackChooseBase ( void   )  [static]

Choose Base that will be attacked.

Returns:
Pointer to the base, NULL if no base set
Note:
Base attack mission -- Stage 1

Definition at line 274 of file cp_mission_baseattack.c.

References base_s::alienInterest, B_COMMAND, B_GetBuildingStatus(), B_GetFoundedBaseByIDX(), BASE_UNDER_ATTACK, base_s::baseStatus, ccs, frand(), and ccs_s::numBases.

Referenced by CP_BaseAttackGoToBase().

static void CP_BaseAttackGoToBase ( mission_t mission  )  [static]
int CP_BaseAttackMissionAvailableUFOs ( const mission_t const *  mission,
ufoType_t ufoTypes 
)

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

Definition at line 357 of file cp_mission_baseattack.c.

References UFO_BOMBER, UFO_FIGHTER, and UFO_ShouldAppearOnGeoscape().

Referenced by CP_MissionChooseUFO().

void CP_BaseAttackMissionDestroyBase ( mission_t mission  ) 

Base attack mission ends: UFO leave earth.

Note:
Base attack mission -- Stage 3
UFO attacking this base will be redirected when notify function will be called, don't set new destination here.

Definition at line 118 of file cp_mission_baseattack.c.

References _, base_s::aircraftCurrent, B_Destroy(), B_UpdateStorageCap(), BASE_WORKING, base_s::baseStatus, ccs, CL_GameTimeStop(), Com_sprintf(), cp_messageBuffer, mission_s::data, ccs_s::missionAircraft, MS_AddNewMessage(), MSG_STANDARD, base_s::name, and qfalse.

Referenced by CP_BaseAttackMissionNextStage(), CP_BaseAttackStartMission(), and CP_MissionEndActions().

void CP_BaseAttackMissionIsFailure ( mission_t mission  ) 
void CP_BaseAttackMissionIsSuccess ( mission_t mission  ) 

Base attack mission is over and is a success (from an alien point of view): change interest values.

Note:
Base attack mission
See also:
CP_BaseAttackMissionStart

Definition at line 48 of file cp_mission_baseattack.c.

References CL_ChangeIndividualInterest(), CP_MissionRemove(), f, INTERESTCATEGORY_HARVEST, INTERESTCATEGORY_INTERCEPT, INTERESTCATEGORY_RECON, and INTERESTCATEGORY_TERROR_ATTACK.

Referenced by CP_BaseAttackMissionNextStage(), and CP_MissionIsOver().

void CP_BaseAttackMissionLeave ( mission_t mission  ) 

Base attack mission ends: UFO leave earth.

Note:
Base attack mission -- Stage 3

Definition at line 98 of file cp_mission_baseattack.c.

References ccs, CP_MissionDisableTimeLimit(), ccs_s::date, mission_s::finalDate, aircraft_s::landed, qfalse, mission_s::stage, STAGE_RETURN_TO_ORBIT, mission_s::ufo, and UFO_SetRandomDest().

Referenced by CP_MissionNotifyBaseDestroyed().

void CP_BaseAttackMissionNextStage ( mission_t mission  ) 

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

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

Definition at line 371 of file cp_mission_baseattack.c.

References Com_Printf(), CP_BaseAttackGoToBase(), CP_BaseAttackMissionDestroyBase(), CP_BaseAttackMissionIsSuccess(), CP_BaseAttackStartMission(), CP_MissionBegin(), CP_MissionRemove(), mission_s::stage, STAGE_BASE_ATTACK, STAGE_COME_FROM_ORBIT, STAGE_MISSION_GOTO, STAGE_NOT_ACTIVE, and STAGE_RETURN_TO_ORBIT.

Referenced by CP_MissionStageEnd().

void CP_BaseAttackMissionOnSpawn ( void   ) 

Run when the mission is spawned.

Definition at line 88 of file cp_mission_baseattack.c.

References CL_ChangeIndividualInterest(), f, and INTERESTCATEGORY_BASE_ATTACK.

Referenced by CP_CreateNewMission().

void CP_BaseAttackStartMission ( mission_t mission  ) 
void CP_CheckBaseAttacks_f ( void   ) 

Variable Documentation

This fake aircraft is used to assign soldiers for a base attack mission.

See also:
CP_BaseAttackStartMission
AIR_AddToAircraftTeam

Definition at line 41 of file cp_mission_baseattack.c.


Generated by  doxygen 1.6.2