From 7439410542db13c6732d5cc198e9746edf4e6861 Mon Sep 17 00:00:00 2001 From: "theastropath@gmail.com" Date: Sun, 10 Mar 2024 20:03:52 -0400 Subject: [PATCH] Fix various Crowd Control issues (Resident Evil Mode persistence after saving/loading, the RE Camera glowing, the RE Camera existing after the effect ends) --- DXRando/DeusEx/Classes/CCResidentEvilCam.uc | 20 ++++++++++++ .../Classes/DXRandoCrowdControlEffects.uc | 32 ++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/DXRando/DeusEx/Classes/CCResidentEvilCam.uc b/DXRando/DeusEx/Classes/CCResidentEvilCam.uc index 9d4b99afa..22dee2c5c 100644 --- a/DXRando/DeusEx/Classes/CCResidentEvilCam.uc +++ b/DXRando/DeusEx/Classes/CCResidentEvilCam.uc @@ -84,6 +84,10 @@ function Tick(float deltaTime) return; } + if (p.ViewTarget!=Self){ + Destroy(); //Self destruct + } + cameraMoveTimer+=deltaTime; curTarget = None; @@ -163,6 +167,17 @@ function CheckPlayerVisibility(DeusExPlayer player) } } +function TriggerEvent(bool bTrigger) +{ +} + +function Trigger(Actor Other, Pawn Instigator) +{ +} + +function UnTrigger(Actor Other, Pawn Instigator) +{ +} defaultproperties { @@ -186,4 +201,9 @@ defaultproperties cameraRange=750 RotationRate=(Pitch=40000,Yaw=40000) AmbientSound=None + LightType=LT_None + LightBrightness=0 + LightHue=0 + LightSaturation=0 + LightRadius=0 } diff --git a/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc b/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc index 9a1d1d2b0..d73703191 100644 --- a/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc +++ b/DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc @@ -72,7 +72,7 @@ var DXRandoCrowdControlPawn CrowdControlPawns[3]; var transient AugEffectState AugEffectStates[32]; //Vanilla has a 25 array, but in case mods bump it up? var transient bool AugEffectStatesInit; -var transient CCResidentEvilCam reCam; +var CCResidentEvilCam reCam; var transient bool HaveFlamethrower; var transient bool FlamethrowerInit; @@ -485,6 +485,27 @@ function InitOnEnter() { } else { player().shaketimer=0; } + + if (isTimerActive('cc_ResidentEvil')) { + if (reCam==None){ + SpawnRECam(); + } + if (player().ViewTarget==None){ + player().ViewTarget=reCam; + player().bCrosshairVisible=False; + } + + player().bCrosshairVisible=False; + } else { + player().ViewTarget=None; + player().bCrosshairVisible=True; + if (reCam==None){ + foreach AllActors(class'CCResidentEvilCam',reCam){ + reCam.Destroy(); + } + } + } + } //Effects should revert to default before exiting a level @@ -1401,6 +1422,7 @@ function int TriggerAllAlarms(String viewer) { local int numAlarms; local AlarmUnit au; local SecurityCamera sc; + local LaserTrigger lt; numAlarms = 0; @@ -1409,11 +1431,19 @@ function int TriggerAllAlarms(String viewer) { au.Trigger(self,player()); } foreach AllActors(class'SecurityCamera',sc){ + if (CCResidentEvilCam(sc)!=None){ continue; } //Skip Resident Evil cameras numAlarms+=1; sc.TriggerEvent(True); sc.bPlayerSeen=True; sc.lastSeenTimer=0; } + foreach AllActors(class'LaserTrigger',lt){ + if (lt.bIsOn==False){continue;} + if (lt.bNoAlarm){continue;} + if (lt.AmbientSound!=None){continue;} + numAlarms+=1; + lt.BeginAlarm(); + } if (numAlarms==0){ return TempFail;