UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_aliencont.cpp File Reference

Deals with the Alien Containment stuff. More...

#include "../../cl_shared.h"
#include "cp_campaign.h"
#include "cp_capacity.h"
#include "cp_aliencont_callbacks.h"
#include "save/save_aliencont.h"
#include "aliencargo.h"
#include "aliencontainment.h"

Go to the source code of this file.

Functions

bool AL_AddAlienTypeToAircraftCargo (aircraft_t *aircraft, const teamDef_t *teamDef, int amount, bool dead)
 Adds an alientype to an aircraft cargo. More...
 
void AL_AddAliens (aircraft_t *aircraft)
 Puts alien cargo into Alien Containment. More...
 
int AL_CountAll (void)
 Counts live aliens in all bases. More...
 
void AC_InitStartup (void)
 Defines commands and cvars for the alien containment menu(s). More...
 
bool AC_LoadXML (xmlNode_t *parent)
 Load callback for savin in XML Format. More...
 
bool AC_ContainmentAllowed (const base_t *base)
 Returns true if the current base is able to handle captured aliens. More...
 

Detailed Description

Deals with the Alien Containment stuff.

Note
Collecting and managing aliens functions prefix: AL_
Alien Containment menu functions prefix: AC_

Definition in file cp_aliencont.cpp.

Function Documentation

bool AC_ContainmentAllowed ( const base_t base)

Returns true if the current base is able to handle captured aliens.

Parameters
[in]basePointer to the base to check alien containment at

Definition at line 227 of file cp_aliencont.cpp.

References base_s::alienContainment.

Referenced by B_BaseInit_f(), and B_BuildingOpenAfterClick_f().

void AC_InitStartup ( void  )

Defines commands and cvars for the alien containment menu(s).

See also
UI_InitStartup

Definition at line 178 of file cp_aliencont.cpp.

References AC_InitCallbacks(), and cgi.

Referenced by CP_InitStartup().

bool AC_LoadXML ( xmlNode_t parent)
void AL_AddAliens ( aircraft_t aircraft)

Puts alien cargo into Alien Containment.

General Collecting aliens functions

Parameters
[in]aircraftAircraft transporting cargo to homebase.
See also
B_AircraftReturnedToHomeBase
AL_FillInContainment
Note
an event mail about missing breathing tech will be triggered if necessary.

Definition at line 69 of file cp_aliencont.cpp.

References _, AlienContainment::add(), AlienCargo::add(), aircraft_s::alienCargo, base_s::alienContainment, ccs_s::campaignStats, CAP_ALIENS, CAP_Get, CAPTURED_ALIENS, CAPTURED_ALIENS_DIED, stats_s::capturedAliens, ccs, cgi, CP_TriggerEvent(), aircraft_s::homebase, aircraft_s::idx, AlienContainment::isLifeSupported(), stats_s::killedAliens, AlienCargo::list(), LIST_Foreach, MS_AddNewMessage(), MSG_DEATH, and aircraft_s::name.

Referenced by B_DumpAircraftToHomeBase().

bool AL_AddAlienTypeToAircraftCargo ( aircraft_t aircraft,
const teamDef_t teamDef,
int  amount,
bool  dead 
)

Adds an alientype to an aircraft cargo.

Collecting aliens functions for aircraft

Parameters
[in]aircraftThe aircraft that owns the alien cargo to add the alien race to
[in]teamDefThe team definition of the alien race to add to the alien cargo container of the given aircraft
[in]amountThe amount of aliens of the given race (teamDef ) that should be added to the alien cargo
[in]deadtrue for cases where the aliens should be added as dead to the alien cargo - false for living aliens

Definition at line 46 of file cp_aliencont.cpp.

References AlienCargo::add(), and aircraft_s::alienCargo.

Referenced by AL_AddAlienTypeToAircraftCargo_(), and AM_AlienCollect().

int AL_CountAll ( void  )

Counts live aliens in all bases.

Definition at line 128 of file cp_aliencont.cpp.

References base_s::alienContainment, B_GetNext(), and AlienCargo::getAlive().

Referenced by RS_RequirementsMet().