UFO: Alien Invasion
Loading...
Searching...
No Matches
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"
Include dependency graph for cp_aliencont.cpp:

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.
void AL_AddAliens (aircraft_t *aircraft)
 Puts alien cargo into Alien Containment.
int AL_CountAll (void)
 Counts live aliens in all bases.
void AC_InitStartup (void)
 Defines commands and cvars for the alien containment menu(s).
bool AC_LoadXML (xmlNode_t *parent)
 Load callback for savin in XML Format.
bool AC_ContainmentAllowed (const base_t *base)
 Returns true if the current base is able to handle captured aliens.

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

◆ AC_ContainmentAllowed()

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_t::alienContainment.

Referenced by B_BaseInit_f(), and B_BuildingOpenAfterClick_f().

◆ AC_InitStartup()

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().

◆ AC_LoadXML()

bool AC_LoadXML ( xmlNode_t * parent)

Load callback for savin in XML Format.

Parameters
[in]parentParent XML node in the savegame
Todo
Remove: Fallback for compatibility

Definition at line 192 of file cp_aliencont.cpp.

References AlienContainment::add(), base_t::alienContainment, B_GetFoundedBaseByIDX(), CAP_ALIENS, CAP_Get, cgi, FOREACH_XMLNODE, MAX_BASES, SAVE_ALIENCONT_ALIEN, SAVE_ALIENCONT_ALIENCONT, SAVE_ALIENCONT_AMOUNTALIVE, SAVE_ALIENCONT_AMOUNTDEAD, SAVE_ALIENCONT_BASEIDX, SAVE_ALIENCONT_CONT, SAVE_ALIENCONT_TEAMID, and xmlNode_t.

Referenced by SAV_Init().

◆ AL_AddAliens()

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 _, AlienCargo::add(), AlienContainment::add(), aircraft_t::alienCargo, CAP_ALIENS, CAP_Get, CAPTURED_ALIENS, CAPTURED_ALIENS_DIED, ccs, cgi, CP_TriggerEvent(), aircraft_t::homebase, aircraft_t::idx, AlienContainment::isLifeSupported(), AlienCargo::list(), LIST_Foreach, MS_AddNewMessage(), MSG_DEATH, and aircraft_t::name.

Referenced by B_DumpAircraftToHomeBase().

◆ AL_AddAlienTypeToAircraftCargo()

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_t::alienCargo.

Referenced by AL_AddAlienTypeToAircraftCargo_(), and AM_AlienCollect().

◆ AL_CountAll()

int AL_CountAll ( void )

Counts live aliens in all bases.

Definition at line 128 of file cp_aliencont.cpp.

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

Referenced by RS_RequirementsMet().