diff --git a/AUTHORS.txt b/AUTHORS.txt index 83aa4a6385..ba89a97abc 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -40,6 +40,7 @@ Aleksey EpMAK Yermakov Alganthe Andrea "AtixNeon" Verano Anthariel +Arcanum417 Anton Arcanum417 Arkhir diff --git a/addons/medical/ACE_Medical_StateMachine.hpp b/addons/medical/ACE_Medical_StateMachine.hpp index b2e676b143..3abe7d101e 100644 --- a/addons/medical/ACE_Medical_StateMachine.hpp +++ b/addons/medical/ACE_Medical_StateMachine.hpp @@ -45,6 +45,10 @@ class ACE_Medical_StateMachine { class Unconscious { onState = QUOTE(DFUNC(handleStateUnconscious)); onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconsciousStatemachine)); + class DeathAI { + targetState = "Dead"; + condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)}); + }; class WakeUp { targetState = "Injured"; condition = QUOTE(_this call FUNC(hasStableVitals)); @@ -64,6 +68,11 @@ class ACE_Medical_StateMachine { // Transition state for handling instant death // This state raises the next transition in the same frame onStateEntered = QUOTE(DFUNC(enteredStateFatalInjury)); + class DeathAI { + events[] = {QGVAR(FatalInjuryInstantTransition)}; + targetState = "Dead"; + condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); + }; class SecondChance { events[] = {QGVAR(FatalInjuryInstantTransition)}; targetState = "CardiacArrest"; @@ -79,6 +88,10 @@ class ACE_Medical_StateMachine { class CardiacArrest { onStateEntered = QUOTE(DFUNC(enteredStateCardiacArrest)); onStateLeaving = QUOTE(DFUNC(leftStateCardiacArrest)); + class DeathAI { + targetState = "Dead"; + condition = QUOTE(!isPlayer _this && {GVAR(fatalInjuryConditionAI)}); + }; class Timeout { targetState = "Dead"; condition = QUOTE(DFUNC(conditionCardiacArrestTimer)); diff --git a/addons/medical/ACE_Settings.hpp b/addons/medical/ACE_Settings.hpp index 1b7c51b077..825827458d 100644 --- a/addons/medical/ACE_Settings.hpp +++ b/addons/medical/ACE_Settings.hpp @@ -117,6 +117,20 @@ class ACE_Settings { typeName = "SCALAR"; values[] = {"Always", "In Cardiac Arrest", "Never"}; }; + class GVAR(fatalInjuryConditionAI) { + category = CSTRING(Category_Medical); + displayName = CSTRING(MedicalSettings_fatalInjuryConditionAI_DisplayName); + description = CSTRING(MedicalSettings_fatalInjuryConditionAI_Description); + value = 1; + typeName = "BOOL"; + }; + class GVAR(unconsciousConditionAI) { + category = CSTRING(Category_Medical); + displayName = CSTRING(MedicalSettings_unconsciousConditionAI_DisplayName); + description = CSTRING(MedicalSettings_unconsciousConditionAI_Description); + value = 1; + typeName = "BOOL"; + }; class GVAR(cardiacArrestTime) { category = CSTRING(Category_Medical); displayName = CSTRING(MedicalSettings_cardiacArrestTime_DisplayName); diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 63a1db497e..033943ee87 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -125,10 +125,22 @@ class CfgVehicles { }; class never { name = ECSTRING(common,Never); - value = 1; + value = 2; }; }; }; + class fatalInjuryConditionAI { + displayName = CSTRING(MedicalSettings_fatalInjuryConditionAI_DisplayName); + description = CSTRING(MedicalSettings_fatalInjuryConditionAI_Description); + typeName = "BOOL"; + defaultValue = 1; + }; + class unconsciousConditionAI { + displayName = CSTRING(MedicalSettings_unconsciousConditionAI_DisplayName); + description = CSTRING(MedicalSettings_unconsciousConditionAI_Description); + typeName = "BOOL"; + defaultValue = 1; + }; class cardiacArrestTime { displayName = CSTRING(MedicalSettings_cardiacArrestTime_DisplayName); description = CSTRING(MedicalSettings_cardiacArrestTime_Description); diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 6345e1fbd0..f04470b5be 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -8,7 +8,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author = ECSTRING(common,ACETeam); - authors[] = {"Glowbal", "KoffeinFlummi"}; + authors[] = {"Glowbal", "KoffeinFlummi","Arcanum417"}; url = ECSTRING(main,URL); VERSION_CONFIG; }; diff --git a/addons/medical/functions/fnc_moduleMedicalSettings.sqf b/addons/medical/functions/fnc_moduleMedicalSettings.sqf index 85c9107bfa..12d326ebfb 100644 --- a/addons/medical/functions/fnc_moduleMedicalSettings.sqf +++ b/addons/medical/functions/fnc_moduleMedicalSettings.sqf @@ -35,6 +35,8 @@ if !(_activated) exitWith {}; [_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(fatalInjuryCondition), "fatalInjuryCondition"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(fatalInjuryConditionAI), "fatalInjuryConditionAI"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(unconsciousConditionAI), "unconsciousConditionAI"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(cardiacArrestTime), "cardiacArrestTime"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(medicSetting_PainVisualization), "painVisualization"] call EFUNC(common,readSettingFromModule); diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 2cc910e09f..291ed389f6 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3493,12 +3493,24 @@ AI 死亡前所能承受的傷害程度 - Fatal Injury + Fatal Injury Player - Defines when you can receive a fatal injury + Defines when Player can receive a fatal injury - + + Instant death AI + + + Defines if AI will be able to die instantly + + + Forbid unconscious AI + + + Defines if AI will be denied to go unconscious and will die instead + + In Cardiac Arrest