2018-07-30 09:22:14 +00:00
|
|
|
#include "script_component.hpp"
|
2016-12-01 19:54:03 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Initializes visual effects of medical.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2020-02-22 20:42:59 +00:00
|
|
|
* 0: Update pain and low blood volume effects only <BOOL>
|
2016-12-01 19:54:03 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
2019-03-30 16:07:54 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [false] call ace_medical_feedback_fnc_initEffects
|
|
|
|
*
|
|
|
|
* Public: No
|
2016-12-01 19:54:03 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-22 20:42:59 +00:00
|
|
|
params [["_updateOnly", false]];
|
2017-02-19 04:11:40 +00:00
|
|
|
|
2020-02-22 20:42:59 +00:00
|
|
|
TRACE_1("initEffects",_updateOnly);
|
2017-02-19 04:11:40 +00:00
|
|
|
|
2017-01-29 18:27:43 +00:00
|
|
|
private _fnc_createEffect = {
|
2016-12-01 19:54:03 +00:00
|
|
|
params ["_type", "_layer", "_default"];
|
|
|
|
|
|
|
|
private _effect = ppEffectCreate [_type, _layer];
|
|
|
|
_effect ppEffectForceInNVG true;
|
|
|
|
_effect ppEffectAdjust _default;
|
|
|
|
_effect ppEffectCommit 0;
|
|
|
|
|
|
|
|
_effect
|
|
|
|
};
|
|
|
|
|
|
|
|
// - Pain ---------------------------------------------------------------------
|
2017-02-19 04:11:40 +00:00
|
|
|
if (!isNil QGVAR(ppPain)) then {
|
|
|
|
TRACE_1("delete pain",GVAR(ppPain));
|
2021-10-17 02:13:40 +00:00
|
|
|
if (GVAR(ppPain) != -1) then { ppEffectDestroy GVAR(ppPain); };
|
2017-02-19 04:11:40 +00:00
|
|
|
};
|
2019-10-11 20:00:53 +00:00
|
|
|
switch (GVAR(painEffectType)) do {
|
|
|
|
case FX_PAIN_WHITE_FLASH: {
|
|
|
|
GVAR(ppPain) = [
|
|
|
|
"ColorCorrections",
|
|
|
|
13502,
|
|
|
|
[1, 1, 0, [1, 1, 1, 0], [1, 1, 1, 1], [0.33, 0.33, 0.33, 0], [0.55, 0.5, 0, 0, 0, 0, 4]]
|
|
|
|
] call _fnc_createEffect;
|
|
|
|
};
|
|
|
|
case FX_PAIN_PULSATING_BLUR: {
|
|
|
|
GVAR(ppPain) = [
|
|
|
|
"RadialBlur", // "Will not do anything if RADIAL BLUR is disabled in Video Options."
|
|
|
|
13502,
|
|
|
|
[0, 0, 0.25, 0.25]
|
|
|
|
] call _fnc_createEffect;
|
|
|
|
};
|
|
|
|
case FX_PAIN_CHROMATIC_ABERRATION: {
|
|
|
|
GVAR(ppPain) = [
|
|
|
|
"ChromAberration",
|
|
|
|
13502,
|
|
|
|
[0, 0, false]
|
|
|
|
] call _fnc_createEffect;
|
|
|
|
};
|
2021-10-17 02:13:40 +00:00
|
|
|
default { GVAR(ppPain) = -1; };
|
2019-10-11 20:00:53 +00:00
|
|
|
};
|
|
|
|
// Base blur on high pain
|
|
|
|
if (isNil QGVAR(ppPainBlur)) then {
|
|
|
|
GVAR(ppPainBlur) = [
|
|
|
|
"DynamicBlur",
|
|
|
|
813, // 135xx does not work
|
|
|
|
[0]
|
2016-12-01 19:54:03 +00:00
|
|
|
] call _fnc_createEffect;
|
|
|
|
};
|
2017-02-19 04:11:40 +00:00
|
|
|
|
2019-10-11 20:00:53 +00:00
|
|
|
TRACE_1("created pain",GVAR(ppPain));
|
2020-02-22 20:42:59 +00:00
|
|
|
|
|
|
|
// - Blood volume -------------------------------------------------------------
|
|
|
|
private _ppBloodVolumeSettings = [
|
|
|
|
"ColorCorrections",
|
|
|
|
13503,
|
|
|
|
[1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [0.2, 0.2, 0.2, 0]]
|
|
|
|
];
|
|
|
|
GVAR(showBloodVolumeIcon) = false;
|
|
|
|
|
|
|
|
if (!isNil QGVAR(ppBloodVolume)) then {
|
|
|
|
TRACE_1("delete blood volume",GVAR(ppBloodVolume));
|
|
|
|
ppEffectDestroy GVAR(ppBloodVolume);
|
|
|
|
GVAR(ppBloodVolume) = nil;
|
|
|
|
};
|
|
|
|
switch (GVAR(bloodVolumeEffectType)) do {
|
|
|
|
case FX_BLOODVOLUME_COLOR_CORRECTION: {
|
|
|
|
GVAR(ppBloodVolume) = _ppBloodVolumeSettings call _fnc_createEffect;
|
|
|
|
};
|
|
|
|
case FX_BLOODVOLUME_ICON: {
|
|
|
|
GVAR(showBloodVolumeIcon) = true;
|
|
|
|
};
|
|
|
|
case FX_BLOODVOLUME_BOTH: {
|
|
|
|
GVAR(showBloodVolumeIcon) = true;
|
|
|
|
GVAR(ppBloodVolume) = _ppBloodVolumeSettings call _fnc_createEffect;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
if (_updateOnly) exitWith {};
|
2017-02-19 04:11:40 +00:00
|
|
|
|
|
|
|
// - Unconscious --------------------------------------------------------------
|
|
|
|
GVAR(ppUnconsciousBlur) = [
|
|
|
|
"DynamicBlur",
|
2019-10-11 20:00:53 +00:00
|
|
|
814, // 135xx does not work
|
2017-02-19 04:11:40 +00:00
|
|
|
[0]
|
|
|
|
] call _fnc_createEffect;
|
|
|
|
|
|
|
|
GVAR(ppUnconsciousBlackout) = [
|
|
|
|
"ColorCorrections",
|
|
|
|
13500,
|
|
|
|
[1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]
|
|
|
|
] call _fnc_createEffect;
|
|
|
|
|
2016-12-01 19:54:03 +00:00
|
|
|
// - Incapacitation -----------------------------------------------------------
|
|
|
|
GVAR(ppIncapacitationGlare) = [
|
|
|
|
"ColorCorrections",
|
|
|
|
13504,
|
|
|
|
[1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [0, 0, 0, 0]]
|
|
|
|
] call _fnc_createEffect;
|
|
|
|
|
|
|
|
GVAR(ppIncapacitationBlur) = [
|
|
|
|
"DynamicBlur",
|
2019-10-11 20:00:53 +00:00
|
|
|
815, // 135xx does not work
|
2016-12-01 19:54:03 +00:00
|
|
|
[0]
|
|
|
|
] call _fnc_createEffect;
|