2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2015-02-08 09:01:32 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
2016-12-05 20:34:20 +00:00
|
|
|
* Calculate the blood pressure of a unit.
|
2015-02-08 09:01:32 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Unit <OBJECT>
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Return Value:
|
2015-08-22 14:25:10 +00:00
|
|
|
* 0: BloodPressure Low <NUMBER>
|
|
|
|
* 1: BloodPressure High <NUMBER>
|
2015-02-07 22:55:48 +00:00
|
|
|
*
|
2017-04-22 18:45:56 +00:00
|
|
|
* Example:
|
2019-03-30 16:07:54 +00:00
|
|
|
* [player] call ace_medical_status_fnc_getBloodPressure
|
2017-04-22 18:45:56 +00:00
|
|
|
*
|
2015-02-08 09:01:32 +00:00
|
|
|
* Public: No
|
2015-02-07 22:55:48 +00:00
|
|
|
*/
|
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
// Value is taken because with cardic output and resistance at default values, it will put blood pressure High at 120.
|
2019-06-10 16:23:21 +00:00
|
|
|
#define MODIFIER_BP_HIGH 9.4736842
|
2015-02-07 22:55:48 +00:00
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
// Value is taken because with cardic output and resistance at default values, it will put blood pressure Low at 80.
|
2019-06-10 16:23:21 +00:00
|
|
|
#define MODIFIER_BP_LOW 6.3157894
|
2015-02-07 22:55:48 +00:00
|
|
|
|
2015-08-22 14:25:10 +00:00
|
|
|
params ["_unit"];
|
|
|
|
|
2016-06-13 00:34:56 +00:00
|
|
|
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
|
2018-05-23 09:52:47 +00:00
|
|
|
private _resistance = _unit getVariable [VAR_PERIPH_RES, DEFAULT_PERIPH_RES];
|
2016-12-05 20:34:20 +00:00
|
|
|
private _bloodPressure = _cardiacOutput * _resistance;
|
2015-02-07 22:55:48 +00:00
|
|
|
|
2016-12-05 20:34:20 +00:00
|
|
|
[round(_bloodPressure * MODIFIER_BP_LOW), round(_bloodPressure * MODIFIER_BP_HIGH)]
|