Merge pull request #1530 from legman/akalegman_zeus_unconscious

Fixed Zeus Unconscious
This commit is contained in:
Glowbal 2015-06-13 20:48:18 +02:00
commit 5013254769
6 changed files with 26 additions and 3 deletions

View File

@ -1,15 +1,21 @@
/*
* Author: bux578, commy2
* Author: bux578, commy2, akalegman
*
* Checks if a unit is a player / curator controlled unit.
* Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine)
*
* Arguments:
* 0: unit to be checked (object)
* 1: exclude remote controlled units (boolean)
*
* Return Value:
* Bool: is unit a player?
*/
#include "script_component.hpp"
isPlayer (_this select 0) || {_this select 0 == call FUNC(player)}
private ["_unit", "_excludeRemoteControlled"];
_unit = _this select 0;
_excludeRemoteControlled = if (count _this > 1) then {_this select 1} else {false};
isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)})

View File

@ -59,6 +59,10 @@ class ACE_Settings {
typeName = "SCALAR";
values[] = {"Disabled", "50/50", "Enabled"};
};
class GVAR(remoteControlledAI) {
typeName = "BOOL";
value = 1;
};
class GVAR(preventInstaDeath) {
typeName = "BOOL";
value = 0;

View File

@ -106,6 +106,12 @@ class CfgVehicles {
};
};
};
class remoteControlledAI {
displayName = CSTRING(MedicalSettings_remoteControlledAI_DisplayName);
description = CSTRING(MedicalSettings_remoteControlledAI_Description);
typeName = "BOOL";
defaultValue = 1;
};
class preventInstaDeath {
displayName = CSTRING(MedicalSettings_preventInstaDeath_DisplayName);
description = CSTRING(MedicalSettings_preventInstaDeath_Description);

View File

@ -30,6 +30,7 @@ if !(_activated) exitWith {};
[_logic, QGVAR(playerDamageThreshold), "playerDamageThreshold"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(AIDamageThreshold), "AIDamageThreshold"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(enableUnconsciousnessAI), "enableUnconsciousnessAI"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(remoteControlledAI), "remoteControlledAI"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(preventInstaDeath), "preventInstaDeath"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(bleedingCoefficient), "bleedingCoefficient"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(painCoefficient), "painCoefficient"] call EFUNC(common,readSettingFromModule);

View File

@ -48,7 +48,7 @@ if (_unit == ACE_player) then {
// if we have unconsciousness for AI disabled, we will kill the unit instead
_isDead = false;
if (!([_unit] call EFUNC(common,isPlayer)) && !_force) then {
if (!([_unit, GVAR(remoteControlledAI)] call EFUNC(common,isPlayer)) && !_force) then {
_enableUncon = _unit getVariable [QGVAR(enableUnconsciousnessAI), GVAR(enableUnconsciousnessAI)];
if (_enableUncon == 0 or {_enableUncon == 1 and (random 1) < 0.5}) then {
[_unit, true] call FUNC(setDead);

View File

@ -2886,6 +2886,12 @@
<German>KI kann bewusstlos werden</German>
<Czech>Umožňuje AI upadnout do bezvědomí</Czech>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_remoteControlledAI_DisplayName">
<English>Remote Controlled AI</English>
</Key>
<Key ID="STR_ACE_Medical_MedicalSettings_remoteControlledAI_Description">
<English>Treat remote controlled units as AI not players?</English>
</Key>
<Key ID="STR_ACE_Medical_disabled">
<English>Disabled</English>
<Russian>Отключено</Russian>