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"
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_t * | CP_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. |
Campaign mission code.
Definition in file cp_mission_baseattack.c.
static base_t* CP_BaseAttackChooseBase | ( | void | ) | [static] |
Choose Base that will be attacked.
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] |
Set base attack mission, and go to base position.
Definition at line 315 of file cp_mission_baseattack.c.
References ccs, Com_Error(), Com_GetMapDefinitionByID(), Com_Printf(), Com_sprintf(), CP_BaseAttackChooseBase(), CP_MissionDisableTimeLimit(), CP_MissionRemove(), mission_s::data, ccs_s::date, ERR_DROP, mission_s::finalDate, mission_s::location, mission_s::mapDef, base_s::name, mission_s::pos, base_s::pos, mission_s::posAssigned, qtrue, mission_s::stage, STAGE_MISSION_GOTO, mission_s::ufo, UFO_SendToDestination(), and Vector2Copy.
Referenced by CP_BaseAttackMissionNextStage().
Fill an array with available UFOs for Base Attack mission type.
[in] | mission | Pointer to the mission we are currently creating. |
[out] | ufoTypes | Array of ufoType_t that may be used for this mission. |
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.
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 | ) |
Base attack mission is over and is a failure (from an alien point of view): change interest values.
Definition at line 61 of file cp_mission_baseattack.c.
References AIR_GetNextFromBase(), base_s::aircraftCurrent, BASE_WORKING, base_s::baseStatus, ccs, CL_ChangeIndividualInterest(), CP_MissionRemove(), mission_s::data, f, INTERESTCATEGORY_BASE_ATTACK, INTERESTCATEGORY_BUILDING, MA_NONE, MAP_NotifyMissionRemoved(), ccs_s::mapAction, and ccs_s::missionAircraft.
Referenced by CP_MissionEndActions(), and CP_MissionIsOver().
void CP_BaseAttackMissionIsSuccess | ( | mission_t * | mission | ) |
Base attack mission is over and is a success (from an alien point of view): change interest values.
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.
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.
[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 | ) |
Start Base Attack.
Definition at line 144 of file cp_mission_baseattack.c.
References _, mission_s::active, AIR_AddToAircraftTeam(), AIR_GetTeamSize(), base_s::aircraftCurrent, B_COMMAND, B_GetNumberOfBuildingsInBaseByBuildingType(), B_SetCurrentSelectedBase(), BASE_UNDER_ATTACK, stats_s::basesAttacked, base_s::baseStatus, ccs_s::campaignStats, Cbuf_AddText(), ccs, CL_GameTimeStop(), Com_DPrintf(), Com_sprintf(), CP_BaseAttackMissionDestroyBase(), CP_MissionDisableTimeLimit(), CP_UFORemoveFromGeoscape(), mission_s::data, DEBUG_CLIENT, E_GetHiredEmployees(), E_IsAwayFromBase(), EMPL_SOLDIER, aircraft_s::homebase, mission_s::id, ccs_s::interceptAircraft, LIST_Count(), LIST_Delete(), MA_BASEATTACK, MAP_SelectMission(), ccs_s::mapAction, MAX_ACTIVETEAM, aircraft_s::maxTeamSize, ccs_s::missionAircraft, base_s::name, popupText, aircraft_s::pos, base_s::pos, mission_s::pos, pos, qfalse, qtrue, ccs_s::selectedMission, mission_s::stage, STAGE_BASE_ATTACK, TEXT_POPUP, mission_s::ufo, UI_PushWindow(), UI_RegisterText(), va(), and VectorCopy.
Referenced by CP_BaseAttackMissionNextStage(), and CP_CheckBaseAttacks_f().
void CP_CheckBaseAttacks_f | ( | void | ) |
Check and start baseattack missions.
Definition at line 244 of file cp_mission_baseattack.c.
References B_GetFoundedBaseByIDX(), mission_s::category, ccs, Cmd_Argc(), Cmd_Argv(), Com_Printf(), CP_BaseAttackStartMission(), mission_s::data, linkedList_s::data, INTERESTCATEGORY_BASE_ATTACK, MAX_BASES, ccs_s::missions, linkedList_s::next, mission_s::stage, and STAGE_BASE_ATTACK.
Referenced by CP_InitStartup().
aircraft_t baseAttackFakeAircraft [static] |
This fake aircraft is used to assign soldiers for a base attack mission.
Definition at line 41 of file cp_mission_baseattack.c.