mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Converted a couple PFHs to use the waitAndExecute function as that is what they were doing.
Fixed a couple bugs.
This commit is contained in:
parent
ef19ffad0c
commit
2fe155f990
@ -37,7 +37,7 @@ GVAR(PostProcessEyes) ppEffectEnable false;
|
|||||||
GVAR(EffectsActive) = false;
|
GVAR(EffectsActive) = false;
|
||||||
SETGLASSES(ace_player,GLASSESDEFAULT);
|
SETGLASSES(ace_player,GLASSESDEFAULT);
|
||||||
GVAR(Current) = "None";
|
GVAR(Current) = "None";
|
||||||
GVAR(EyesDamageScript) = 0 spawn {};
|
GVAR(EyesDamageScript) = -1;
|
||||||
GVAR(FrameEvent) = [false, [false,20]];
|
GVAR(FrameEvent) = [false, [false,20]];
|
||||||
GVAR(PostProcessEyes_Enabled) = false;
|
GVAR(PostProcessEyes_Enabled) = false;
|
||||||
GVAR(DustHandler) = -1;
|
GVAR(DustHandler) = -1;
|
||||||
@ -77,9 +77,13 @@ player addEventHandler ["Killed",{
|
|||||||
call FUNC(removeGlassesEffect);
|
call FUNC(removeGlassesEffect);
|
||||||
GVAR(EffectsActive)=false;
|
GVAR(EffectsActive)=false;
|
||||||
ace_player setVariable ["ACE_EyesDamaged", false];
|
ace_player setVariable ["ACE_EyesDamaged", false];
|
||||||
terminate GVAR(EyesDamageScript);
|
if (GVAR(EyesDamageScript) != -1) then {
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
|
||||||
GVAR(DustHandler) = -1;
|
};
|
||||||
|
if (GVAR(DustHandler) != -1) then {
|
||||||
|
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
|
};
|
||||||
}];
|
}];
|
||||||
player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
|
player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}];
|
||||||
player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
|
player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
|
||||||
@ -99,20 +103,21 @@ player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
|
|||||||
["GlassesCracked",{
|
["GlassesCracked",{
|
||||||
if (_this select 0 != ace_player) exitWith {};
|
if (_this select 0 != ace_player) exitWith {};
|
||||||
ace_player setVariable ["ACE_EyesDamaged", true];
|
ace_player setVariable ["ACE_EyesDamaged", true];
|
||||||
if !(scriptDone GVAR(EyesDamageScript)) then {
|
if (GVAR(EyesDamageScript) != -1) then {
|
||||||
terminate GVAR(EyesDamageScript);
|
[GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler);
|
||||||
};
|
};
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
|
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 0;
|
GVAR(PostProcessEyes) ppEffectCommit 0;
|
||||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||||
GVAR(EyesDamageScript) = [] spawn {
|
GVAR(EyesDamageScript) = [{
|
||||||
sleep 25;
|
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 5;
|
GVAR(PostProcessEyes) ppEffectCommit 5;
|
||||||
sleep 5;
|
GVAR(EyesDamageScript) = [{
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||||
ace_player setVariable ["ACE_EyesDamaged", false];
|
ace_player setVariable ["ACE_EyesDamaged", false];
|
||||||
};
|
GVAR(EyesDamageScript) = -1;
|
||||||
|
}, [], 5, 1] call EFUNC(common,waitAndExecute);
|
||||||
|
}, [], 25, 5] call EFUNC(common,waitAndExecute);
|
||||||
}] call EFUNC(common,addEventHandler);
|
}] call EFUNC(common,addEventHandler);
|
||||||
call FUNC(checkGlasses);
|
call FUNC(checkGlasses);
|
||||||
[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler;
|
[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
@ -33,10 +33,12 @@ _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
|||||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 1;
|
GVAR(PostProcessEyes) ppEffectCommit 1;
|
||||||
GVAR(PostProcessEyes) ppEffectEnable true;
|
GVAR(PostProcessEyes) ppEffectEnable true;
|
||||||
|
SETDUST(DBULLETS,0);
|
||||||
|
|
||||||
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
};
|
};
|
||||||
SETDUST(DBULLETS,0);
|
|
||||||
GVAR(DustHandler) = [{
|
GVAR(DustHandler) = [{
|
||||||
if (diag_tickTime >= GETDUSTT(DTIME) + 3) then {
|
if (diag_tickTime >= GETDUSTT(DTIME) + 3) then {
|
||||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
||||||
@ -49,12 +51,7 @@ GVAR(DustHandler) = [{
|
|||||||
if (GETDUSTT(DAMOUNT) <= 0) then {
|
if (GETDUSTT(DAMOUNT) <= 0) then {
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 2;
|
GVAR(PostProcessEyes) ppEffectCommit 2;
|
||||||
[{
|
[{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute);
|
||||||
if (diag_tickTime >= ((_this select 0) select 0)) then {
|
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
|
||||||
[(_this select 1)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
|
||||||
};
|
|
||||||
},0.5,[diag_tickTime+2]] call CALLSTACK(cba_fnc_addPerFrameHandler);
|
|
||||||
SETDUST(DACTIVE,false);
|
SETDUST(DACTIVE,false);
|
||||||
SETDUST(DBULLETS,0);
|
SETDUST(DBULLETS,0);
|
||||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
|
@ -27,13 +27,11 @@ SETGLASSES(ace_player,_effects);
|
|||||||
if ((stance ace_player) != "PRONE") then {
|
if ((stance ace_player) != "PRONE") then {
|
||||||
ace_player playActionNow "gestureWipeFace";
|
ace_player playActionNow "gestureWipeFace";
|
||||||
};
|
};
|
||||||
|
[{
|
||||||
null = [] spawn {
|
|
||||||
sleep 0.3;
|
|
||||||
if (cameraView == "INTERNAL") then {
|
if (cameraView == "INTERNAL") then {
|
||||||
addCamShake [5, 1.75, 2];
|
addCamShake [5, 1.75, 2];
|
||||||
};
|
};
|
||||||
};
|
}, [], 0.3, 0] call EFUNC(common,waitAndExecute);
|
||||||
|
|
||||||
call FUNC(removeDirtEffect);
|
call FUNC(removeDirtEffect);
|
||||||
call FUNC(removeRainEffect);
|
call FUNC(removeRainEffect);
|
||||||
|
@ -18,11 +18,13 @@
|
|||||||
See http://community.bistudio.com/wiki/ArmA_3:_Event_Handlers#Fired
|
See http://community.bistudio.com/wiki/ArmA_3:_Event_Handlers#Fired
|
||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType"];
|
private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType", "_unit"];
|
||||||
_weapon = _this select 1;
|
EXPLODE_2_PVT(_this,_unit,_weapon);
|
||||||
|
if (_unit != ace_player) exitWith {true};
|
||||||
_cloudType = "";
|
_cloudType = "";
|
||||||
|
|
||||||
if ((_this select 0) != ace_player) exitWith {true};
|
if (rain > 0.1) exitWith {true};
|
||||||
|
if ((stance _unit) != "PRONE") exitWith {true};
|
||||||
|
|
||||||
if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then {
|
if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then {
|
||||||
_cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName");
|
_cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName");
|
||||||
@ -33,10 +35,8 @@ if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEff
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (_cloudType == "") exitWith {true};
|
if (_cloudType == "") exitWith {true};
|
||||||
if (rain > 0.1) exitWith {true};
|
|
||||||
if ((stance ace_player) != "PRONE") exitWith {true};
|
|
||||||
|
|
||||||
_position = getPosATL ace_player;
|
_position = getPosATL _unit;
|
||||||
|
|
||||||
if (surfaceIsWater _position) exitWith {};
|
if (surfaceIsWater _position) exitWith {};
|
||||||
if ((_position select 2) > 0.2) exitWith {};
|
if ((_position select 2) > 0.2) exitWith {};
|
||||||
|
@ -28,15 +28,16 @@ _safe = false;
|
|||||||
if !(_rotorWash select 0) exitWith {
|
if !(_rotorWash select 0) exitWith {
|
||||||
if (GVAR(PostProcessEyes_Enabled)) then {
|
if (GVAR(PostProcessEyes_Enabled)) then {
|
||||||
GVAR(PostProcessEyes_Enabled) = false;
|
GVAR(PostProcessEyes_Enabled) = false;
|
||||||
if (!scriptDone (GVAR(DustHandler))) then {
|
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
||||||
terminate GVAR(DustHandler);
|
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
};
|
};
|
||||||
GVAR(DustHandler) = [] spawn {
|
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
||||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
GVAR(PostProcessEyes) ppEffectCommit 2;
|
||||||
GVAR(PostProcessEyes) ppEffectCommit 2;
|
GVAR(DustHandler) = [{
|
||||||
sleep 2;
|
|
||||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||||
};
|
GVAR(DustHandler) = -1;
|
||||||
|
}, [], 2, 0.5] call EFUNC(common,waitAndExecute);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
if ((headgear ace_player) != "") then {
|
if ((headgear ace_player) != "") then {
|
||||||
@ -66,8 +67,9 @@ if ((_rotorWash select 1) <= 15) then {
|
|||||||
_scale = 0.1;
|
_scale = 0.1;
|
||||||
};
|
};
|
||||||
_scale = 1 - _scale;
|
_scale = 1 - _scale;
|
||||||
if (!scriptDone (GVAR(DustHandler))) then {
|
if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
||||||
terminate GVAR(DustHandler);
|
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||||
|
GVAR(DustHandler) = -1;
|
||||||
};
|
};
|
||||||
if !(ace_player getVariable ["ACE_EyesDamaged", false]) then {
|
if !(ace_player getVariable ["ACE_EyesDamaged", false]) then {
|
||||||
GVAR(PostProcessEyes_Enabled) = true;
|
GVAR(PostProcessEyes_Enabled) = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user