32 #include "../../cl_shared.h"
44 if (
cgi->Cmd_Argc() < 2)
49 cgi->Com_Printf(
"No base selected\n");
54 cgi->UI_ExecuteConfunc(
"ui_aliencont_clear");
60 cgi->UI_ExecuteConfunc(
"ui_aliencont_add \"%s\" \"%s\" \"%s\" \"%s\" \"%s\" %f %d %d",
61 item->teamDef->id,
_(item->teamDef->name), tech->
id, tech->
image,
65 cgi->LIST_Delete(&list);
77 if (
cgi->Cmd_Argc() < 2) {
92 cgi->LIST_Delete(&list);
94 cgi->Cmd_ExecuteString(
"ui_aliencont_init");
103 const int argc =
cgi->Cmd_Argc();
116 cgi->Com_Printf(
"Usage: %s [baseIdx] <techId>\n",
cgi->
Cmd_Argv(0));
130 cgi->LIST_Delete(&list);
132 cgi->Cmd_ExecuteString(
"ui_aliencont_init");
141 const int argc =
cgi->Cmd_Argc();
162 int substract = std::min(
int(ceil(1.0
f * (aliens - limit) / alienSize)),
int(item->alive * alienSize));
169 cgi->LIST_Delete(&list);
173 {
"ui_aliencont_init",
AC_Init_f,
"Init function for alien containment menu"},
174 {
"ui_aliencont_killall",
AC_KillAll_f,
"Kills all aliens in current base"},
175 {
"ui_aliencont_killone",
AC_KillOne_f,
"Kills one alien of a given type"},
176 {
"aliencont_killexceeding",
AC_KillExceeding_f,
"Kills aliens that exceed a certain base capacity"},
177 {
nullptr,
nullptr,
nullptr}
181 cgi->Cmd_TableAddList(alienContCallbacks);
186 cgi->Cmd_TableRemoveList(alienContCallbacks);
static const cmdList_t alienContCallbacks[]
Header file for menu callback functions used for alien containment menu.
bool RS_IsResearched_ptr(const technology_t *tech)
Checks whether an item is already researched.
static void AC_KillAll_f(void)
Console command to kill all aliens on a base.
static void AC_KillOne_f(void)
Kill single alien of a given type.
linkedList_t * list(void) const
Returns a copy of the cargo list.
base_t * B_GetCurrentSelectedBase(void)
returns the currently selected base
class AlienContainment * alienContainment
#define CAP_GetCurrent(base, capacity)
A base with all it's data.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
static void AC_KillExceeding_f(void)
Kill aliens over a certain capacity.
technology_t * RS_GetTechForTeam(const teamDef_t *team)
Returns technology entry for a team.
static int getCapacityNeedForAlien(const teamDef_t *teamDef, const bool isDead)
Returns the number of capacity needed for an alien in the containment.
const cgame_import_t * cgi
This is the technology parsed from research.ufo.
static void AC_Init_f(void)
Alien containment menu init function.
Alien containment class header.
#define CAP_GetMax(base, capacity)
virtual bool add(const teamDef_t *team, int alive, int dead)
Add aliens to the containment by teamDef.
void AC_ShutdownCallbacks(void)
#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.
void AC_InitCallbacks(void)
const char *IMPORT * Cmd_Argv(int n)