2015-04-17 22:36:03 +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>
|
|
|
|
* 2: Selection Number <NUMBER>
|
|
|
|
* 3: The action to modify <OBJECT>
|
|
|
|
*
|
|
|
|
* ReturnValue:
|
2015-08-22 14:25:10 +00:00
|
|
|
* None
|
2015-04-17 22:36:03 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-06-13 10:18:56 +00:00
|
|
|
params ["_target", "_player", "_partNumber", "_actionData"];
|
2015-08-22 14:25:10 +00:00
|
|
|
|
2016-06-13 10:18:56 +00:00
|
|
|
private _bloodLossOnSelection = 0;
|
|
|
|
// Add all bleeding from wounds on selection
|
|
|
|
{
|
|
|
|
_x params ["", "", "_selectionX", "_amountOf", "_percentageOpen"];
|
|
|
|
if (_selectionX == _partNumber) then {
|
|
|
|
_bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _percentageOpen);
|
2015-04-30 06:17:26 +00:00
|
|
|
};
|
2016-06-13 10:18:56 +00:00
|
|
|
} forEach (_target getvariable [QGVAR(openWounds), []]);
|
|
|
|
|
|
|
|
if (_bloodLossOnSelection >=1 ) then {
|
|
|
|
_actionData set [2, QPATHTOF(UI\icons\medical_crossRed.paa)];
|
|
|
|
} else {
|
|
|
|
if (_bloodLossOnSelection > 0 ) then {
|
2016-04-08 18:34:50 +00:00
|
|
|
_actionData set [2, QPATHTOF(UI\icons\medical_crossYellow.paa)];
|
2015-04-30 06:17:26 +00:00
|
|
|
};
|
2015-04-17 22:36:03 +00:00
|
|
|
};
|