ACE3/addons/medical_feedback/functions/fnc_initEffects.sqf

126 lines
3.3 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2016-12-01 19:54:03 +00:00
/*
* Author: BaerMitUmlaut
* Initializes visual effects of medical.
*
* Arguments:
* 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
*/
params [["_updateOnly", false]];
TRACE_1("initEffects",_updateOnly);
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 ---------------------------------------------------------------------
if (!isNil QGVAR(ppPain)) then {
TRACE_1("delete pain",GVAR(ppPain));
if (GVAR(ppPain) != -1) then { ppEffectDestroy GVAR(ppPain); };
};
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;
};
default { GVAR(ppPain) = -1; };
};
// 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;
};
TRACE_1("created pain",GVAR(ppPain));
// - 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 {};
// - Unconscious --------------------------------------------------------------
GVAR(ppUnconsciousBlur) = [
"DynamicBlur",
814, // 135xx does not work
[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",
815, // 135xx does not work
2016-12-01 19:54:03 +00:00
[0]
] call _fnc_createEffect;