Skip to content

Commit

Permalink
More stuff
Browse files Browse the repository at this point in the history
 should be done until brain sim stuff
  • Loading branch information
Cplhardcore committed Nov 13, 2024
1 parent 3459d41 commit 91d054b
Show file tree
Hide file tree
Showing 28 changed files with 526 additions and 67 deletions.
2 changes: 1 addition & 1 deletion addons/breathing/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ _patient setVariable [QGVAR(etco2Monitor), [], true];
_patient setVariable [QGVAR(breathRate), 15, true];
_patient setVariable [QGVAR(nasalCannula), false, true];
_patient setVariable [QGVAR(lungSurfaceArea), 400];

_patient setvariable [QGVAR(respiratoryRateMultiplier), 1];
if (ACEGVAR(advanced_fatigue,enabled)) then {
["kat_LSDF"] call ACEFUNC(advanced_fatigue,removeDutyFactor);
};
1 change: 1 addition & 0 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
#undef GET_BLOOD_VOLUME

#define GET_OPIOID_FACTOR(unit) (unit getVariable [QEGVAR(pharma,opioidFactor), 0])
#define GET_OPIOID_DEPRESSION(unit) (unit getVariable [QEGVAR(pharma,opioidDepression), 0])
#define GET_PAIN_PERCEIVED(unit) (0 max ((GET_PAIN(unit) - GET_PAIN_SUPPRESS(unit)) min 1))

#undef GET_DAMAGE_THRESHOLD
Expand Down
24 changes: 12 additions & 12 deletions addons/pharma/ACE_Medical_Treatment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ class ACE_ADDON(Medical_Treatment) {
incompatibleMedication[] = {};
viscosityChange = 0;
};
class Alteplase {
painReduce = 0;
hrIncreaseLow[] = {-4, -10};
hrIncreaseNormal[] = {-5, -15};
hrIncreaseHigh[] = {-5, -20};
timeInSystem = 180;
timeTillMaxEffect = 30;
maxDose = 1;
maxDoseDeviation = 0;
incompatibleMedication[] = {};
viscosityChange = 0;
};
class AdenosineIV {
painReduce = 0;
hrIncreaseLow[] = {-7, -10};
Expand Down Expand Up @@ -727,6 +715,18 @@ class ACE_ADDON(Medical_Treatment) {
timeTillMaxEffect = 15;
viscosityChange = 0;
};
class syringe_alteplase_5ml_3 {
painReduce = 0;
hrIncreaseLow[] = {-4, -10};
hrIncreaseNormal[] = {-5, -15};
hrIncreaseHigh[] = {-5, -20};
timeInSystem = 180;
timeTillMaxEffect = 30;
maxDose = 1;
maxDoseDeviation = 0;
incompatibleMedication[] = {};
viscosityChange = 0;
};
class syringe_fentanyl_10ml_1 {
painReduce = 0.6;
hrIncreaseLow[] = {-5, -10};
Expand Down
1 change: 1 addition & 0 deletions addons/pharma/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ _patient setVariable [QGVAR(externalPh), 0, true];
_patient setVariable [QGVAR(pH), 0, true];

_patient setVariable [QGVAR(opioidFactor), 0, true];
_patient setVariable [QGVAR(opioidDepressionFactor), 0, true];

_patient setVariable [QGVAR(kidneyFail), false, true];
_patient setVariable [QGVAR(kidneyArrest), false, true];
Expand Down
5 changes: 3 additions & 2 deletions addons/pharma/functions/fnc_medicationLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private _alphaFactor = GET_NUMBER(_medicationConfig >> "alphaFactor",
private _maxRelief = GET_NUMBER(_medicationConfig >> "maxRelief",getNumber (_defaultConfig >> "maxRelief"));
private _opioidRelief = GET_NUMBER(_medicationConfig >> "opioidRelief",getNumber (_defaultConfig >> "opioidRelief"));
private _opioidEffect = GET_NUMBER(_medicationConfig >> "opioidEffect",getNumber (_defaultConfig >> "opioidEffect"));
private _opioidDepression = GET_NUMBER(_medicationConfig >> "opioidRelief",getNumber (_defaultConfig >> "opioidRelief"));

private _heartRate = GET_HEART_RATE(_patient);
private _hrIncrease = [_hrIncreaseLow, _hrIncreaseNormal, _hrIncreaseHigh] select (floor ((0 max _heartRate min 110) / 55));
Expand All @@ -113,14 +114,14 @@ if ([QGVAR(AMS_Enabled)] call CBA_settings_fnc_get) then {
};
// Adjust the medication effects and add the medication to the list
TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange);
[_patient, _medicationName, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect] call EFUNC(vitals,addMedicationAdjustment);
[_patient, _medicationName, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression] call EFUNC(vitals,addMedicationAdjustment);

// Check for medication compatiblity
[_patient, _medicationName, _maxDose, _maxDoseDeviation, _incompatibleMedication] call ACEFUNC(medical_treatment,onMedicationUsage);
} else {
// Adjust the medication effects and add the medication to the list
TRACE_3("adjustments",_heartRateChange,_painReduce,_viscosityChange);
[_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect] call EFUNC(vitals,addMedicationAdjustment);
[_patient, _className, _timeTillMaxEffect, _timeInSystem, _heartRateChange, _painReduce, _viscosityChange, _alphaFactor, _opioidRelief, _opioidEffect, _opioidDepression] call EFUNC(vitals,addMedicationAdjustment);

// Check for medication compatiblity
[_patient, _className, _maxDose, _maxDoseDeviation, _incompatibleMedication] call ACEFUNC(medical_treatment,onMedicationUsage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,52 @@
*
* Public: No
*/
params ["_patient"];
params ["_patient"];
[{
params ["_patient"];
private _adenosineOverdoseTarget = 0;
[{
params ["_patient", "_idPFH"];
if (!(alive _patient)) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
_adenosineOverdoseTarget = _adenosineOverdoseTarget + 1;
if (_adenosineOverdoseTarget > 12) exitWith {
if (random(100) < 15) then {
[{
params ["_args", "_idPFH"];
_args params ["_patient"];
private _ht = _patient getVariable [QEGVAR(circulation,ht), []];
if ((_ht findIf {_x isEqualTo "adenosineOD"}) == -1) then {
_ht pushBack "adenosineOD";

if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then {
[QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent;
};

_patient setVariable [QEGVAR(circulation,ht), _ht, true];
};
}, [_patient], 15] call CBA_fnc_waitAndExecute;
};
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private _surfaceArea = (_patient getVariable [QEGVAR(breathing,lungSurfaceArea), 400]) - 10;
_patient setVariable [QEGVAR(breathing,lungSurfaceArea), _surfaceArea];
}, 15, [_patient]] call CBA_fnc_addPerFrameHandler;
}, _patient, 15] call CBA_fnc_waitAndExecute;
[{
params ["_patient"];
private _AdenosineTarget = 0;
[{
params ["_patient", "_idPFH"];
if (!(alive _patient)) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
_AdenosineTarget = _AdenosineTarget + 1;
if (_AdenosineTarget > 18) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private _surfaceArea = (_patient getVariable [QEGVAR(breathing,lungSurfaceArea), 400]) + 10;
_patient setVariable [QEGVAR(breathing,lungSurfaceArea), _surfaceArea];
}, 10, [_patient]] call CBA_fnc_addPerFrameHandler;
}, _patient, 300] call CBA_fnc_waitAndExecute;
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
params ["_patient"];
private _hrAdjust = -50 + floor random ((-30 - -50) + 1);
[_patient, "BRADYCARDIA", 120, 1200, _hrAdjust, "", "", "", "", ""] call EFUNC(vitals,addMedicationAdjustment);
[_patient, AmiodaroneOverdose, 30, 600, "", "", "", 0.2, "", ""] call EFUNC(vitals,addMedicationAdjustment);
[_patient, "AmiodaroneOverdose", 30, 600, "", "", "", 0.2, "", ""] call EFUNC(vitals,addMedicationAdjustment);
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,56 @@
*
* Public: No
*/
params ["_patient"];
params ["_patient"];
[{
params ["_patient"];
private _adenosineOverdoseTarget = 0;
[{
params ["_patient", "_idPFH"];
if (!(alive _patient)) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
_adenosineOverdoseTarget = _adenosineOverdoseTarget + 1;
if (_adenosineOverdoseTarget > 12) exitWith {
if (random(100) < 15) then {
[{
params ["_args", "_idPFH"];
_args params ["_patient"];
private _ht = _patient getVariable [QEGVAR(circulation,ht), []];
if ((_ht findIf {_x isEqualTo "adenosineOD"}) == -1) then {
_ht pushBack "adenosineOD";

if (_patient getVariable [QEGVAR(circulation,cardiacArrestType), 0] == 0) then {
[QACEGVAR(medical,FatalVitals), _patient] call CBA_fnc_localEvent;
};

_patient setVariable [QEGVAR(circulation,ht), _ht, true];
};
}, [_patient], 15] call CBA_fnc_waitAndExecute;
};
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] + 0.05;
_patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression];
private _rr = _patient getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1] - 0.07;

Check notice on line 48 in addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf

View workflow job for this annotation

GitHub Actions / build

`getvariable` does not match the wiki's case

non-standard command case
_patient setvariable [QEGVAR(breathing,respiratoryRateMultiplier), _rr];

Check notice on line 49 in addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf

View workflow job for this annotation

GitHub Actions / build

`setvariable` does not match the wiki's case

non-standard command case
}, 15, [_patient]] call CBA_fnc_addPerFrameHandler;
}, _patient, 15] call CBA_fnc_waitAndExecute;
[{
params ["_patient"];
private _AdenosineTarget = 0;
[{
params ["_patient", "_idPFH"];
if (!(alive _patient)) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
_AdenosineTarget = _AdenosineTarget + 1;
if (_AdenosineTarget > 18) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
};
private _depression = _unit getVariable [QEGVAR(pharma,opioidDepressionFactor)] - 0.05;
_patient setVariable [QEGVAR(pharma,opioidDepressionFactor), _depression];
private _rr = _patient getvariable [QEGVAR(breathing,respiratoryRateMultiplier), 1] + 0.07;

Check notice on line 66 in addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf

View workflow job for this annotation

GitHub Actions / build

`getvariable` does not match the wiki's case

non-standard command case
_patient setvariable [QEGVAR(breathing,respiratoryRateMultiplier), _rr];

Check notice on line 67 in addons/pharma/functions/fnc_treatmentAdvanced_AtropineOverdoseLocal.sqf

View workflow job for this annotation

GitHub Actions / build

`setvariable` does not match the wiki's case

non-standard command case
}, 10, [_patient]] call CBA_fnc_addPerFrameHandler;
}, _patient, 300] call CBA_fnc_waitAndExecute;
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ if GVAR(kidneyAction) then
[_idPFH] call CBA_fnc_removePerFrameHandler;};
private _ph = _patient getVariable [QGVAR(externalPh), _ph, true] + 100;
_patient setVariable [QGVAR(externalPh), _ph, true];
private _coagulationFactor = (_patient getVariable [QGVAR(coagulationFactor), 30]);
private _factorstoremove = 1;
_patient setVariable [QGVAR(coagulationFactor), (_coagulationFactor - _factorstoremove), true];
}, 10, [_patient]] call CBA_fnc_addPerFrameHandler;
}, _patient, 15] call CBA_fnc_waitAndExecute;
}
};
[{
params ["_patient"];
private _bpTarget = 0;
Expand All @@ -49,5 +46,8 @@ if GVAR(kidneyAction) then
if (_bpTarget > 12) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;};
[_patient, -2, -2, "CWMPOverdose"] call kat_circulation_fnc_updateBloodPressureChange;
private _coagulationFactor = (_patient getVariable [QGVAR(coagulationFactor), 30]);
private _factorstoremove = 1;
_patient setVariable [QGVAR(coagulationFactor), (_coagulationFactor - _factorstoremove), true];
}, 15, [_patient]] call CBA_fnc_addPerFrameHandler;
}, _patient, 15] call CBA_fnc_waitAndExecute;
Loading

0 comments on commit 91d054b

Please sign in to comment.