From 8bf81c4e3d7fc16588d57a210656bbe2925af7ed Mon Sep 17 00:00:00 2001 From: Mei Date: Sat, 27 Aug 2022 09:16:49 -0400 Subject: [PATCH] Door fixes Door messages are worded a bit better and locked keypads don't show the keypad screen anymore --- Data/local.ini | 12 +- SourceCode/GUI.bb | 446 ++++++++++++++++--------------- SourceCode/Rooms/Testroom_860.bb | 4 + 3 files changed, 240 insertions(+), 222 deletions(-) diff --git a/Data/local.ini b/Data/local.ini index 695eee5..5a14dc7 100644 --- a/Data/local.ini +++ b/Data/local.ini @@ -286,13 +286,15 @@ esoteric=Esoteric [Doors] door_nothing=You pushed the button but nothing happened. +door_nothing_keypad=You tried to use the keypad but it does not work. door_locked=The door appears to be locked. -keycard_inserted=The keycard was inserted into the slot. -keycard_nothing=The keycard was inserted into the slot but nothing happened. +keycard_inserted=You inserted the keycard into the slot and the door opened. +keycard_nothing=You inserted the keycard into the slot but nothing happened. keycard_required=A keycard is required to operate this door. keycard_required2=A keycard with security clearance %s or higher is required to operate this door. keypad_denied=Access denied -scanner_granted=You place the palm of the hand onto the scanner. The scanner reads: "DNA verified. Access granted." +keypad_granted=You entered in the code on the keypad and the door opened. +scanner_granted=You placed the palm of the hand onto the scanner. The scanner reads: "DNA verified. Access granted." scanner_denied=You placed your palm onto the scanner. The scanner reads: "DNA does not match known sample. Access denied." elevator_called=You called the elevator. elevator_called2=You already called the elevator. @@ -367,7 +369,9 @@ cont_1162_1=You feel a sudden overwhelming pain in your chest. cont_1162_2=You notice something moving in your pockets and a sudden pain in your chest. cont_1162_death=%s was discovered within the containment chamber of SCP-1162. An autopsy revealed that his right lung was missing, which suggests interaction with SCP-1162. tesla_death=%s killed by the Tesla gate at [REDACTED]. -testroom_860_1=The door will not budge. +testroom_860_1=The door is locked. +testroom_860_1_open=You used SCP-860 to unlock the door taking you to a forest. +testroom_860_1_close=You opened the door leading out of SCP-860-1 showing you the other side of the room. pd_death_1=In addition to the decomposed appearance typical of SCP-106's victims, the body exhibits injuries that have not been observed before: massive skull fracture, three broken ribs, fractured shoulder and multiple heavy lacerations. pd_death_2=In addition to the decomposed appearance typical of the victims of SCP-106, the subject seems to have suffered multiple heavy fractures to both of his legs. fuse_placed=You placed the fuse into the fuse box. diff --git a/SourceCode/GUI.bb b/SourceCode/GUI.bb index de1f430..4d9ecf7 100644 --- a/SourceCode/GUI.bb +++ b/SourceCode/GUI.bb @@ -145,242 +145,252 @@ Function UpdateGUI() SelectedItem = Null If shouldDrawHUD Then - HideEntity g_I\GunPivot - If d_I\SelectedDoor\dir<>5 Then - pvt = CreatePivot() - PositionEntity pvt, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True),EntityZ(d_I\ClosestButton,True) - RotateEntity pvt, 0, EntityYaw(d_I\ClosestButton,True)-180,0 - MoveEntity pvt, 0,0,0.22 - PositionEntity Camera, EntityX(pvt),EntityY(pvt),EntityZ(pvt) - PointEntity Camera, d_I\ClosestButton - pvt = FreeEntity_Strict(pvt) - - CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)+MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) - projY# = ProjectedY() - CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)-MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) - scale# = (ProjectedY()-projY)/462.0 - - x = opt\GraphicWidth/2-ImageWidth(KeypadHUD)*scale/2 - y = opt\GraphicHeight/2-ImageHeight(KeypadHUD)*scale/2 - - If KeypadMSG <> "" Then - KeypadTimer = KeypadTimer-FPSfactor2 + If d_I\SelectedDoor\Locked Then + d_I\SelectedDoor = Null + SelectedItem = Null + PlaySound_Strict ScannerSFX2 + Msg = GetLocalString("Doors", "door_nothing_keypad") + MsgTimer = 70 * 5 + Else + HideEntity g_I\GunPivot + If d_I\SelectedDoor\dir<>5 Then + pvt = CreatePivot() + PositionEntity pvt, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True),EntityZ(d_I\ClosestButton,True) + RotateEntity pvt, 0, EntityYaw(d_I\ClosestButton,True)-180,0 + MoveEntity pvt, 0,0,0.22 + PositionEntity Camera, EntityX(pvt),EntityY(pvt),EntityZ(pvt) + PointEntity Camera, d_I\ClosestButton + pvt = FreeEntity_Strict(pvt) - If KeypadTimer =<0 Then - KeypadMSG = "" - d_I\SelectedDoor = Null - MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 - EndIf - EndIf - - x = x+44*scale - y = y+249*scale - - For n = 0 To 3 - For i = 0 To 2 - xtemp = x+Int(58.5*scale*n) - ytemp = y+(67*scale)*i + CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)+MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) + projY# = ProjectedY() + CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)-MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) + scale# = (ProjectedY()-projY)/462.0 + + x = opt\GraphicWidth/2-ImageWidth(KeypadHUD)*scale/2 + y = opt\GraphicHeight/2-ImageHeight(KeypadHUD)*scale/2 + + If KeypadMSG <> "" Then + KeypadTimer = KeypadTimer-FPSfactor2 - temp = False - If MouseOn(xtemp,ytemp, 54*scale,65*scale) And KeypadMSG = "" Then - If MouseUp1 Then - PlaySound_Strict ButtonSFX - - Select (n+1)+(i*4) - Case 1,2,3 - KeypadInput=KeypadInput + ((n+1)+(i*4)) - Case 4 - KeypadInput=KeypadInput + "0" - Case 5,6,7 - KeypadInput=KeypadInput + ((n+1)+(i*4)-1) - Case 8 ;enter - If KeypadInput = d_I\SelectedDoor\Code Then - PlaySound_Strict ScannerSFX1 - - If d_I\SelectedDoor\Code = Str(AccessCode) Then - GiveAchievement(AchvMaynard) - ElseIf d_I\SelectedDoor\Code = "7816" - GiveAchievement(AchvHarp) - EndIf - - d_I\SelectedDoor\locked = 0 - UseDoor(d_I\SelectedDoor,True) - d_I\SelectedDoor = Null - MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 - Else - PlaySound_Strict ScannerSFX2 - KeypadMSG = Upper(GetLocalString("Doors", "keypad_denied")) - KeypadTimer = 210 - KeypadInput = "" - EndIf - Case 9,10,11 - KeypadInput=KeypadInput + ((n+1)+(i*4)-2) - Case 12 - KeypadInput = "" - End Select + If KeypadTimer =<0 Then + KeypadMSG = "" + d_I\SelectedDoor = Null + MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 + EndIf + EndIf + + x = x+44*scale + y = y+249*scale + + For n = 0 To 3 + For i = 0 To 2 + xtemp = x+Int(58.5*scale*n) + ytemp = y+(67*scale)*i + + temp = False + If MouseOn(xtemp,ytemp, 54*scale,65*scale) And KeypadMSG = "" Then + If MouseUp1 Then + PlaySound_Strict ButtonSFX + + Select (n+1)+(i*4) + Case 1,2,3 + KeypadInput=KeypadInput + ((n+1)+(i*4)) + Case 4 + KeypadInput=KeypadInput + "0" + Case 5,6,7 + KeypadInput=KeypadInput + ((n+1)+(i*4)-1) + Case 8 ;enter + If KeypadInput = d_I\SelectedDoor\Code Then + PlaySound_Strict ScannerSFX1 + + If d_I\SelectedDoor\Code = Str(AccessCode) Then + GiveAchievement(AchvMaynard) + ElseIf d_I\SelectedDoor\Code = "7816" + GiveAchievement(AchvHarp) + EndIf + + d_I\SelectedDoor\locked = 0 + UseDoor(d_I\SelectedDoor,True) + d_I\SelectedDoor = Null + Msg = GetLocalString("Doors", "keypad_granted") + MsgTimer = 70 * 5 + MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 + Else + PlaySound_Strict ScannerSFX2 + KeypadMSG = Upper(GetLocalString("Doors", "keypad_denied")) + KeypadTimer = 210 + KeypadInput = "" + EndIf + Case 9,10,11 + KeypadInput=KeypadInput + ((n+1)+(i*4)-2) + Case 12 + KeypadInput = "" + End Select + + If Len(KeypadInput)> 4 Then KeypadInput = Left(KeypadInput,4) + EndIf - If Len(KeypadInput)> 4 Then KeypadInput = Left(KeypadInput,4) + Else + temp = False EndIf - Else - temp = False - EndIf - + Next Next - Next - Else - pvt = CreatePivot() - PositionEntity pvt, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True),EntityZ(d_I\ClosestButton,True) - RotateEntity pvt, 0, EntityYaw(d_I\ClosestButton,True)-180,0 - MoveEntity pvt, 0,0,0.3 - PositionEntity Camera, EntityX(pvt),EntityY(pvt),EntityZ(pvt) - PointEntity Camera, d_I\ClosestButton - pvt = FreeEntity_Strict(pvt) - - CameraZoom Camera,1.0 - - CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)+MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) - projY# = ProjectedY() - CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)-MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) - scale# = (ProjectedY()-projY)/462.0 - - MoveEntity Camera,0.001,0.1672,0 - - x = opt\GraphicWidth/2-ImageWidth(KeypadHUD)*scale/2 - y = opt\GraphicHeight/2-ImageHeight(KeypadHUD)*scale/2 - - If co\Enabled - If co\WaitTimer = 0.0 - If GetDPadButtonPress()=0 - co\KeyPad_CurrButton = co\KeyPad_CurrButton - 1 - PlaySound_Strict co\SelectSFX - co\WaitTimer = FPSfactor2 - If co\KeyPad_CurrButton < 0 - co\KeyPad_CurrButton = 2 - EndIf - ElseIf GetDPadButtonPress()=180 - co\KeyPad_CurrButton = co\KeyPad_CurrButton + 1 - PlaySound_Strict co\SelectSFX - co\WaitTimer = FPSfactor2 - If co\KeyPad_CurrButton > 2 - co\KeyPad_CurrButton = 0 + Else + pvt = CreatePivot() + PositionEntity pvt, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True),EntityZ(d_I\ClosestButton,True) + RotateEntity pvt, 0, EntityYaw(d_I\ClosestButton,True)-180,0 + MoveEntity pvt, 0,0,0.3 + PositionEntity Camera, EntityX(pvt),EntityY(pvt),EntityZ(pvt) + PointEntity Camera, d_I\ClosestButton + pvt = FreeEntity_Strict(pvt) + + CameraZoom Camera,1.0 + + CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)+MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) + projY# = ProjectedY() + CameraProject(Camera, EntityX(d_I\ClosestButton,True),EntityY(d_I\ClosestButton,True)-MeshHeight(d_I\ButtonOBJ[BUTTON_NORMAL])*0.015,EntityZ(d_I\ClosestButton,True)) + scale# = (ProjectedY()-projY)/462.0 + + MoveEntity Camera,0.001,0.1672,0 + + x = opt\GraphicWidth/2-ImageWidth(KeypadHUD)*scale/2 + y = opt\GraphicHeight/2-ImageHeight(KeypadHUD)*scale/2 + + If co\Enabled + If co\WaitTimer = 0.0 + If GetDPadButtonPress()=0 + co\KeyPad_CurrButton = co\KeyPad_CurrButton - 1 + PlaySound_Strict co\SelectSFX + co\WaitTimer = FPSfactor2 + If co\KeyPad_CurrButton < 0 + co\KeyPad_CurrButton = 2 + EndIf + ElseIf GetDPadButtonPress()=180 + co\KeyPad_CurrButton = co\KeyPad_CurrButton + 1 + PlaySound_Strict co\SelectSFX + co\WaitTimer = FPSfactor2 + If co\KeyPad_CurrButton > 2 + co\KeyPad_CurrButton = 0 + EndIf EndIf - EndIf - - If GetLeftAnalogStickPitch(True) > 0.0 - co\KeyPad_CurrButton = co\KeyPad_CurrButton - 1 - PlaySound_Strict co\SelectSFX - co\WaitTimer = FPSfactor2 - If co\KeyPad_CurrButton < 0 - co\KeyPad_CurrButton = 2 + + If GetLeftAnalogStickPitch(True) > 0.0 + co\KeyPad_CurrButton = co\KeyPad_CurrButton - 1 + PlaySound_Strict co\SelectSFX + co\WaitTimer = FPSfactor2 + If co\KeyPad_CurrButton < 0 + co\KeyPad_CurrButton = 2 + EndIf + ElseIf GetLeftAnalogStickPitch(True) < 0.0 + co\KeyPad_CurrButton = co\KeyPad_CurrButton + 1 + PlaySound_Strict co\SelectSFX + co\WaitTimer = FPSfactor2 + If co\KeyPad_CurrButton > 2 + co\KeyPad_CurrButton = 0 + EndIf EndIf - ElseIf GetLeftAnalogStickPitch(True) < 0.0 - co\KeyPad_CurrButton = co\KeyPad_CurrButton + 1 - PlaySound_Strict co\SelectSFX - co\WaitTimer = FPSfactor2 - If co\KeyPad_CurrButton > 2 - co\KeyPad_CurrButton = 0 + Else + If co\WaitTimer > 0.0 And co\WaitTimer < 15.0 + co\WaitTimer = co\WaitTimer + FPSfactor2 + ElseIf co\WaitTimer >= 15.0 + co\WaitTimer = 0.0 EndIf EndIf - Else - If co\WaitTimer > 0.0 And co\WaitTimer < 15.0 - co\WaitTimer = co\WaitTimer + FPSfactor2 - ElseIf co\WaitTimer >= 15.0 - co\WaitTimer = 0.0 - EndIf EndIf - EndIf - - x=x+120*scale - y=y+259*scale - If (Not co\Enabled) - If RectsOverlap(x,y,82*scale,82*scale,MouseX(),MouseY(),0,0) - If MouseHit1 - PlaySound_Strict ButtonSFX - StartNewElevator(d_I\SelectedDoor,3) - d_I\SelectedDoor = Null - ResetInput() -; For g.Guns = Each Guns -; If g\name$ = "p90" -; g\MouseDownTimer# = 15.0 -; EndIf -; Next + + x=x+120*scale + y=y+259*scale + If (Not co\Enabled) + If RectsOverlap(x,y,82*scale,82*scale,MouseX(),MouseY(),0,0) + If MouseHit1 + PlaySound_Strict ButtonSFX + StartNewElevator(d_I\SelectedDoor,3) + d_I\SelectedDoor = Null + ResetInput() + ; For g.Guns = Each Guns + ; If g\name$ = "p90" + ; g\MouseDownTimer# = 15.0 + ; EndIf + ; Next + EndIf EndIf - EndIf - Else - If co\KeyPad_CurrButton = 0 - If JoyHit(CKM_Press) - PlaySound_Strict ButtonSFX - StartNewElevator(d_I\SelectedDoor,3) - d_I\SelectedDoor = Null - ResetInput() -; For g.Guns = Each Guns -; If g\name$ = "p90" -; g\MouseDownTimer# = 15.0 -; EndIf -; Next + Else + If co\KeyPad_CurrButton = 0 + If JoyHit(CKM_Press) + PlaySound_Strict ButtonSFX + StartNewElevator(d_I\SelectedDoor,3) + d_I\SelectedDoor = Null + ResetInput() + ; For g.Guns = Each Guns + ; If g\name$ = "p90" + ; g\MouseDownTimer# = 15.0 + ; EndIf + ; Next + EndIf EndIf EndIf - EndIf - - y=y+131*scale - If (Not co\Enabled) - If RectsOverlap(x,y,82*scale,82*scale,MouseX(),MouseY(),0,0) - If MouseHit1 - PlaySound_Strict ButtonSFX - StartNewElevator(d_I\SelectedDoor,2) - d_I\SelectedDoor = Null - ResetInput() -; For g.Guns = Each Guns -; If g\name$ = "p90" -; g\MouseDownTimer# = 15.0 -; EndIf -; Next + + y=y+131*scale + If (Not co\Enabled) + If RectsOverlap(x,y,82*scale,82*scale,MouseX(),MouseY(),0,0) + If MouseHit1 + PlaySound_Strict ButtonSFX + StartNewElevator(d_I\SelectedDoor,2) + d_I\SelectedDoor = Null + ResetInput() + ; For g.Guns = Each Guns + ; If g\name$ = "p90" + ; g\MouseDownTimer# = 15.0 + ; EndIf + ; Next + EndIf EndIf - EndIf - Else - If co\KeyPad_CurrButton = 1 - If JoyHit(CKM_Press) - PlaySound_Strict ButtonSFX - StartNewElevator(d_I\SelectedDoor,2) - d_I\SelectedDoor = Null - ResetInput() -; For g.Guns = Each Guns -; If g\name$ = "p90" -; g\MouseDownTimer# = 15.0 -; EndIf -; Next + Else + If co\KeyPad_CurrButton = 1 + If JoyHit(CKM_Press) + PlaySound_Strict ButtonSFX + StartNewElevator(d_I\SelectedDoor,2) + d_I\SelectedDoor = Null + ResetInput() + ; For g.Guns = Each Guns + ; If g\name$ = "p90" + ; g\MouseDownTimer# = 15.0 + ; EndIf + ; Next + EndIf EndIf EndIf - EndIf - - y=y+130*scale - If (Not co\Enabled) - If RectsOverlap(x,y,82*scale,82*scale,MouseX(),MouseY(),0,0) - If MouseHit1 - PlaySound_Strict ButtonSFX - StartNewElevator(d_I\SelectedDoor,1) - d_I\SelectedDoor = Null - ResetInput() -; For g.Guns = Each Guns -; If g\name$ = "p90" -; g\MouseDownTimer# = 15.0 -; EndIf -; Next + + y=y+130*scale + If (Not co\Enabled) + If RectsOverlap(x,y,82*scale,82*scale,MouseX(),MouseY(),0,0) + If MouseHit1 + PlaySound_Strict ButtonSFX + StartNewElevator(d_I\SelectedDoor,1) + d_I\SelectedDoor = Null + ResetInput() + ; For g.Guns = Each Guns + ; If g\name$ = "p90" + ; g\MouseDownTimer# = 15.0 + ; EndIf + ; Next + EndIf EndIf - EndIf - Else - If co\KeyPad_CurrButton = 2 - If JoyHit(CKM_Press) - PlaySound_Strict ButtonSFX - StartNewElevator(d_I\SelectedDoor,1) - d_I\SelectedDoor = Null - ResetInput() -; For g.Guns = Each Guns -; If g\name$ = "p90" -; g\MouseDownTimer# = 15.0 -; EndIf -; Next + Else + If co\KeyPad_CurrButton = 2 + If JoyHit(CKM_Press) + PlaySound_Strict ButtonSFX + StartNewElevator(d_I\SelectedDoor,1) + d_I\SelectedDoor = Null + ResetInput() + ; For g.Guns = Each Guns + ; If g\name$ = "p90" + ; g\MouseDownTimer# = 15.0 + ; EndIf + ; Next + EndIf EndIf EndIf EndIf diff --git a/SourceCode/Rooms/Testroom_860.bb b/SourceCode/Rooms/Testroom_860.bb index a605b13..febdc5a 100644 --- a/SourceCode/Rooms/Testroom_860.bb +++ b/SourceCode/Rooms/Testroom_860.bb @@ -133,6 +133,8 @@ Function UpdateEvent_Testroom_860(e.Events) e\EventState = 0.0 + Msg = GetLocalString("Singleplayer", "testroom_860_1_close") + MsgTimer = 70 * 5 Else PlaySound_Strict(LoadTempSound("SFX\Door\WoodenDoorBudge.ogg")) Msg = GetLocalString("Singleplayer", "testroom_860_1") @@ -174,6 +176,8 @@ Function UpdateEvent_Testroom_860(e.Events) PlaySound_Strict(LoadTempSound("SFX\Door\WoodenDoorOpen.ogg")) ShowEntity fr.Forest\Forest_Pivot SelectedItem = Null + Msg = GetLocalString("Singleplayer", "testroom_860_1_open") + MsgTimer = 70 * 5 BlinkTimer = -10