2019-03-30 20:44:58 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
/*
|
|
|
|
* Author: SilentSpike
|
|
|
|
* Prevents bandage actions from showing if selected body part isn't bleeding.
|
|
|
|
* Toggles between showing all or only basic bandage action for advanced setting.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2019-06-03 15:31:46 +00:00
|
|
|
* 0: Medic <OBJECT>
|
|
|
|
* 1: Patient <OBJECT>
|
|
|
|
* 2: Body Part <STRING>
|
|
|
|
* 3: Treatment <STRING>
|
2019-03-30 20:44:58 +00:00
|
|
|
*
|
2019-06-03 15:31:46 +00:00
|
|
|
* Return Value:
|
2019-03-30 20:44:58 +00:00
|
|
|
* Can Bandage <BOOL>
|
|
|
|
*
|
2019-04-03 11:36:37 +00:00
|
|
|
* Example:
|
|
|
|
* [player, cursorTarget, "Head", "FieldDressing"] call ace_medical_treatment_fnc_canBandage
|
|
|
|
*
|
2019-03-30 20:44:58 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2019-06-03 15:31:46 +00:00
|
|
|
params ["_medic", "_patient", "_bodyPart", "_bandage"];
|
2019-03-30 20:44:58 +00:00
|
|
|
|
|
|
|
// Bandage type and bandage setting XNOR to show only active actions
|
2020-01-04 20:43:51 +00:00
|
|
|
if ((_bandage == "BasicBandage") isEqualTo (GVAR(advancedBandages) != 0)) exitWith {false};
|
2019-03-30 20:44:58 +00:00
|
|
|
|
2019-06-03 15:31:46 +00:00
|
|
|
private _index = ALL_BODY_PARTS find toLower _bodyPart;
|
2019-03-30 20:44:58 +00:00
|
|
|
private _canBandage = false;
|
|
|
|
|
|
|
|
{
|
2019-05-12 04:13:59 +00:00
|
|
|
_x params ["", "_bodyPartN", "_amountOf", "_bleeding"];
|
2019-03-30 20:44:58 +00:00
|
|
|
|
|
|
|
// If any single wound on the bodypart is bleeding bandaging can go ahead
|
|
|
|
if (_bodyPartN == _index && {_amountOf * _bleeding > 0}) exitWith {
|
|
|
|
_canBandage = true;
|
|
|
|
};
|
2019-06-22 18:36:27 +00:00
|
|
|
} forEach GET_OPEN_WOUNDS(_patient);
|
2019-03-30 20:44:58 +00:00
|
|
|
|
|
|
|
_canBandage
|