diff --git a/addons/vitals/functions/fnc_handleUnitVitals.sqf b/addons/vitals/functions/fnc_handleUnitVitals.sqf index 41170a65e..179afea67 100644 --- a/addons/vitals/functions/fnc_handleUnitVitals.sqf +++ b/addons/vitals/functions/fnc_handleUnitVitals.sqf @@ -37,19 +37,26 @@ if (_syncValues) then { private _bloodVolume = ([_unit, _deltaT, _syncValues] call EFUNC(pharma,getBloodVolumeChange)); _unit setVariable [VAR_BLOOD_VOL, _bloodVolume, _syncValues]; -private _temperature = 37; +// Enviromental Impact (Altitude, Temperature, Pressure) private _baroPressure = 760; +private _temperature = DEFAULT_TEMPERATURE; +private _altitude = (getPosASL _unit) select 2; + +if (GVAR(baroPressureEnable)) then { + if (GVAR(useACEpressure)) then { + private _hPa = _altitude call ACEFUNC(weather,calculateBarometricPressure); + _baroPressure = _hPa * 0.750062; + } else { + _baroPressure = 760 * exp((-(_altitude)) / 8400); + }; +}; if (EGVAR(hypothermia,hypothermiaActive)) then { - // Enviromental Impact (Altitude, Temperature, Pressure) - private _altitude = (getPosASL _unit) select 2; private _altitudeTempImpact = switch (true) do { case (_altitude >= 10): { abs(_altitude/153) * -1 }; //For every 1000 meters of elevation gain, temperature decreases by ~6.5 degrees celsius case (_altitude <= -1): { -35 max((abs(_altitude/50) * -1) - 17) }; //Average water temperature is 20 degrees celsius. Decreases to 2 degrees celsius at 1000 meters default { 0 }; }; - - _baroPressure = 760 * exp((-(_altitude)) / 8400); _temperature = [_unit, _altitudeTempImpact, _bloodVolume, _deltaT, _syncValues] call FUNC(handleTemperatureFunction); }; diff --git a/addons/vitals/initSettings.inc.sqf b/addons/vitals/initSettings.inc.sqf index ae38c8d08..acf0bb797 100644 --- a/addons/vitals/initSettings.inc.sqf +++ b/addons/vitals/initSettings.inc.sqf @@ -34,3 +34,21 @@ [0.1, 60, 15, 1], true ] call CBA_fnc_addSetting; + +[ + QGVAR(baroPressureEnable), + "CHECKBOX", + [LLSTRING(PRESSURE_ENABLE), LLSTRING(PRESSURE_ENABLE_DESC)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Environment)], + [true], + true +] call CBA_fnc_addSetting; + +[ + QGVAR(useACEpressure), + "CHECKBOX", + [LLSTRING(PRESSURE_ACE), LLSTRING(PRESSURE_ACE_DESC)], + [CBA_SETTINGS_CAT, ELSTRING(GUI,SubCategory_Environment)], + [true], + true +] call CBA_fnc_addSetting; diff --git a/addons/vitals/stringtable.xml b/addons/vitals/stringtable.xml index 5974b933d..1e45d20e5 100644 --- a/addons/vitals/stringtable.xml +++ b/addons/vitals/stringtable.xml @@ -79,6 +79,22 @@ Versimpelt de vitale-waardensimulatie voor KI-eenheden. Dit kan helpen bij het besparen op FPS FPS tasarrufu sağlamak için yapay zekâ birimlerine basitleştirilmiş vital hesaplamaları uygular. + + Enable barometric pressure change + 気圧の変化を有効化 + + + Enables barometric pressure changes with altitude that affect vitals such as oxygen calculations.\nDisabling this will prevent oxygen deprivation symptoms at high altitudes. + 酸素の計算などバイタルに影響を与える高度による気圧の変化を有効化します。\n無効化すると、高高度での酸欠症状が発生しなくなります。 + + + Use ACE barometric pressure + ACEの大気圧を使用 + + + Use ACE calculation instead of KAM simplified calculation for barometric pressure value. (Require ACE Weather) + 気圧の値にKAMによる簡易化された計算ではなく、ACEによる計算を使用します。 (ACE Weather 天候システム が必要です) + %1 - %2 %1 - %2 diff --git a/addons/watch/functions/fnc_showKWatch.sqf b/addons/watch/functions/fnc_showKWatch.sqf index 6bd16b723..05e418895 100644 --- a/addons/watch/functions/fnc_showKWatch.sqf +++ b/addons/watch/functions/fnc_showKWatch.sqf @@ -107,10 +107,18 @@ private _timeSeconds = _display displayCtrl 22008; _altitude ctrlSetText ([_altitudeValue, 1, 0] call CBA_fnc_formatNumber); }; - if (GVAR(pressureUnit) == 1) then { - _baro ctrlSetText ([(_altitudeValue call ACEFUNC(weather,calculateBarometricPressure)), 1, 0] call CBA_fnc_formatNumber); + if (EGVAR(vitals,useACEpressure)) then { + if (GVAR(pressureUnit) == 1) then { + _baro ctrlSetText ([(_altitudeValue call ACEFUNC(weather,calculateBarometricPressure)), 1, 0] call CBA_fnc_formatNumber); + } else { + _baro ctrlSetText ([((_altitudeValue call ACEFUNC(weather,calculateBarometricPressure)) * 0.750062), 1, 0] call CBA_fnc_formatNumber); + }; } else { - _baro ctrlSetText ([((_altitudeValue call ACEFUNC(weather,calculateBarometricPressure)) / 1.3), 1, 0] call CBA_fnc_formatNumber); + if (GVAR(pressureUnit) == 1) then { + _baro ctrlSetText ([((760 * exp((-(_altitudeValue)) / 8400))* 1.333), 1, 0] call CBA_fnc_formatNumber); + } else { + _baro ctrlSetText ([(760 * exp((-(_altitudeValue)) / 8400)), 1, 0] call CBA_fnc_formatNumber); + }; }; if (GVAR(temperatureUnit) == 1) then {