2015-08-06 21:51:17 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal
|
|
|
|
* Grab available treatment options for given category
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: The medic <OBJECT>
|
|
|
|
* 1: The patient <OBJECT>
|
|
|
|
* 2: Category name <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Available actions <ARRAY>
|
|
|
|
*
|
2015-08-07 03:37:41 +00:00
|
|
|
* Exmaple:
|
|
|
|
* [ACE_player, poor_dude, "some category"] call ace_medical_menu_fnc_getTreatmentOptions
|
|
|
|
*
|
2015-08-06 21:51:17 +00:00
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
params ["_player", "_target", "_name"];
|
|
|
|
|
2015-10-13 07:01:59 +00:00
|
|
|
private ["_actions", "_collectedActions", "_bodyPart"];
|
|
|
|
|
2015-11-30 16:14:05 +00:00
|
|
|
if (!([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {[]};
|
2015-08-06 21:51:17 +00:00
|
|
|
|
|
|
|
_actions = if (EGVAR(medical,level) == 2) then {
|
|
|
|
GVAR(actionsAdvanced);
|
|
|
|
} else {
|
|
|
|
GVAR(actionsBasic);
|
|
|
|
};
|
|
|
|
|
|
|
|
_collectedActions = [];
|
|
|
|
|
|
|
|
_bodyPart = EGVAR(medical,SELECTIONS) select GVAR(selectedBodyPart);
|
|
|
|
{
|
2015-08-07 03:37:41 +00:00
|
|
|
_x params ["", "_currentCategory", "_currentCondition"];
|
|
|
|
if (_name == _currentCategory && {call _currentCondition}) then {
|
|
|
|
_collectedActions pushBack _x;
|
2015-08-06 21:51:17 +00:00
|
|
|
};
|
2015-08-07 03:37:41 +00:00
|
|
|
nil
|
|
|
|
} count _actions;
|
2015-08-06 21:51:17 +00:00
|
|
|
|
2015-08-07 03:37:41 +00:00
|
|
|
_collectedActions // return
|