mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Glasses conditions are local to each unit. No longer global scope on each client.
This commit is contained in:
parent
b499cc9a1d
commit
ef19ffad0c
@ -35,7 +35,7 @@ GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 0;
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
GVAR(EffectsActive) = false;
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
SETGLASSES(ace_player,GLASSESDEFAULT);
|
||||
GVAR(Current) = "None";
|
||||
GVAR(EyesDamageScript) = 0 spawn {};
|
||||
GVAR(FrameEvent) = [false, [false,20]];
|
||||
@ -58,7 +58,9 @@ player addEventHandler ["Explosion", {
|
||||
if (GETBROKEN) exitWith {};
|
||||
if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {};
|
||||
if !(ace_player call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);};
|
||||
GVAR(Effects) set [BROKEN, true];
|
||||
_effects = GETGLASSES(ace_player,GLASSESDEFAULT);
|
||||
_effects set [BROKEN, true];
|
||||
SETGLASSES(ace_player,_effects);
|
||||
if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then {
|
||||
if (call FUNC(ExternalCamera)) exitWith {};
|
||||
if (isNull(GLASSDISPLAY)) then {
|
||||
@ -71,7 +73,7 @@ player addEventHandler ["Explosion", {
|
||||
}];
|
||||
player addEventHandler ["Killed",{
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
SETGLASSES(ace_player,GLASSESDEFAULT);
|
||||
call FUNC(removeGlassesEffect);
|
||||
GVAR(EffectsActive)=false;
|
||||
ace_player setVariable ["ACE_EyesDamaged", false];
|
||||
@ -84,7 +86,7 @@ player AddEventHandler ["Take",{call FUNC(checkGlasses);}];
|
||||
player AddEventHandler ["Put", {call FUNC(checkGlasses);}];
|
||||
|
||||
["GlassesChanged",{
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
SETGLASSES(ace_player,GLASSESDEFAULT);
|
||||
|
||||
if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)};
|
||||
|
||||
|
@ -19,7 +19,9 @@
|
||||
|
||||
if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false};
|
||||
private "_dirtImage";
|
||||
GVAR(Effects) set [DIRT, true];
|
||||
_effects = GETGLASSES(ace_player,GLASSESDEFAULT);
|
||||
_effects set [DIRT, true];
|
||||
SETGLASSES(ace_player,_effects);
|
||||
|
||||
if (ace_player call FUNC(isGogglesVisible)) then{
|
||||
_dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt");
|
||||
|
@ -38,7 +38,6 @@ if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA
|
||||
};
|
||||
SETDUST(DBULLETS,0);
|
||||
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";
|
||||
@ -48,7 +47,14 @@ GVAR(DustHandler) = [{
|
||||
GVAR(PostProcessEyes) ppEffectCommit 0.5;
|
||||
};
|
||||
if (GETDUSTT(DAMOUNT) <= 0) then {
|
||||
GVAR(PostProcessEyes) ppEffectEnable false;
|
||||
GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
|
||||
GVAR(PostProcessEyes) ppEffectCommit 2;
|
||||
[{
|
||||
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(DBULLETS,0);
|
||||
[GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler);
|
||||
|
@ -20,8 +20,9 @@
|
||||
|
||||
private "_broken";
|
||||
_broken = GETBROKEN;
|
||||
GVAR(Effects) = GLASSESDEFAULT;
|
||||
GVAR(Effects) set [BROKEN, _broken];
|
||||
_effects = GLASSESDEFAULT;
|
||||
_effects set [BROKEN, _broken];
|
||||
SETGLASSES(ace_player,_effects);
|
||||
|
||||
if ((stance ace_player) != "PRONE") then {
|
||||
ace_player playActionNow "gestureWipeFace";
|
||||
|
@ -13,16 +13,19 @@
|
||||
|
||||
// MACROS
|
||||
#define GLASSESDEFAULT [false,[false,0,0,0],false]
|
||||
#define GETGLASSES(unit) GETVAR(unit,GVAR(Condition),GLASSESDEFAULT)
|
||||
#define SETGLASSES(unit,value) SETVAR(unit,GVAR(Condition),value)
|
||||
|
||||
#define DIRT 0
|
||||
#define DUST 1
|
||||
#define BROKEN 2
|
||||
|
||||
#define GETDIRT (GVAR(Effects) select DIRT)
|
||||
#define GETDUST (GVAR(Effects) select DUST)
|
||||
#define GETBROKEN (GVAR(Effects) select BROKEN)
|
||||
#define GETDUSTT(type) ((GVAR(Effects) select DUST) select type)
|
||||
#define GETDIRT (GETGLASSES(ace_player) select DIRT)
|
||||
#define GETDUST (GETGLASSES(ace_player) select DUST)
|
||||
#define GETBROKEN (GETGLASSES(ace_player) select BROKEN)
|
||||
#define GETDUSTT(type) ((GETGLASSES(ace_player) select DUST) select type)
|
||||
|
||||
#define SETDUST(type,value) (GVAR(Effects) select DUST) set [type,value]
|
||||
#define SETDUST(type,value) (GETGLASSES(ace_player) select DUST) set [type,value]
|
||||
|
||||
#define DACTIVE 0
|
||||
#define DTIME 1
|
||||
|
Loading…
Reference in New Issue
Block a user