ACE3/addons/medical_status/functions/fnc_getBloodPressure.sqf

32 lines
932 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: Glowbal
2016-12-05 20:34:20 +00:00
* Calculate the blood pressure of a unit.
*
* Arguments:
* 0: The Unit <OBJECT>
*
* Return Value:
2015-08-22 14:25:10 +00:00
* 0: BloodPressure Low <NUMBER>
* 1: BloodPressure High <NUMBER>
*
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
*
* Public: No
*/
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.
Medical - Fix severity of wound bleeding and adjust cardiac output calculations (#7010) * Fix severity of wound bleeding I'm simplifying the nastiness calculations so that the wound config specifies the worst wound and we scale it between 25% to 100% based on the wound damage and number of wounds recieved. Similarly I've updated the wound configs to more reasonable maximum bleeding values based on the fact that they're percentages of cardiac output being bled. * Limit variance of pain modifier This is to avoid unexpectedly high pain for small wounds or unexpectedly small pain for large wounds * Make more wounds increase chance for nastiness Rather than guarantee * Adjust worst damage scaling This handles torso wounds better as they're typically around 0.3-0.6 for 6.5mm shots which makes them roughly medium sized. * Fix cardiac output calculation Previously the calculation didn't make sense as it wasn't outputting a value in l/s. This method of calculation makes more logical sense and provides a point of reference for what the bleeding values actually represent (percentage of the blood being pumped that is lost - which now has an actual volumetric value). * Fix blood pressure after change to cardiac output * Fix heartrate skyrocketing between 5l and 4l blood Pretty sure someone accidnentally got these conditions the wrong way around. This way blood pressure will first drop and then heart rate will later go up to compensate. * Fix comment typo Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
2019-06-10 16:23:21 +00:00
#define MODIFIER_BP_HIGH 9.4736842
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.
Medical - Fix severity of wound bleeding and adjust cardiac output calculations (#7010) * Fix severity of wound bleeding I'm simplifying the nastiness calculations so that the wound config specifies the worst wound and we scale it between 25% to 100% based on the wound damage and number of wounds recieved. Similarly I've updated the wound configs to more reasonable maximum bleeding values based on the fact that they're percentages of cardiac output being bled. * Limit variance of pain modifier This is to avoid unexpectedly high pain for small wounds or unexpectedly small pain for large wounds * Make more wounds increase chance for nastiness Rather than guarantee * Adjust worst damage scaling This handles torso wounds better as they're typically around 0.3-0.6 for 6.5mm shots which makes them roughly medium sized. * Fix cardiac output calculation Previously the calculation didn't make sense as it wasn't outputting a value in l/s. This method of calculation makes more logical sense and provides a point of reference for what the bleeding values actually represent (percentage of the blood being pumped that is lost - which now has an actual volumetric value). * Fix blood pressure after change to cardiac output * Fix heartrate skyrocketing between 5l and 4l blood Pretty sure someone accidnentally got these conditions the wrong way around. This way blood pressure will first drop and then heart rate will later go up to compensate. * Fix comment typo Co-Authored-By: PabstMirror <pabstmirror@gmail.com>
2019-06-10 16:23:21 +00:00
#define MODIFIER_BP_LOW 6.3157894
2015-08-22 14:25:10 +00:00
params ["_unit"];
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;
2016-12-05 20:34:20 +00:00
[round(_bloodPressure * MODIFIER_BP_LOW), round(_bloodPressure * MODIFIER_BP_HIGH)]