diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf index 77acd4ffc6..5692b9a663 100644 --- a/addons/medical/XEH_preInit.sqf +++ b/addons/medical/XEH_preInit.sqf @@ -25,6 +25,10 @@ PREP(getUnconsciousCondition); PREP(addUnconsciousCondition); PREP(setDead); PREP(playInjuredSound); +PREP(treatment); +PREP(treatmentCallback); +PREP(treatmentCallback_basic); +PREP(treatmentCallback_advanced); GVAR(injuredUnitCollection) = []; diff --git a/addons/medical/functions/fnc_treatment.sqf b/addons/medical/functions/fnc_treatment.sqf new file mode 100644 index 0000000000..772e73d455 --- /dev/null +++ b/addons/medical/functions/fnc_treatment.sqf @@ -0,0 +1,34 @@ +/* + * Author: KoffeinFlummi + * Starts the treatment process + * + * Arguments: + * 0: The medic + * 1: The patient + * 2: The treatment type/item + * 3+: Additional paramters + * + * Return Value: + * nil + * + * Public: Yes + */ + +#include "script_component.hpp" + +_medic = _this select 0; +_patient = _this select 1; +_type = _this select 2; + +_params = + _this; +_params deleteAt 0; +_params deleteAt 0; +_params deleteAt 0; + +// @todo: animation + +// @todo: remove item + +// @todo: progress bar + +_this call FUNC(treatmentCallback); diff --git a/addons/medical/functions/fnc_treatmentCallback.sqf b/addons/medical/functions/fnc_treatmentCallback.sqf new file mode 100644 index 0000000000..f7f7b40f3e --- /dev/null +++ b/addons/medical/functions/fnc_treatmentCallback.sqf @@ -0,0 +1,32 @@ +/* + * Author: KoffeinFlummi + * Callback for a successfull treatment. + * + * Arguments: + * 0: The medic + * 1: The patient + * 2: Treatment type/item + * 3+: Additional parameters + * + * Return Value: + * nil + * + * Public: Yes + */ + +#include "script_component.hpp" + +_medic = _this select 0; +_patient = _this select 1; +_type = _this select 2; + +_params = + _this; +_params deleteAt 0; +_params deleteAt 0; +_params deleteAt 0; + +if (GVAR(level) == 0) then { + _this call FUNC(treatmentCallback_basic); +} else { + _this call FUNC(treatmentCallback_advanced); +}; diff --git a/addons/medical/functions/fnc_treatmentCallback_advanced.sqf b/addons/medical/functions/fnc_treatmentCallback_advanced.sqf new file mode 100644 index 0000000000..700048203b --- /dev/null +++ b/addons/medical/functions/fnc_treatmentCallback_advanced.sqf @@ -0,0 +1,27 @@ +/* + * Author: KoffeinFlummi + * Callback for an advanced successfull treatment. + * + * Arguments: + * 0: The medic + * 1: The patient + * 2: Treatment type/item + * 3+: Additional parameters + * + * Return Value: + * nil + * + * Public: Yes + */ + +#include "script_component.hpp" + +_medic = _this select 0; +_patient = _this select 1; +_type = _this select 2; + +_params = + _this; +_params deleteAt 0; +_params deleteAt 0; +_params deleteAt 0; + diff --git a/addons/medical/functions/fnc_treatmentCallback_basic.sqf b/addons/medical/functions/fnc_treatmentCallback_basic.sqf new file mode 100644 index 0000000000..410f1d3df8 --- /dev/null +++ b/addons/medical/functions/fnc_treatmentCallback_basic.sqf @@ -0,0 +1,27 @@ +/* + * Author: KoffeinFlummi + * Callback for a basic successfull treatment. + * + * Arguments: + * 0: The medic + * 1: The patient + * 2: Treatment type/item + * 3+: Additional parameters + * + * Return Value: + * nil + * + * Public: Yes + */ + +#include "script_component.hpp" + +_medic = _this select 0; +_patient = _this select 1; +_type = _this select 2; + +_params = + _this; +_params deleteAt 0; +_params deleteAt 0; +_params deleteAt 0; +