38 for (
int bodyPart = 0; bodyPart < bodyData->
numBodyParts(); ++bodyPart) {
45 cgi->UI_ExecuteConfunc(
"hospital_wounds %i %s %f \"%s\"", chr.
ucn, bodyData->
id(bodyPart), severity, text);
54 return _(rankPtr->
name);
62 if (employee.
chr.
HP <= (
int) (employee.
chr.
maxHP * 0.5) || injuryLevel > 0.5f)
66 else if (employee.
chr.
HP <= (
int) (employee.
chr.
maxHP * 0.85) || injuryLevel > 0.15f)
70 else if (employee.
chr.
HP >= employee.
chr.
maxHP && injuryLevel < 0.0001f)
87 cgi->UI_ExecuteConfunc(
"hospitaladd %i \"%s\" %i %i \"%s\" \"%s\" \"%s\"",
94 const int odIdx = atoi(
cgi->Cmd_Argv(1));
101 cgi->Com_Printf(
"implant: %s\n", def->
id);
110 if (
cgi->Cmd_Argc() < 2) {
111 cgi->Com_Printf(
"Usage: %s <baseIDX>\n",
cgi->Cmd_Argv(0));
115 if (base ==
nullptr) {
116 cgi->Com_Printf(
"%s: Invalid base IDX: %s\n",
cgi->Cmd_Argv(0),
cgi->Cmd_Argv(1));
121 cgi->UI_PopWindow(
false);
125 bool containerSet =
false;
129 if (!employee->isHiredInBase(base) || employee->isAwayFromBase())
141 {
"hosp_init",
HOS_Init_f,
"Init function for hospital menu"},
143 {
nullptr,
nullptr,
nullptr}
bool CHRSH_IsTeamDefRobot(const teamDef_t *const td)
Check if a team definition is a robot.
Share stuff between the different cgame implementations.
const char * name(const short bodyPart) const
short numBodyParts(void) const
const char * id(void) const
employeeType_t getType() const
const aircraft_t * AIR_IsEmployeeInAircraft(const Employee *employee, const aircraft_t *aircraft)
Tells you if an employee is assigned to an aircraft.
base_t * B_GetFoundedBaseByIDX(int baseIdx)
Array bound check for the base index.
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t buildingType)
Get the status associated to a building.
Header file for single player campaign control.
const cgame_import_t * cgi
const char * E_GetEmployeeString(employeeType_t type, int n)
Convert employeeType_t to translated string.
#define E_Foreach(employeeType, var)
float HOS_GetInjuryLevel(const character_t &chr)
Header file for hospital related stuff.
static void HOS_EntryWoundData(const character_t &chr)
static const cmdList_t hospitalCmds[]
static void HOS_Init_f(void)
Script command to initialize the hospital menu.
static void HOS_ImplantDetails_f(void)
static const char * HOS_GetInjuryLevelString(const Employee &employee, float injuryLevel)
void HOS_InitCallbacks(void)
void HOS_ShutdownCallbacks(void)
static void HOS_Entry(const Employee &employee)
static const char * HOS_GetRank(const Employee &employee)
Header file for menu related console command callbacks.
rank_t * CL_GetRankByIdx(const int index)
Returns a rank at an index.
void CP_SetEquipContainer(character_t *chr)
Set up equip (floor) container for soldiers.
Team management for the campaign gametype headers.
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
const implantDef_t * INVSH_GetImplantForObjDef(const objDef_t *od)
QGL_EXTERN GLint GLenum type
bool Com_sprintf(char *dest, size_t size, const char *fmt,...)
copies formatted string with buffer-size checking
An aircraft with all it's data.
A base with all it's data.
Describes a character with all its attributes.
const teamDef_t * teamDef
Defines all attributes of objects used in the inventory.
Describes a rank that a recruit can gain.
const BodyData * bodyTemplate
int treatmentLevel[BODYPART_MAXTYPE]