mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add options to disable AI going unconscious and for AI to die instantly
This commit is contained in:
parent
e3f9e65fb7
commit
9895881ad9
@ -39,6 +39,10 @@ class ACE_Medical_StateMachine {
|
||||
class Unconscious {
|
||||
onState = QUOTE(DFUNC(handleStateUnconscious));
|
||||
onStateEntered = QUOTE([ARR_2(_this,(true))] call FUNC(setUnconscious));
|
||||
class DeathAI {
|
||||
targetState = "Dead";
|
||||
condition = QUOTE(!isPlayer _this && {GVAR(unconsciousConditionAI)});
|
||||
};
|
||||
class WakeUp {
|
||||
targetState = "Injured";
|
||||
condition = QUOTE(_this call FUNC(hasStableVitals));
|
||||
@ -58,6 +62,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";
|
||||
|
@ -115,9 +115,15 @@ class ACE_Settings {
|
||||
category = CSTRING(Category_Medical);
|
||||
displayName = CSTRING(MedicalSettings_fatalInjuryConditionAI_DisplayName);
|
||||
description = CSTRING(MedicalSettings_fatalInjuryConditionAI_Description);
|
||||
value = 0;
|
||||
typeName = "SCALAR";
|
||||
values[] = {"Always", "In Cardiac Arrest", "Never"};
|
||||
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);
|
||||
|
@ -131,6 +131,18 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
};
|
||||
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);
|
||||
|
@ -32,6 +32,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);
|
||||
|
@ -2981,10 +2981,16 @@
|
||||
<English>Defines when Player can receive a fatal injury</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_MedicalSettings_fatalInjuryConditionAI_DisplayName">
|
||||
<English>Fatal Injury AI</English>
|
||||
<English>Instant death AI</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_MedicalSettings_fatalInjuryConditionAI_Description">
|
||||
<English>Defines when AI can receive a fatal injury</English>
|
||||
<English>Defines if AI will be able to die instantly</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_MedicalSettings_unconsciousConditionAI_DisplayName">
|
||||
<English>Forbid unconscious AI</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_MedicalSettings_unconsciousConditionAI_Description">
|
||||
<English>Defines if AI will be denied to go unconscious and will die instead</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_MedicalSettings_fatalInjuryCondition_InCardiacArrest">
|
||||
<English>In Cardiac Arrest</English>
|
||||
|
Loading…
Reference in New Issue
Block a user