From bbcc82acf6ccc22e1ffc847bda093dd9f44c0e1d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Wed, 7 Sep 2016 15:05:39 -0500 Subject: [PATCH] Tweak fatgiue duty factors --- addons/advanced_fatigue/XEH_postInit.sqf | 34 +++++++++++++----------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/addons/advanced_fatigue/XEH_postInit.sqf b/addons/advanced_fatigue/XEH_postInit.sqf index 2eff26abdf..ba733b33e1 100644 --- a/addons/advanced_fatigue/XEH_postInit.sqf +++ b/addons/advanced_fatigue/XEH_postInit.sqf @@ -18,22 +18,24 @@ if (!hasInterface) exitWith {}; ["unit", FUNC(handlePlayerChanged)] call CBA_fnc_addPlayerEventHandler; // - Duty factors ------------------------------------------------------------- - [QEGVAR(medical,pain), { - 1 + (((_this getVariable [QEGVAR(medical,pain), 0]) min 1) / 10) - }] call FUNC(addDutyFactor); - [QEGVAR(medical,bloodVolume), { - 2 - (((_this getVariable [QEGVAR(medical,bloodVolume), 100]) min 100) / 100) - }] call FUNC(addDutyFactor); - [QEGVAR(dragging,isCarrying), { - if (_this getVariable [QEGVAR(dragging,isCarrying), false]) then { - 3 - } else { - 1 - }; - }] call FUNC(addDutyFactor); - [QEGVAR(weather,temperature), { - (((missionNamespace getVariable [QEGVAR(weather,currentTemperature), 25]) - 35) / 10) max 2 min 1 - }] call FUNC(addDutyFactor); + if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(medical,pain), { // 0->1.0, 0.5->1.05, 1->1.1 + linearConversion [0, 1, (_this getVariable [QEGVAR(medical,pain), 0]), 1, 1.1, true]; + }] call FUNC(addDutyFactor); + [QEGVAR(medical,bloodVolume), { // 100->1.0, 90->1.1, 80->1.2 + linearConversion [100, 0, (_this getVariable [QEGVAR(medical,bloodVolume), 100]), 1, 2, true]; + }] call FUNC(addDutyFactor); + }; + if (["ACE_Dragging"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(dragging,isCarrying), { + [1, 3] select (_this getVariable [QEGVAR(dragging,isCarrying), false]); + }] call FUNC(addDutyFactor); + }; + if (["ACE_Weather"] call EFUNC(common,isModLoaded)) then { + [QEGVAR(weather,temperature), { // 35->1, 45->2 + linearConversion [35, 45, (missionNamespace getVariable [QEGVAR(weather,currentTemperature), 25]), 1, 2, true]; + }] call FUNC(addDutyFactor); + }; // - Add main PFH ------------------------------------------------------------- [FUNC(pfhMain), 1, []] call CBA_fnc_addPerFrameHandler;