Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circulation/GUI/Pharmacy/Surgery - Various fixes #433

Merged
merged 20 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ YetheSamartaka (https://github.com/YetheSamartaka)
Battlekeeper (https://github.com/Battlekeeper)
MJSTIC (https://github.com/mazinskihenry)
Digii / Julian (https://github.com/AtrixZockt)

MiszczuZPolski (https://github.com/MiszczuZPolski)
Blue (https://github.com/BlueTheKing)

# ORIGINAL AUTHOR
Katalam (https://github.com/Katalam)
Expand Down
56 changes: 33 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,29 @@
</p>

<p align="center">
<a href="https://github.com/Tomcat-SG/KAM/releases/latest">
<img src="https://img.shields.io/badge/Version-2.0-blue.svg?style=flat-square" alt="KAM Version">
<a href="https://github.com/KAT-Advanced-Medical/KAM/releases/latest">
<img src="https://img.shields.io/github/v/release/KAT-Advanced-Medical/KAM?style=flat-square" alt="KAM Version">
</a>
<a href="https://github.com/KAT-Advanced-Medical/KAM/issues">
<img src="https://img.shields.io/github/issues/KAT-Advanced-Medical/KAM?style=flat-square" alt="KAM Issues">
</a>
<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 href="https://github.com/KAT-Advanced-Medical/KAM/pulls">
<img src="https://img.shields.io/github/issues-pr/KAT-Advanced-Medical/KAM?style=flat-square&color=8921c2" alt="KAM Pull Requests">
</a>
<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">
<img src="https://img.shields.io/github/downloads/KAT-Advanced-Medical/KAM/total?style=flat-square" alt="KAM Downloads">
</a>
</p>

<p align="center">
<sup><strong>Download latest stable release on <a href="https://steamcommunity.com/sharedfiles/filedetails/?id=2020940806">steam</a>.<br/>
<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.**

Originaly created by Katalam, currently maintained by Tomcat, Kygan, YetheSamartaka, Battlekeeper, MJSTIC, MiszczuZPolski and Digii / Julian.
Originaly created by Katalam, currently maintained by Tomcat, Kygan, YetheSamartaka, Battlekeeper, MJSTIC, MiszczuZPolski, Digii / Julian, and Blue.

## Big thanks to

Expand All @@ -38,54 +41,61 @@ Originaly created by Katalam, currently maintained by Tomcat, Kygan, YetheSamart
- [MiszczuZPolski](https://github.com/MiszczuZPolski)
- [Digii / Julian](https://github.com/AtrixZockt)
- [regiregi22](https://github.com/regiregi22)
- [Blue](https://github.com/BlueTheKing)

## Disclaimer from current Developers

- This Git is for Development use, full playable version is also on Steam availible (https://steamcommunity.com/sharedfiles/filedetails/?id=2020940806)
- This repository is for development use, full playable version is also available on Steam (https://steamcommunity.com/sharedfiles/filedetails/?id=2020940806)
- Everybody can make Pull/Push request
- As this addon depends on ACE, some of its updates may break KAT, so fix from our side can take some time
- This addon depends on ACE, some of its updates may break KAM, so fixes may take some time
- New features are still in development

## Core features

- Airway
- [x] Airway management for unconscious patients
- [x] Head overstretching
- [x] Head hyper-extension
- [x] Intubation
- [x] Aspiration
- [x] Items such as Guedel tube, KingLT and Acuvacc
- [x] Items such as Guedel Tube, King LT and Accuvacc
- [x] Recovery position
- Breathing
- [x] Oxygen saturation
- [x] Pulse-oximeter
- [x] Cyanosis diagnose
- [x] Pulse Oximeter
- [x] Cyanosis
- [x] Pneumothorax, tension pneumothorax and hemothorax
- Circulation
- [x] Advanced cardiac arrest rhythms
- [x] Blood Groups including Rh Factors
- [x] Painkillers
- [x] Internal bleeding
- [x] Automated external defibrillators
- [x] Settable sucess CPR chances per medical level expertise
- [x] Settable success CPR chances per medical level expertise
- Disability
- [x] Surgery
- [x] Complex fractures
- Exposure
- [ ] Heat-preserving?
- Burns
- [ ] Burn injuries
- [ ] Burn injuries treatment
- Exposure
- [ ] Heat-preserving?
- Misc
- [ ] Big Backpack?
- [x] Workable IV stand
- Zeus modules
- [x] Manage unit airways
- [x] Change blood group / volume
- [x] Change shockable state
- [x] Change cardiac rhythm type
- [x] Open unit medical menu

## Known Issues

- [Issues](https://github.com/Tomcat-SG/KAM/issues)
- [Issues](https://github.com/KAT-Advanced-Medical/KAM/issues)

## Required

- [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)
- [CBA_A3 v3.16.0 or later](https://steamcommunity.com/sharedfiles/filedetails/?id=450814997)
- [ACE3 3.16.1 or later](https://steamcommunity.com/sharedfiles/filedetails/?id=463939057)

## Youtube - Currently outdated

Expand All @@ -98,19 +108,19 @@ Originaly created by Katalam, currently maintained by Tomcat, Kygan, YetheSamart

## Class Names - WIP

- [click here](https://github.com/Tomcat-SG/KAM/wiki/Classnames)
- [click here](https://github.com/KAT-Advanced-Medical/KAM/wiki/Classnames)

## Contributing

You can help out with the ongoing development by looking for potential bugs in my code base, or by contributing new features. I am always welcome to new pull requests containing bug fixes, refactors and new features.

### Building

[Setup dev-enviroment](https://github.com/Tomcat-SG/KAM/wiki/Build-KAM-with-SQFC)
[Setup dev-enviroment](https://github.com/KAT-Advanced-Medical/KAM/wiki/Build-KAM-with-SQFC)

### Submitting issues and requesting features

Please, use our [Issue Tracker](https://github.com/Tomcat-SG/KAM/issues) to report a bug, propose a feature, or suggest changes to the existing ones.
Please, use our [Issue Tracker](https://github.com/KAT-Advanced-Medical/KAM/issues) to report a bug, propose a feature, or suggest changes to the existing ones.

## License

Expand Down
24 changes: 11 additions & 13 deletions addons/breathing/functions/fnc_handleBreathing.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -193,22 +193,20 @@ if (!local _unit) then {
};

if ((_unit getVariable [QGVAR(pneumothorax), 0] > 0) || _unit getVariable [QGVAR(hemopneumothorax), false] || _unit getVariable [QGVAR(tensionpneumothorax), false]) then {
if (!(_unit getVariable [QACEGVAR(medical,inCardiacArrest), false])) then {
if (!(_unit getVariable [QGVAR(PneumoBreathCooldownOn), false])) then {
_unit setVariable [QGVAR(PneumoBreathCooldownOn), true, true];
if (!(_unit getVariable [QACEGVAR(medical,inCardiacArrest), false]) && !(_unit getVariable [QGVAR(PneumoBreathCooldownOn), false])) then {
_unit setVariable [QGVAR(PneumoBreathCooldownOn), true, true];

private _soundTargets = allPlayers inAreaArray [ASLToAGL getPosASL _unit, 15, 15, 0, false, 15];
private _soundTargets = allPlayers inAreaArray [ASLToAGL getPosASL _unit, 15, 15, 0, false, 15];

if !(_soundTargets isEqualTo []) then {
[QGVAR(playCough), [_unit], _soundTargets] call CBA_fnc_targetEvent;
};

[{
params["_unit"];
_unit setVariable [QGVAR(PneumoBreathCooldownOn), false, true];
},
[_unit], 30] call CBA_fnc_waitAndExecute;
if !(_soundTargets isEqualTo []) then {
[QGVAR(playCough), [_unit], _soundTargets] call CBA_fnc_targetEvent;
};

[{
params["_unit"];
_unit setVariable [QGVAR(PneumoBreathCooldownOn), false, true];
},
[_unit], 30] call CBA_fnc_waitAndExecute;
};
};
};
Expand Down
1 change: 1 addition & 0 deletions addons/circulation/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ PREP(Defibrillator_Pads_CheckCondition);
PREP(Defibrillator_RemovePads);
PREP(drawBlood);
PREP(generateBloodType);
PREP(getBloodPressure);
PREP(getCardiacArrestHeartRate);
PREP(handleCardiacArrest);
PREP(handleTreatment);
Expand Down
2 changes: 1 addition & 1 deletion addons/circulation/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ PREP_RECOMPILE_END;
"SLIDER",
LLSTRING(SETTING_AdvRhythm_asystoleBloodlossThreshold),
[CBA_SETTINGS_CAT, LSTRING(SubCategory_AdvRhythms)],
[3.0,6.0,3.6,1],
[0,6.0,3.6,1],
true
] call CBA_Settings_fnc_init;

Expand Down
6 changes: 3 additions & 3 deletions addons/circulation/functions/fnc_handleCardiacArrest.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ if (_initial) then {
if (GVAR(AdvRhythm_canDeteriorate)) then {
private _timeToDeteriorate = 0;

if (GVAR(AdvRhythm_deteriorateTimeWeight) < GVAR(AdvRhythm_deteriorateTimeWeight)) then {
_timeToDeteriorate = random [20, GVAR(AdvRhythm_deteriorateTimeWeight), GVAR(AdvRhythm_deteriorateTimeWeight)];
if (GVAR(AdvRhythm_deteriorateTimeWeight) < GVAR(AdvRhythm_deteriorateTimeMax)) then {
_timeToDeteriorate = random [20, GVAR(AdvRhythm_deteriorateTimeWeight), GVAR(AdvRhythm_deteriorateTimeMax)];
} else {
_timeToDeteriorate = random [20, GVAR(AdvRhythm_deteriorateTimeWeight) / 2, GVAR(AdvRhythm_deteriorateTimeWeight)];
_timeToDeteriorate = random [20, GVAR(AdvRhythm_deteriorateTimeMax) / 2, GVAR(AdvRhythm_deteriorateTimeMax)];
};

switch (_cardiacArrestType) do {
Expand Down
4 changes: 2 additions & 2 deletions addons/circulation/ui/AEDX_Monitor_Dialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,13 +563,13 @@ class GVAR(AEDX_Monitor_Dialog) {
y = QUOTE(pxToScreen_Y(1487));
w = QUOTE(pxToScreen_W(122));
h = QUOTE(pxToScreen_H(89));
onButtonClick = QUOTE(if (!(GVAR(AEDX_MonitorTarget) isEqualTo objNull) && !(GVAR(AEDX_MonitorTarget) getVariable [ARR_2(QQGVAR(DefibrillatorInUse), false)])) then {[ARR_3(player, GVAR(AEDX_MonitorTarget),'AEDX')] call FUNC(AED_Analyze); [] call FUNC(AEDX_ViewMonitor_AnalyzeFeedback)});
onButtonClick = QUOTE(if (!(GVAR(AEDX_MonitorTarget) isEqualTo objNull) && GVAR(AEDX_MonitorTarget) getVariable [ARR_2(QQGVAR(DefibrillatorPads_Connected), false)] && !(GVAR(AEDX_MonitorTarget) getVariable [ARR_2(QQGVAR(DefibrillatorInUse), false)])) then {[ARR_3(player, GVAR(AEDX_MonitorTarget),'AEDX')] call FUNC(AED_Analyze); [] call FUNC(AEDX_ViewMonitor_AnalyzeFeedback)});
tooltip = CSTRING(AnalyzeRhythm);
};
class ChargeButton: AnalyzeButton {
idc = -1;
x = QUOTE(pxToScreen_X(1316));
onButtonClick = QUOTE(if (!(GVAR(AEDX_MonitorTarget) isEqualTo objNull) && !(GVAR(AEDX_MonitorTarget) getVariable [ARR_2(QQGVAR(DefibrillatorInUse), false)])) then {[ARR_2(player, GVAR(AEDX_MonitorTarget))] call FUNC(Defibrillator_ManualCharge); [true] call FUNC(AEDX_ViewMonitor_AnalyzeFeedback); [] call FUNC(AEDX_ViewMonitor_Charging)});
onButtonClick = QUOTE(if (!(GVAR(AEDX_MonitorTarget) isEqualTo objNull) && GVAR(AEDX_MonitorTarget) getVariable [ARR_2(QQGVAR(DefibrillatorPads_Connected), false)] && !(GVAR(AEDX_MonitorTarget) getVariable [ARR_2(QQGVAR(DefibrillatorInUse), false)])) then {[ARR_2(player, GVAR(AEDX_MonitorTarget))] call FUNC(Defibrillator_ManualCharge); [true] call FUNC(AEDX_ViewMonitor_AnalyzeFeedback); [] call FUNC(AEDX_ViewMonitor_Charging)});
tooltip = CSTRING(Defibrillator_Action_Charge);
};
class CancelChargeButton: ShockButton {
Expand Down
3 changes: 3 additions & 0 deletions addons/gui/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class CfgFunctions {
class updateLogList {
file = QPATHTOF(functions\fnc_updateLogList.sqf);
};
class countTreatmentItems {
file = QPATHTOF(functions\fnc_countTreatmentItems.sqf);
};
};
};
};
1 change: 1 addition & 0 deletions addons/gui/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PREP(countTreatmentItems);
PREP(displayPatientInformation);
PREP(onMenuClose);
PREP(onMenuOpen);
Expand Down
2 changes: 1 addition & 1 deletion addons/gui/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private _damageColors = [
[0.00, 0.00, 1.00, 1]
];

private _categoryColors = [ACELSTRING(medical,Category), format ["| %1 |", ACELLSTRING(common,subcategory_colors)]];
private _categoryColors = [ACELSTRING(medical,Interface_Category), format ["| %1 |", ACELLSTRING(common,subcategory_colors)]];
{
[
format ["%1_%2", QACEGVAR(medical_gui,bloodLossColor), _forEachIndex],
Expand Down
63 changes: 63 additions & 0 deletions addons/gui/functions/fnc_countTreatmentItems.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#include "..\script_component.hpp"
/*
* Author: AmsteadRayle
* Modified: Blue
* Counts how many of the given items are present between the medic and patient.
* If medic or patient are in a vehicle then vehicle's inventory will also be checked.
*
* Arguments:
* 0: Items <ARRAY>
*
* Return Value:
* Counts (can be nil) <ARRAY>
*
* Example:
* [items] call ace_medical_gui_fnc_countTreatmentItems
*
* Public: No
*/

params ["_items"];

private _medicCount = 0;
private _patientCount = nil;
private _vehicleCount = nil;

// Medic
{
_medicCount = _medicCount + ([ACE_player, _x] call ACEFUNC(common,getCountOfItem));
} forEach _items;

// Patient
if (ACE_player != ACEGVAR(medical_gui,target)) then {
_patientCount = 0;
{
_patientCount = _patientCount + ([ACEGVAR(medical_gui,target), _x] call ACEFUNC(common,getCountOfItem));
} forEach _items;
};

// Vehicle
private _medicVehicle = objectParent ACE_player;
private _patientVehicle = objectParent ACEGVAR(medical_gui,target);
private _vehicle = if !(isNull _medicVehicle) then {_medicVehicle} else {_patientVehicle};

if !(isNull _vehicle) then {
_vehicleCount = 0;
if (((_items select 0) call BIS_fnc_itemType) select 0 isEqualTo "Magazine") then {
(getMagazineCargo _vehicle) params ["_itemTypes", "_itemCounts"];
{
private _item = _x;
private _index = _itemTypes find _item;
_vehicleCount = _vehicleCount + (_itemCounts param [_index, 0]);
} forEach _items;
} else {
(getItemCargo _vehicle) params ["_itemTypes", "_itemCounts"];
{
private _item = _x;
private _index = _itemTypes find _item;
_vehicleCount = _vehicleCount + (_itemCounts param [_index, 0]);
} forEach _items;
};
};

[_medicCount, _patientCount, _vehicleCount]
2 changes: 1 addition & 1 deletion addons/gui/functions/fnc_updateBodyImage.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private _bodyPartBloodLoss = [0, 0, 0, 0, 0, 0];
_damageThreshold = _damageThreshold * 1.5
};
};
_damage = (_damage / _damageThreshold) min 1;
_damage = (_damage / (0.01 max _damageThreshold)) min 1;
[_damage] call ACEFUNC(medical_gui,damageToRGBA);
};

Expand Down
3 changes: 0 additions & 3 deletions addons/gui/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ class ACE_Medical_Menu {
tooltip = "Surgery";
x = QUOTE(POS_X(13.5));
};
class Toggle: Triage {
tooltip = ACECSTRING(medical_gui,ToggleSelf);
};
class TriageCard: RscListBox {
h = QUOTE(POS_H(12.2));
};
Expand Down
4 changes: 4 additions & 0 deletions addons/main/script_macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

// BEGIN ACE3 reference macros

#define ACE_PREFIX ace

Check warning on line 83 in addons/main/script_macros.hpp

View workflow job for this annotation

GitHub Actions / build

redefining macro `ACE_PREFIX`

redefining macro

#define ACE_ADDON(component) DOUBLES(ACE_PREFIX,component)

Expand Down Expand Up @@ -125,7 +125,7 @@
#define VAR_PAIN_SUPP QACEGVAR(medical,painSuppress)
#define VAR_PERIPH_RES QACEGVAR(medical,peripheralResistance)
#define VAR_UNCON "ACE_isUnconscious"
#define VAR_OPEN_WOUNDS QACEGVAR(medical,openWounds)

Check warning on line 128 in addons/main/script_macros.hpp

View workflow job for this annotation

GitHub Actions / build

redefining macro `VAR_OPEN_WOUNDS`

redefining macro
#define VAR_BANDAGED_WOUNDS QACEGVAR(medical,bandagedWounds)
#define VAR_STITCHED_WOUNDS QACEGVAR(medical,stitchedWounds)
// These variables track gradual adjustments (from medication, etc.)
Expand Down Expand Up @@ -163,6 +163,8 @@
#define GET_TOURNIQUETS(unit) (unit getVariable [VAR_TOURNIQUET, DEFAULT_TOURNIQUET_VALUES])
#define HAS_TOURNIQUET_APPLIED_ON(unit,index) ((GET_TOURNIQUETS(unit) select index) > 0)

#define PAIN_UNCONSCIOUS ACEGVAR(medical,painUnconsciousThreshold)

// END ACE3 reference macros

// item types
Expand Down Expand Up @@ -232,6 +234,8 @@

#include "script_debug.hpp"

#define ALL_BODY_PARTS_PRIORITY ["body", "head", "leftarm", "rightarm", "leftleg", "rightleg"]

// Airway
#define VAR_SPO2 QEGVAR(breathing,airwayStatus)
#define GET_SPO2(unit) (unit getVariable [VAR_SPO2, 100])
Expand Down
8 changes: 8 additions & 0 deletions addons/misc/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,12 @@ class CfgFunctions {
};
};
};
class overwrite_ace_common {
tag = "ace_common";
class ace_common {
class getCountOfItem {
file = QPATHTOF(functions\fnc_getCountOfItem.sqf);
};
};
};
};
1 change: 1 addition & 0 deletions addons/misc/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ PREP(conditionIV);
PREP(conditionIVstand);
PREP(conditionSecondChance);
PREP(fullHealLocal);
PREP(getCountOfItem);
PREP(getDogtagData);
PREP(getUniqueItems);
PREP(groupID);
Expand Down
Loading
Loading