diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 77273c60b7..e110970ae3 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -115,4 +115,34 @@ class CfgVehicles { sync[] = {}; }; }; + class GVAR(moduleSetMedic): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSetMedic_displayName); + function = QFUNC(moduleSetMedic); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); + class ModuleDescription { + description = ""; + sync[] = {}; + }; + }; + class GVAR(moduleSetMedicalVehicle): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSetMedicalVehicle_displayName); + function = QFUNC(moduleSetMedicalVehicle); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); + class ModuleDescription { + description = ""; + sync[] = {}; + }; + }; + class GVAR(moduleSetMedicalFacility): GVAR(moduleBase) { + curatorCanAttach = 1; + displayName = CSTRING(ModuleSetMedicalFacility_displayName); + function = QFUNC(moduleSetMedicalFacility); + icon = QUOTE(PATHTOF(UI\Icon_Module_Zeus_Medic_ca.paa)); + class ModuleDescription { + description = ""; + sync[] = {}; + }; + }; }; diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 1b2ac19263..3817db218f 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -8,6 +8,9 @@ PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); PREP(handleZeusUnitAssigned); PREP(moduleCaptive); +PREP(moduleSetMedic); +PREP(moduleSetMedicalVehicle); +PREP(moduleSetMedicalFacility); PREP(moduleSurrender); PREP(moduleUnconscious); PREP(moduleZeusSettings); diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 7505f2770e..810ce17396 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -19,7 +19,10 @@ class CfgPatches { }; class GVAR(medical): ADDON { units[] = { - QGVAR(moduleUnconscious) + QGVAR(moduleUnconscious), + QGVAR(moduleSetMedic), + QGVAR(moduleSetMedicalVehicle), + QGVAR(moduleSetMedicalFacility) }; }; }; diff --git a/addons/zeus/functions/fnc_moduleCaptive.sqf b/addons/zeus/functions/fnc_moduleCaptive.sqf index 94e421e8d9..8273c8ba6f 100644 --- a/addons/zeus/functions/fnc_moduleCaptive.sqf +++ b/addons/zeus/functions/fnc_moduleCaptive.sqf @@ -3,21 +3,20 @@ * Flips the capture state of the unit the module is placed on. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * - * ReturnValue: - * nil + * Return Value: + * None * - * Public: no + * Public: No */ #include "script_component.hpp" -private ["_mouseOver", "_unit", "_captive"]; - params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_captive"]; if !(_activated && local _logic) exitWith {}; diff --git a/addons/zeus/functions/fnc_moduleSetMedic.sqf b/addons/zeus/functions/fnc_moduleSetMedic.sqf new file mode 100644 index 0000000000..661e33f907 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSetMedic.sqf @@ -0,0 +1,52 @@ +/* + * Author: SilentSpike, Glowbal + * Assigns a medic role from the medical module to a unit + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_medicN"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + + if ((_mouseOver select 0) != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + _unit = effectivecommander (_mouseOver select 1); + + if !(_unit isKindOf "CAManBase") then { + [LSTRING(OnlyInfantry)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { + [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + } else { + _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); + if (_medicN < 1) then { + _unit setvariable [QEGVAR(medical,medicClass), 1, true]; + }; + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf new file mode 100644 index 0000000000..22826108e7 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSetMedicalFacility.sqf @@ -0,0 +1,51 @@ +/* + * Author: SilentSpike, Glowbal + * Assigns a medic role from the medical module to a unit + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + + if ((_mouseOver select 0) != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + _unit = (_mouseOver select 1); + + if (_unit isKindOf "Man" || {!(_unit isKindOf "Building")}) then { + [LSTRING(OnlyStructures)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { + [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + } else { + if (!(GETVAR(_unit,EGVAR(medical,isMedicalFacility),false))) then { + _unit setvariable [QEGVAR(medical,isMedicalFacility), true, true]; + }; + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf new file mode 100644 index 0000000000..9e5e788461 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleSetMedicalVehicle.sqf @@ -0,0 +1,52 @@ +/* + * Author: SilentSpike, Glowbal + * Assigns a medic role from the medical module to a unit + * + * Arguments: + * 0: The module logic + * 1: Synchronized units + * 2: Activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_medicN"]; + +if !(_activated && local _logic) exitWith {}; + +if !(["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + [LSTRING(RequiresAddon)] call EFUNC(common,displayTextStructured); +} else { + _mouseOver = GETMVAR(bis_fnc_curatorObjectPlaced_mouseOver,[""]); + + if ((_mouseOver select 0) != "OBJECT") then { + [LSTRING(NothingSelected)] call EFUNC(common,displayTextStructured); + } else { + _unit = (_mouseOver select 1); + + if (_unit isKindOf "Man" || {_unit isKindOf "Building"}) then { + [LSTRING(OnlyVehicles)] call EFUNC(common,displayTextStructured); + } else { + if !(alive _unit) then { + [LSTRING(OnlyAlive)] call EFUNC(common,displayTextStructured); + } else { + if (GETVAR(_unit,EGVAR(captives,isHandcuffed),false)) then { + [LSTRING(OnlyNonCaptive)] call EFUNC(common,displayTextStructured); + } else { + _medicN = GETVAR(_unit,EGVAR(medical,medicClass),0); + if (_medicN < 1) then { + _unit setvariable [QEGVAR(medical,medicClass), 1, true]; + }; + }; + }; + }; + }; +}; + +deleteVehicle _logic; diff --git a/addons/zeus/functions/fnc_moduleSurrender.sqf b/addons/zeus/functions/fnc_moduleSurrender.sqf index b5365f8fc9..95f35593a5 100644 --- a/addons/zeus/functions/fnc_moduleSurrender.sqf +++ b/addons/zeus/functions/fnc_moduleSurrender.sqf @@ -3,21 +3,20 @@ * Flips the surrender state of the unit the module is placed on. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * - * ReturnValue: - * nil + * Return Value: + * None * - * Public: no + * Public: No */ #include "script_component.hpp" -private ["_mouseOver", "_unit", "_surrendering"]; - params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_surrendering"]; if !(_activated && local _logic) exitWith {}; diff --git a/addons/zeus/functions/fnc_moduleUnconscious.sqf b/addons/zeus/functions/fnc_moduleUnconscious.sqf index eeff54a0f8..d9f9031cee 100644 --- a/addons/zeus/functions/fnc_moduleUnconscious.sqf +++ b/addons/zeus/functions/fnc_moduleUnconscious.sqf @@ -3,21 +3,20 @@ * Flips the unconscious state of the unit the module is placed on. * * Arguments: - * 0: The module logic - * 1: units - * 2: activated + * 0: The module logic + * 1: Synchronized units + * 2: Activated * - * ReturnValue: - * nil + * Return Value: + * None * - * Public: no + * Public: No */ #include "script_component.hpp" -private ["_mouseOver", "_unit", "_conscious"]; - params ["_logic", "_units", "_activated"]; +private ["_mouseOver", "_unit", "_conscious"]; if !(_activated && local _logic) exitWith {}; diff --git a/addons/zeus/stringtable.xml b/addons/zeus/stringtable.xml index 7c70978aa4..fd1c978188 100644 --- a/addons/zeus/stringtable.xml +++ b/addons/zeus/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -137,6 +137,15 @@ Bewusstlosigkeit umschalten Alternar inconsciência + + Assign Medic + + + Assign Medical Vehicle + + + Assign Medical Facility + Unit must be alive Utiliser uniquement sur une unité vivante @@ -161,6 +170,12 @@ Si può usare solo su fanteria a piedi Usar somente em infantaria desmontada + + Unit must be a structure + + + Unit must be a vehicle + Unit must not be captive Jednostka nie może być więźniem diff --git a/addons/zeus/ui/Icon_Module_Zeus_Medic_ca.paa b/addons/zeus/ui/Icon_Module_Zeus_Medic_ca.paa new file mode 100644 index 0000000000..60963046a7 Binary files /dev/null and b/addons/zeus/ui/Icon_Module_Zeus_Medic_ca.paa differ