27 #include "../../cl_shared.h"
76 cgi->Com_Printf(
"AL_AddAliens: Aircraft %s (idx: %d) has no base, alienCargo destroyed\n", aircraft->
name, aircraft->
idx);
89 bool messageSent =
false;
95 cont->
add(item->teamDef, 0, item->alive + item->dead);
96 aircraft->
alienCargo->
add(item->teamDef, -item->alive, -item->dead);
99 if (item->alive > 0) {
108 cont->
add(item->teamDef, item->alive, item->dead);
109 aircraft->
alienCargo->
add(item->teamDef, -item->alive, -item->dead);
113 if (item->alive > 0) {
122 cgi->LIST_Delete(&cargo);
133 while ((base =
B_GetNext(base)) !=
nullptr) {
144 static 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));
156 cgi->Com_Printf(
"%s: B base %d has no alien containment\n",
cgi->
Cmd_Argv(0), base->
idx);
163 bool updateAlive =
true;
164 if (
cgi->Cmd_Argc() == 4)
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)
Header file for menu callback functions used for alien containment menu.
int AL_CountAll(void)
Counts live aliens in all bases.
#define FOREACH_XMLNODE(var, node, name)
static bool isLifeSupported(const teamDef_t *team)
Returns if storing a specific life form is supported by the containment.
bool AC_ContainmentAllowed(const base_t *base)
Returns true if the current base is able to handle captured aliens.
virtual bool add(const teamDef_t *team, int alive, int dead)
Add aliens to the cargo by teamDef.
#define SAVE_ALIENCONT_ALIEN
#define CAP_Get(base, capacity)
Capacity macros.
linkedList_t * list(void) const
Returns a copy of the cargo list.
class AlienContainment * alienContainment
#define SAVE_ALIENCONT_AMOUNTDEAD
void AL_AddAliens(aircraft_t *aircraft)
Puts alien cargo into Alien Containment.
#define SAVE_ALIENCONT_AMOUNTALIVE
#define SAVE_ALIENCONT_CONT
#define SAVE_ALIENCONT_BASEIDX
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.
A base with all it's data.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
bool AL_AddAlienTypeToAircraftCargo(aircraft_t *aircraft, const teamDef_t *teamDef, int amount, bool dead)
Adds an alientype to an aircraft cargo.
base_t * B_GetNext(base_t *lastBase)
Iterates through founded bases.
const cgame_import_t * cgi
XML tag constants for savegame.
void CP_TriggerEvent(campaignTriggerEventType_t type, const void *userdata)
Triggers a campaign event with a special type.
#define SAVE_ALIENCONT_TEAMID
void AC_InitStartup(void)
Defines commands and cvars for the alien containment menu(s).
Alien containment class header.
virtual bool add(const teamDef_t *team, int alive, int dead)
Add aliens to the containment by teamDef.
Alien cargo class header.
#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 ...
Header file for single player campaign control.
int getAlive(const teamDef_t *team) const
Return number of alive aliens of a type in the cargo.
void AC_InitCallbacks(void)
#define SAVE_ALIENCONT_ALIENCONT
An aircraft with all it's data.
class AlienCargo * alienCargo
const char *IMPORT * Cmd_Argv(int n)
const char *IMPORT * XML_GetString(xmlNode_t *parent, const char *name)
xmlNode_t *IMPORT * XML_GetNode(xmlNode_t *parent, const char *name)
bool AC_LoadXML(xmlNode_t *parent)
Load callback for savin in XML Format.