76 cgi->Com_Printf(
"AL_AddAliens: Aircraft %s (idx: %d) has no base, alienCargo destroyed\n", aircraft->
name, aircraft->
idx);
82 if (aircraft->
homebase->alienContainment ==
nullptr)
89 bool messageSent =
false;
95 cont->
add(item->teamDef, 0, item->alive + item->dead);
96 aircraft->
alienCargo->
add(item->teamDef, -item->alive, -item->dead);
98 ccs.campaignStats.killedAliens += item->dead + item->alive;
99 if (item->alive > 0) {
108 cont->
add(item->teamDef, item->alive, item->dead);
109 aircraft->
alienCargo->
add(item->teamDef, -item->alive, -item->dead);
111 ccs.campaignStats.killedAliens += item->dead;
112 ccs.campaignStats.capturedAliens += item->alive;
113 if (item->alive > 0) {
122 cgi->LIST_Delete(&cargo);
133 while ((base =
B_GetNext(base)) !=
nullptr) {
144static void AC_AddOne_f (
void)
146 if (
cgi->Cmd_Argc() < 3) {
147 cgi->Com_Printf(
"Usage: %s <baseIDX> <alientype> [dead:true|false]\n",
cgi->Cmd_Argv(0));
152 cgi->Com_Printf(
"%s: Invalid base idx: %s\n",
cgi->Cmd_Argv(0),
cgi->Cmd_Argv(1));
156 cgi->Com_Printf(
"%s: B base %d has no alien containment\n",
cgi->Cmd_Argv(0), base->
idx);
159 const char* alienName =
cgi->Cmd_Argv(2);
163 bool updateAlive =
true;
164 if (
cgi->Cmd_Argc() == 4)
165 updateAlive =
cgi->Com_ParseBoolean(
cgi->Cmd_Argv(3));
182 cgi->Cmd_AddCommand(
"debug_addalientocont", AC_AddOne_f,
"Add one alien of a given type");
201 cgi->Com_Printf(
"AC_LoadXML: Invalid base idx '%i'\n", baseIdx);
210 if (alive == 0 && dead == 0)
Alien cargo class header.
Alien containment class header.
Share stuff between the different cgame implementations.
virtual bool add(const teamDef_t *team, int alive, int dead)
Add aliens to the cargo by teamDef.
linkedList_t * list(void) const
Returns a copy of the cargo list.
int getAlive(const teamDef_t *team) const
Return number of alive aliens of a type in the cargo.
static bool isLifeSupported(const teamDef_t *team)
Returns if storing a specific life form is supported by the containment.
virtual bool add(const teamDef_t *team, int alive, int dead)
Add aliens to the containment by teamDef.
void AL_AddAliens(aircraft_t *aircraft)
Puts alien cargo into Alien Containment.
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.
void AC_InitStartup(void)
Defines commands and cvars for the alien containment menu(s).
int AL_CountAll(void)
Counts live aliens in all bases.
bool AL_AddAlienTypeToAircraftCargo(aircraft_t *aircraft, const teamDef_t *teamDef, int amount, bool dead)
Adds an alientype to an aircraft cargo.
void AC_InitCallbacks(void)
Header file for menu callback functions used for alien containment menu.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
Header file for single player campaign control.
const cgame_import_t * cgi
#define CAP_Get(base, capacity)
Capacity macros.
void CP_TriggerEvent(campaignTriggerEventType_t type, const void *userdata)
Triggers a campaign event with a special type.
uiMessageListNodeMessage_t * MS_AddNewMessage(const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup, bool playSound)
Adds a new message to message stack.
#define FOREACH_XMLNODE(var, node, name)
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
XML tag constants for savegame.
#define SAVE_ALIENCONT_AMOUNTALIVE
#define SAVE_ALIENCONT_ALIENCONT
#define SAVE_ALIENCONT_CONT
#define SAVE_ALIENCONT_TEAMID
#define SAVE_ALIENCONT_BASEIDX
#define SAVE_ALIENCONT_AMOUNTDEAD
#define SAVE_ALIENCONT_ALIEN
An aircraft with all it's data.
class AlienCargo * alienCargo
A base with all it's data.
class AlienContainment * alienContainment