ACE3/addons/medical_treatment/functions/fnc_isMedic.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

32 lines
804 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Glowbal, KoffeinFlummi
* Checks if the unit is a medic of the given level.
* Medic Levels: 0 - None, 1 - Medic, 2 - Doctor
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Medic Level <NUMBER> (default: 1)
*
* Return Value:
* Is Medic <BOOL>
*
* Example:
* [player] call ace_medical_treatment_fnc_isMedic
*
* Public: No
*/
params ["_unit", ["_medicN", 1]];
private _class = _unit getVariable [QEGVAR(medical,medicClass), parseNumber (_unit getUnitTrait "medic")];
if (_class >= _medicN) exitWith {true};
if (!GVAR(locationsBoostTraining)) exitWith {false};
if (IN_MED_VEHICLE(_unit) || {IN_MED_FACILITY(_unit)}) then {
_class = _class + 1; // Boost medical training by one: untrained becomes medic, medic becomes doctor
};
_class >= _medicN