ACE3/addons/medical_menu/functions/fnc_modifyAction.sqf

39 lines
1.0 KiB
Plaintext
Raw Normal View History

/*
* 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: Body part index <NUMBER>
* 3: The action to modify <OBJECT>
*
* ReturnValue:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_target", "_player", "_partIndex", "_actionData"];
private _bloodLossOnSelection = 0;
// Add all bleeding from wounds on selection
{
_x params ["", "", "_bodyPartN", "_amountOf", "_percentageOpen"];
if (_bodyPartN == _partIndex) then {
_bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _percentageOpen);
};
} forEach (_target getvariable [QEGVAR(medical,openWounds), []]);
if (_bloodLossOnSelection >= 0.15) then {
_actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossRed.paa)];
} else {
if (_bloodLossOnSelection > 0) then {
_actionData set [2, QPATHTOEF(medical,UI\icons\medical_crossYellow.paa)];
};
};