Skip to content

Instantly share code, notes, and snippets.

@diwako
Created January 11, 2021 13:07
Show Gist options
  • Save diwako/99027e223c292fe35ee1f567859e9292 to your computer and use it in GitHub Desktop.
Save diwako/99027e223c292fe35ee1f567859e9292 to your computer and use it in GitHub Desktop.
ace medical rewrite, make epi do way more
["ace_medical_treatment_medicationLocal", {
params ["_unit", "", "_classname"];
if (_classname == "Epinephrine") then {
// this guy dead or bleeding
if (!alive _unit || {
(_unit getVariable ["ace_medical_woundBleeding", 0]) > 0
}) exitWith {};
private _heartRate = _unit getVariable ["ace_medical_heartRate", 80];
private _blood = _unit getVariable ["ace_medical_bloodVolume", 6.0];
private _bloodPressure = [_unit] call ace_medical_status_fnc_getBloodPressure;
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
if (_heartRate < 40) then {
_unit setVariable ["ace_medical_heartRate", 40, true];
[{
["ace_medical_CPRSucceeded", _this] call CBA_fnc_localEvent;
}, [_unit], 0.25] call CBA_fnc_waitAndExecute
};
if (_heartRate > 220) then {
_unit setVariable ["ace_medical_heartRate", 80, true];
};
if (_bloodPressureH < 50) then {
_bloodPressureH = 50;
};
if (_bloodPressureL < 40) then {
_bloodPressureL = 40;
};
if (_bloodPressureL >= 190) then {
_bloodPressureL = 180;
};
if (_blood <= 5.100) then {
_blood = 5.100 + 0.25;
_unit setVariable ["ace_medical_bloodVolume", _blood, true];
};
_bloodPressure = [_bloodPressureL, _bloodPressureH];
_unit setVariable ["ace_medical_bloodPressure", _bloodPressure, true];
};
}] call CBA_fnc_addEventHandler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment