diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf new file mode 100644 index 0000000000..f82e0fd5e4 --- /dev/null +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -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; +}; diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf index 9af27ea16d..a010f0fdde 100644 --- a/addons/medical/functions/fnc_getBloodLoss.sqf +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -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 + * + * ReturnValue: + * Total blood loss of unit + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_getBloodPressure.sqf b/addons/medical/functions/fnc_getBloodPressure.sqf index 980d95918d..f5012c8735 100644 --- a/addons/medical/functions/fnc_getBloodPressure.sqf +++ b/addons/medical/functions/fnc_getBloodPressure.sqf @@ -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 + * + * ReturnValue: + * Blood Pressuret ,> + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf index 31bda33cce..92b4408fbf 100644 --- a/addons/medical/functions/fnc_getBloodVolumeChange.sqf +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -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 + * + * ReturnValue: + * Current cardiac output + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_getCardiacOutput.sqf b/addons/medical/functions/fnc_getCardiacOutput.sqf index e45cd0ab61..a44e8a8e29 100644 --- a/addons/medical/functions/fnc_getCardiacOutput.sqf +++ b/addons/medical/functions/fnc_getCardiacOutput.sqf @@ -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 + * + * ReturnValue: + * Current cardiac output + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_getHeartRateChange.sqf b/addons/medical/functions/fnc_getHeartRateChange.sqf index a3c0c239cd..2f1b7bfab8 100644 --- a/addons/medical/functions/fnc_getHeartRateChange.sqf +++ b/addons/medical/functions/fnc_getHeartRateChange.sqf @@ -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 + * + * ReturnValue: + * Change in heart Rate + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf index 2153a5659c..2e12640838 100644 --- a/addons/medical/functions/fnc_getTypeOfDamage.sqf +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -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 + * + * ReturnValue: + * Type of damage + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_handleDamage_advanced.sqf b/addons/medical/functions/fnc_handleDamage_advanced.sqf index aa2a14489a..c345c4fbb1 100644 --- a/addons/medical/functions/fnc_handleDamage_advanced.sqf +++ b/addons/medical/functions/fnc_handleDamage_advanced.sqf @@ -1,3 +1,23 @@ +/* + * Author: Glowbal + * Advanced HandleDamage EH function. + * + * Arguments: + * 0: Unit That Was Hit + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter + * 4: Projectile + * 5: Current damage to be returned + * 6: Type of Damage + * + * Return Value: + * Damage To Be Inflicted + * + * 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; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleAirway.sqf b/addons/medical/functions/fnc_handleDamage_airway.sqf similarity index 65% rename from addons/medical/functions/fnc_handleAirway.sqf rename to addons/medical/functions/fnc_handleDamage_airway.sqf index ff675c2780..0fb7daeed4 100644 --- a/addons/medical/functions/fnc_handleAirway.sqf +++ b/addons/medical/functions/fnc_handleDamage_airway.sqf @@ -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 + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter or source of the damage + * 4: Type of the damage done + * + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_handleFractures.sqf b/addons/medical/functions/fnc_handleDamage_fractures.sqf similarity index 84% rename from addons/medical/functions/fnc_handleFractures.sqf rename to addons/medical/functions/fnc_handleDamage_fractures.sqf index 1fac4f5729..0a22365044 100644 --- a/addons/medical/functions/fnc_handleFractures.sqf +++ b/addons/medical/functions/fnc_handleDamage_fractures.sqf @@ -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 + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter or source of the damage + * 4: Type of the damage done + * + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_handleInternalInjuries.sqf b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf similarity index 53% rename from addons/medical/functions/fnc_handleInternalInjuries.sqf rename to addons/medical/functions/fnc_handleDamage_internalInjuries.sqf index b9a13ae173..6ee256a977 100644 --- a/addons/medical/functions/fnc_handleInternalInjuries.sqf +++ b/addons/medical/functions/fnc_handleDamage_internalInjuries.sqf @@ -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 + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter or source of the damage + * 4: Type of the damage done + * + * Return Value: + * None + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_handleDamage_medium.sqf b/addons/medical/functions/fnc_handleDamage_medium.sqf index 81a5d85917..78e0bca011 100644 --- a/addons/medical/functions/fnc_handleDamage_medium.sqf +++ b/addons/medical/functions/fnc_handleDamage_medium.sqf @@ -1,3 +1,21 @@ +/* + * Author: Glowbal + * Medium HandleDamage EH function. + * + * Arguments: + * 0: Unit That Was Hit + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter + * 4: Projectile + * 5: Current damage to be returned + * 6: Type of Damage + * + * Return Value: + * Damage To Be Inflicted + * + * Public: No + */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_handleDamage_wounds.sqf b/addons/medical/functions/fnc_handleDamage_wounds.sqf index 1f3ae71ee7..73b9e47e67 100644 --- a/addons/medical/functions/fnc_handleDamage_wounds.sqf +++ b/addons/medical/functions/fnc_handleDamage_wounds.sqf @@ -1,3 +1,19 @@ +/* + * Author: Glowbal + * Handling of the open wounds & injuries upon the handleDamage eventhandler. + * + * Arguments: + * 0: Unit That Was Hit + * 1: Name Of Hit Selection + * 2: Amount Of Damage + * 3: Shooter or source of the damage + * 4: Type of the damage done + * + * Return Value: + * None + * + * Public: No + */ #include "script_component.hpp" #define ADD_INJURY(BODYPART,TYPE,AMOUNT) _woundID = 1; \ diff --git a/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf index 063dda629b..3df90ddb1b 100644 --- a/addons/medical/functions/fnc_handleUnitVitals.sqf +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -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 + * + * ReturnValue: + * + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/medical/functions/fnc_selectionNameToNumber.sqf b/addons/medical/functions/fnc_selectionNameToNumber.sqf index de717d6a33..1e8d79183f 100644 --- a/addons/medical/functions/fnc_selectionNameToNumber.sqf +++ b/addons/medical/functions/fnc_selectionNameToNumber.sqf @@ -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 + * + * ReturnValue: + * Number representation. -1 if invalid. + * + * Public: yes */ #include "script_component.hpp" -(["head","body","hand_l","hand_r","leg_l","leg_r"] find (_this select 0)); \ No newline at end of file +(["head","body","hand_l","hand_r","leg_l","leg_r"] find (_this select 0)); diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf index f23d269d8f..9767978a16 100644 --- a/addons/medical/functions/fnc_setCardiacArrest.sqf +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -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.
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 + * + * ReturnValue: + * + * + * Public: yes */ #include "script_component.hpp"