diff --git a/addons/medical_ui/functions/fnc_effectPain.sqf b/addons/medical_ui/functions/fnc_effectPain.sqf index 01f1cf64d9..bafa29f6ba 100644 --- a/addons/medical_ui/functions/fnc_effectPain.sqf +++ b/addons/medical_ui/functions/fnc_effectPain.sqf @@ -17,6 +17,11 @@ if (!_enable) exitWith { }; GVAR(ppPain) ppEffectEnable true; +// Trigger effect every 2s +private _showNextTick = ACE_player getVariable [QGVAR(showPainNextTick), true]; +ACE_player setVariable [QGVAR(showPainNextTick), !_showNextTick]; +if (_showNextTick) exitWith {}; + private _initialAdjust = []; private _delayedAdjust = []; @@ -31,8 +36,8 @@ if (GVAR(painEffectType) == 0) then { }; GVAR(ppPain) ppEffectAdjust _initialAdjust; -GVAR(ppPain) ppEffectCommit 0.2; +GVAR(ppPain) ppEffectCommit FX_PAIN_FADE_IN; [{ GVAR(ppPain) ppEffectAdjust _this; - GVAR(ppPain) ppEffectCommit 0.5; -}, _delayedAdjust, 0.2] call CBA_fnc_waitAndExecute; + GVAR(ppPain) ppEffectCommit FX_PAIN_FADE_OUT; +}, _delayedAdjust, FX_PAIN_FADE_IN] call CBA_fnc_waitAndExecute; diff --git a/addons/medical_ui/functions/fnc_handleEffects.sqf b/addons/medical_ui/functions/fnc_handleEffects.sqf index 16d341285b..5a7db9077b 100644 --- a/addons/medical_ui/functions/fnc_handleEffects.sqf +++ b/addons/medical_ui/functions/fnc_handleEffects.sqf @@ -27,7 +27,10 @@ private _pain = ACE_player getVariable [QEGVAR(medical,pain), 0]; // - Visual effects ----------------------------------------------------------- [_unconscious, _unconscious] call FUNC(effectUnconscious); -[true, _pain] call FUNC(effectPain); [ true, linearConversion [BLOOD_VOLUME_CLASS_2_HEMORRHAGE, BLOOD_VOLUME_CLASS_4_HEMORRHAGE, _bloodVolume, 0, 1, true] ] call FUNC(effectBloodVolume); + +if (!_unconscious) then { + [true, _pain] call FUNC(effectPain); +}; diff --git a/addons/medical_ui/script_component.hpp b/addons/medical_ui/script_component.hpp index b95b81ce46..8c863998b1 100644 --- a/addons/medical_ui/script_component.hpp +++ b/addons/medical_ui/script_component.hpp @@ -17,3 +17,5 @@ #include "\z\ace\addons\main\script_macros.hpp" #include "\z\ace\addons\medical\script_macros_medical.hpp" +#define FX_PAIN_FADE_IN 0.3 +#define FX_PAIN_FADE_OUT 0.7