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,
63 (1.0f - tech->
time / tech->
overallTime) * 100, item->alive, item->dead);
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));
122 const char* techId =
cgi->Cmd_Argv(argc - 1);
130 cgi->LIST_Delete(&list);
132 cgi->Cmd_ExecuteString(
"ui_aliencont_init");
141 const int argc =
cgi->Cmd_Argc();
144 cgi->Com_Printf(
"Usage: %s <baseID>\n",
cgi->Cmd_Argv(0));
162 int substract = std::min(
int(ceil(1.0f * (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}
Alien containment class header.
Share stuff between the different cgame implementations.
linkedList_t * list(void) const
Returns a copy of the cargo list.
virtual bool add(const teamDef_t *team, int alive, int dead)
Add aliens to the containment by teamDef.
static int getCapacityNeedForAlien(const teamDef_t *teamDef, const bool isDead)
Returns the number of capacity needed for an alien in the containment.
static void AC_KillExceeding_f(void)
Kill aliens over a certain capacity.
static void AC_KillOne_f(void)
Kill single alien of a given type.
void AC_InitCallbacks(void)
static void AC_Init_f(void)
Alien containment menu init function.
static void AC_KillAll_f(void)
Console command to kill all aliens on a base.
void AC_ShutdownCallbacks(void)
static const cmdList_t alienContCallbacks[]
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_GetCurrentSelectedBase(void)
returns the currently selected base
Header file for single player campaign control.
const cgame_import_t * cgi
#define CAP_GetCurrent(base, capacity)
#define CAP_GetMax(base, capacity)
technology_t * RS_GetTechForTeam(const teamDef_t *team)
Returns technology entry for a team.
bool RS_IsResearched_ptr(const technology_t *tech)
Checks whether an item is already researched.
#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 ...
A base with all it's data.
class AlienContainment * alienContainment
This is the technology parsed from research.ufo.