2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2016-07-15 10:23:47 +00:00
|
|
|
/*
|
2023-08-17 10:02:17 +00:00
|
|
|
* Author: esteldunedain, kymckay, mharis001
|
2019-03-24 22:17:48 +00:00
|
|
|
* Modifies the medical action icons to show blood loss and tourniquets.
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2019-03-24 22:17:48 +00:00
|
|
|
* 0: Unit <OBJECT>
|
2023-06-24 05:11:56 +00:00
|
|
|
* 1: Body part <STRING>
|
2019-03-24 22:17:48 +00:00
|
|
|
* 2: Action data <ARRAY>
|
2016-07-15 10:23:47 +00:00
|
|
|
*
|
2019-03-24 22:17:48 +00:00
|
|
|
* Return Value:
|
2016-07-15 10:23:47 +00:00
|
|
|
* None
|
|
|
|
*
|
2019-03-24 22:17:48 +00:00
|
|
|
* Example:
|
2023-06-24 05:11:56 +00:00
|
|
|
* [_target, "head", _actionData] call ace_medical_gui_fnc_modifyAction
|
2019-03-24 22:17:48 +00:00
|
|
|
*
|
2016-07-15 10:23:47 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
#define COLOR_SCALE ["#ffffff", "#fff1a1", "#ffe075", "#ffcb55", "#ffb73c", "#ffa127", "#ff8815", "#ff6d05", "#ff4b00", "#ff0000"]
|
|
|
|
|
2023-06-24 05:11:56 +00:00
|
|
|
params ["_target", "_bodyPart", "_actionData"];
|
|
|
|
private _partIndex = ALL_BODY_PARTS find _bodyPart;
|
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
|
|
|
|
{
|
2023-06-24 05:11:56 +00:00
|
|
|
_x params ["", "_amountOf", "_bleeding"];
|
|
|
|
_bloodLossOnBodyPart = _bloodLossOnBodyPart + (_amountOf * _bleeding);
|
|
|
|
} forEach (GET_OPEN_WOUNDS(_target) getOrDefault [_bodyPart, []]);
|
2016-07-15 10:23:47 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
private _frBL = 0 max (_bloodLossOnBodyPart / BLOOD_LOSS_RED_THRESHOLD) min 1;
|
|
|
|
private _colorInt = ceil (_frBL * (BLOOD_LOSS_TOTAL_COLORS - 1)); // ceil because any bleeding more than zero shouldn't be white
|
2016-10-13 17:05:29 +00:00
|
|
|
|
2019-03-24 22:17:48 +00:00
|
|
|
if (HAS_TOURNIQUET_APPLIED_ON(_target,_partIndex)) then {
|
|
|
|
_actionData set [2, format [QPATHTOF(ui\cross_t_%1.paa), _colorInt]];
|
|
|
|
} else {
|
|
|
|
_actionData set [2, [QPATHTOF(ui\cross.paa), COLOR_SCALE select _colorInt]];
|
2016-07-15 10:23:47 +00:00
|
|
|
};
|