Skip to content

Commit

Permalink
additional changes
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Johnson <[email protected]>
  • Loading branch information
Hazado and Hoikas committed Sep 8, 2023
1 parent dcfd8df commit d71b569
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions Scripts/Python/xHighLevelStarTrekDoor.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ def OnServerInitComplete(self):

PtDebugPrint("xHighLevelStarTrekDoor: Somebody is already in the age. Attempting to sync states.")

if self.SDL['DoorState'][0] in (doorSDLstates['opening'], doorSDLstates['movingopen'], doorSDLstates['opentoclose']):
if self.SDL['DoorState'][0] in (doorSDLstates.opening, doorSDLstates.movingopen, doorSDLstates.opentoclose):
respOpenDoor.run(self.key)
elif self.SDL['DoorState'][0] in (doorSDLstates['closing'], doorSDLstates['movingclosed'], doorSDLstates['closetoopen']):
elif self.SDL['DoorState'][0] in (doorSDLstates.closing, doorSDLstates.movingclosed, doorSDLstates.closetoopen):
respCloseDoor.run(self.key)
elif self.SDL['DoorState'][0] == doorSDLstates['open']:
elif self.SDL['DoorState'][0] == doorSDLstates.open:
respOpenDoor.run(self.key,fastforward=True)

else:
# the door is really shut, someone left it open
self.SDL['DoorState'] = (doorSDLstates['closed'],)
self.SDL['DoorState'] = (doorSDLstates.closed,)
ageSDL[strDoorClosedVar.value] = (1,)

##########################################
Expand Down Expand Up @@ -149,49 +149,49 @@ def OnNotify(self,state,id,events):
for event in events:
#true when you enter the region
if event[0] == 1 and event[1] == 1:
if doorState == doorSDLstates['closed']:
self.UpdateDoorState(doorSDLstates['opening'])
if doorState == doorSDLstates.closed:
self.UpdateDoorState(doorSDLstates.opening)
PtDebugPrint("xHighLevelStarTrekDoor: Setting Door to opening.")

elif doorState in (doorSDLstates['movingclosed'], doorSDLstates['closing']):
self.UpdateDoorState(doorSDLstates['closetoopen'])
elif doorState in (doorSDLstates.movingclosed, doorSDLstates.closing):
self.UpdateDoorState(doorSDLstates.closetoopen)
PtDebugPrint("xHighLevelStarTrekDoor: Setting Door to closetoopen.")

elif doorState == doorSDLstates['opentoclose']:
self.UpdateDoorState(doorSDLstates['movingopen'])
elif doorState == doorSDLstates.opentoclose:
self.UpdateDoorState(doorSDLstates.movingopen)
PtDebugPrint("xHighLevelStarTrekDoor: Setting Door to movingopen.")
return

#true when you leave the region
elif event[0] == 1 and event[1] == 0:
if doorState == doorSDLstates['open']:
self.UpdateDoorState(doorSDLstates['closing'])
if doorState == doorSDLstates.open:
self.UpdateDoorState(doorSDLstates.closing)
PtDebugPrint("xHighLevelStarTrekDoor: Setting Door to closing.")

elif doorState in (doorSDLstates['movingopen'], doorSDLstates['opening']):
self.UpdateDoorState(doorSDLstates['opentoclose'])
elif doorState in (doorSDLstates.movingopen, doorSDLstates.opening):
self.UpdateDoorState(doorSDLstates.opentoclose)
PtDebugPrint("xHighLevelStarTrekDoor: Setting Door to opentoclose.")

elif doorState == doorSDLstates['closetoopen']:
self.UpdateDoorState(doorSDLstates['movingclosed'])
elif doorState == doorSDLstates.closetoopen:
self.UpdateDoorState(doorSDLstates.movingclosed)
PtDebugPrint("xHighLevelStarTrekDoor: Setting Door to movingclosed.")
return

elif id == respOpenDoor.id:
PtDebugPrint("xHighLevelStarTrekDoor: Door is now open.")
if doorState == doorSDLstates['opentoclose']:
self.UpdateDoorState(doorSDLstates['closing'])
if doorState == doorSDLstates.opentoclose:
self.UpdateDoorState(doorSDLstates.closing)

elif doorState in (doorSDLstates['movingopen'], doorSDLstates['opening']):
self.UpdateDoorState(doorSDLstates['open'])
elif doorState in (doorSDLstates.movingopen, doorSDLstates.opening):
self.UpdateDoorState(doorSDLstates.open)

elif id == respCloseDoor.id:
PtDebugPrint("xHighLevelStarTrekDoor: Door is now closed.")
if doorState == doorSDLstates['closetoopen']:
self.UpdateDoorState(doorSDLstates['opening'])
if doorState == doorSDLstates.closetoopen:
self.UpdateDoorState(doorSDLstates.opening)

elif doorState in (doorSDLstates['movingclosed'], doorSDLstates['closing']):
self.UpdateDoorState(doorSDLstates['closed'])
elif doorState in (doorSDLstates.movingclosed, doorSDLstates.closing):
self.UpdateDoorState(doorSDLstates.closed)

##########################################
def UpdateDoorState (self, StateNum):
Expand All @@ -200,8 +200,8 @@ def UpdateDoorState (self, StateNum):
self.SDL['DoorState'] = (StateNum,)
if self.DoorEnabled == 0:
return
if self.SDL['DoorState'][0] == doorSDLstates['opening']:
if self.SDL['DoorState'][0] == doorSDLstates.opening:
ageSDL[strDoorClosedVar.value] = (0,)
elif self.SDL['DoorState'][0] == doorSDLstates['closing']:
elif self.SDL['DoorState'][0] == doorSDLstates.closing:
ageSDL[strDoorClosedVar.value] = (1,)

0 comments on commit d71b569

Please sign in to comment.