mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
40 lines
1.2 KiB
Plaintext
40 lines
1.2 KiB
Plaintext
/*
|
|
* 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:
|
|
* None
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
params ["_target", "_player", "_selectionN", "_actionData"];
|
|
|
|
if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitWith {
|
|
private _pointDamage = (_target getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN;
|
|
|
|
if (_pointDamage >= 0.8) exitWith {
|
|
_actionData set [2, QPATHTOF(UI\icons\medical_crossRed.paa)];
|
|
};
|
|
if (_pointDamage > 0) exitWith {
|
|
_actionData set [2, QPATHTOF(UI\icons\medical_crossYellow.paa)];
|
|
};
|
|
};
|
|
|
|
private _openWounds = _target getVariable [QGVAR(openWounds), []];
|
|
{
|
|
_x params ["", "", "_selectionX", "_amountOf", "_x4"];
|
|
if (_amountOf > 0 && {(_selectionN == _selectionX)} && {_x4 > 0}) exitWith {
|
|
_actionData set [2, QPATHTOF(UI\icons\medical_crossRed.paa)];
|
|
};
|
|
} forEach _openWounds;
|