2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-07-15 10:23:47 +00:00
|
|
|
/*
|
|
|
|
* Author: esteldunedain
|
|
|
|
* Modify the visuals of a medical action point.
|
|
|
|
* On Basic medical: modify the icon color based on damage on that body part.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The Patient Unit <OBJECT>
|
|
|
|
* 1: The Diagnosing Unit <OBJECT>
|
2016-10-06 23:58:40 +00:00
|
|
|
* 2: Body part index <NUMBER>
|
2016-07-15 10:23:47 +00:00
|
|
|
* 3: The action to modify <OBJECT>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-10-06 23:58:40 +00:00
|
|
|
params ["_target", "_player", "_partIndex", "_actionData"];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2016-10-13 17:05:29 +00:00
|
|
|
private _bloodLossOnBodyPart = 0;
|
2016-10-06 23:58:40 +00:00
|
|
|
|
2016-07-15 10:23:47 +00:00
|
|
|
// Add all bleeding from wounds on selection
|
|
|
|
{
|
2018-04-20 11:28:18 +00:00
|
|
|
_x params ["", "", "_bodyPartN", "_amountOf", "_bleeding"];
|
2016-10-06 23:58:40 +00:00
|
|
|
|
|
|
|
if (_bodyPartN == _partIndex) then {
|
2018-04-20 11:28:18 +00:00
|
|
|
_bloodLossOnBodyPart = _bloodLossOnBodyPart + (20 * _amountOf * _bleeding);
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
|
|
|
} forEach (_target getvariable [QEGVAR(medical,openWounds), []]);
|
|
|
|
|
2018-07-29 21:43:14 +00:00
|
|
|
private _hasTourniquet = HAS_TOURNIQUET_APPLIED_ON(_target,_partIndex);
|
2016-10-13 17:05:29 +00:00
|
|
|
|
|
|
|
switch (true) do {
|
|
|
|
case (_bloodLossOnBodyPart >= 0.15): {
|
|
|
|
if (_hasTourniquet) then {
|
2018-05-08 12:57:32 +00:00
|
|
|
_actionData set [2, QPATHTOF(ui\ui\icons\medical_crossRed_t.paa)];
|
2016-10-13 17:05:29 +00:00
|
|
|
} else {
|
2018-05-08 12:57:32 +00:00
|
|
|
_actionData set [2, QPATHTOF(ui\ui\icons\medical_crossRed.paa)];
|
2016-10-13 17:05:29 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
case (_bloodLossOnBodyPart > 0): {
|
|
|
|
if (_hasTourniquet) then {
|
2018-05-08 12:57:32 +00:00
|
|
|
_actionData set [2, QPATHTOF(ui\ui\icons\medical_crossYellow_t.paa)];
|
2016-10-13 17:05:29 +00:00
|
|
|
} else {
|
2018-05-08 12:57:32 +00:00
|
|
|
_actionData set [2, QPATHTOF(ui\ui\icons\medical_crossYellow.paa)];
|
2016-10-13 17:05:29 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
default {
|
|
|
|
if (_hasTourniquet) then {
|
2018-05-08 12:57:32 +00:00
|
|
|
_actionData set [2, QPATHTOF(ui\ui\icons\medical_cross_t.paa)];
|
2016-10-13 17:05:29 +00:00
|
|
|
};
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|
|
|
|
};
|