Files
DayZ-Epoch/SQF/dayz_code/actions/apsiState.sqf
worldwidesorrow 3bb6b94185 Add Nightstalker EVR storms
Includes manual on/off for APSI and localized strings.
2022-04-21 02:00:25 -05:00

43 lines
1.2 KiB
Plaintext

/*
This function simulates turning "ItemAPSI_DZE" on and off to protect against EVR storms.
Players need to have post-processing effects enabled in order to see the film grain effects.
*/
// Create the particle effect
if (isNil "DZE_APSI_SFX") then {
DZE_APSI_SFX = ppEffectCreate ["filmGrain", 2001];
DZE_APSI_SFX ppEffectAdjust [0.15, 1, 1, 0.1, 1, false];
DZE_APSI_SFX ppEffectCommit 0;
};
closeDialog 0;
if (player getVariable["APSIState",false]) then {
player setVariable["APSIState",false];
playSound "ns_apsi_off";
DZE_APSI_SFX ppEffectEnable false;
cutRsc ["RscAPSI_Off","PLAIN"];
} else {
player setVariable["APSIState",true];
playSound "ns_apsi_on";
DZE_APSI_SFX ppEffectEnable true;
cutRsc ["RscAPSI_On","PLAIN"];
// monitor the player's inventory and turn the effect off if the APSI is removed.
[] spawn {
while {true} do {
uiSleep 1;
if !(player getVariable["APSIState",false]) exitWith {
//diag_log "Player has turned the APSI off";
};
if !(player hasWeapon "ItemAPSI_DZE") exitWith {
DZE_APSI_SFX ppEffectEnable false;
playSound "ns_apsi_off";
player setVariable["APSIState",false];
//diag_log "Player has removed the APSI from inventory";
};
};
};
};