Skip to content

Commit

Permalink
Fix various Crowd Control issues (Resident Evil Mode persistence after
Browse files Browse the repository at this point in the history
saving/loading, the RE Camera glowing, the RE Camera existing after the
effect ends)
  • Loading branch information
theastropath committed Mar 11, 2024
1 parent 168390f commit 7439410
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
20 changes: 20 additions & 0 deletions DXRando/DeusEx/Classes/CCResidentEvilCam.uc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ function Tick(float deltaTime)
return;
}

if (p.ViewTarget!=Self){
Destroy(); //Self destruct
}

cameraMoveTimer+=deltaTime;

curTarget = None;
Expand Down Expand Up @@ -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
{
Expand All @@ -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
}
32 changes: 31 additions & 1 deletion DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1401,6 +1422,7 @@ function int TriggerAllAlarms(String viewer) {
local int numAlarms;
local AlarmUnit au;
local SecurityCamera sc;
local LaserTrigger lt;

numAlarms = 0;

Expand All @@ -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;
Expand Down

0 comments on commit 7439410

Please sign in to comment.