diff --git a/addons/aceWakeup/config.cpp b/addons/aceWakeup/config.cpp new file mode 100644 index 000000000..7031fad95 --- /dev/null +++ b/addons/aceWakeup/config.cpp @@ -0,0 +1,24 @@ +#include "script_component.hpp" + +class CfgFunctions { + class overwrite_ace_medical_status { + tag = "ace_medical_status"; + class ace_medical_status { + class hasStableVitals { + file = "\potato_ace_wakeup\functions\fnc_hasStableVitals.sqf"; + }; + }; + }; +}; + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "potato_core", "ace_medical" };\ + author = "Potato"; + authorUrl = "https://github.com/BourbonWarfare/POTATO"; + VERSION_CONFIG; + }; +}; \ No newline at end of file diff --git a/addons/aceWakeup/functions/fnc_hasStableVitals.sqf b/addons/aceWakeup/functions/fnc_hasStableVitals.sqf new file mode 100644 index 000000000..e68538e52 --- /dev/null +++ b/addons/aceWakeup/functions/fnc_hasStableVitals.sqf @@ -0,0 +1,18 @@ +#include "\z\ace\addons\medical_engine\script_macros_medical.hpp" +#include "\z\ace\addons\medical_engine\script_macros_config.hpp" +#include "\z\ace\addons\main\script_mod.hpp" +#include "\z\ace\addons\main\script_macros.hpp" + +params ["_unit"]; + +if (GET_BLOOD_VOLUME(_unit) > BLOOD_VOLUME_CLASS_2_HEMORRHAGE) exitwith {true}; + +if ((GET_BLOOD_VOLUME(_unit) <= BLOOD_VOLUME_CLASS_2_HEMORRHAGE) && {random 3 < 1}) exitwith {true}; + +if ((GET_BLOOD_VOLUME(_unit) <= BLOOD_VOLUME_CLASS_4_HEMORRHAGE) && {random 6 < 1}) exitwith {true}; // Maybe up to 5? + +// The below code is intended to add a mechanic wherein if players are not stable but woke up, they have a %chance to go back uncon so as to simulate a fade-in fade-out mechanic + +// if ((GET_BLOOD_VOLUME(_unit) <= BLOOD_VOLUME_CLASS_2_HEMORRHAGE) && {random 2 < 1} && (IS_UNCONSCIOUS(_unit) == true)) exitwith {false}; + +// if ((GET_BLOOD_VOLUME(_unit) <= BLOOD_VOLUME_CLASS_4_HEMORRHAGE) && {random 2 < 1} && (IS_UNCONSCIOUS(_unit) == true)) exitwith {false}; \ No newline at end of file