ACE3/addons/medical_status/functions/fnc_getBloodPressure.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

32 lines
935 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Glowbal
* Calculate the blood pressure of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
* 0: BloodPressure Low <NUMBER>
* 1: BloodPressure High <NUMBER>
*
* Example:
* [player] call ace_medical_status_fnc_getBloodPressure
*
* Public: No
*/
// Value is taken because with cardic output and resistance at default values, it will put blood pressure High at 120.
#define MODIFIER_BP_HIGH 9.4736842
// Value is taken because with cardic output and resistance at default values, it will put blood pressure Low at 80.
#define MODIFIER_BP_LOW 6.3157894
params ["_unit"];
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
private _resistance = _unit getVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES];
private _bloodPressure = _cardiacOutput * _resistance;
[round(_bloodPressure * MODIFIER_BP_LOW), round(_bloodPressure * MODIFIER_BP_HIGH)]