Phantomsmedia / Wavelength

This is the repository for the Wavelength, ArmA 3 mission framework derivative of F3..
9 stars 11 forks source link

Enabled ace_medical_preventInstaDeath #350

Closed MysticalLatios closed 8 years ago

MysticalLatios commented 8 years ago

Me and killpact have decided to enable prevent insta death, I tested it shortly and it just feels like a increased chance of going unconscious instead of instantly dieing.

MysticalLatios commented 8 years ago

This will be tested on this Saturday before being commited

JonBons commented 8 years ago

Here is what that setting does in ACE:

if ((_minLethalDamage <= _newDamage) && {[_unit, [_effectiveSelectionName] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)}) then {
    if ((_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)])) exitwith {
        _damageReturn = 0.9;
    };
    if ([_unit, false, true] call FUNC(setDead)) then {
        _damageReturn = 1;
    } else {
        _damageReturn = _damageReturn min 0.89;
    };
} else {
    _damageReturn = _damageReturn min 0.89;
};

// some stuff

if (_unit getVariable [QGVAR(preventInstaDeath), GVAR(preventInstaDeath)]) exitWith {
    private _delayedUnconsicous = false;
    if (_vehicle != _unit and {damage _vehicle >= 1}) then {
        [_unit] call EFUNC(common,unloadPerson);
        _delayedUnconsicous = true;
    };

    if (_damageReturn >= 0.9 && {_selection in ["", "head", "body"]}) exitWith {
        if (_unit getVariable ["ACE_isUnconscious", false]) exitwith {
            [_unit, false, true] call FUNC(setDead);
            0.89;
        };
        if (_delayedUnconsicous) then {
            [{
                [_this select 0, true] call FUNC(setUnconscious);
            }, [_unit], 0.7] call EFUNC(common,waitAndExecute);
        } else {
            [{
                [_this select 0, true] call FUNC(setUnconscious);
            }, [_unit]] call EFUNC(common,execNextFrame);
        };
        0.89;
    };
    _damageReturn min 0.89;
};

if (((_unit getVariable [QGVAR(enableRevive), GVAR(enableRevive)]) > 0) && {_damageReturn >= 0.9} && {_selection in ["", "head", "body"]}) exitWith {
    if (vehicle _unit != _unit and {damage (vehicle _unit) >= 1}) then {
        [_unit] call EFUNC(common,unloadPerson);
    };
    [_unit, false, true] call FUNC(setDead);
    0.89;
};

TRACE_3("ACE_DEBUG: HandleDamage damage return",_selection,_damageReturn,_unit);

_damageReturn
JonBons commented 8 years ago

Essentially it prevents any type of damage before being downed from killing you and then any further damage behaves normally. My only concern is how it behaves with explosives as I don't think it would be good to survive a direct/close hit.

MysticalLatios commented 8 years ago

This will be closed in favor of changing the damage delt to players.