Merge branch 'medical-rewrite' of https://github.com/acemod/ACE3 into medical-rewrite

This commit is contained in:
commy2 2016-10-06 23:44:31 +02:00
commit f004504a53
2 changed files with 22 additions and 11 deletions

View File

@ -1,6 +1,24 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
[missionNamespace, "ACE_setCustomAimCoef", QUOTE(ADDON), {
private _unit = ACE_player;
private _fatigue = _unit getVariable [QGVAR(aimFatigue), 0];
switch (stance _unit) do {
case ("CROUCH"): {
1.0 + _fatigue ^ 2 * 0.1
};
case ("PRONE"): {
1.0 + _fatigue ^ 2 * 2.0
};
default {
1.5 + _fatigue ^ 2 * 3.0
};
};
}] call EFUNC(common,arithmeticSetSource);
["ace_settingsInitialized", {
if (!GVAR(enabled)) exitWith {};

View File

@ -77,14 +77,7 @@ if (_overexhausted) then {
};
};
switch (stance _unit) do {
case ("CROUCH"): {
_unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 0.1);
};
case ("PRONE"): {
_unit setCustomAimCoef (1.0 + _fatigue ^ 2 * 2.0);
};
default {
_unit setCustomAimCoef (1.5 + _fatigue ^ 2 * 3.0);
};
};
_unit setVariable [QGVAR(aimFatigue), _fatigue];
private _aimCoef = [missionNamespace, "ACE_setCustomAimCoef", "max"] call EFUNC(common,arithmeticGetResult);
_unit setCustomAimCoef _aimCoef;