ACE3/addons/medical/functions/fnc_getBloodPressure.sqf

30 lines
860 B
Plaintext
Raw Normal View History

/*
* Author: Glowbal
2016-12-05 20:34:20 +00:00
* Calculate the blood pressure of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* ReturnValue:
2015-08-22 14:25:10 +00:00
* 0: BloodPressure Low <NUMBER>
* 1: BloodPressure High <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
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.
2016-12-05 20:34:20 +00:00
#define MODIFIER_BP_HIGH 13.7142792
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.
2016-12-05 20:34:20 +00:00
#define MODIFIER_BP_LOW 9.1428528
2015-08-22 14:25:10 +00:00
params ["_unit"];
private _cardiacOutput = [_unit] call FUNC(getCardiacOutput);
private _resistance = _unit getVariable [QGVAR(peripheralResistance), 100];
2016-12-05 20:34:20 +00:00
private _bloodPressure = _cardiacOutput * _resistance;
2016-12-05 20:34:20 +00:00
[round(_bloodPressure * MODIFIER_BP_LOW), round(_bloodPressure * MODIFIER_BP_HIGH)]