Skip to content

Commit

Permalink
Merge pull request KAT-Advanced-Medical#36 from YetheSamartaka/hemopn…
Browse files Browse the repository at this point in the history
…eumothorax_yethe

performance issue fix
  • Loading branch information
Conrimaceogain authored Oct 13, 2020
2 parents e4229aa + a8dfd86 commit c375763
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 57 deletions.
51 changes: 28 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,47 @@
# KAT Medical

<p align="center">
<img src="https://raw.githubusercontent.com/Katalam/kat_aceAdvMedical/master/logo.jpg">
<img src="https://raw.githubusercontent.com/Tomcat-SG/KAM/master/logo.jpg">
</p>

<p align="center">
<a href="https://github.com/Katalam/kat_aceAdvMedical/releases/latest">
<a href="https://github.com/Tomcat-SG/KAM/releases/latest">
<img src="https://img.shields.io/badge/Version-1.0.0.0-blue.svg?style=flat-square" alt="KAM Version">
</a>
<a href="https://github.com/Katalam/kat_aceAdvMedical/issues">
<img src="https://img.shields.io/github/issues-raw/Katalam/kat_aceAdvMedical.svg?style=flat-square&label=Issues" alt="KAM Issues">
<a href="https://github.com/Tomcat-SG/KAM/issues">
<img src="https://img.shields.io/github/issues-raw/Tomcat-SG/KAM.svg?style=flat-square&label=Issues" alt="KAM Issues">
</a>
<a href="https://github.com/Katalam/kat_aceAdvMedical/releases">
<img src="https://img.shields.io/github/downloads/Katalam/kat_aceAdvMedical/total.svg?style=flat-square&label=Downloads" alt="KAM Downloads">
<a href="https://github.com/Tomcat-SG/KAM/releases/latest">
<img src="https://img.shields.io/github/downloads/Tomcat-SG/KAM/total.svg?style=flat-square&label=Downloads" alt="KAM Downloads">
</a>
</p>

<p align="center">
<sup><strong>Requires the latest version of <a href="https://github.com/CBATeam/CBA_A3/releases">CBA A3</a>.<br/>
Visit me on <a href="https://discord.gg/HbA93HK">Discord</a></strong></sup>
<sup><strong>Download latest stable release on <a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2020940806">steam</a>.<br/>
Visit us on <a href="https://discord.gg/HbA93HK">Discord</a></strong></sup>
</p>


**The ACE Advanced Medical System is nice, but we can do it better, even on a more realistic way and bring it on another level with these addons.**

Created by Katalam
Originaly created by Katalam, currently maintained by Tomcat, Kygan and YetheSamartaka.

## Big thanks to

- [Katalam](https://github.com/Katalam)
- [Kellerkompanie](http://kellerkompanie.com/)
- [Tomcat-SG](https://github.com/Tomcat-SG)
- [Kygan/Conrimaceogain](https://github.com/Conrimaceogain)
- [YetheSamartaka](https://github.com/YetheSamartaka)
- [regiregi22](https://github.com/regiregi22)

## Disclaimer from the Editor Tomcat (and Kygan/Conrimaceogain)
## Disclaimer from current Developers

- This isn’t a bug free or official Version of the KAT System
- This isn’t a bug free or official Version of the KAT System (Official one is here: https://steamcommunity.com/sharedfiles/filedetails/?id=2020940806 )
- This Git is for Development use
- Everybody can make Pull/Push request
- There will be a lot of bugs at the moment
- The rewrite will take its time
- As this addon depends on ACE, some of its updates may break KAT, so fix from our side can take some time
- New features are still in development

## Core features

Expand All @@ -49,31 +50,35 @@ Created by Katalam
- [x] Head overstretching
- [x] Intubation
- [x] Aspiration
- [x] Items such as Guedel tube, KingLT and Acuvacc
- Breathing
- [x] Oxygen saturation
- [x] Pulse-oximeter
- [x] Pneumothorax, tension pneumothorax and hemothorax
- Circulation
- [x] Blood Groups
- [x] Painkillers
- [x] Bigger AED with monitoring
- Disability
- [x] Cut of clothes
- [x] Allergic reactions
- [x] Automated external defibrillators
- [x] Settable sucess CPR chances per medical level expertise
- Burns
- [ ] Burn injuries
- [ ] Burn injuries treatment
- Exposure
- [ ] Heat-preserving
- [ ] Heat-preserving?
- Misc
- [ ] Big Backpack?
- [x] Workable IV stand

## Known Issues

- [Issues](https://github.com/Katalam/kat_aceAdvMedical/issues)
- [Issues](https://github.com/Tomcat-SG/KAM/issues)

## Required

- [CBA_A3 3.15 or later](http://www.armaholic.com/page.php?id=18767)
- [ACE3 3.13.2 or later](https://ace3mod.com/)
- [CBA_A3 v3.15.0 or later](https://steamcommunity.com/sharedfiles/filedetails/?id=450814997)
- [ACE3 3.13.4 or later](https://steamcommunity.com/sharedfiles/filedetails/?id=463939057)

## Youtube
## Youtube - Currently outdated

- [Airway](https://youtu.be/V0csFQ1PLIw)
- [Breathing](abc)
Expand All @@ -82,7 +87,7 @@ Created by Katalam
- [Exposure](abc)
- [Misc](abc)

## Class Names
## Class Names - WIP

- [click here](https://github.com/Katalam/kat_aceAdvMedical/wiki/Class-Names)

Expand Down
4 changes: 2 additions & 2 deletions addons/airway/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ACE_Medical_Treatment_Actions {
callbackSuccess = QUOTE([ARR_3(_player, _patient, 'Larynxtubus')] call FUNC(treatmentAdvanced_airway));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 1;
consumeItem = 1;
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
Expand All @@ -38,7 +38,7 @@ class ACE_Medical_Treatment_Actions {
treatmentTime = QGVAR(Accuvac_time);
items[] = {"kat_accuvac"};
icon = QPATHTOF(ui\accuvac.paa);
itemConsumed = 0;
consumeItem = 0;
medicRequired = QGVAR(medLvl_Accuvac);
callbackSuccess = QUOTE([ARR_2(_player, _patient)] call FUNC(treatmentAdvanced_accuvac));
callbackProgress = QUOTE(_this call FUNC(accuvacSound));
Expand Down
2 changes: 1 addition & 1 deletion addons/airway/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if !(GVAR(enable)) exitWith {};
if !(_state) exitWith {
_unit call FUNC(init);
};
if (_unit getVariable [GVAR(string_exit), false]) exitWith {};
if (!_alive && (_unit getVariable [GVAR(string_exit), false])) exitWith {};
if (EGVAR(breathing,enable)) then {
["handleBreathing", [_unit, CBA_missionTime], _unit] call CBA_fnc_targetEvent;
};
Expand Down
4 changes: 2 additions & 2 deletions addons/airway/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ In real life, this will happen sometimes, not quiet often.
"SLIDER",
LLSTRING(SETTING_obstruction),
CBA_SETTINGS_CAT,
[0, 100, 10, 0],
[0, 100, 15, 0],
true
] call CBA_Settings_fnc_init;

Expand All @@ -55,7 +55,7 @@ In real life, this will happen sometimes, not quiet often.
"SLIDER",
LLSTRING(SETTING_occluded),
CBA_SETTINGS_CAT,
[0, 100, 15, 0],
[0, 100, 10, 0],
true
] call CBA_Settings_fnc_init;

Expand Down
5 changes: 5 additions & 0 deletions addons/airway/functions/fnc_displayPatientInformation.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

params ["_target", "_selectionN"];

if (_target getVariable ["kat_DPatientInfo_PFH", false]) exitWith {};
_target setVariable ["kat_DPatientInfo_PFH", true];

private _display = uiNamespace getVariable ["ace_medical_gui_RscPatientInfo", displayNull];

if (isNull _display) then {
Expand All @@ -31,6 +34,7 @@ if (isNull _display) then {

if (isNull _display) exitWith {
[_pfhID] call CBA_fnc_removePerFrameHandler;
_target setVariable ["kat_DPatientInfo_PFH", nil];
};

private _target = _display getVariable ["ace_medical_gui_target", objNull];
Expand All @@ -41,6 +45,7 @@ if (isNull _display) then {
[_pfhID] call CBA_fnc_removePerFrameHandler;
"ace_medical_gui_RscPatientInfo" cutFadeOut 0.3;
[["ace_medical_DistanceToFar", _target call ace_common_fnc_getName], 2] call ace_common_fnc_displayTextStructured;
_target setVariable ["kat_DPatientInfo_PFH", nil];
};

// Update body image
Expand Down
5 changes: 5 additions & 0 deletions addons/airway/functions/fnc_handlePuking.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ params ["_unit"];

if !(GVAR(enable)) exitWith {};

if (_unit getVariable ["kat_pukeActive_PFH", false]) exitWith {};
_unit setVariable ["kat_pukeActive_PFH", true];


[{
params ["_args", "_idPFH"];
_args params ["_unit"];
private _alive = _unit getVariable ["ACE_isUnconscious", false];
if (!_alive || (_unit getVariable [QGVAR(airway_item), ""] isEqualTo "larynx")) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
_unit setVariable ["kat_pukeActive_PFH", nil];
};
if (random(100) <= GVAR(probability_occluded)) then {
if !(_unit getVariable ["KAT_medical_airwayOccluded", false]) then {
Expand Down
5 changes: 5 additions & 0 deletions addons/airway/functions/fnc_handleTimer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ params [["_unit", objNull, [objNull]], "_time"];

if !(GVAR(enable)) exitWith {};

if (_unit getVariable ["kat_DeathTimerC_PFH", false]) exitWith {};
_unit setVariable ["kat_DeathTimerC_PFH", true];

if (!local _unit) exitWith {
["deathTimerAirway", [_unit, CBA_missionTime], _unit] call CBA_fnc_targetEvent;
};
Expand All @@ -37,6 +40,7 @@ if (EGVAR(breathing,death_timer_enable)) exitWith {};
};
if ([_unit] call ace_common_fnc_isAwake || _unit getVariable [QGVAR(airway), false]) exitWith {
[_idPFH] call CBA_fnc_removePerFrameHandler;
_unit setVariable ["kat_DeathTimerC_PFH", nil];
_unit setVariable [QGVAR(startTime), 0, false];
};
if (_unit getVariable [QGVAR(overstretch), false]) exitWith {
Expand All @@ -45,6 +49,7 @@ if (EGVAR(breathing,death_timer_enable)) exitWith {};
if (CBA_missionTime - _startTime >= GVAR(deathTimer) &&
(_unit getVariable [QGVAR(obstruction), false] || _unit getVariable ["KAT_medical_airwayOccluded", false])) then {
[_idPFH] call CBA_fnc_removePerFrameHandler;
_unit setVariable ["kat_DeathTimerC_PFH", nil];
_unit setVariable [QGVAR(startTime), 0, false];
[_unit, "#setDead"] call ace_medical_status_fnc_setDead;
};
Expand Down
2 changes: 1 addition & 1 deletion addons/airway/functions/fnc_updateInjuryList.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ if (_target getVariable [QGVAR(overstretch), false] && _selectionN isEqualTo 0)
_woundEntries pushback [localize LSTRING(overstretched), [0.1, 1, 1, 1]];
};

if (_target getVariable ["KAT_medical_airwayCollapsed", false] && _selectionN isEqualTo 1) then {
if (_target getVariable ["KAT_medical_pneumothorax", false] && _selectionN isEqualTo 1) then {
_woundEntries pushback [localize ELSTRING(breathing,pneumothorax_mm), [1,1,1,1]];
};

Expand Down
20 changes: 10 additions & 10 deletions addons/breathing/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ACE_Medical_Treatment_Actions {
category = "examine";
treatmentLocations = 0;
allowedSelections[] = {"LeftArm", "RightArm"};
allowSelfTreatment = 0;
allowSelfTreatment = 1;
medicRequired = QGVAR(medLvl_Pulseoximeter);
treatmentTime = 2;
items[] = {"kat_Pulseoximeter"};
Expand All @@ -14,7 +14,7 @@ class ACE_Medical_Treatment_Actions {
callbackSuccess = QUOTE([ARR_2(_medic, _patient)] call FUNC(treatmentAdvanced_pulseoximeter));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 1;
consumeItem = 1;
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
Expand All @@ -30,7 +30,7 @@ class ACE_Medical_Treatment_Actions {
category = "examine";
treatmentLocations = 0;
allowedSelections[] = {"LeftArm", "RightArm"};
allowSelfTreatment = 0;
allowSelfTreatment = 1;
medicRequired = QGVAR(medLvl_Pulseoximeter);
treatmentTime = 2;
items[] = {};
Expand All @@ -39,7 +39,7 @@ class ACE_Medical_Treatment_Actions {
callbackSuccess = QUOTE([ARR_2(_medic, _patient)] call FUNC(treatmentAdvanced_removePulseoximeter));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 0;
consumeItem = 0;
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
Expand All @@ -59,12 +59,12 @@ class ACE_Medical_Treatment_Actions {
medicRequired = QGVAR(medLvl_Chestseal);
treatmentTime = 7;
items[] = {"kat_chestSeal"};
condition = "_patient getVariable ['KAT_medical_airwayCollapsed', false]";
condition = "_patient getVariable ['KAT_medical_pneumothorax', false]";
patientStateCondition = 0;
callbackSuccess = QUOTE([ARR_2(_medic, _patient)] call FUNC(treatmentAdvanced_chestSeal));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 1;
consumeItem = 1;
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
Expand All @@ -84,12 +84,12 @@ class ACE_Medical_Treatment_Actions {
medicRequired = QGVAR(medLvl_hemopneumothoraxTreatment);
treatmentTime = 7;
items[] = {"kat_aatKit"};
condition = "_patient getVariable ['KAT_medical_hemopneumothorax', false] && !(_patient getVariable ['KAT_medical_airwayCollapsed', false])";
condition = "_patient getVariable ['KAT_medical_hemopneumothorax', false] && !(_patient getVariable ['KAT_medical_pneumothorax', false])";
patientStateCondition = 0;
callbackSuccess = QUOTE([ARR_2(_medic, _patient)] call FUNC(treatmentAdvanced_hemopneumothorax));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 1;
consumeItem = 1;
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
Expand All @@ -109,12 +109,12 @@ class ACE_Medical_Treatment_Actions {
medicRequired = QGVAR(medLvl_hemopneumothoraxTreatment);
treatmentTime = 7;
items[] = {"kat_aatKit"};
condition = "_patient getVariable ['KAT_medical_tensionpneumothorax', false] && !(_patient getVariable ['KAT_medical_airwayCollapsed', false])";
condition = "_patient getVariable ['KAT_medical_tensionpneumothorax', false] && !(_patient getVariable ['KAT_medical_pneumothorax', false])";
patientStateCondition = 0;
callbackSuccess = QUOTE([ARR_2(_medic, _patient)] call FUNC(treatmentAdvanced_tensionpneumothorax));
callbackFailure = "";
callbackProgress = "";
itemConsumed = 1;
consumeItem = 1;
animationPatient = "";
animationPatientUnconscious = "AinjPpneMstpSnonWrflDnon_rolltoback";
animationPatientUnconsciousExcludeOn[] = {"ainjppnemstpsnonwrfldnon"};
Expand Down
6 changes: 3 additions & 3 deletions addons/breathing/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PREP_RECOMPILE_END;
"SLIDER",
LLSTRING(SETTING_Value_Before),
CBA_SETTINGS_CAT,
[0, 100, 4, 0],
[0, 100, 30, 0],
true
] call CBA_Settings_fnc_init;

Expand All @@ -44,7 +44,7 @@ PREP_RECOMPILE_END;
"SLIDER",
LLSTRING(SETTING_Value_After),
CBA_SETTINGS_CAT,
[0, 100, 10, 0],
[0, 100, 66, 0],
true
] call CBA_Settings_fnc_init;

Expand All @@ -65,7 +65,7 @@ PREP_RECOMPILE_END;
"LIST",
[LLSTRING(ALLOW_PULSEOXIMETER), LLSTRING(TRAININGLEVEL_PULSEOXIMETER)],
CBA_SETTINGS_CAT,
[[0, 1, 2], ["Anyone", "Medics", "Doctors"], 1],
[[0, 1, 2], ["Anyone", "Medics", "Doctors"], 0],
true
] call CBA_settings_fnc_init;

Expand Down
2 changes: 1 addition & 1 deletion addons/breathing/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _patient setVariable ["ace_medical_isLimping", false, true];
_patient setVariable ["ace_medical_fractures", [0,0,0,0,0,0], true];
_patient setVariable ["KAT_medical_airwayStatus", 100, true];
_patient setVariable ["KAT_medical_airwayOccluded", false, true];
_patient setVariable ["KAT_medical_airwayCollapsed", false, true];
_patient setVariable ["KAT_medical_pneumothorax", false, true];
_patient setVariable ["KAT_medical_hemopneumothorax", false, true];
_patient setVariable ["KAT_medical_tensionpneumothorax", false, true];

Expand Down
Loading

0 comments on commit c375763

Please sign in to comment.