Last active
January 25, 2024 19:11
-
-
Save deckarep/a4af4b8b16851e65688a94f445fb1a8e to your computer and use it in GitHub Desktop.
WTF - SCI Script to Python3 - experiment to modernize the SCI source code...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hello, before anyone freaks out this is just an experiment...to see how far the rabbit hole can go. | |
# Original .sc file for ref: https://github.com/EricOakford/SCI-Decompilation-Archive/blob/master/lsl1/src/rmSidewalk.sc | |
# SCI script is really interesting to me, but largely outdated | |
# Based on a combination of Small-Talk and Lisp, with Prefix notation for expressions...it can get unwieldy | |
# to read at least for me. Boat-load of paranthesis and expressions that don't read like normal infix notation. | |
# But, | |
# It does have some reedeeming qualities: | |
# - Obviously powerful enough to run Sierra's SCI games | |
# - Compiles to bytecode and built on a proper PMachine virtual machine architecture as a stack VM | |
# - Supports for loops, repeat, switch, switch expressions, conds, if/else, if expressions and object-orientation | |
# - Supports Small-Talk cascade-style syntax which Python3 does not unfortunately (but all is not lost) | |
# So the question is: what happens when the code is "transpiled" and modernized to a newer language? | |
# It doesn't have to be Python, but it needs to be something that is flexible enough to work properly | |
# It means, you can have an easier time reading/studying the source code | |
# It means, the original VM intepreter and garbage collector goes away, Python has its own | |
# It means a large body of code could theoretically be modernized to run on a newer language | |
# It means a direct 1:1 translation so far isn't possible but perhaps gets us close | |
# It means, the games might just work | |
# If... | |
# If the kernel calls are ported into something Python (or whatever dynamic target language) can consume. | |
# Not that anyone is even up for this work, including me...i'd be happy enough if all the source was ported over just | |
# to make reading this code nicer. | |
# CAVEAT: this code below will not run as is; its not even fully worked out but perhaps 85% there. Many things read | |
# much nicer in Python3 while a few things are kind of hideous as a result of the translation. Python3 doesn't | |
# currently support: | |
# - Taking the address of a variable: @myScript will not work | |
# - Condition statements: but match statements work and read similarly | |
# - No switch statements: So all switch statements must be written to if/elif/else statements | |
# - No cascade syntax: (gEgo size: 20 5 yourself:) becomes gEgo._SEND(size=(20, 5), yourself=()) in Python3 which | |
# I would argue is probably uglier to read. | |
# More work needs to be done: | |
# - Handle procedures | |
# - Handle public/local declaration blocks | |
# - Fill in or modify method/procedure parameters such as: &tmp goes away, &rest becomes *args (in Python3) and params | |
# Thanks for reading! | |
# -deckarep | |
# transpiled from SCI script => Python3 by @deckarep, 2024 | |
# script# 700 | |
import Main | |
import Interface | |
import PolyPath | |
import Polygon | |
import Feature | |
import LoadMany | |
import Sound | |
import Motion | |
import Game | |
import Actor | |
import System | |
# public export declarations | |
SCI.public_exports( | |
sidewalk = 0, | |
dog = 1, | |
taxi = 2, | |
sTaxiScript = 3, | |
) | |
# local declarations | |
flatY = None | |
taxiPts = [None] * 8 | |
dogPts = [None] * 8 | |
dogTimer = None | |
taxiY = None | |
carView = None | |
beenPissedOn = None | |
@SCI.procedure | |
def PolyTaxi(self): | |
# &tmp params: rL, rT, rR, rB | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
rL = (taxi.brLeft() - 8) | |
rT = (taxi.brTop() - 8) | |
rR = (taxi.brRight() + 8) | |
rB = (taxi.brBottom() + 5) | |
taxiPts[0] = taxiPts[6] = rL | |
taxiPts[1] = taxiPts[3] = rT | |
taxiPts[2] = taxiPts[4] = rR | |
taxiPts[5] = taxiPts[7] = rB | |
taxiPoly.send(points_, SCI._ADDRESSOF(taxiPts), size_, 4) | |
gCurRoom.addObstacle(taxiPoly) | |
@SCI.procedure | |
def PolyDog(self): | |
# &tmp params: rL, rT, rR, rB | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
rL = (dog.brLeft() - 8) | |
rT = (dog.brTop() - 4) | |
rR = (dog.brRight() + 8) | |
rB = dog.brBottom() | |
dogPts[0] = dogPts[6] = rL | |
dogPts[1] = dogPts[3] = rT | |
dogPts[2] = dogPts[4] = rR | |
dogPts[5] = dogPts[7] = rB | |
dogPoly.send(points_, SCI._ADDRESSOF(dogPts), size_, 4) | |
gCurRoom.addObstacle(dogPoly) | |
@SCI.instance | |
class sidewalk(Rgn): | |
def _properties(self): | |
# properties not defined | |
pass | |
def init(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
carView = Random(822, 827) | |
LoadMany(rsVIEW, carView, 806, 810, 811, 820, 821, 200) | |
LoadMany(rsSOUND, 800, 810, 811, 812, 103, 102, 200, 202, 203, 204, 205, 206) | |
if (((gTheMusic2.number() != 800) or (gTheMusic2.prevSignal() == -1)) and not(IsFlag(38))): | |
gTheMusic2.send(number_, 800, loop_, -1, vol_, 127, play_) | |
super().init() | |
streetF.init() | |
gEgo.actions(taxiActions) | |
gEHead.actions(taxiActions) | |
taxiY = flatY = 169 if gCurRoomNum == 100 else 165 if gCurRoomNum == 300 else 159 if gCurRoomNum == 400 else 170 if gCurRoomNum == 500 else 167 if gCurRoomNum == 600 else else raise Exception("unexpected else") | |
if (710 <= gPrevRoomNum and gPrevRoomNum <= 720): | |
gTheMusic.fade(0, 30, 1, 1) | |
dogTimer = 1000 | |
if (gPrevRoomNum == 200): | |
HandsOff() | |
if IsFlag(38): | |
Load(rsVIEW, 171) | |
gCurRoom.setScript(sDropoff) | |
if (LarryHours() > 7): | |
self.setScript(virginScript) | |
if (gCurRoomNum != 100): | |
taxiSignProp.send(x_, 74 if gCurRoomNum == 300 else 294 if gCurRoomNum == 400 else 200 if gCurRoomNum == 500 else 246 if gCurRoomNum == 600 else else raise Exception("unexpected else"), y_, 178 if gCurRoomNum == 300 else 181 if gCurRoomNum == 400 else 175 if gCurRoomNum == 500 else 172 if gCurRoomNum == 600 else else raise Exception("unexpected else"), approachX_, gEgo.x(), approachY_, (flatY - 10), approachVerbs_, 3, 5, init_, setPri_, 14, stopUpd_) | |
def newRoom(self, newRoomNumber): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
keep = OneOf(newRoomNumber, 100, 300, 400, 500, 600) | |
initialized = 0 | |
if (not(OneOf(newRoomNumber, 100, 300, 400, 500, 600)) and (newRoomNumber != 160)): | |
gTheMusic2.fade() | |
if ((newRoomNumber != 200) and (gTheMusic3.number() == 205)): | |
gTheMusic3.stop() | |
if ((newRoomNumber == 160) and (gTheMusic.number() == 700)): | |
gTheMusic.fade() | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
super().newRoom(newRoomNumber, *rest) | |
def doit(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
taxiSignProp.approachX(gEgo.x()) | |
if (dogTimer and not(dog.script())): | |
dogTimer-=1 | |
if gEgo.mover(): | |
dogTimer = 1000 | |
# transpiled from cond | |
if (gCurRoom.script() == sFlattenLarry): | |
gEgo.setMotion(0) | |
# transpiled cond arm | |
elif: (gEgo.y() > flatY): | |
# transpiled from cond | |
if not(gCast.contains(taxi)): | |
HandsOff() | |
gCurRoom.setScript(sFlattenLarry) | |
# transpiled cond arm | |
elif: (gEgo.y() > (taxi.y() + 5)): | |
HandsOff() | |
gCurRoom.setScript(sFlattenLarry) | |
# transpiled cond arm | |
elif: not(dogTimer) and not(beenPissedOn) and (gCurRoomNum != 500) and (gCurRoom.curPic() != 245): | |
dogTimer = -1 | |
dog.send(init_, cycleSpeed_, gEgo.cycleSpeed(), moveSpeed_, gEgo.moveSpeed(), setCycle_, Walk, z_, 0, setScript_, sFindLarry) | |
@SCI.class | |
class taxiActions(Code): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doVerb(self, theVerb): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (theVerb): | |
case 5: | |
HandsOff() | |
gCurRoom.setScript(sTaxiScript) | |
return 1 | |
@SCI.instance | |
class virginScript(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
seconds = 5 | |
case 1: | |
if gCurRoom.script(): | |
cycles = 60 | |
state-=1 | |
else: | |
HandsOff() | |
gEgo.setHeading(180, self) | |
case 2: | |
cycles = 3 | |
case 3: | |
LoadMany(rsFONT, gGiantFont) | |
Print(700, 0, SCI.at, 15, -1, SCI.width, 280) | |
Print(700, 1, SCI.at, 15, -1, SCI.width, 280) | |
Print(700, 2, SCI.at, 15, -1, SCI.width, 280) | |
Print(700, 3, SCI.at, 15, -1, SCI.width, 280, SCI.font, gGiantFont) | |
seconds = 3 | |
case 4: | |
gEgo.send(egoSpeed_, normal_, 0, view_, 811, setLoop_, 0 if register else 1, setCel_, 8, setCycle_, End, self) | |
case 5: | |
seconds = 3 | |
case 6: | |
Death(807, 1) | |
Format(SCI._ADDRESSOF(gYourPart), 700, 4) | |
GameOver(700, 5) | |
@SCI.instance | |
class sDropoff(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doit(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
if ((state == 1) or (state == 5)): | |
taxi.x((150 - register)) | |
gTheMusic3.send(9, 255, (((150 - taxi.x()) * 10) + 3000)) | |
if (taxi.x() < -800): | |
cycles = 1 | |
register *= 2 | |
if (register == 4): | |
soundFX.send(number_, 202, setLoop_, 1, flags_, 1, play_) | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
taxi.send(init_, setCel_, 1, cycleSpeed_, global101, moveSpeed_, global101, x_, 150, y_, taxiY) | |
gEgo.send(x_, 150, y_, (flatY - 10), z_, 0) | |
if IsFlag(38): | |
gEgo.send(egoSpeed_, view_, 171, loop_, 0, setCycle_, Fwd) | |
state+=1 | |
cycles = 1 | |
else: | |
gEgo.setHeading(180, self) | |
case 1: | |
register = 1 | |
case 2: | |
if IsFlag(38): | |
gTheMusic.send(number_, 171, loop_, -1, vol_, 127, flags_, 1, play_) | |
gEgo.setCycle(Fwd) | |
seconds = 5 | |
else: | |
taxi.dispose() | |
gTheMusic3.fade() | |
HandsOn() | |
self.dispose() | |
case 3: | |
gEgo.setLoop(1) | |
cycles = 3 | |
case 4: | |
gEgo.send(setLoop_, 0, setCycle_, Fwd) | |
seconds = 4 | |
case 5: | |
gTheMusic.stop() | |
register = 1 | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 6) | |
gEgo.send(view_, 806, loop_, 1, x_, (gEgo.x() - 0), y_, (gEgo.y() + 5), setCycle_, 0) | |
mCar2.play() | |
case 6: | |
gTheMusic3.fade() | |
Death(171, 3, 1) | |
Format(SCI._ADDRESSOF(gYourPart), 700, 4) | |
GameOver(700, 7) | |
@SCI.instance | |
class sFindLarry(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doit(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
if gEgo.mover(): | |
sPiss.stop() | |
dog.setScript(sRunOff, 0, register) | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
gTheMusic.send(number_, 103, loop_, 1, vol_, 127, flags_, 1, play_) | |
dog.send(x_, 330 if register = Random(0, 1) else -10, y_, 155, setCycle_, Walk, setMotion_, PolyPath, (gEgo.x() + 17) if register else (gEgo.x() - 15), (gEgo.y() + 1), self) | |
case 1: | |
PolyDog() | |
dog.send(view_, 821, loop_, (0 + register), cel_, 0, setCycle_, End, self) | |
case 2: | |
dog.send(loop_, (2 + register), cel_, 0, setCycle_, End, self) | |
case 3: | |
sPiss.play() | |
dog.send(loop_, (4 + register), setCycle_, Fwd) | |
SetFlag(37) | |
beenPissedOn = 1 | |
seconds = 3 | |
case 4: | |
sPiss.stop() | |
if ((gEgo.view() == 800) or (gEgo.view() == 809)): | |
HandsOff() | |
gCurRoom.setScript(sShakeLeg, 0, register) | |
dog.setScript(sRunOff, 0, register) | |
@SCI.instance | |
class sRunOff(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
# transpiled from cond | |
if ((dog.view() == 820) or (dog.loop() == 0)): | |
cycles = state = 1 | |
# transpiled cond arm | |
elif: (dog.loop() == 2): | |
cycles = 1 | |
# transpiled cond arm | |
else: | |
dog.send(loop_, (2 + register), cel_, 2, setCycle_, Beg, self) | |
case 1: | |
dog.send(loop_, 0 if register else 1, cel_, 2, setCycle_, Beg, self) | |
case 2: | |
gCurRoom.obstacles().delete(dogPoly) | |
dog.send(view_, 820, setCycle_, Walk, setMotion_, PolyPath, 350 if (dog.x() > gEgo.x()) else -30, 155, self) | |
case 3: | |
gTheMusic.fade() | |
dog.send(z_, 1000, dispose_) | |
self.dispose() | |
@SCI.instance | |
class sTaxiScript(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doit(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
if (state == 4): | |
gTheMusic3.send(9, 255, ((taxi.x() - 150) * 50)) | |
if (state == 5): | |
taxi.x((150 + register)) | |
gTheMusic3.send(9, 255, ((taxi.x() - 150) * 30)) | |
if (register == 0): | |
gTheMusic3.send(9, 255, 0) | |
cycles = 1 | |
if (register == 16): | |
soundFX.send(number_, 202, setLoop_, 1, flags_, 1, play_) | |
register //= 2 | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
gEgo.setHeading(180, self) | |
case 1: | |
gEgo.send(egoSpeed_, view_, 810, setLoop_, 0, setCel_, 0, cycleSpeed_, 1, setCycle_, End, self) | |
case 2: | |
soundFX.send(number_, 200, loop_, 1, flags_, 0, vol_, 127, play_) | |
seconds = 3 | |
case 3: | |
seconds = Random(1, 3) | |
case 4: | |
NormalEgo(2) | |
if not(gCast.contains(taxi)): | |
taxi.send(approachVerbs_, 3, cycleSpeed_, global101, moveSpeed_, global101, init_, x_, 400, y_, taxiY, setMotion_, MoveTo, 214, taxiY, self) | |
register = 64 | |
gTheMusic3.send(number_, 205, loop_, -1, vol_, 127, flags_, 1, play_) | |
else: | |
# transpiled from cond | |
if (taxi.x() == 150): | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 8) | |
# transpiled cond arm | |
elif: (taxi.x() < 150): | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 9) | |
# transpiled cond arm | |
else: | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 10) | |
HandsOn() | |
self.dispose() | |
case 5: | |
case 6: | |
taxi.setCycle(End, self) | |
case 7: | |
HandsOn() | |
PolyTaxi() | |
taxi.send(setScript_, sTaxiWait, approachX_, (taxi.x() + 10), approachY_, (taxi.brTop() - 8), stopUpd_) | |
self.dispose() | |
@SCI.instance | |
class sTaxiWait(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doit(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
if (state == 7): | |
taxi.send(startUpd_, x_, (150 - (register / 4))) | |
gTheMusic3.send(9, 255, ((150 - taxi.x()) * 10)) | |
if (taxi.x() < -120): | |
cycles = 1 | |
register *= 2 | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
seconds = 14 | |
case 1: | |
taxi.startUpd() | |
cycles = 1 | |
case 2: | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 11, SCI.dispose, SCI.time, 4) | |
cycles = 9 | |
case 3: | |
if ((gEgo.x() < (taxi.x() - 20)) and (gEgo.y() > (taxi.brTop() - 8))): | |
soundFX.send(number_, 810, play_) | |
cycles = 12 | |
else: | |
state = 6 | |
cycles = 1 | |
case 4: | |
soundFX.stop() | |
cycles = 1 | |
case 5: | |
soundFX.play() | |
cycles = 12 | |
case 6: | |
soundFX.stop() | |
state = 2 | |
seconds = 5 | |
case 7: | |
register = 1 | |
if (gCurRoom.script() != sEnterTaxi): | |
gCurRoom.obstacles().delete(taxiPoly) | |
soundFX.send(number_, 202, setLoop_, 1, flags_, 1, play_) | |
else: | |
self.dispose() | |
case 8: | |
if (taxi.x() < -80): | |
taxi.dispose() | |
gTheMusic3.fade() | |
self.dispose() | |
else: | |
state -= 1 | |
cycles = 1 | |
@SCI.instance | |
class sFlattenLarry(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doit(self): | |
# &tmp params: dist | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
# transpiled from cond | |
if (dist = GetDistance(gEgo.x(), gEgo.y(), aCar.x(), aCar.y()) < 0): | |
dist = 0 | |
# transpiled cond arm | |
elif: (dist > 300): | |
dist = 300 | |
if (state < 2): | |
mCar.setVol((127 - (dist / 4))) | |
if ((state == 1) or (state == 2)): | |
register+=1 | |
mCar.send(2, 255, -((register * 100))) | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
mCar.play(50) | |
gEgo.send(view_, 806, loop_, 0, cel_, 0) | |
aCar.send(cycleSpeed_, global101, moveSpeed_, global101, init_, view_, carView, x_, 450, setPri_, (gEgo.priority() + 2), setMotion_, MoveTo, (gEgo.x() + 67), aCar.y(), self) | |
case 1: | |
mCar2.play() | |
mCar3.play() | |
gEgo.send(setPri_, (aCar.priority() + 1), x_, (aCar.x() - 67), setCel_, 1) | |
aCar.setMotion(MoveTo, -50, aCar.y(), aCar) | |
cycles = 5 | |
case 2: | |
mCar.fade(0, 5, 8, 1) | |
gEgo.send(setPri_, -1, setLoop_, 1, setCel_, 1, x_, (gEgo.x() - 0), y_, (gEgo.y() + 0)) | |
seconds = 3 | |
case 3: | |
seconds = 3 | |
case 4: | |
Death(806, 2) | |
Format(SCI._ADDRESSOF(gYourPart), 700, 12) | |
GameOver(700, 13) | |
@SCI.instance | |
class sEnterTaxi(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doit(self): | |
# &tmp params: maxVal | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
if (state == 3): | |
taxi.send(startUpd_, x_, (150 - register)) | |
maxVal = ((150 - taxi.x()) * 10) | |
gTheMusic3.send(9, 255, maxVal if (maxVal < 2000) else 2000) | |
if (taxi.x() < -80): | |
cycles = 1 | |
register *= 2 | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
cycles = 1 | |
case 1: | |
soundFX.send(number_, 203, loop_, 1, flags_, 0, vol_, 127, play_) | |
gEgo.setHeading(180) | |
cycles = 10 | |
case 2: | |
soundFX.send(number_, 204, loop_, 1, flags_, 0, vol_, 127, play_) | |
gEgo.hide() | |
cycles = 10 | |
case 3: | |
register = 1 | |
soundFX.send(number_, 202, setLoop_, 1, flags_, 1, play_) | |
case 4: | |
gTheMusic3.fade(90, 5, 5, 0) | |
gCurRoom.newRoom(200) | |
@SCI.instance | |
class sShakeLeg(Script): | |
def _properties(self): | |
# properties not defined | |
pass | |
def doit(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().doit(*rest) | |
if (not(state) and (sRunOff.state() == 2)): | |
cycles = 1 | |
def changeState(self, newState): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (state = newState): | |
case 0: | |
case 1: | |
gEgo.send(egoSpeed_, normal_, 0, view_, 811, loop_, 0 if register else 1, cel_, 0, cycleSpeed_, 1, setCycle_, End, self) | |
case 2: | |
NormalEgo(2) | |
HandsOn() | |
self.dispose() | |
@SCI.instance | |
class aCar(Actor): | |
def _properties(self): | |
self.x = 340 | |
self.y = 170 | |
self.description = '''the car''' | |
self.lookStr = '''Crazy driver!''' | |
self.view = 806 | |
self.signal = 22528 | |
self.xStep = 30 | |
def __init__(self): | |
self._properties() | |
def cue(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().cue() | |
z = 1000 | |
self.dispose() | |
@SCI.instance | |
class taxi(Actor): | |
def _properties(self): | |
self.description = '''the taxi''' | |
self.sightAngle = 40 | |
self.view = 200 | |
self.signal = 22528 | |
self.xStep = 20 | |
def __init__(self): | |
self._properties() | |
def cue(self): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
super().cue() | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 14) | |
Print(700, 15) | |
Print(700, 16, SCI.at, -1, 140) | |
def doVerb(self, theVerb, invItem): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (theVerb): | |
case 2: | |
gEgo.setHeading(GetAngle(gEgo.x(), gEgo.y(), self.x(), self.y()), self) | |
case 11: | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 17) | |
case 3: | |
if (taxi.x() < 150): | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 18) | |
else: | |
if not(IsFlag(34)): | |
SetFlag(34) | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
Print(700, 19) | |
HandsOff() | |
taxi.setScript(0) | |
soundFX.stop() | |
gCurRoom.setScript(sEnterTaxi) | |
case _: | |
super().doVerb(theVerb, invItem) | |
@SCI.instance | |
class dog(Actor): | |
def _properties(self): | |
self.description = '''the dog''' | |
self.sightAngle = 40 | |
self.view = 820 | |
self.signal = 16384 | |
def __init__(self): | |
self._properties() | |
def doVerb(self, theVerb, invItem): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
if gModelessDialog: | |
gModelessDialog.dispose() | |
# transpiled to match statement from sci switch statement | |
match (theVerb): | |
case 2: | |
# transpiled from cond | |
if (dog.view() == 821): | |
Print(700, 20) | |
# transpiled cond arm | |
elif: (dog.script() == sRunOff): | |
Print(700, 21) | |
# transpiled cond arm | |
else: | |
Print(700, 22) | |
case 3: | |
Print(700, 23) | |
case 11: | |
Print(700, 24) | |
case 10: | |
Print(700, 25) | |
case _: | |
super().doVerb(theVerb, invItem) | |
@SCI.instance | |
class taxiSignProp(View): | |
def _properties(self): | |
self.z = 100 | |
self.description = '''the taxi sign''' | |
self.sightAngle = 40 | |
self.lookStr = '''High up that pole sits a lonely sign that reads, "Taxi Stand."''' | |
self.view = 810 | |
self.loop = 1 | |
def __init__(self): | |
self._properties() | |
def doVerb(self, theVerb, invItem): | |
global beenPissedOn, carView, dogTimer, flatY, taxiY | |
# transpiled to match statement from sci switch statement | |
match (theVerb): | |
case 3: | |
Print(700, 26) | |
HandsOff() | |
gCurRoom.setScript(sTaxiScript) | |
case 5: | |
self.doVerb(3) | |
case _: | |
super().doVerb(theVerb, invItem, *rest) | |
@SCI.instance | |
class dogPoly(Polygon): | |
def _properties(self): | |
self.type = PBarredAccess | |
def __init__(self): | |
self._properties() | |
@SCI.instance | |
class taxiPoly(Polygon): | |
def _properties(self): | |
self.type = PBarredAccess | |
def __init__(self): | |
self._properties() | |
@SCI.instance | |
class streetF(Feature): | |
def _properties(self): | |
self.x = 160 | |
self.y = 480 | |
self.description = '''the street''' | |
self.sightAngle = 85 | |
self.onMeCheck = 2048 | |
self.lookStr = '''Isn't it funny how there's so little traffic?''' | |
def __init__(self): | |
self._properties() | |
@SCI.instance | |
class mCar(Sound): | |
def _properties(self): | |
self.number = 810 | |
self.vol = 50 | |
def __init__(self): | |
self._properties() | |
@SCI.instance | |
class mCar2(Sound): | |
def _properties(self): | |
self.number = 811 | |
def __init__(self): | |
self._properties() | |
@SCI.instance | |
class mCar3(Sound): | |
def _properties(self): | |
self.number = 812 | |
def __init__(self): | |
self._properties() | |
@SCI.instance | |
class sPiss(Sound): | |
def _properties(self): | |
self.flags = 1 | |
self.number = 102 | |
self.loop = -1 | |
def __init__(self): | |
self._properties() | |
@SCI.instance | |
class soundFX(Sound): | |
def _properties(self): | |
self.flags = 1 | |
def __init__(self): | |
self._properties() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment