Updated headers to correct format

Reorganized function names.
Added unit vitals loop
This commit is contained in:
Glowbal 2015-02-08 10:01:32 +01:00
parent 35de875382
commit bf762bbdf1
16 changed files with 220 additions and 88 deletions

View File

@ -0,0 +1,29 @@
/**
* fnc_addToInjuredCollection.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
if !(local _unit) exitwith{
[[_unit], QUOTE(FUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc);
};
if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{
_unit setvariable [QGVAR(addedToUnitLoop),true, true];
};
if ([_unit] call FUNC(hasMedicalEnabled)) then {
if (isnil QGVAR(injuredUnitCollection)) then {
GVAR(injuredUnitCollection) = [];
};
if (_unit in GVAR(injuredUnitCollection)) exitwith {};
GVAR(injuredUnitCollection) pushback _unit;
};

View File

@ -1,11 +1,14 @@
/**
* fn_getBloodLoss.sqf
* @Descr: Calculate the total blood loss of a unit.
* @Author: Glowbal
/*
* Author: Glowbal
* Calculate the total blood loss of a unit.
*
* @Arguments: [unit OBJECT]
* @Return: NUMBER Total blood loss of unit
* @PublicAPI: true
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* Total blood loss of unit <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,11 +1,14 @@
/**
* fn_getBloodPressure.sqf
* @Descr: Calculate the current blood pressure of a unit.
* @Author: Glowbal
/*
* Author: Glowbal
* Calculates the blood volume change and decreases the IVs given to the unit.
*
* @Arguments: [unit OBJECT (The unit to get the blood pressure from.)]
* @Return: ARRAY Blood Pressure. Format [low NUMBER, high NUMBER]
* @PublicAPI: true
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* Blood Pressuret <ARRAY <NUMBER>,<NUMBER>>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,11 +1,14 @@
/**
* fn_getBloodVolumeChange.sqf
* @Descr: Calculates the blood volume change and decreases the IVs given to the unit.
* @Author: Glowbal
/*
* Author: Glowbal
* Calculates the blood volume change and decreases the IVs given to the unit.
*
* @Arguments: []
* @Return: NUMBER Bloodvolume change
* @PublicAPI: false
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* Current cardiac output <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,11 +1,14 @@
/**
* fn_getCardiacOutput.sqf
* @Descr: Get the cardiac output from the Heart, based on current Heart Rate and Blood Volume.
* @Author: Glowbal
/*
* Author: Glowbal
* Get the cardiac output from the Heart, based on current Heart Rate and Blood Volume.
*
* @Arguments: [unit OBJECT]
* @Return: NUMBER Current cardiac output.
* @PublicAPI: true
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* Current cardiac output <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,11 +1,14 @@
/**
* fn_getHeartRateChange.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal
* Get the change in the heart rate. Used for the vitals calculations. Calculated in one seconds.
*
* @Arguments: []
* @Return: void
* @PublicAPI: false
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* Change in heart Rate <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,11 +1,14 @@
/**
* fn_getTypeOfDamage.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal
* Get the type of damage based upon the projectile.
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* 0: The projectile classname or object <STRING>
*
* ReturnValue:
* Type of damage <STRING>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,3 +1,23 @@
/*
* Author: Glowbal
* Advanced HandleDamage EH function.
*
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter <OBJECT>
* 4: Projectile <STRING>
* 5: Current damage to be returned <NUMBER>
* 6: Type of Damage <STRING>
*
* Return Value:
* Damage To Be Inflicted <NUMBER>
*
* Public: No
*/
private ["_unit","_selectionName","_amountOfDamage","_sourceOfDamage","_typeOfProjectile","_typeOfDamage"];
_unit = _this select 0;
_selectionName = _this select 1;
@ -8,12 +28,12 @@ _returnDamage = _this select 5;
_typeOfDamage = _this select 6; //[_typeOfProjectile] call FUNC(getTypeOfDamage);
if (GVAR(enableAirway)) then {
[_unit,_selectionName,_amountOfDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleAirway);
[_unit,_selectionName,_amountOfDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_airway);
};
if (GVAR(enableFractures)) then {
[_unit,_selectionName,_amountOfDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleFractures);
[_unit,_selectionName,_amountOfDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_fractures);
};
if (GVAR(enableInternalBleeding)) then {
[_unit,_selectionName,_amountOfDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleInternalInjuries);
[_unit,_selectionName,_amountOfDamage,_sourceOfDamage, _typeOfDamage] call FUNC(handleDamage_internalInjuries);
};
_returnDamage;

View File

@ -1,11 +1,18 @@
/**
* fn_assignAirwayStatus.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal
* Handling of the airway injuries upon the handleDamage eventhandler.
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter or source of the damage <OBJECT>
* 4: Type of the damage done <STRING>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,11 +1,18 @@
/**
* fn_assignFractures.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal
* Handling of the fracture injuries upon the handleDamage eventhandler.
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter or source of the damage <OBJECT>
* 4: Type of the damage done <STRING>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,11 +1,18 @@
/**
* fn_assignFractures.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal
* Handling of the internal injuries upon the handleDamage eventhandler.
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter or source of the damage <OBJECT>
* 4: Type of the damage done <STRING>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,3 +1,21 @@
/*
* Author: Glowbal
* Medium HandleDamage EH function.
*
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter <OBJECT>
* 4: Projectile <STRING>
* 5: Current damage to be returned <NUMBER>
* 6: Type of Damage <STRING>
*
* Return Value:
* Damage To Be Inflicted <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,3 +1,19 @@
/*
* Author: Glowbal
* Handling of the open wounds & injuries upon the handleDamage eventhandler.
*
* Arguments:
* 0: Unit That Was Hit <OBJECT>
* 1: Name Of Hit Selection <STRING>
* 2: Amount Of Damage <NUMBER>
* 3: Shooter or source of the damage <OBJECT>
* 4: Type of the damage done <STRING>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"
#define ADD_INJURY(BODYPART,TYPE,AMOUNT) _woundID = 1; \

View File

@ -1,11 +1,14 @@
/**
* fn_handleUnitVitals.sqf
* @Descr: Updates the vitals. Is expected to be called every second.
* @Author: Glowbal
/*
* Author: Glowbal
* Updates the vitals. Is expected to be called every second.
*
* @Arguments: [unit OBJECT]
* @Return: void
* @PublicAPI: false
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
* <NIL>
*
* Public: No
*/
#include "script_component.hpp"

View File

@ -1,13 +1,16 @@
/**
* fn_getBodyPartNumber.sqf
* @Descr: N/A
* @Author: Glowbal
/*
* Author: Glowbal
* Get the number representation of a selection name.
*
* @Arguments: []
* @Return:
* @PublicAPI: false
* Arguments:
* 0: The selection name of a unit <STRING>
*
* ReturnValue:
* Number representation. -1 if invalid. <NUMBER>
*
* Public: yes
*/
#include "script_component.hpp"
(["head","body","hand_l","hand_r","leg_l","leg_r"] find (_this select 0));
(["head","body","hand_l","hand_r","leg_l","leg_r"] find (_this select 0));

View File

@ -1,11 +1,15 @@
/**
* fn_setCardiacArrest.sqf
* @Descr: Triggers a unit into the Cardiac Arrest state from CMS. Will put the unit in an unconscious state and run a countdown timer until unit dies. <br />Timer is a random value between 120 and 720 seconds.
* @Author: Glowbal
/*
* Author: Glowbal
* Triggers a unit into the Cardiac Arrest state from CMS. Will put the unit in an unconscious state and run a countdown timer until unit dies.
* Timer is a random value between 120 and 720 seconds.
*
* @Arguments: [unit OBJECT (The unit that will be put in cardiac arrest state)]
* @Return: void
* @PublicAPI: true
* Arguments:
* 0: The unit that will be put in cardiac arrest state <OBJECT>
*
* ReturnValue:
* <NIL>
*
* Public: yes
*/
#include "script_component.hpp"