-
Notifications
You must be signed in to change notification settings - Fork 103
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
Conversion - Allows for Conversion of Player Patients to AI Patients #686
Open
mazinskihenry
wants to merge
36
commits into
KAT-Advanced-Medical:dev-Tomcat
Choose a base branch
from
mazinskihenry:Role_Two
base: dev-Tomcat
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+887
−34
Open
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
b312e6b
Start
mazinskihenry 2360b79
Working?
mazinskihenry 0bf1fef
Pulling hairs
mazinskihenry aa72614
Ticket/Lib Supply Conversion
mazinskihenry 010fd88
Extension
mazinskihenry f89b676
Diag_log remove
mazinskihenry 234172d
Mechanics
mazinskihenry 8dd8144
Update stringtable.xml
mazinskihenry 6f2b196
Headers
mazinskihenry f411965
Update fnc_handleUnitVitals.sqf
mazinskihenry a0d0d73
Errors
mazinskihenry 218b85e
Merge branch 'Role_Two' of https://github.com/mazinskihenry/KAM into …
mazinskihenry 4fb4d00
Update stringtable.xml
mazinskihenry c99d9f1
Update fnc_handleUnitVitals.sqf
mazinskihenry 5d8768e
One Life Conversion
mazinskihenry c2bdda8
Redo Config
mazinskihenry 846f3fc
Its broken again
mazinskihenry ce56b12
Update fnc_KATConditionExecutionDeath.sqf
mazinskihenry eeccf2e
Working again
mazinskihenry 4375982
Add option to disable text
mazinskihenry 5f143f8
Add distance for libConversion and one life options
mazinskihenry e59b2d2
Delete fnc_spectatorRespawn.sqf
mazinskihenry 7c7ed1d
Update XEH_PREP.hpp
mazinskihenry 30950d3
Update fnc_manualConversionCondition.sqf
mazinskihenry 5ff9f09
Update addons/conversion/ACE_Medical_Treatment_Actions.hpp
mazinskihenry e0f2a16
Update addons/conversion/ACE_Medical_Treatment_Actions.hpp
mazinskihenry 3fa54b9
Review
mazinskihenry 6c70041
Merge branch 'Role_Two' of https://github.com/mazinskihenry/KAM into …
mazinskihenry 3493372
Shift statemachine to seperate addon
mazinskihenry bd83366
Update fnc_handleUnitVitals.sqf
mazinskihenry 2688fee
Update addons/vitals/functions/fnc_hasStableVitals.sqf
mazinskihenry ee826bd
Update addons/conversion/functions/fnc_init.sqf
mazinskihenry 7c48285
Update addons/conversion/ACE_Medical_Treatment_Actions.hpp
mazinskihenry a018e1e
Update addons/conversion/functions/fnc_fullHealLocal.sqf
mazinskihenry 85f588e
Update addons/conversion/stringtable.xml
mazinskihenry 7486c92
Update addons/conversion/functions/fnc_handleRespawn.sqf
mazinskihenry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x\kat\addons\conversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[] = {""}; | ||
callbackSuccess = QFUNC(manualConversion); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
}; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
PREP(conversionCheck); | ||
PREP(conversionCondition); | ||
PREP(fullHealLocal); | ||
PREP(handleRespawn); | ||
PREP(init); | ||
PREP(KATConditionExecutionDeath); | ||
PREP(KATConditionSecondChance); | ||
PREP(libConversion); | ||
PREP(libConversionCondition); | ||
PREP(libConversionDistance); | ||
PREP(manualConversion); | ||
PREP(manualConversionCondition); | ||
PREP(setDead); | ||
PREP(ticketConversion); | ||
PREP(ticketConversionCondition); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "script_component.hpp" | ||
|
||
[QEGVAR(misc,handleRespawn), LINKFUNC(handleRespawn)] call CBA_fnc_addEventHandler; | ||
[QACEGVAR(medical_treatment,fullHealLocalMod), LINKFUNC(fullHealLocal)] call CBA_fnc_addEventHandler; | ||
|
||
["kat_conversion_convertCasualty", { | ||
private _type = typeOf player; | ||
private _group = createGroup [(side player), true]; | ||
private _previousUnit = player; | ||
private _setName = name _previousUnit; | ||
private _loadout = getUnitLoadout player; | ||
private _unit = _group createUnit [_type, [0,0,0], [], 0, "NONE"]; | ||
_unit setUnitLoadout _loadout; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
_previousUnit setVariable [QEGVAR(vitals,simpleMedical), false, true]; | ||
_previousUnit setVariable [QGVAR(currentConverted), true, true]; | ||
|
||
selectPlayer _unit; | ||
|
||
["kat_conversion_unitTransfer", [_previousUnit]] call CBA_fnc_serverEvent; | ||
|
||
_previousUnit setName _setName; | ||
|
||
forceRespawn player; | ||
deleteVehicle _unit; | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
["kat_conversion_unitTransfer", { | ||
params ["_previousUnit"]; | ||
private _group2 = createGroup [(side _previousUnit), true]; | ||
[_previousUnit] join _group2; | ||
_group2 setGroupOwner 2; | ||
[_previousUnit, true] call ACEFUNC(medical,setUnconscious); | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
["kat_conversion_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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
#include "script_component.hpp" | ||
|
||
ADDON = false; | ||
|
||
PREP_RECOMPILE_START; | ||
#include "XEH_PREP.hpp" | ||
PREP_RECOMPILE_END; | ||
|
||
#define CBA_SETTINGS_CAT "KAT - ADV Medical: Conversion" | ||
|
||
[ | ||
QGVAR(enable), | ||
"CHECKBOX", | ||
[LLSTRING(CONVERSION_ENABLE), LLSTRING(CONVERSION_ENABLE_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[false], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(enableConversionMessage), | ||
"CHECKBOX", | ||
[LLSTRING(CONVERSION_MESSAGE), LLSTRING(CONVERSION_MESSAGE_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[false], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(enableTicketConversion), | ||
"CHECKBOX", | ||
[LLSTRING(CONVERSION_TICKET_CONVERSION), LLSTRING(CONVERSION_TICKET_CONVERSION_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[false], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(ticketConversionGain), | ||
"SLIDER", | ||
[LLSTRING(CONVERSION_TICKET_CONVERSION_GAIN), LLSTRING(CONVERSION_TICKET_CONVERSION_GAIN_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[0, 10, 3, 0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(enableLiberationConversion), | ||
"CHECKBOX", | ||
[LLSTRING(CONVERSION_LIBERATION_CONVERSION), LLSTRING(CONVERSION_LIBERATION_CONVERSION_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[false], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(enableLiberationConversionGain), | ||
"SLIDER", | ||
[LLSTRING(CONVERSION_LIBERATION_CONVERSION_GAIN), LLSTRING(CONVERSION_LIBERATION_CONVERSION_GAIN_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[0, 100, 50, 0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(enableLiberationConversionDistance), | ||
"SLIDER", | ||
[LLSTRING(CONVERSION_LIBERATION_CONVERSION_DISTANCE), LLSTRING(CONVERSION_LIBERATION_CONVERSION_DISTANCE_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[0, 5000, 1000, 0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(enableSpectatorRespawn), | ||
"CHECKBOX", | ||
[LLSTRING(CONVERSION_SPECTATOR_RESPAWN), LLSTRING(CONVERSION_SPECTATOR_RESPAWN_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[false], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(forceVehicleConversion), | ||
"CHECKBOX", | ||
[LLSTRING(CONVERSION_FORCE_VEHICLE), LLSTRING(CONVERSION_FORCE_VEHICLE_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[false], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(convertVehicles), | ||
"EDITBOX", | ||
[LLSTRING(CONVERSION_FORCE_VEHICLE_LIST), LLSTRING(CONVERSION_FORCE_VEHICLE_LIST_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
"'kat_stretcher'", | ||
1, | ||
{ | ||
private _array = [_this, "CfgVehicles"] call EFUNC(chemical,getList); | ||
missionNamespace setVariable [QGVAR(convertVehicles), _array, true]; | ||
}, | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(allowManualConversion), | ||
"CHECKBOX", | ||
[LLSTRING(CONVERSION_MANUAL_CONVERSION), LLSTRING(CONVERSION_MANUAL_CONVERSION_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[false], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(manualConversionLevel), | ||
"LIST", | ||
[LLSTRING(CONVERSION_MANUAL_CONVERSION_LEVEL), LLSTRING(CONVERSION_MANUAL_CONVERSION_LEVEL_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[[0, 1, 2], ["STR_ACE_Medical_Treatment_Anyone", "STR_ACE_Medical_Treatment_Medics", "STR_ACE_Medical_Treatment_Doctors"], 0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(manualConversionLocation), | ||
"LIST", | ||
[LLSTRING(CONVERSION_MANUAL_CONVERSION_LOCATION), LLSTRING(CONVERSION_MANUAL_CONVERSION_LOCATION_DESC)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[[0,1,2,3],["STR_ACE_Common_Anywhere", "STR_ACE_Common_Vehicle", "STR_ACE_Medical_Treatment_MedicalFacilities", "STR_ACE_Medical_Treatment_VehiclesAndFacilities"],0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
[ | ||
QGVAR(manualConversionTime), | ||
"SLIDER", | ||
[LLSTRING(CONVERSION_LIBERATION_CONVERSION_TIME)], | ||
[CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Basic)], | ||
[0, 60, 15, 0], | ||
true | ||
] call CBA_Settings_fnc_init; | ||
|
||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would use https://cbateam.github.io/CBA_A3/docs/files/loadout/fnc_getLoadout-sqf.html#CBA_fnc_getLoadout instead