Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Run 'safe' 2to3 fixers and convert print to PtDebugPrint #119

Merged
merged 2 commits into from May 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Python/Ahnonay.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,60 +100,60 @@ def OnServerInitComplete(self):
chron = ageDataChild.upcastToChronicleNode()
if chron and chron.getName() == "AhnonayLink":
linkid = chron
print "Ahnonay.OnServerInitComplete(): Link Chron already exists: %s" % (linkid.getValue())
PtDebugPrint("Ahnonay.OnServerInitComplete(): Link Chron already exists: %s" % (linkid.getValue()))
elif chron and chron.getName() == "AhnonayLocked":
locked = chron
print "Ahnonay.OnServerInitComplete(): Locked Chron already exists: %s" % (locked.getValue())
PtDebugPrint("Ahnonay.OnServerInitComplete(): Locked Chron already exists: %s" % (locked.getValue()))
elif chron and chron.getName() == "AhnonayVolatile":
volatile = chron
print "Ahnonay.OnServerInitComplete(): Volatile Chron already exists: %s" % (volatile.getValue())
PtDebugPrint("Ahnonay.OnServerInitComplete(): Volatile Chron already exists: %s" % (volatile.getValue()))
elif chron and chron.getName() == "AhnonaySpawnPoints":
spawn = chron
print "Ahnonay.OnServerInitComplete(): Spawn Chron already exists: %s" % (spawn.getValue())
PtDebugPrint("Ahnonay.OnServerInitComplete(): Spawn Chron already exists: %s" % (spawn.getValue()))
elif chron and chron.getName() == "AhnonayOwner":
owner = chron
break

if owner == None:
print "I am not the age owner, and I don't have my own Ahnonay"
PtDebugPrint("I am not the age owner, and I don't have my own Ahnonay")
elif owner.getValue() == myID:
if linkid == None:
print "Ahnonay.OnServerInitComplete(): Link Chron not found, creating"
PtDebugPrint("Ahnonay.OnServerInitComplete(): Link Chron not found, creating")
newNode = ptVaultChronicleNode(0)
newNode.chronicleSetName("AhnonayLink")
newNode.chronicleSetValue(guid)
ageDataFolder.addNode(newNode)

if locked == None:
print "Ahnonay.OnServerInitComplete(): Locked Chron not found, creating"
PtDebugPrint("Ahnonay.OnServerInitComplete(): Locked Chron not found, creating")
newNode = ptVaultChronicleNode(0)
newNode.chronicleSetName("AhnonayLocked")
newNode.chronicleSetValue("1")
ageDataFolder.addNode(newNode)

if volatile == None:
print "Ahnonay.OnServerInitComplete(): Volatile Chron not found, creating"
PtDebugPrint("Ahnonay.OnServerInitComplete(): Volatile Chron not found, creating")
newNode = ptVaultChronicleNode(0)
newNode.chronicleSetName("AhnonayVolatile")
newNode.chronicleSetValue("0")
ageDataFolder.addNode(newNode)

if spawn == None:
print "Ahnonay.OnServerInitComplete(): Spawn Chron not found, creating"
PtDebugPrint("Ahnonay.OnServerInitComplete(): Spawn Chron not found, creating")
newNode = ptVaultChronicleNode(0)
newNode.chronicleSetName("AhnonaySpawnPoints")
newNode.chronicleSetValue("Default,LinkInPointDefault")
ageDataFolder.addNode(newNode)

if volatile and linkid:
if volatile.getValue() == "1" and guid != linkid.getValue():
print "Ahnonay.OnServerInitComplete(): In a new instance of Ahnonay so setting new vars"
PtDebugPrint("Ahnonay.OnServerInitComplete(): In a new instance of Ahnonay so setting new vars")
linkid.setValue(guid)
locked.setValue("1")
volatile.setValue("0")
spawn.setValue("Default,LinkInPointDefault")
else:
print "I am not the age owner, but I do have my own Ahnonay"
PtDebugPrint("I am not the age owner, but I do have my own Ahnonay")


ageSDL = PtGetAgeSDL()
Expand All @@ -172,11 +172,11 @@ def OnServerInitComplete(self):

if spTitle == "SCSavePoint":
if spName == "SaveClothPoint7" or spName == "SaveClothPoint8":
print "linking to hub or hut"
PtDebugPrint("linking to hub or hut")
newSphere = 4
else:
offset = str(ageSDL["ahnyCurrentOffset"][0])
print "Ahnonay.OnPageLoad(): Sphere0%s loaded with offset:%s" % (sphere, offset)
PtDebugPrint("Ahnonay.OnPageLoad(): Sphere0%s loaded with offset:%s" % (sphere, offset))
newSphere = (int(sphere) - int(offset)) % 4
if newSphere == 0:
newSphere = 4
Expand Down Expand Up @@ -221,7 +221,7 @@ def OnPageLoad(self,what,who):

if spTitle == "SCSavePoint":
if spName == "SaveClothPoint7" or spName == "SaveClothPoint8":
print "linking to hub or hut"
PtDebugPrint("linking to hub or hut")
newSphere = 4
else:
newSphere = (int(sphere) - int(offset)) % 4
Expand Down
2 changes: 1 addition & 1 deletion Python/AhnonayCathedral.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def OnServerInitComplete(self):
owner = chron
break
if owner == None and vault.amOwnerOfCurrentAge():
print "I own this Cathedral, but I haven't set myself as Ahnonay owner yet."
PtDebugPrint("I own this Cathedral, but I haven't set myself as Ahnonay owner yet.")
newNode = ptVaultChronicleNode(0)
newNode.chronicleSetName("AhnonayOwner")
newNode.chronicleSetValue(str(PtGetClientIDFromAvatarKey(PtGetLocalAvatar().getKey())))
Expand Down
12 changes: 6 additions & 6 deletions Python/AhnyVogondolaRide.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ def OnNotify(self,state,id,events):
if (id == click.id and state):
avatar = PtFindAvatar(events)
climb.run(avatar)
print"clicked on chair"
PtDebugPrint("clicked on chair")
return

if (id == hutChairClickable.id and state):
theAvatar = PtFindAvatar(events)
theAvatar.physics.warpObj(dummy.value.getKey())
PtAttachObject(theAvatar.getKey(),dummy.value.getKey())
theAvatar.avatar.enterSubWorld(subworld.value)
print"pinned avatar"
PtDebugPrint("pinned avatar")
beginHutRide.run(self.key,avatar=theAvatar)

if (id == climb.id):
for event in events:
if event[0] == kMultiStageEvent and event[1] == 0 and event[2] == kEnterStage:
lower.run(self.key,avatar=PtGetLocalAvatar())
print"finished smart-seek"
PtDebugPrint("finished smart-seek")
elif event[0] == kMultiStageEvent and event[1] == 0 and event[2] == kAdvanceNextStage:
theAvatar=PtGetLocalAvatar()
theAvatar.physics.warpObj(dummy.value.getKey())
PtAttachObject(theAvatar.getKey(),dummy.value.getKey())
theAvatar.avatar.enterSubWorld(subworld.value)
print"pinned avatar"
PtDebugPrint("pinned avatar")
ride.run(self.key,avatar=theAvatar)

if (id == eject1.id and state):
Expand All @@ -117,14 +117,14 @@ def OnNotify(self,state,id,events):
PtDetachObject(theAvatar.getKey(),dummy.value.getKey())
theAvatar.avatar.exitSubWorld()
theAvatar.physics.warpObj(ejectPt1.value.getKey())
print"ejecting at the hub"
PtDebugPrint("ejecting at the hub")

if (id == ejectResp2.id and state):
theAvatar=PtGetLocalAvatar()
PtDetachObject(theAvatar.getKey(),dummy.value.getKey())
theAvatar.avatar.exitSubWorld()
theAvatar.physics.warpObj(ejectPt2.value.getKey())
print"ejecting at the hut"
PtDebugPrint("ejecting at the hut")



10 changes: 5 additions & 5 deletions Python/Cleft.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def __init__(self):
pages += ["ZandiJC04aFace","ZandiJC04bFace","ZandiJC05aFace","ZandiJC05bFace","ZandiJC06aFace","ZandiJC06bFace"]
pages += ["ZandiJC07aFace","ZandiJC07bFace"]
else:
print "Zandi seems to have stepped away from the Airstream. Hmmm..."
PtDebugPrint("Zandi seems to have stepped away from the Airstream. Hmmm...")
if loadBook:
pages += ["clftYeeshaBookVis","FemaleGetPersonalBook","MaleGetPersonalBook"]
else:
print "Zandi seems to have stepped away from the Airstream. Hmmm..."
PtDebugPrint("Zandi seems to have stepped away from the Airstream. Hmmm...")

# Put in all the common pages
pages += ["BookRoom","clftAtrusNote"]
Expand Down Expand Up @@ -221,7 +221,7 @@ def OnServerInitComplete(self):
try:
avatar = PtGetLocalAvatar()
except:
print"failed to get local avatar"
PtDebugPrint("failed to get local avatar")
return
avatar.avatar.registerForBehaviorNotify(self.key)
cam = ptCamera()
Expand Down Expand Up @@ -258,7 +258,7 @@ def OnNotify(self,state,id,events):
global fissureDrop

if (id == respFissureDropMain.id):
print "FISSUREDROP.OnNotify: respFissureDropMain.id callback"
PtDebugPrint("FISSUREDROP.OnNotify: respFissureDropMain.id callback")
if fissureDrop:
cam = ptCamera()
cam.enableFirstPersonOverride()
Expand All @@ -274,7 +274,7 @@ def OnBehaviorNotify(self,type,id,state):

#PtDebugPrint("Cleft.OnBehaviorNotify(): %d" % (type))
if type == PtBehaviorTypes.kBehaviorTypeLinkIn and not state:
print "FISSUREDROP.OnBehaviorNotify: fissureDrop = %d" % (fissureDrop)
PtDebugPrint("FISSUREDROP.OnBehaviorNotify: fissureDrop = %d" % (fissureDrop))
if fissureDrop:
PtDebugPrint("Cleft.OnBehaviorNotify(): will run respFissureDropMain now.")
respFissureDropMain.run(self.key,avatar=PtGetLocalAvatar())
46 changes: 23 additions & 23 deletions Python/ErcanaCitySilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def OnServerInitComplete(self):
try:
ageSDL = PtGetAgeSDL()
except:
print "ErcanaCitySilo.OnServerInitComplete():\tERROR---Cannot find the ErcanaCitySilo Age SDL"
PtDebugPrint("ErcanaCitySilo.OnServerInitComplete():\tERROR---Cannot find the ErcanaCitySilo Age SDL")
ageSDL[SDLGotPellet.value] = (0,)

ageSDL.setNotify(self.key,SDLGotPellet.value,0.0)
Expand All @@ -141,17 +141,17 @@ def OnBehaviorNotify(self,type,id,state):
cam.undoFirstPerson()
elif type == PtBehaviorTypes.kBehaviorTypeLinkIn and not state:
if self._gotTurd:
print "ErcanaCitySilo.OnBehaviorNotify: Will now call IDoMeter."
PtDebugPrint("ErcanaCitySilo.OnBehaviorNotify: Will now call IDoMeter.")
self.IDoMeter()
else:
print "Says we don't have a turd. Shouldn't be possible, I'm in OnBehaviorNotify."
PtDebugPrint("Says we don't have a turd. Shouldn't be possible, I'm in OnBehaviorNotify.")
avatar = PtGetLocalAvatar()
avatar.avatar.unRegisterForBehaviorNotify(self.key)


def IDoMeter(self):
levelMeter = self.IEvalPellet()
print "ErcanaCitySilo.IDoMeter(): pellet is level: ",levelMeter
PtDebugPrint("ErcanaCitySilo.IDoMeter(): pellet is level: ",levelMeter)
if levelMeter == 1.0:
RespScanMeter.run(self.key,state="Level1")
PtAtTimeCallback(self.key,6.3,2)
Expand Down Expand Up @@ -243,8 +243,8 @@ def IDoScores(self):
self._lakePoints = self._pellet
self._kiPoints = int(round(self._kiPoints * ((xRandom.randint(1,25) / 100.0) + 4.75)))
self._lakePoints = int(round(self._lakePoints))
print "ErcanaCitySilo.IDoScores(): this pellet drop is worth %d KI points!" % (self._kiPoints)
print "ErcanaCitySilo.IDoScores(): and %d lake points!" % (self._lakePoints)
PtDebugPrint("ErcanaCitySilo.IDoScores(): this pellet drop is worth %d KI points!" % (self._kiPoints))
PtDebugPrint("ErcanaCitySilo.IDoScores(): and %d lake points!" % (self._lakePoints))

# Try to find the needed scores...
# The magic will happen in OnGameScoreMsg()
Expand All @@ -255,7 +255,7 @@ def IDoScores(self):

def OnNotify(self,state,id,events):
if (id == RespScanMeter.id and self._gotTurd):
print "ErcanaCitySilo.OnNotify: Received callback from RespScanMeter, will now call IDropPellet."
PtDebugPrint("ErcanaCitySilo.OnNotify: Received callback from RespScanMeter, will now call IDropPellet.")
self.IDropPellet()

elif (id == RespDropPellet.id and self._gotTurd):
Expand Down Expand Up @@ -304,57 +304,57 @@ def IEvalPellet(self):

def IPlayPellet(self,level):
if level > 0.0:
print "ErcanaCitySilo.IPlayPellet(): and the pellet anim is..."
PtDebugPrint("ErcanaCitySilo.IPlayPellet(): and the pellet anim is...")
if level == 1.0:
print "steam & bubbles - HIGH"
PtDebugPrint("steam & bubbles - HIGH")
RespPlaySteam.run(self.key,state="Hi")
RespPlayBubbles.run(self.key,state="Hi")
elif level == 2.0:
print "steam & bubbles - MEDIUM"
PtDebugPrint("steam & bubbles - MEDIUM")
RespPlaySteam.run(self.key,state="Med")
RespPlayBubbles.run(self.key,state="Med")
elif level == 3.1:
print "steam & bubbles - LOW"
PtDebugPrint("steam & bubbles - LOW")
RespPlaySteam.run(self.key,state="Low")
RespPlayBubbles.run(self.key,state="Low")
elif level == 3.2:
print "dud"
PtDebugPrint("dud")
RespPlayDud.run(self.key)
elif level == 4.0:
print "orange glow - LOW"
PtDebugPrint("orange glow - LOW")
RespPlayOrangeGlow.run(self.key,state="Low")
elif level == 5.0:
print "orange glow - MEDIUM"
PtDebugPrint("orange glow - MEDIUM")
RespPlayOrangeGlow.run(self.key,state="Med")
elif level == 6.0:
print "orange glow - HIGH"
PtDebugPrint("orange glow - HIGH")
RespPlayOrangeGlow.run(self.key,state="Hi")
elif level == 7.0:
print "white glow"
PtDebugPrint("white glow")
RespPlayWhiteGlow.run(self.key)
elif level == 8.0:
print "explosion - LOW"
PtDebugPrint("explosion - LOW")
RespPlayBoom.run(self.key,state="Low")
elif level == 9.0:
print "explosion - MEDIUM"
PtDebugPrint("explosion - MEDIUM")
RespPlayBoom.run(self.key,state="Med")
elif level == 10.0:
print "explosion - HIGH"
PtDebugPrint("explosion - HIGH")
RespPlayBoom.run(self.key,state="Hi")
else:
print "ErcanaCitySilo.IPlayPellet(): ERROR. Level must be greater than 0"
PtDebugPrint("ErcanaCitySilo.IPlayPellet(): ERROR. Level must be greater than 0")


def OnBackdoorMsg(self,target,param):
if target == "pelletfx":
param = float(param)
#print "param = ",param
#PtDebugPrint("param = ",param)
if param > 0.0 and param <= 10.0:
if param == 3.0:
print "can't use 3.0, must be either 3.1 or 3.2"
PtDebugPrint("can't use 3.0, must be either 3.1 or 3.2")
return
else:
self.IPlayPellet(param)
else:
print "must be between 0.0 and 10.0"
PtDebugPrint("must be between 0.0 and 10.0")

Loading