27 #include "../../cl_shared.h"
31 #define GET_HP_HEALING( ab ) (1 + (ab) * 15/MAX_SKILL)
66 chr->
HP = std::min(chr->
HP + static_cast<int>(healing), chr->
maxHP);
68 chr->
HP = std::min(chr->
HP + static_cast<int>(((healing / 100.0f) * chr->
maxHP)), chr->
maxHP);
87 if (!employee->isHired())
98 float injuryLevel = 0.0f;
104 injuryLevel += woundLevel / chr.
maxHP;
119 static void HOS_HealAll_f (
void)
121 if (
cgi->Cmd_Argc() < 2) {
127 cgi->Com_Printf(
"Invalid base idx\n");
133 if (!employee->isHiredInBase(base))
135 employee->chr.HP = employee->chr.maxHP;
143 static void HOS_HurtAll_f (
void)
145 if (
cgi->Cmd_Argc() < 2) {
146 cgi->Com_Printf(
"Usage: %s <baseIDX> [amount]\n",
cgi->
Cmd_Argv(0));
151 cgi->Com_Printf(
"Invalid base idx\n");
156 if (
cgi->Cmd_Argc() >= 3)
164 if (!employee->isHiredInBase(base))
166 employee->chr.HP = std::max(0, employee->chr.HP - amount);
180 cgi->Cmd_AddCommand(
"debug_hosp_hurt_all", HOS_HurtAll_f,
"Debug function to hurt all employees in the current base by one");
181 cgi->Cmd_AddCommand(
"debug_hosp_heal_all", HOS_HealAll_f,
"Debug function to heal all employees in the current base completely");
#define GET_HP_HEALING(ab)
QGL_EXTERN GLint GLenum type
bool B_GetBuildingStatus(const base_t *const base, const buildingType_t buildingType)
Get the status associated to a building.
#define E_Foreach(employeeType, var)
const teamDef_t * teamDef
float HOS_GetInjuryLevel(const character_t &chr)
#define B_IsUnderAttack(base)
bool HOS_LoadXML(xmlNode_t *p)
Saving function for hospital related data.
A base with all it's data.
void CHRSH_UpdateImplants(character_t &chr)
Updates the characters permanent implants. Called every day.
int treatmentLevel[BODYPART_MAXTYPE]
Header file for hospital related stuff.
bool HOS_HealCharacter(character_t *chr, bool hospital)
Heals character.
const cgame_import_t * cgi
employeeType_t
The types of employees.
bool HOS_SaveXML(xmlNode_t *p)
Saving function for hospital related data.
base_t * B_GetBaseByIDX(int baseIdx)
Array bound check for the base index. Will also return unfounded bases as long as the index is in the...
static void HOS_HealWounds(character_t *chr, int healing)
void HOS_InitStartup(void)
Initial stuff for hospitals Bind some of the functions in this file to console-commands that you can ...
float woundThreshold(const short bodyPart) const
short numBodyParts(void) const
const BodyData * bodyTemplate
bool HOS_NeedsHealing(const character_t &chr)
Header file for single player campaign control.
void HOS_HospitalRun(void)
Checks health status of all employees in all bases.
int skills[SKILL_NUM_TYPES]
const char *IMPORT * Cmd_Argv(int n)
Describes a character with all its attributes.
bool HOS_HospitalAllowed(const base_t *base)
Returns true if you can enter in the hospital.