ACE3/addons/medical/functions/fnc_modifyMedicalAction.sqf

40 lines
1.2 KiB
Plaintext
Raw Normal View History

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"
2015-08-22 14:25:10 +00:00
params ["_target", "_player", "_selectionN", "_actionData"];
2015-11-30 16:14:05 +00:00
if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitWith {
private _pointDamage = (_target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN;
2015-04-17 22:36:03 +00:00
2015-04-30 06:17:26 +00:00
if (_pointDamage >= 0.8) exitWith {
2016-04-08 18:34:50 +00:00
_actionData set [2, QPATHTOF(UI\icons\medical_crossRed.paa)];
2015-04-30 06:17:26 +00:00
};
if (_pointDamage > 0) exitWith {
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
};
private _openWounds = _target getVariable [QGVAR(openWounds), []];
{
2015-08-22 14:25:10 +00:00
_x params ["", "", "_selectionX", "_amountOf", "_x4"];
2015-11-30 16:14:05 +00:00
if (_amountOf > 0 && {(_selectionN == _selectionX)} && {_x4 > 0}) exitWith {
2016-04-08 18:34:50 +00:00
_actionData set [2, QPATHTOF(UI\icons\medical_crossRed.paa)];
};
2015-11-30 16:23:48 +00:00
} forEach _openWounds;