cp_hospital.c File Reference

Most of the hospital related stuff. More...

#include "../cl_shared.h"
#include "../cl_team.h"
#include "../ui/ui_main.h"
#include "cp_campaign.h"
#include "cp_hospital.h"
Include dependency graph for cp_hospital.c:

Go to the source code of this file.

Defines

#define GET_HP_HEALING(ab)   (1 + (ab) * 15/MAX_SKILL)

Functions

qboolean HOS_HealCharacter (character_t *chr, qboolean hospital)
 Heals character.
void HOS_HospitalRun (void)
 Checks health status of all employees in all bases.
qboolean HOS_HealEmployee (employee_t *employee)
 Callback for HOS_HealCharacter() in hospital.
void HOS_HealAll (const base_t *const base)
 Heal all employees in the given base.
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.
qboolean HOS_SaveXML (mxml_node_t *p)
 Saving function for hospital related data.
qboolean HOS_LoadXML (mxml_node_t *p)
 Saving function for hospital related data.
qboolean 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.c.


Define Documentation

#define GET_HP_HEALING ( ab   )     (1 + (ab) * 15/MAX_SKILL)

Definition at line 33 of file cp_hospital.c.

Referenced by HOS_HealCharacter().


Function Documentation

void HOS_HealAll ( const base_t *const   base  ) 

Heal all employees in the given base.

Parameters:
[in] base The base the employees should become healed
See also:
HOS_HealEmployee

Definition at line 103 of file cp_hospital.c.

References E_GetNextFromBase(), HOS_HealEmployee(), MAX_EMPL, and type.

qboolean HOS_HealCharacter ( character_t chr,
qboolean  hospital 
)

Heals character.

Parameters:
[in] chr Character data of an employee
[in] hospital True 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 42 of file cp_hospital.c.

References ABILITY_POWER, GET_HP_HEALING, character_s::HP, MAX_HP, character_s::maxHP, qfalse, qtrue, character_s::score, and chrScoreGlobal_s::skills.

Referenced by HOS_HealEmployee(), and HOS_HospitalRun().

qboolean HOS_HealEmployee ( employee_t employee  ) 

Callback for HOS_HealCharacter() in hospital.

Parameters:
[in] employee Pointer to the employee to heal.
See also:
HOS_HealCharacter
HOS_HealAll

Definition at line 92 of file cp_hospital.c.

References employee_s::chr, HOS_HealCharacter(), and qtrue.

Referenced by HOS_HealAll().

qboolean HOS_HospitalAllowed ( const base_t base  ) 

Returns true if you can enter in the hospital.

See also:
B_BaseInit_f

Definition at line 205 of file cp_hospital.c.

References B_GetBuildingStatus(), B_HOSPITAL, BASE_UNDER_ATTACK, base_s::baseStatus, qfalse, and qtrue.

Referenced by B_BaseInit_f(), and B_BuildingOpenAfterClick().

void HOS_HospitalRun ( void   ) 

Checks health status of all employees in all bases.

See also:
CL_CampaignRun
Note:
Called every day.

Definition at line 71 of file cp_hospital.c.

References B_GetBuildingStatus(), B_HOSPITAL, employee_s::baseHired, employee_s::chr, E_GetNextHired(), HOS_HealCharacter(), MAX_EMPL, qfalse, qtrue, and type.

Referenced by CL_CampaignRun().

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 172 of file cp_hospital.c.

References Cmd_AddCommand().

Referenced by CP_InitStartup().

qboolean HOS_LoadXML ( mxml_node_t p  ) 

Saving function for hospital related data.

See also:
HOS_SaveXML
SAV_GameLoadXML

Definition at line 196 of file cp_hospital.c.

References qtrue.

Referenced by SAV_Init().

qboolean HOS_SaveXML ( mxml_node_t p  ) 

Saving function for hospital related data.

See also:
HOS_LoadXML
SAV_GameSaveXML

Definition at line 185 of file cp_hospital.c.

References qtrue.

Referenced by SAV_Init().


Generated by  doxygen 1.6.2