2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-01-18 21:50:45 +00:00
|
|
|
Name: fnc_applyDust.sqf
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Author: Garth de Wet (LH)
|
2015-01-18 21:50:45 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Description:
|
|
|
|
Applies dust to screen.
|
2015-01-18 21:50:45 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Parameters:
|
|
|
|
Nothing
|
2015-01-18 21:50:45 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Returns:
|
|
|
|
Nothing
|
2015-01-18 21:50:45 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
Example 1:
|
2015-01-18 21:50:45 +00:00
|
|
|
call FUNC(ApplyDust);
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-18 21:50:45 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
if (call FUNC(ExternalCamera)) exitWith {};
|
|
|
|
if (ace_player call FUNC(isGogglesVisible)) exitWith {
|
2015-01-18 19:43:51 +00:00
|
|
|
100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false];
|
2015-01-18 21:50:45 +00:00
|
|
|
(uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1];
|
2015-01-11 16:42:31 +00:00
|
|
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1));
|
|
|
|
SETDUST(DBULLETS,0);
|
|
|
|
};
|
|
|
|
|
2015-01-18 21:50:45 +00:00
|
|
|
if (GETVAR(ace_player,ACE_EyesDamaged,false)) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);};
|
2015-01-11 16:42:31 +00:00
|
|
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,2));
|
|
|
|
|
|
|
|
private "_amount";
|
|
|
|
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
|
|
|
|
2015-01-18 21:50:45 +00:00
|
|
|
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
|
|
|
GVAR(PostProcessEyes) ppEffectCommit 1;
|
|
|
|
GVAR(PostProcessEyes) ppEffectEnable true;
|
2015-01-18 22:57:39 +00:00
|
|
|
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
|
|
|
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
SETDUST(DBULLETS,0);
|
2015-01-18 22:57:39 +00:00
|
|
|
GVAR(DustHandler) = [{
|
|
|
|
EXPLODE_2_PVT(_this select 0,_sleep,_startTime);
|
|
|
|
if (diag_tickTime >= GETDUSTT(DTIME) + 3) then {
|
|
|
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
|
|
|
private "_amount";
|
|
|
|
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
|
|
|
if !(ace_player getVariable ["ACE_EyesDamaged", false]) then {
|
|
|
|
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
|
|
|
GVAR(PostProcessEyes) ppEffectCommit 0.5;
|
|
|
|
};
|
|
|
|
if (GETDUSTT(DAMOUNT) <= 0) then {
|
|
|
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
|
|
|
SETDUST(DACTIVE,false);
|
|
|
|
SETDUST(DBULLETS,0);
|
|
|
|
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
|
|
|
GVAR(DustHandler) = -1;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
};
|
2015-01-18 22:57:39 +00:00
|
|
|
},0,[]] call CALLSTACK(cba_fnc_addPerFrameHandler);
|