-
Notifications
You must be signed in to change notification settings - Fork 113
Conversion - Allows for Conversion of Player Patients to AI Patients #686
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
base: dev-Tomcat
Are you sure you want to change the base?
Changes from 30 commits
b312e6b
2360b79
0bf1fef
aa72614
010fd88
f89b676
234172d
8dd8144
6f2b196
f411965
a0d0d73
218b85e
4fb4d00
c99d9f1
5d8768e
c2bdda8
846f3fc
ce56b12
eeccf2e
4375982
5f143f8
e59b2d2
7c7ed1d
30950d3
5ff9f09
e0f2a16
3fa54b9
6c70041
3493372
bd83366
2688fee
ee826bd
7c48285
a018e1e
85f588e
7486c92
cb18c68
2fd12c6
c02ce5a
84144b7
16f0b80
be8e2ab
a7cb839
826a60c
07369ed
030b2ed
2aa8d70
ee3cb70
406273c
4b55167
981e940
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| x\kat\addons\conversion |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||||||||||
| class ACE_Medical_Treatment_Actions { | ||||||||||||||
| class CheckPulse; | ||||||||||||||
| class BasicBandage; | ||||||||||||||
| class ConvertPatient: CheckPulse { | ||||||||||||||
| displayName = CSTRING(convertPatient); | ||||||||||||||
| displayNameProgress = CSTRING(converting); | ||||||||||||||
| condition = QFUNC(manualConversionCondition); | ||||||||||||||
| medicRequired = QGVAR(manualConversionLevel); | ||||||||||||||
| treatmentLocations = QGVAR(manualConversionLocation); | ||||||||||||||
| treatmentTime = QGVAR(manualConversionTime); | ||||||||||||||
| allowedSelections[] = {"All"}; | ||||||||||||||
| items[] = {""}; | ||||||||||||||
|
Contributor
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.
Suggested change
|
||||||||||||||
| callbackSuccess = QFUNC(manualConversion); | ||||||||||||||
| }; | ||||||||||||||
| }; | ||||||||||||||
| 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)); | ||
| }; | ||
| }; |
| 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); | ||
| }; | ||
| }; | ||
| }; | ||
| }; |
|
Contributor
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. 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); | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
| }; |
| 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); |
| 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]; | ||||||
|
Contributor
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.
Suggested change
side player on an uncon player returns CIV, not the original side |
||||||
| private _previousUnit = player; | ||||||
| private _setName = name _previousUnit; | ||||||
| private _loadout = getUnitLoadout player; | ||||||
|
mazinskihenry marked this conversation as resolved.
Outdated
|
||||||
| private _unit = _group createUnit [_type, [0,0,0], [], 0, "NONE"]; | ||||||
| _unit setUnitLoadout _loadout; | ||||||
|
mazinskihenry marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| _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]; | ||||||
|
Contributor
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.
Suggested change
Same as above |
||||||
| [_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; | ||||||
| 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; |
| 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" |
Uh oh!
There was an error while loading. Please reload this page.