UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_hospital.cpp File Reference

Most of the hospital related stuff. More...

#include "../../cl_shared.h"
#include "cp_campaign.h"
#include "cp_hospital.h"
Include dependency graph for cp_hospital.cpp:

Go to the source code of this file.

Macros

#define GET_HP_HEALING(ab)

Functions

static void HOS_HealWounds (character_t *chr, int healing)
bool HOS_HealCharacter (character_t *chr, bool hospital)
 Heals character.
void HOS_HospitalRun (void)
 Checks health status of all employees in all bases.
float HOS_GetInjuryLevel (const character_t &chr)
bool HOS_NeedsHealing (const character_t &chr)
void HOS_InitStartup (void)
 Initial stuff for hospitals Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal.
bool HOS_SaveXML (xmlNode_t *p)
 Saving function for hospital related data.
bool HOS_LoadXML (xmlNode_t *p)
 Saving function for hospital related data.
bool HOS_HospitalAllowed (const base_t *base)
 Returns true if you can enter in the hospital.

Detailed Description

Most of the hospital related stuff.

Note
Hospital functions prefix: HOS_

Definition in file cp_hospital.cpp.

Macro Definition Documentation

◆ GET_HP_HEALING

#define GET_HP_HEALING ( ab)
Value:
(1 + (ab) * 15/MAX_SKILL)
#define MAX_SKILL
Definition q_shared.h:278

Definition at line 31 of file cp_hospital.cpp.

Referenced by HOS_HealCharacter().

Function Documentation

◆ HOS_GetInjuryLevel()

◆ HOS_HealCharacter()

bool HOS_HealCharacter ( character_t * chr,
bool hospital )

Heals character.

Parameters
[in]chrCharacter data of an employee
[in]hospitalTrue if we call this function for hospital healing (false when autoheal).
See also
HOS_HealEmployee
Returns
true if soldiers becomes healed - false otherwise

Definition at line 51 of file cp_hospital.cpp.

References ABILITY_POWER, ccs, GET_HP_HEALING, HOS_HealWounds(), character_t::HP, INITIAL_HP, character_t::maxHP, character_t::score, and chrScoreGlobal_t::skills.

Referenced by HOS_HospitalRun().

◆ HOS_HealWounds()

void HOS_HealWounds ( character_t * chr,
int healing )
static

◆ HOS_HospitalAllowed()

bool HOS_HospitalAllowed ( const base_t * base)

Returns true if you can enter in the hospital.

See also
B_BaseInit_f

Definition at line 210 of file cp_hospital.cpp.

References B_GetBuildingStatus(), B_HOSPITAL, and B_IsUnderAttack.

Referenced by B_BaseInit_f(), and B_BuildingOpenAfterClick_f().

◆ HOS_HospitalRun()

void HOS_HospitalRun ( void )

Checks health status of all employees in all bases.

See also
CP_CampaignRun
Note
Called every day.

Definition at line 82 of file cp_hospital.cpp.

References B_GetBuildingStatus(), B_HOSPITAL, CHRSH_UpdateImplants(), E_Foreach, HOS_HealCharacter(), i, MAX_EMPL, and type.

Referenced by CP_CampaignRun(), and TEST_F().

◆ HOS_InitStartup()

void HOS_InitStartup ( void )

Initial stuff for hospitals Bind some of the functions in this file to console-commands that you can call ingame. Called from UI_InitStartup resp. CL_InitLocal.

Definition at line 177 of file cp_hospital.cpp.

References cgi.

Referenced by CP_InitStartup().

◆ HOS_LoadXML()

bool HOS_LoadXML ( xmlNode_t * p)

Saving function for hospital related data.

See also
HOS_SaveXML
SAV_GameLoadXML

Definition at line 201 of file cp_hospital.cpp.

References xmlNode_t.

Referenced by SAV_Init().

◆ HOS_NeedsHealing()

bool HOS_NeedsHealing ( const character_t & chr)

◆ HOS_SaveXML()

bool HOS_SaveXML ( xmlNode_t * p)

Saving function for hospital related data.

See also
HOS_LoadXML
SAV_GameSaveXML

Definition at line 190 of file cp_hospital.cpp.

References xmlNode_t.

Referenced by SAV_Init().