mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-19 18:06:32 +03:00
Add Nightstalker EVR storms
Includes manual on/off for APSI and localized strings.
This commit is contained in:
42
SQF/dayz_code/actions/apsiState.sqf
Normal file
42
SQF/dayz_code/actions/apsiState.sqf
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user