mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
32 lines
804 B
Plaintext
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
|