Add requireSurrender setting for AI - close #5518 (#5522)

This commit is contained in:
Keithen 2017-09-19 20:21:30 +02:00 committed by PabstMirror
parent e47212ea9c
commit 7fe932803b
6 changed files with 23 additions and 1 deletions

View File

@ -90,6 +90,7 @@ Head <brobergsebastian@gmail.com>
Hybrid V
Karneck <dschultz26@hotmail.com>
Kavinsky <nmunozfernandez@gmail.com>
Keithen <Keithen.Neu@gmail.com>
Kllrt <kllrtik@gmail.com>
legman <juicemelon@msn.com>
Legolasindar "Viper" <legolasindar@gmail.com>

View File

@ -18,4 +18,10 @@ class ACE_Settings {
typeName = "BOOL";
value = 1;
};
class GVAR(requireSurrenderAi) {
displayName = CSTRING(ModuleSettings_requireSurrenderAi_name);
description = CSTRING(ModuleSettings_requireSurrenderAi_description);
typeName = "BOOL";
value = 0;
};
};

View File

@ -222,6 +222,12 @@ class CfgVehicles {
};
};
};
class requireSurrenderAi {
displayName = CSTRING(ModuleSettings_requireSurrenderAi_name);
description = CSTRING(ModuleSettings_requireSurrenderAi_description);
typeName = "BOOL";
defaultValue = 0;
};
};
class ModuleDescription: ModuleDescription {
description = CSTRING(ModuleSettings_Description);

View File

@ -25,7 +25,7 @@ params ["_unit", "_target"];
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
{
(_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious
{!([_target] call EFUNC(common,isPlayer))} || //is an AI (not a player)
{!GVAR(requireSurrenderAi) && {!([_target] call EFUNC(common,isPlayer))}} || //is an AI (not a player) and doesn't require surrendering
{GVAR(requireSurrender) == 0} || //or don't require surrendering
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon

View File

@ -21,3 +21,4 @@ params ["_logic"];
[_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(requireSurrender), "requireSurrender"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(requireSurrenderAi), "requireSurrenderAi"] call EFUNC(common,readSettingFromModule);

View File

@ -427,5 +427,13 @@
<Chinese>投降或無武器狀態</Chinese>
<Chinesesimp>投降或无武器状态</Chinesesimp>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrenderAi_name">
<English>Require AI surrendering</English>
<German>Benötigt AI Kapitulation</German>
</Key>
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrenderAi_description">
<English>Require AI to surrender before they can be arrested</English>
<German>AI muss sich erst ergeben, bevor sie gefangen genommen werden kann</German>
</Key>
</Package>
</Project>