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
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-10-06 23:58:40 +00:00
|
|
|
params ["_target", "_player", "_partIndex", "_actionData"];
|
2016-07-15 10:23:47 +00:00
|
|
|
|
|
|
|
private _bloodLossOnSelection = 0;
|
2016-10-06 23:58:40 +00:00
|
|
|
|
2016-07-15 10:23:47 +00:00
|
|
|
// Add all bleeding from wounds on selection
|
|
|
|
{
|
2016-10-06 23:58:40 +00:00
|
|
|
_x params ["", "", "_bodyPartN", "_amountOf", "_percentageOpen"];
|
|
|
|
|
|
|
|
if (_bodyPartN == _partIndex) then {
|
2016-07-15 10:23:47 +00:00
|
|
|
_bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _percentageOpen);
|
|
|
|
};
|
|
|
|
} forEach (_target getvariable [QEGVAR(medical,openWounds), []]);
|
|
|
|
|
2016-08-03 18:14:12 +00:00
|
|
|
if (_bloodLossOnSelection >= 0.15) then {
|
2016-07-15 10:23:47 +00:00
|
|
|
_actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossRed.paa)];
|
|
|
|
} else {
|
2016-10-06 23:58:40 +00:00
|
|
|
if (_bloodLossOnSelection > 0) then {
|
2016-07-15 10:23:47 +00:00
|
|
|
_actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossYellow.paa)];
|
|
|
|
};
|
|
|
|
};
|