Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
b312e6b
Start
mazinskihenry Jan 11, 2025
2360b79
Working?
mazinskihenry Jan 11, 2025
0bf1fef
Pulling hairs
mazinskihenry Jan 11, 2025
aa72614
Ticket/Lib Supply Conversion
mazinskihenry Jan 12, 2025
010fd88
Extension
mazinskihenry Jan 12, 2025
f89b676
Diag_log remove
mazinskihenry Jan 12, 2025
234172d
Mechanics
mazinskihenry Jan 12, 2025
8dd8144
Update stringtable.xml
mazinskihenry Jan 12, 2025
6f2b196
Headers
mazinskihenry Jan 12, 2025
f411965
Update fnc_handleUnitVitals.sqf
mazinskihenry Jan 12, 2025
a0d0d73
Errors
mazinskihenry Jan 12, 2025
218b85e
Merge branch 'Role_Two' of https://github.com/mazinskihenry/KAM into …
mazinskihenry Jan 12, 2025
4fb4d00
Update stringtable.xml
mazinskihenry Jan 12, 2025
c99d9f1
Update fnc_handleUnitVitals.sqf
mazinskihenry Jan 12, 2025
5d8768e
One Life Conversion
mazinskihenry Jan 12, 2025
c2bdda8
Redo Config
mazinskihenry Jan 13, 2025
846f3fc
Its broken again
mazinskihenry Jan 13, 2025
ce56b12
Update fnc_KATConditionExecutionDeath.sqf
mazinskihenry Jan 13, 2025
eeccf2e
Working again
mazinskihenry Jan 13, 2025
4375982
Add option to disable text
mazinskihenry Jan 13, 2025
5f143f8
Add distance for libConversion and one life options
mazinskihenry Jan 13, 2025
e59b2d2
Delete fnc_spectatorRespawn.sqf
mazinskihenry Jan 13, 2025
7c7ed1d
Update XEH_PREP.hpp
mazinskihenry Jan 13, 2025
30950d3
Update fnc_manualConversionCondition.sqf
mazinskihenry Jan 15, 2025
5ff9f09
Update addons/conversion/ACE_Medical_Treatment_Actions.hpp
mazinskihenry Jan 17, 2025
e0f2a16
Update addons/conversion/ACE_Medical_Treatment_Actions.hpp
mazinskihenry Jan 17, 2025
3fa54b9
Review
mazinskihenry Jan 17, 2025
6c70041
Merge branch 'Role_Two' of https://github.com/mazinskihenry/KAM into …
mazinskihenry Jan 17, 2025
3493372
Shift statemachine to seperate addon
mazinskihenry Jan 17, 2025
bd83366
Update fnc_handleUnitVitals.sqf
mazinskihenry Jan 22, 2025
2688fee
Update addons/vitals/functions/fnc_hasStableVitals.sqf
mazinskihenry Jan 30, 2025
ee826bd
Update addons/conversion/functions/fnc_init.sqf
mazinskihenry Jan 30, 2025
7c48285
Update addons/conversion/ACE_Medical_Treatment_Actions.hpp
mazinskihenry Jan 30, 2025
a018e1e
Update addons/conversion/functions/fnc_fullHealLocal.sqf
mazinskihenry Jan 30, 2025
85f588e
Update addons/conversion/stringtable.xml
mazinskihenry Jan 30, 2025
7486c92
Update addons/conversion/functions/fnc_handleRespawn.sqf
mazinskihenry Jan 30, 2025
cb18c68
Update XEH_postInit.sqf
mazinskihenry Apr 1, 2025
2fd12c6
Merge branch 'dev-Tomcat' into pr/686
MiszczuZPolski Apr 4, 2025
c02ce5a
use api
MiszczuZPolski Apr 4, 2025
84144b7
use macros
MiszczuZPolski Apr 4, 2025
16f0b80
move settings to separate file, fix casing
MiszczuZPolski Apr 4, 2025
be8e2ab
Merge branch 'dev-Tomcat' into pr/686
MiszczuZPolski Apr 7, 2025
a7cb839
sort
MiszczuZPolski Apr 7, 2025
826a60c
Update stringtable.xml
MiszczuZPolski Apr 7, 2025
07369ed
Update stringtable.xml
MiszczuZPolski Apr 7, 2025
030b2ed
Update stringtable.xml
mazinskihenry Apr 7, 2025
2aa8d70
Update initSettings.inc.sqf
mazinskihenry Apr 7, 2025
ee3cb70
Update fnc_manualConversionCondition.sqf
mazinskihenry Apr 24, 2025
406273c
Update fnc_manualConversionCondition.sqf
mazinskihenry Apr 24, 2025
4b55167
Update fnc_manualConversionCondition.sqf
mazinskihenry Apr 24, 2025
981e940
Update fnc_handleUnitVitals.sqf
mazinskihenry May 4, 2025
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
1 change: 1 addition & 0 deletions addons/conversion/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x\kat\addons\conversion
14 changes: 14 additions & 0 deletions addons/conversion/ACE_Medical_Treatment_Actions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class ACE_Medical_Treatment_Actions {
class CheckPulse;
class ConvertPatient: CheckPulse {
displayName = CSTRING(convertPatient);
displayNameProgress = CSTRING(converting);
condition = QFUNC(manualConversionCondition);
medicRequired = QGVAR(manualConversionLevel);
treatmentLocations = QGVAR(manualConversionLocation);
treatmentTime = QGVAR(manualConversionTime);
allowedSelections[] = {"All"};
items[] = {""};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
items[] = {""};
items[] = {};
category = "advanced";
allowSelfTreatment = 0;
};
};

callbackSuccess = QFUNC(manualConversion);
};
};
20 changes: 20 additions & 0 deletions addons/conversion/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
disableModuload = "true";
};
};

class Extended_Init_EventHandlers {
class CAManBase {
class ADDON {
init = QUOTE([ARR_2((_this select 0),false)] call FUNC(init));
};
};
};

class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
10 changes: 10 additions & 0 deletions addons/conversion/CfgFunctions.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CfgFunctions {
class overwrite_ace_medical_status {
tag = "ace_medical_status";
class ace_medical_status {
class setDead {
file = QPATHTOF(functions\fnc_setDead.sqf);
};
};
};
};
21 changes: 21 additions & 0 deletions addons/conversion/CfgVehicles.hpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get why these are ace actions, just make them medical menu actions like manual conversion.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class CfgVehicles {
class Man;
class CAManBase: Man {
class ACE_Actions {
class ACE_MainActions {
class KAT_TicketConversion {
displayName = CSTRING(TicketConversion);
condition = QUOTE(_target call FUNC(ticketConversionCondition));
statement = QUOTE(_target call FUNC(ticketConversion));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
class KAT_LibConversion {
displayName = CSTRING(LibConversion);
condition = QUOTE(_target call FUNC(libConversionCondition));
statement = QUOTE(_target call FUNC(libConversion));
icon = QACEPATHTOF(medical_gui,ui\cross.paa);
};
};
};
};
};
16 changes: 16 additions & 0 deletions addons/conversion/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
PREP(conversionCheck);
PREP(conversionCondition);
PREP(fullHealLocal);
PREP(gui_updateInjuryListPart);
PREP(handleRespawn);
PREP(init);
PREP(KATConditionExecutionDeath);
PREP(KATConditionSecondChance);
PREP(libConversion);
PREP(libConversionCondition);
PREP(libConversionDistance);
PREP(manualConversion);
PREP(manualConversionCondition);
PREP(setDead);
PREP(ticketConversion);
PREP(ticketConversionCondition);
51 changes: 51 additions & 0 deletions addons/conversion/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#include "script_component.hpp"

[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler;
[QACEGVAR(medical_gui,updateInjuryListPart), LINKFUNC(gui_updateInjuryListPart)] call CBA_fnc_addEventHandler;

[QGVAR(convertCasualty), {
private _type = typeOf player;
private _group = createGroup [(side player), true];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private _group = createGroup [(side player), true];
private _group = createGroup [(side group player), true];

side player on an uncon player returns CIV, not the original side

private _previousUnit = player;
private _setName = name _previousUnit;
private _loadout = [player] call CBA_fnc_getLoadout;
private _unit = _group createUnit [_type, [0,0,0], [], 0, "NONE"];
[player, _loadout] call CBA_fnc_setLoadout;

_previousUnit setVariable [QEGVAR(vitals,simpleMedical), false, true];
_previousUnit setVariable [QGVAR(currentConverted), true, true];

selectPlayer _unit;

[QGVAR(unitTransfer), [_previousUnit]] call CBA_fnc_serverEvent;

_previousUnit setName _setName;

forceRespawn player;
deleteVehicle _unit;
}] call CBA_fnc_addEventHandler;

[QGVAR(unitTransfer), {
params ["_previousUnit"];
private _group2 = createGroup [(side _previousUnit), true];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private _group2 = createGroup [(side _previousUnit), true];
private _group2 = createGroup [(side group _previousUnit), true];

Same as above

[_previousUnit] join _group2;
_group2 setGroupOwner 2;
[_previousUnit, true] call ACEFUNC(medical,setUnconscious);
}] call CBA_fnc_addEventHandler;

[QGVAR(respawnTimer), {
params ["_time"];
private _currentRespawnTime = playerRespawnTime;
setPlayerRespawnTime _time;
_currentUnit = player;

[{
params ["_currentUnit"];

(lifeState _currentUnit isEqualTo "HEALTHY")
}, {
params [_currentRespawnTime];
setPlayerRespawnTime _currentRespawnTime;
}, [_currentUnit, _currentRespawnTime], 360, {}] call CBA_fnc_waitUntilAndExecute;
}] call CBA_fnc_addEventHandler;
12 changes: 12 additions & 0 deletions addons/conversion/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include "script_component.hpp"

ADDON = false;

PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;

#define CBA_SETTINGS_CAT LSTRING(cba_name)
#include "initSettings.inc.sqf"

ADDON = true;
35 changes: 35 additions & 0 deletions addons/conversion/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
requiredVersion = REQUIRED_VERSION;
units[] = {};
weapons[] = {};
magazines[] = {};
requiredAddons[] = {
"ace_medical",
"ace_medical_ai",
"ace_medical_blood",
"ace_medical_damage",
"ace_medical_engine",
"ace_medical_feedback",
"ace_medical_gui",
"ace_medical_statemachine",
"ace_medical_status",
"ace_medical_treatment",
"ace_medical_vitals",
"ace_dogtags",
"cba_settings"
};
author = "Mazinski";
authors[] = {"Mazinski"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgEventHandlers.hpp"
#include "CfgFunctions.hpp"
#include "CfgVehicles.hpp"
#include "ACE_Medical_Treatment_Actions.hpp"
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "..\script_component.hpp"
/*
* Author: BaerMitUmlaut
* Modified: Blue
* Condition for an execution caused death (fatal injury received in cardiac arrest).
* Author: mharis001
* Edited: Blue, Mazinski.H
* Condition for going into cardiac arrest upon receiving a fatal injury.
*
* Arguments:
* 0: Unit <OBJECT>
Expand All @@ -11,16 +11,16 @@
* None
*
* Example:
* [player] call ace_medical_statemachine_fnc_conditionExecutionDeath
* [player] call kat_conversion_fnc_conditionSecondChance
*
* Public: No
*/

params ["_unit"];

(if (isPlayer _unit) then {
(if (isPlayer _unit || (GET_CONVERT_STATUS(_unit) && LIB_CONVERSION_DISTANCE(_unit))) then {
ACEGVAR(medical_statemachine,fatalInjuriesPlayer) != FATAL_INJURIES_NEVER
} else {
(ACEGVAR(medical_statemachine,fatalInjuriesAI) != FATAL_INJURIES_NEVER) && {!(_unit getVariable [QGVAR(PreventInstantAIDeath), false])}
(ACEGVAR(medical_statemachine,fatalInjuriesAI) != FATAL_INJURIES_NEVER) && {!(_unit getVariable [QEGVAR(misc,PreventInstantAIDeath), false])}
})
&& {!(_unit getVariable [QACEGVAR(medical,deathBlocked), false])}
&& {!(_unit getVariable [QACEGVAR(medical,deathBlocked), false])}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "..\script_component.hpp"
/*
* Author: mharis001
* Modified: Blue
* Edited: Blue, Mazinski.H
* Condition for going into cardiac arrest upon receiving a fatal injury.
*
* Arguments:
Expand All @@ -11,15 +11,15 @@
* None
*
* Example:
* [player] call ace_medical_statemachine_fnc_conditionSecondChance
* [player] call kat_conversion_fnc_conditionSecondChance
*
* Public: No
*/

params ["_unit"];

if (isPlayer _unit) then {
if (isPlayer _unit || (GET_CONVERT_STATUS(_unit) && LIB_CONVERSION_DISTANCE(_unit))) then {
ACEGVAR(medical_statemachine,fatalInjuriesPlayer) != FATAL_INJURIES_ALWAYS
} else {
ACEGVAR(medical_statemachine,fatalInjuriesAI) != FATAL_INJURIES_ALWAYS || {_unit getVariable [QGVAR(PreventInstantAIDeath), false]}
};
ACEGVAR(medical_statemachine,fatalInjuriesAI) != FATAL_INJURIES_ALWAYS || {_unit getVariable [QEGVAR(misc,PreventInstantAIDeath), false]}
}
22 changes: 22 additions & 0 deletions addons/conversion/functions/fnc_conversionCheck.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "..\script_component.hpp"
/*
* Author: Mazinski
* Condition for automatic conversion
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call kat_conversion_conversionCheck
*
* Public: No
*/

params ["_unit"];

if ((!(ACEGVAR(medical_statemachine,AIUnconsciousness))) && (!isPlayer _unit) && LIB_CONVERSION_DISTANCE(_unit)) then {
GET_CONVERT_STATUS(_unit) != true
}
38 changes: 38 additions & 0 deletions addons/conversion/functions/fnc_conversionCondition.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include "..\script_component.hpp"
/*
* Author: Mazinski
* Check if a unit is in a stable state for resource conversion
*
* Arguments:
* 0: The patient <OBJECT>
*
* Return Value:
* Has no critical health conditions <BOOL>
*
* Example:
* [player] call kat_conversion_conversionCondition
*
* Public: No
*/

params ["_unit"];

private _bloodVolume = GET_BLOOD_VOLUME_LITERS(_unit);
if (_bloodVolume < ACEGVAR(medical,const_stableVitalsBloodThreshold)) exitWith { false };

if IN_CRDC_ARRST(_unit) exitWith { false };

private _bloodPressure = GET_BLOOD_PRESSURE(_unit);
_bloodPressure params ["_bloodPressureL", "_bloodPressureH"];
if (_bloodPressureL < 50 || {_bloodPressureH < 60}) exitWith { false };

private _heartRate = GET_HEART_RATE(_unit);
if (_heartRate < 70 || _heartRate > 100) exitWith { false };

private _o2 = GET_KAT_SPO2(_unit);
if (_o2 < EGVAR(breathing,Stable_spo2)) exitWith { false };

private _fractures = _unit getVariable [QEGVAR(surgery,fractures), [0,0,0,0,0,0]];
if (({_x == 0} count _fracture) != 6) exitWith { false };

true
25 changes: 25 additions & 0 deletions addons/conversion/functions/fnc_fullHealLocal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "..\script_component.hpp"
/*
* Author: MiszczuZPolski
* Local callback for fully healing a patient.
*
* Arguments:
* 0: Patient <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call kat_conversion_fnc_fullHealLocal
*
* Public: No
*/

params ["_patient"];

if (hasInterface && GVAR(enable)) then {
_patient setVariable [QGVAR(convert), true, true];
};

_patient setVariable [QGVAR(currentConverted), false, true];
_patient setVariable [QGVAR(associatedPlayer), player, true];
25 changes: 25 additions & 0 deletions addons/conversion/functions/fnc_gui_updateInjuryListPart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "..\script_component.hpp"
/*
* Author: MiszczuZPolski
* Updates injury list for given body part for the target.
*
* Arguments:
* 0: Injury list <CONTROL>
* 1: Target <OBJECT>
* 2: Body part, -1 to only show overall health info <NUMBER>
* 3: Entries <ARRAY>
*
* Return Value:
* None
*
* Example:
* [_ctrlInjuries, _target, 0] call kat_conversion_fnc_gui_updateInjuryListPart
*
* Public: No
*/

params ["_ctrl", "_target", "_selectionN", "_entries"];

if (_target getVariable [QGVAR(currentConverted), false] && GVAR(enableConversionMessage)) then {
_entries pushBack [LLSTRING(ConversionText), [0.35, 0.72, 0.82, 1]];
};
20 changes: 20 additions & 0 deletions addons/conversion/functions/fnc_handleRespawn.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include "..\script_component.hpp"
/*
* Author: MiszczuZPolski
* Local callback for fully healing a patient.
*
* Arguments:
* 0: Patient <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call kat_conversion_fnc_handleRespawn
*
* Public: No
*/

params ["_patient"];

[_patient] call FUNC(fullHealLocal);
Loading
Loading