This commit is contained in:
Glowbal 2015-04-17 20:24:05 +02:00
parent 111a350a84
commit c86be12668
3 changed files with 15 additions and 4 deletions

View File

@ -21,10 +21,10 @@ if ((vehicle _unit != _unit) && {!alive (vehicle _unit)}) exitwith { true };
// Find the correct Damage threshold for unit.
_damageThreshold = [1,1,1];
if (isPlayer _unit) then {
//_damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_Players), GVAR(damageThreshold_Players), GVAR(damageThreshold_Players) * 1.7]];
if ([_unit] call EFUNC(common,IsPlayer)) then {
_damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(playerDamageThreshold), GVAR(playerDamageThreshold), GVAR(playerDamageThreshold) * 1.7]];
} else {
//_damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_AI), GVAR(damageThreshold_AI), GVAR(damageThreshold_AI) * 1.7]];
_damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(AIDamageThreshold), GVAR(AIDamageThreshold), GVAR(AIDamageThreshold) * 1.7]];
};
_damageBodyPart = ((_unit getvariable [QGVAR(bodyPartStatus),[0, 0, 0, 0, 0, 0]]) select _part) + _withDamage;

View File

@ -36,6 +36,12 @@ if !(_selection in (GVAR(SELECTIONS) + [""])) exitWith {0};
_damageReturn = _damage;
if (GVAR(level) < 2) then {
if ([_unit] call EFUNC(isPlayer)) then {
_this set [2, _damage / (GVAR(playerDamageThreshold) max 0.01)];
} else {
_this set [2, _damage / (GVAR(AIDamageThreshold) max 0.01)];
};
_damageReturn = _this call FUNC(handleDamage_basic);
};

View File

@ -23,7 +23,7 @@ _set = if (count _this > 1) then {_this select 1} else {true};
_minWaitingTime = if (count _this > 2) then {_this select 2} else {DEFAULT_DELAY};
if !(_set) exitwith {
_unit setvariable ["ACE_isUnconscious", false,true];
_unit setvariable ["ACE_isUnconscious", false, true];
};
if !(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(common,isAwake))}) exitwith{};
@ -40,6 +40,11 @@ if (_unit == ACE_player) then {
closeDialog 0;
};
// if we have unconsciousness for AI disabled, we will kill the unit instead
if (!([_unit] call EFUNC(common,IsPlayer)) && (GVAR(enableUnsconsiousnessAI) == 0 || (GVAR(enableUnsconsiousnessAI) == 2 && random(1) <= 0.5))) exitwith {
[_unit, true] call FUNC(setDead); // force, to avoid getting into a loop in case revive is enabled.
};
// If a unit has the launcher out, it will sometimes start selecting the primairy weapon while unconscious,
// therefor we force it to select the primairy weapon before going unconscious
if ((vehicle _unit) isKindOf "StaticWeapon") then {