(include "sci.sh")
(use "Class_255_0")
(use "n802")
(use "RegionPath")
(use "SQEgo")
(use "PseudoMouse")
(use "Slider")
(use "BorderWindow")
(use "RandCycle")
(use "StopWalk")
(use "DCIcon")
(use "Grooper")
(use "Sound")
(use "Game")
(use "InvI")
(use "User")
(use "IconI")
(use "PicView")
(use "Obj")
(script 0)


(local
    gEgo
    gGame
    global2
    global3 = 6
    global4
    gCast
    gRegions
    gTimers
    gSounds
    gInv
    gAddToPics
    gNumber
    gWest
    gTheGNumber
    global14
    global15
    global16
    global17 = 7
    global18
    global19
    global20 = 999
    global21 = 20
    global22 = 1
    global23 = 4
    gPEvent
    gTheNewDialog
    global26 = 1
    gLOOKUP_ERROR
    global28
    global29
    global30 = 10
    gPicAngle
    gFeatures
    gSFeatures
    global34
    global35
    global36 = 65535
    global37
    gSq4Win
    global39 = 3
    global40
    global41
    global42
    global43
    global44
    global45
    global46
    global47
    global48
    global49
    global50
    global51
    global52
    global53
    global54
    global55
    global56
    global57
    global58
    global59
    global60
    global61
    global62
    global63
    global64
    global65
    global66
    global67
    global68
    global69
    global70
    global71
    global72
    global73
    global74
    global75
    global76
    global77
    global78
    global79
    global80
    global81
    global82
    global83
    gSq4FtrInit
    gSq4DoVerbCode
    global86
    global87 = 1
    global88
    gIconBar
    gPEventX
    gPEventY
    gSq4KeyDownHandler
    gSq4MouseDownHandler
    gSq4DirectionHandler
    global95
    global96
    gPseudoMouse
    gTheDoits
    global99
    gLongSong
    global101
    global102
    global103 = 1
    global104
    global105
    global106
    global107
    global108
    global109
    global110
    global111
    gEgoHead
    gStopGroop
    global114
    global115
    global116
    global117
    global118
    global119
    global120
    global121
    gNewDisplayCel
    global123
    global124
    global125
    global126
    global127
    global128
    gColor
    gBack
    global131
    global132
    global133
    global134
    global135
    global136
    global137
    global138
    global139
    global140
    global141
    global142
    global143
    global144
    global145
    global146
    global147
    global148
    global149
    global150
    global151
    global152
    global153
    gLongSong2
    global155
    global156
    global157
    global158
    global159 = 59
    gBoxPropBoxID
    global161
    global162
    global163
    global164
    global165
    global166
    global167
    global168
    global169 = 2001
    global170
    global171
    global172
    gNewDisplayCel_2 = 10
    global174
    global175
    global176
    global177
    global178
    gNewDisplayCel_3
    global180
    global181
    global182
    global183
    global184
    global185
    global186
    global187
    global188
    global189
    global190
    global191
    global192
    global193
    global194

)
(procedure public (proc0_1 param1 param2 param3)
    (var temp0)
    = temp0 0
    (if (> paramTotal 0)
        (send gEgo:loop(param1))
        (if (> paramTotal 1)
            (send gEgo:view(param2))
            (if (> paramTotal 2)
                = temp0 param3
            )
        )
    )
    (if (not temp0)
        = temp0 4
    )
    (send gEgo:
        normal(1)
        moveHead(1)
        setLoop(-1)
        setLoop(stopGroop)
        setPri(-1)
        setMotion(0)
        setCycle(StopWalk temp0)
        setStep(3 2)
        illegalBits(0)
        ignoreActors(0)
        moveSpeed((send gGame:egoMoveSpeed))
        cycleSpeed((send gGame:egoMoveSpeed))
    )
)


(procedure public (proc0_2)
    (var gIconBarCurIcon)
    (User:
        canControl(0)
        canInput(0)
    )
    (send gEgo:setMotion(0))
    = gIconBarCurIcon (send gIconBar:curIcon)
    (send gIconBar:disable(0 1 2 3 4 5 6 7))
    (send gIconBar:curIcon(gIconBarCurIcon))
    (if (not HaveMouse())
        = global192 (send ((User:curEvent)):x)
        = global193 (send ((User:curEvent)):y)
        (send gGame:setCursor(global21 1 304 172))
    )(else
        (send gGame:setCursor(global21 1))
    )
)


(procedure public (proc0_3)
    (User:
        canControl(1)
        canInput(1)
    )
    (send gIconBar:enable(0 1 2 3 4 5 6 7))
    (if (not HaveMouse())
        (send gGame:setCursor((send ((send gIconBar:curIcon)):cursor) 1 global192 global193))
    )(else
        (send gGame:setCursor((send ((send gIconBar:curIcon)):cursor)))
    )
)


(procedure public (proc0_4 param1)
    return >u MemoryInfo(1) param1
)


(procedure public (proc0_5 param1 param2)
    return 
        (if (& (send param1:onControl(1)) param2)
            return 1
        )(else
            0
        )
)


(procedure public (Btest param1)
    return & global114[(/ param1 16)] (>> $8000 (% param1 16))
)


(procedure public (Bset param1)
    (var temp0)
    = temp0 Btest(param1)
    = global114[(/ param1 16)] (| global114[(/ param1 16)] (>> $8000 (% param1 16)))
    return temp0
)


(procedure public (Bclear param1)
    (var temp0)
    = temp0 Btest(param1)
    = global114[(/ param1 16)] (& global114[(/ param1 16)] bnot (>> $8000 (% param1 16)))
    return temp0
)


(procedure public (proc0_9 param1)
    (var temp0)
    = temp0 0
    (if (paramTotal)
        = temp0 param1
    )(else
        = temp0 4
    )
    = gEgoHead egoHead
    (send gEgoHead:
        init(gEgo)
        view(temp0)
        cycleSpeed(24)
    )
)


(procedure public (proc0_10 param1 param2)
    (if (> paramTotal 0)
        = global186 param1
        (if (proc999_5((send gEgo:view) 373 374 993))
            (if (== global186 0)
                = global186 7
            )
            (if (== global186 8)
                = global186 9
            )
        )
    )(else
        = global186 0
    )
    (if (> paramTotal 1)
        = global187 param2
    )(else
        = global187 0
    )
    (send global2:newRoom(900))
)


(procedure public (proc0_11 param1 param2)
    (if (not Btest(param1))
        (send gGame:changeScore(param2))
        Bset(param1)
        (pointsSound:play())
    )
)


(procedure public (proc0_12 theTheGBack)
    (var theTheTheGBack, theTheTheGBack_2, temp2, theTheTheGBack_3, theTheTheGBack_4, theTheTheGBack_5, theGBack, theTheTheGBack_6, temp8)
    return 
        (if (== paramTotal 1)
            Display(0 27 108 theTheGBack[0])
        )(else
            = theTheTheGBack_5 -1
            = theTheTheGBack_4 theTheTheGBack_5
            = theTheTheGBack 0
            = theTheTheGBack_2 68
            = temp2 69
            = theTheTheGBack_3 320
            = theGBack gBack
            = theTheTheGBack_6 0
            = temp8 1
            (while (< temp8 paramTotal)
                (switch (theTheGBack[temp8])
                    (case 30
                        = theTheTheGBack theTheGBack[++temp8]
                    )
                    (case 33
                        = theTheTheGBack_2 theTheGBack[++temp8]
                        = temp2 (+ theTheTheGBack_2 1)
                    )
                    (case 70
                        = theTheTheGBack_3 theTheGBack[++temp8]
                    )
                    (case 67
                        = theTheTheGBack_4 theTheGBack[++temp8]
                        = theTheTheGBack_5 theTheGBack[++temp8]
                    )
                    (case 28
                        = theGBack theTheGBack[++temp8]
                    )
                    (case 29
                        = theTheTheGBack_6 theTheGBack[++temp8]
                    )
                )
                ++temp8
            )
            = temp8 Display(theTheGBack[0] 100 theTheTheGBack_4 theTheTheGBack_5 102 theTheTheGBack_6 106 theTheTheGBack_3 101 theTheTheGBack 105 temp2 107)
            Display(theTheGBack[0] 100 theTheTheGBack_4 theTheTheGBack_5 102 theGBack 106 theTheTheGBack_3 101 theTheTheGBack 105 theTheTheGBack_2)
            return temp8
        )
)


(procedure public (proc0_13 param1 param2 param3 param4)
    (var temp0, temp1, temp2, temp3)
    = temp3 0
    (if (IsObject(param2))
        = temp1 (send param2:x)
        = temp2 (send param2:y)
        (if (== paramTotal 3)
            = temp3 param3
        )
    )(else
        = temp1 param2
        = temp2 param3
        (if (== paramTotal 4)
            = temp3 param4
        )
    )
    = temp0 GetAngle((send param1:x) (send param1:y) temp1 temp2)
    (send param1:setHeading(temp0 
        (if (IsObject(temp3))
            temp3
        )(else
            0
        )
))
)


(procedure public (proc0_14 param1)
    (var temp0, temp1[25], temp26[100], temp126[4], temp130, temp131[65280])
    (if (<> param1 -1)
        = global188 param1
    )
    StrCpy(@temp1 "Space Quest ")
    (switch (global188)
        (case 1
            StrCat(@temp1 " - The Sarien Encounter")
        )
        (case 3
            StrCat(@temp1 " - The Pirates of Pestulon")
        )
        (case 4
            StrCat(@temp1 " - Roger Wilco and The Time Rippers")
        )
        (case 10
            StrCat(@temp1 " - Latex Babes of Estros")
        )
        (case 12
            StrCat(@temp1 " - Vohaul's Revenge ")
            = temp0 global148
        )
    )
    TextSize(@temp126 @temp1 0 -1)
    StrCpy(@temp26 "")
    = temp130 (/ (- 326 (- temp126[3] temp126[1])) 2)
    (while (> temp130 0)
        StrCat(@temp26 "")
        --temp130
    )
    StrCat(@temp26 @temp1)
    DrawStatus(@temp26 0 proc0_18(global158 global155))
)


(procedure public (proc0_15 param1 param2)
    return 
        (if (== (send param1:onControl()) param2)
            return 1
        )(else
            0
        )
)


(procedure public (proc0_16)
    (var newList, temp1[2], temp3, userCurEvent, temp5, temp6[5])
    = temp3 (send gGame:setCursor(69 1))
    = userCurEvent (User:curEvent)
    (redX:
        x((send userCurEvent:x))
        y(+ 300 (send userCurEvent:y))
        z(300)
        show()
    )
    = newList (List:new())
    (send newList:add(redX))
    Animate((send newList:elements) 1)
    Animate((send gCast:elements) 0)
    = temp5 GetTime()
    (while (not (< Abs((- temp5 GetTime())) 40) or proc999_5((send ((= userCurEvent (Event:new()))):type) 4 1))
    )
    (if (IsObject(userCurEvent))
        (send userCurEvent:dispose())
    )
    (redX:
        hide()
        posn(1000 64536)
    )
    Animate((send newList:elements) 1)
    (send newList:
        delete(redX)
        dispose()
    )
    (send gGame:setCursor(temp3))
)


(procedure public (proc0_17 param1 param2 param3 param4)
    (var temp0[500])
    (if (<u param2 1000)
        GetFarText(param2 param3 @temp0)
    )(else
        StrCpy(@temp0 param2)
    )
    (babbleIcon:
        view(param1)
        cycleSpeed(* (+ global101 1) 4)
    )
    (if (<u param2 1000)
        Print(@temp0 rest param4 82 babbleIcon 0 0)
    )(else
        Print(@temp0 param3 rest param4 82 babbleIcon 0 0)
    )
)


(procedure public (proc0_18 param1 param2)
    (if (< param1 0)
        = param1 0
    )
    (if (> param1 255)
        = param1 255
    )
    (if (< param2 0)
        = param2 0
    )
    (if (> param2 15)
        = param2 15
    )
    return 
        (if (Btest(21))
            param1
        )(else
            param2
        )
)


(instance ego of SQEgo
    (properties
        description "Roger Wilco"
        sightAngle 180
        lookStr "It's you. Roger Wilco, space guy."
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 4
                Print("You talk to yourself but are stumped for a reply.")
            )
            (case 2
                Print("Hey! Keep your hands off yourself!   This is a family game.")
            )
            (case 10
                Print("I'll bet you wish you could!")
            )
            (case 11
                Print("Ahhh!  The aroma of several adventure games emanates from your person.")
            )
            (case 3
                (switch (param2)
                    (case 12
                        Print("You slide the pre-smoked tobacco tube in your mouth and, after noticing a hint of grease and cruel breath, decide you'll save it for a special occasion.")
                    )
                    (default 
                        proc0_16()
                    )
                )
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance egoHead of Head
    (properties
        description "Roger Wilco"
        lookStr "Roger Wilco, space guy."
        view 4
    )

    (method (doVerb param1 param2)
        (send gEgo:doVerb(param1 param2))
    )

)
(instance longSong of Sound
    (properties
        number 1
    )
)
(instance longSong2 of Sound
    (properties
        number 1
    )
)
(instance pointsSound of Sound
    (properties
        number 888
        priority 15
        flags 1
    )
)
(instance stopGroop of Grooper
    (properties)

    (method (doit param1)
        (if (IsObject((send gEgo:cycler)) and (send ((send gEgo:cycler)):isKindOf(StopWalk)))
            (send gEgo:view((send ((send gEgo:cycler)):vWalking)))
        )
        (super:doit(rest param1))
    )

)
(instance babbleIcon of DCIcon
    (properties)

    (method (init)
        (send (= cycler (RandCycle:new())):init(self 20))
    )

)
(instance sq4KeyDownHandler of EventHandler
    (properties)
)
(instance sq4MouseDownHandler of EventHandler
    (properties)
)
(instance sq4DirectionHandler of EventHandler
    (properties)
)
(instance public sq4 of Game
    (properties)

    (method (init)
        (var temp0)
        = gSq4Win sq4Win
        proc802_0()
        = gStopGroop stopGroop
        = global34 1
        (super:init())
        StrCpy(@global42 "")
        = gSq4DoVerbCode sq4DoVerbCode
        = gSq4FtrInit sq4FtrInit
        = gSq4KeyDownHandler sq4KeyDownHandler
        (send gSq4KeyDownHandler:add())
        = gSq4MouseDownHandler sq4MouseDownHandler
        (send gSq4MouseDownHandler:add())
        = gSq4DirectionHandler sq4DirectionHandler
        (send gSq4DirectionHandler:add())
        = gPseudoMouse PseudoMouse
        (self:
            egoMoveSpeed(0)
            setCursor(global19 1 304 172)
        )
        = gEgoHead egoHead
        = gEgo ego
        (send gEgo:
            _head(gEgo)
            moveSpeed((self:egoMoveSpeed))
            cycleSpeed((self:egoMoveSpeed))
        )
        (send ((send gEgo:_head)):client(gEgo))
        (User:
            alterEgo(gEgo)
            verbMessager(0)
            canControl(0)
            canInput(0)
        )
        = gLongSong longSong
        (send gLongSong:
            owner(self)
            init()
        )
        = gLongSong2 longSong2
        (send gLongSong2:
            owner(self)
            init()
        )
        = global21 997
        = global16 315
        = global22 4
        = gLOOKUP_ERROR LOOKUP_ERROR
        = global106 DoSound(3)
        = global105 Graph(2)
        (if ((>= global105 2) and (<= global105 16))
            Bclear(21)
        )(else
            Bset(21)
        )
        (sq4Win:
            color(0)
            back(proc0_18(global158 global155))
            topBordColor(gBack)
            lftBordColor(proc0_18(global161 gBack))
            rgtBordColor(proc0_18(global157 global156))
            botBordColor(global156)
        )
        (gcWin:
            color(0)
            back(proc0_18(global158 global155))
            topBordColor(gBack)
            lftBordColor(proc0_18(global161 gBack))
            rgtBordColor(proc0_18(global157 global156))
            botBordColor(global156)
        )
        (invWin:
            color(0)
            back(proc0_18(global156 global155))
            topBordColor(proc0_18(global158 gBack))
            lftBordColor(proc0_18(global157 gBack))
            rgtBordColor(proc0_18(global155 global156))
            botBordColor(proc0_18(gColor global156))
            insideColor(proc0_18(global155 global156))
            topBordColor2(gColor)
            lftBordColor2(gColor)
            botBordColor2(proc0_18(global158 gBack))
            rgtBordColor2(proc0_18(global161 gBack))
        )
        = gIconBar IconBar
        (send gIconBar:
            add(icon0 icon1 icon2 icon3 icon6 icon7 icon4 icon5 icon8 icon9)
            eachElementDo(102)
            eachElementDo(182 0)
            eachElementDo(183 proc0_18(global158 global155))
            curIcon(icon0)
            useIconItem(icon4)
            helpIconItem(icon9)
            disable()
        )
        (icon5:message(
            (if (HaveMouse())
                3840
            )(else
                9
            )
))
        (Inv:
            init()
            add(buckazoid rope bomb rabbit battery jar {paper with gum} {oxygen tank} hintbook pen atmCard plug cigar matches diskette {laptop computer} invLook invHand invSelect invHelp ok)
            eachElementDo(182 0)
            eachElementDo(183 global155)
            eachElementDo(102)
            window(invWin)
            helpIconItem(invHelp)
            selectIcon(invSelect)
            okButton(ok)
        )
        (GameControls:
            window(gcWin)
            add(iconOk (detailSlider:
                    theObj(self)
                    selector(340)
                    topValue(3)
                    bottomValue(0)
                    yourself()
                )
 (volumeSlider:
                    theObj(self)
                    selector(350)
                    topValue(
                        (if (> global106 1)
                            15
                        )(else
                            1
                        )
)
                    bottomValue(0)
                    yourself()
                )
 (speedSlider:
                    theObj(self)
                    selector(346)
                    topValue(1)
                    bottomValue(15)
                    yourself()
                )
 (iconSave:
                    theObj(self)
                    selector(78)
                    yourself()
                )
 (iconRestore:
                    theObj(self)
                    selector(79)
                    yourself()
                )
 (iconRestart:
                    theObj(self)
                    selector(344)
                    yourself()
                )
 (iconQuit:
                    theObj(self)
                    selector(349)
                    yourself()
                )
 (iconAbout:
                    theObj(ScriptID(811 0))
                    selector(60)
                    yourself()
                )
 iconHelp)
            eachElementDo(182 0)
            eachElementDo(183 proc0_18(global157 global156))
            helpIconItem(iconHelp)
            curIcon(iconRestore)
        )
        (buckazoid:owner(gEgo))
        = global107 
            (if (GameIsRestarting())
                60
            )(else
                1
            )
        (self:newRoom(803))
    )


    (method (doit)
        (super:doit())
        (if (not proc999_5(gNumber 803 1 6 9 10 15 16 17 19 20 21 59 119 120 150 321 329 330 335 340 345 350 355 371 398 500 505 510 514 515 520 525 531 541 615))
            (send (ScriptID(808 0)):doit())
        )
    )


    (method (replay)
        proc0_14(-1)
        Palette(4 0 255 100)
        (super:replay())
    )


    (method (newRoom param1)
        (if (== (send ((send gInv:at(12))):state) 1)
            Print("The cigar goes, as cigars often do, out.")
            (send ((send gInv:at(12))):state(0))
        )
        (super:newRoom(rest param1))
    )


    (method (startRoom param1)
        (if (gPseudoMouse)
            (send gPseudoMouse:stop())
        )
        (send (ScriptID(801)):doit(param1))
        (if (global14)
            SetDebug()
        )
        (if (proc999_5(param1 370 371 375 376 380 381 385 386 387 390 391 395 397 398 399 400 405 406 410 411))
            RegionPath
            ScriptID(700)
            = global102 700
            (if (proc999_5(param1 405 406 410 411))
                ScriptID(809)
            )
        )(else
            (if (proc999_5(param1 25 30 35 40 45 50 55 60 65))
                RegionPath
                ScriptID(701)
                = global102 701
                (if (proc999_5(param1 25 30 35 40 45 50 55 60 65))
                    ScriptID(705)
                )
            )(else
                (if (proc999_5(param1 75 80 85 90 95 100 105 110 115))
                    ScriptID(702)
                )(else
                    (if (proc999_5(param1 609 610 611 612 613 614 615 620))
                        ScriptID(706)
                    )(else
                        (if (proc999_5(param1 299 300 305 306 310 315 320 298))
                            ScriptID(703)
                        )(else
                            (if (proc999_5(param1 150 500 505 510 514 515 520 525 541 544 545))
                                RegionPath
                                ScriptID(704)
                                = global102 704
                            )(else
                                (if (proc999_5(param1 1 6 9 10 15 16 17 19 20 21))
                                    ScriptID(707)
                                )(else
                                    (if (proc999_5(param1 530 535 540))
                                        ScriptID(709)
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
        (if (not proc999_5(param1 803 1 6 9 10 15 16 17 19 20 21 59 119 120 150 321 329 330 335 340 345 350 355 371 398 500 505 510 514 515 520 525 531 541 615))
            ScriptID(808)
        )
        ScriptID(982)
        (super:startRoom(param1))
        (if ((send gCast:contains(gEgo)))
            (if (((send gEgo:normal) and not proc999_5(param1 405 406 410 411)) and not (send ((send gEgo:cycler)):isKindOf(StopWalk)))
                (send gEgo:setCycle(StopWalk 4))
            )
            (if (not (send gEgo:looper))
                (send gEgo:setLoop(stopGroop))
            )
            proc0_9((egoHead:view))
        )
        (redX:
            init()
            hide()
            setPri(15)
            posn(1000 64536)
        )
    )


    (method (restart)
        (babbleIcon:
            view(946)
            cycleSpeed(* (+ global101 1) 4)
        )
        (if (Print("\"Are you sure you want to restart?\""))
            (super:restart())
        )
    )


    (method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if ((send pEvent:claimed))
            return 1
        )
        return 
            (switch ((send pEvent:type))
                (case 4
                    (switch ((send pEvent:message))
                        (case 9
                            (if (not & (icon5:signal) $0004)
                                (Inv:showSelf(gEgo))
                            )
                        )
                        (case 3840
                            (if (not & (icon5:signal) $0004)
                                (Inv:showSelf(gEgo))
                            )
                        )
                        (case 17
                            (send gGame:quitGame())
                            (send pEvent:claimed(1))
                        )
                        (case 15360
                            (if ((send gGame:masterVolume()))
                                (send gGame:masterVolume(0))
                            )(else
                                (if (> global106 1)
                                    (send gGame:masterVolume(15))
                                )(else
                                    (send gGame:masterVolume(1))
                                )
                            )
                            (send pEvent:claimed(1))
                        )
                        (case 16128
                            (send gGame:save())
                            (send pEvent:claimed(1))
                        )
                        (case 16640
                            (send gGame:restore())
                            (send pEvent:claimed(1))
                        )
                        (case 17152
                            (send gGame:restart())
                            (send pEvent:claimed(1))
                        )
                    )
                )
            )
    )


    (method (quitGame)
        (babbleIcon:
            view(946)
            cycleSpeed(* (+ global101 1) 4)
        )
        (super:quitGame(Print("\"See ya on the chronostream, Time Jockey!\"")))
    )


    (method (pragmaFail)
        (if ((User:canInput()))
            proc0_16()
        )
    )

)
(instance ok of IconI
    (properties)

    (method (init)
        (self:
            highlightColor(0)
            lowlightColor(proc0_18(global158 global155))
        )
        (super:init())
    )

)
(instance invLook of IconI
    (properties)

    (method (init)
        (self:
            highlightColor(0)
            lowlightColor(proc0_18(global158 global155))
        )
        (super:init())
    )

)
(instance invHand of IconI
    (properties)

    (method (init)
        (self:
            highlightColor(0)
            lowlightColor(proc0_18(global158 global155))
        )
        (super:init())
    )

)
(instance invHelp of IconI
    (properties)

    (method (init)
        (self:
            highlightColor(0)
            lowlightColor(proc0_18(global158 global155))
        )
        (super:init())
    )

)
(instance invSelect of IconI
    (properties)

    (method (init)
        (self:
            highlightColor(0)
            lowlightColor(proc0_18(global158 global155))
        )
        (super:init())
    )

)
(instance buckazoid of InvI
    (properties
        view 700
        cursor 1
        signal 2
    )

    (method (doVerb param1)
        (asm
            lsp     param1
            dup     
            ldi     1
            eq?     
            bnt     code_0fd7
            pushi   4
            pushi   0
            pushi   8
            lsg     global159
            dup     
            ldi     1
            eq?     
            bnt     code_0fcf
            lofsa   "."
            jmp     code_0fd2
code_0fcf:  lofsa   "s."
code_0fd2:  push    
            calle   proc255_4, 8
code_0fd7:  toss    
            ret     
        )
    )

)
(instance jar of InvI
    (properties
        view 700
        cel 1
        cursor 15
        signal 2
        description "glass jar"
        owner 70
    )

    (method (doVerb param1)
        (switch (param1)
            (case 1
                (if (== cel 2)
                    Print("You have a jar of green acid.")
                )(else
                    Print("You have an empty jar.")
                )
            )
        )
    )

)
(instance hintbook of InvI
    (properties
        view 700
        cel 4
        cursor 18
        signal 2
        description "An SQ 4 hintbook."
    )

    (method (doVerb param1)
        (switch (param1)
            (case 2
                (if ((send global2:script))
                    Print("You're far too busy for that now.")
                )(else
                    (if (proc999_5(gNumber 397 398) and not Btest(31))
                        Print("Hey! This isn't a free hint service.  You need to pay for it before you read it!")
                    )(else
                        (if (not proc0_4(6800))
                            Print("Sorry, you don't have enough memory to view the hint book.")
                        )(else
                            (Inv:
                                curIcon((send gInv:at(9)))
                                hide()
                            )
                            (send global2:setScript(ScriptID(708 0)))
                        )
                    )
                )
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance pen of InvI
    (properties
        view 700
        cel 5
        cursor 8
        signal 2
        description "Yes, it's a Reveal-O-matic electric hint revealer."
    )
)
(instance atmCard of InvI
    (properties
        view 700
        cel 6
        cursor 2
        signal 2
        description "An AutoBucks Teller Machine card."
    )
)
(instance plug of InvI
    (properties
        view 700
        cel 7
        cursor 5
        signal 2
        description "A PocketPal adaptor plug."
    )
)
(instance cigar of InvI
    (properties
        view 700
        cel 8
        cursor 3
        signal 2
        description "An obviously used stogie."
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                (if (<> param2 13)
                    0
                )(else
                    (if (state)
                        Print("The horrid-smelling smoke eminating from its tip would indicate that the cigar is already lit.")
                    )(else
                        Print("You slide the conveniently pre-moistened stogie between your lips, apply fire via a match, and proceed to nearly hack up a lung.")
                        = state 1
                    )
                )
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance matches of InvI
    (properties
        view 700
        cel 9
        cursor 4
        signal 2
        description "A book of matches."
    )
)
(instance diskette of InvI
    (properties
        view 700
        cel 10
        cursor 11
        signal 2
    )

    (method (doVerb param1)
        (switch (param1)
            (case 1
                Print("The label on the diskette reads:\n\n     Roger Jr.\n     Brain Tools\n     Stunt Flyer")
            )
        )
    )

)
(instance rabbit of InvI
    (properties
        view 700
        cel 11
        cursor 9
        signal 2
        description "cute bunny"
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (if (<> view 700)
                    (Inv:hide())
                    (self:
                        view(700)
                        loop(0)
                        cel(11)
                    )
                    (Inv:show(gEgo))
                )(else
                    (if (not (send ((send gInv:at(4))):owner))
                        (Inv:hide())
                        (self:
                            view(701)
                            loop(0)
                            cel(0)
                        )
                        (Inv:show(gEgo))
                    )(else
                        Print("A darn cute bunny.")
                    )
                )
            )
            (case 2
                (if (== view 700)
                    0
                )(else
                    proc0_11(67 3)
                    Print("You extract the portable power pellet from the rear confines of the hare's polyplastoid torso.")
                    (Inv:hide())
                    (send gEgo:get(4))
                    (self:
                        view(700)
                        loop(0)
                        cel(11)
                    )
                    (Inv:show(gEgo))
                )
            )
            (case 3
                (switch (param2)
                    (case 4
                        Print("You clumsily insert the battery into the furry burrow inhabitant's hollow trunk.")
                        (Inv:hide())
                        (send gEgo:put(4 0))
                        (Inv:
                            curIcon(0)
                            show(gEgo)
                        )
                    )
                )
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance battery of InvI
    (properties
        view 700
        cel 12
        cursor 13
        signal 2
        description "A battery."
    )
)
(instance {oxygen tank} of InvI
    (properties
        view 700
        cel 13
        cursor 12
        signal 2
        description "An oxygen tank."
        owner 335
    )
)
(instance rope of InvI
    (properties
        view 700
        cel 14
        cursor 10
        signal 2
        description "A crummy piece of rope."
        owner 65
    )
)
(instance {laptop computer} of InvI
    (properties
        view 700
        cel 15
        cursor 17
        signal 2
        description "A handy Dandy PocketPal portable terminal."
        owner 55
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (if (<> view 700)
                    (Inv:hide())
                    (self:
                        view(700)
                        loop(0)
                        cel(15)
                    )
                    (Inv:show(gEgo))
                )(else
                    (if (== (send ((send gInv:at(4))):owner) 1)
                        Print("Your PocketPal now has power. Now all you need is a place to use it.")
                    )(else
                        (Inv:hide())
                        (self:
                            view(701)
                            loop(0)
                            cel(1)
                        )
                        (Inv:show(gEgo))
                    )
                )
            )
            (case 2
                (if (== (send ((send gInv:at(4))):owner) 1)
                    Print("You liberate the battery from the PocketPal.")
                    (Inv:hide())
                    (send gEgo:get(4))
                    (Inv:show(gEgo))
                )(else
                    Print("This is just a dumb terminal. It won't do anything by itself.")
                )
            )
            (case 3
                (switch (param2)
                    (case 4
                        proc0_11(72 3)
                        Print("You plug the mobile power cylinder into the laptop.")
                        (Inv:hide())
                        (self:
                            view(700)
                            loop(0)
                            cel(15)
                        )
                        (send gEgo:put(4 1))
                        (Inv:
                            curIcon(0)
                            show(gEgo)
                        )
                    )
                    (case 11
                        proc0_11(71 3)
                        Print("You attach the plug to the PocketPal.")
                        (Inv:hide())
                        (send gEgo:put(11 1))
                        (Inv:
                            curIcon(0)
                            show(gEgo)
                        )
                    )
                )
            )
        )
    )

)
(instance {paper with gum} of InvI
    (properties
        view 700
        loop 2
        cursor 21
        signal 2
        description "Paper-wrapped gum - a Pinedale dining delight."
        owner 297
    )

    (method (doVerb param1)
        (switch (param1)
            (case 1
                (if (cel)
                    Print("These symbols look vaguely familiar. Now, where have you seen them?")
                )(else
                    Print("Ummm! This lumpy paper-wrapped wad looks mighty interesting.")
                )
            )
            (case 2
                (if (not cel)
                    (Inv:hide())
                    (self:
                        view(700)
                        loop(2)
                        cel(1)
                    )
                    (Inv:show(gEgo))
                )
            )
            (default 
                (super:doVerb(param1))
            )
        )
    )

)
(instance bomb of InvI
    (properties
        view 700
        cel 3
        cursor 22
        signal 2
        description "A piece of unstable ordnance."
        owner 40
    )
)
(instance redX of View
    (properties
        view 942
    )
)
(instance icon0 of IconI
    (properties)
)
(instance icon1 of IconI
    (properties)
)
(instance icon2 of IconI
    (properties)
)
(instance icon3 of IconI
    (properties)
)
(instance icon4 of IconI
    (properties)
)
(instance icon5 of IconI
    (properties)

    (method (select)
        (if ((super:select()))
            (Inv:showSelf(gEgo))
        )
    )

)
(instance icon6 of IconI
    (properties)
)
(instance icon7 of IconI
    (properties)
)
(instance icon8 of IconI
    (properties)

    (method (select)
        (if ((super:select()))
            (send gIconBar:hide())
            (GameControls:show())
        )
    )

)
(instance icon9 of IconI
    (properties)
)
(instance sq4DoVerbCode of Code
    (properties)

    (method (doit param1 param2)
        (var temp0)
        = temp0 (send param2:description)
        (switch (param1)
            (case 1
                (if ((send param2:facingMe(gEgo)))
                    (if ((send param2:lookStr))
                        Print((send param2:lookStr))
                    )(else
                        proc0_16()
                    )
                )
            )
            (default 
                proc0_16()
            )
        )
    )

)
(instance sq4FtrInit of Code
    (properties)

    (method (doit param1)
        (if (== (send param1:sightAngle) 26505)
            (send param1:sightAngle(90))
        )
        (if (== (send param1:actions) 26505)
            (send param1:actions(0))
        )
    )

)
(instance sq4Win of BorderWindow
    (properties)
)
(instance invWin of InsetWindow
    (properties)
)
(instance gcWin of BorderWindow
    (properties)

    (method (open)
        (var temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, theGBack, temp10, temp11, temp12, temp13, temp14[15], temp29[4])
        (self:
            top(/ (- 200 (+ CelHigh(947 1 1) 6)) 2)
            left(/ (- 320 (+ 151 CelWide(947 0 1))) 2)
            bottom(+ (+ CelHigh(947 1 1) 6) (/ (- 200 (+ CelHigh(947 1 1) 6)) 2))
            right(+ (+ 151 CelWide(947 0 1)) (/ (- 320 (+ 151 CelWide(947 0 1))) 2))
            priority(15)
        )
        (super:open())
        DrawCel(947 0 5 + (/ (- (- (+ 151 CelWide(947 0 1)) (+ 4 CelWide(947 1 1))) CelWide(947 0 5)) 2) (+ 4 CelWide(947 1 1)) 6 15)
        DrawCel(947 1 1 4 3 15)
        DrawCel(947 1 0 94 38 15)
        DrawCel(947 1 0 135 38 15)
        DrawCel(947 0 4 63 - 37 (+ CelHigh(947 0 4) 3) 15)
        DrawCel(947 0 3 101 - 37 (+ CelHigh(947 0 4) 3) 15)
        DrawCel(947 0 2 146 - 37 (+ CelHigh(947 0 4) 3) 15)
        = temp2 (+ 46 CelHigh(947 0 1))
        = temp5 (+ temp2 13)
        = temp3 (+ 10 CelWide(947 1 1))
        = temp4 (+ temp3 (- (+ 151 CelWide(947 0 1)) (+ (+ 10 CelWide(947 1 1)) 6)))
        = temp12 15
        = temp6 0
        = temp8 global156
        = temp11 proc0_18(global157 global156)
        = temp10 proc0_18(global161 gBack)
        = theGBack gBack
        = temp1 3
        = temp7 3
        Graph(11 temp2 temp3 + temp5 1 + temp4 1 temp7 temp6 temp12)
        = temp2 (- temp2 temp1)
        = temp3 (- temp3 temp1)
        = temp4 (+ temp4 temp1)
        = temp5 (+ temp5 temp1)
        Graph(11 temp2 temp3 + temp2 temp1 temp4 temp7 temp8 temp12)
        Graph(11 - temp5 temp1 temp3 temp5 temp4 temp7 theGBack temp12)
        = temp13 0
        (while (< temp13 temp1)
            Graph(4 + temp2 temp13 + temp3 temp13 - temp5 (+ temp13 1) + temp3 temp13 temp11 temp12)
            Graph(4 + temp2 temp13 - temp4 (+ temp13 1) - temp5 (+ temp13 1) - temp4 (+ temp13 1) temp10 temp12)
            ++temp13
        )
        Graph(12 temp2 temp3 + temp5 1 + temp4 1 1)
        Format(@temp14 0 28 global15 global16)
        TextSize(@temp29 @temp14 999 0)
        Display(@temp14 105 999 102 proc0_18(global161 gBack) 100 + (+ 10 CelWide(947 1 1)) (/ (- (- (+ 151 CelWide(947 0 1)) (+ (+ 10 CelWide(947 1 1)) 6)) temp29[3]) 2) + (+ 46 CelHigh(947 0 1)) 3)
    )

)
(instance detailSlider of Slider
    (properties
        view 947
        loop 0
        cel 1
        nsLeft 67
        nsTop 37
        signal 128
        helpStr "Raises and lowers the level of graphics detail."
        sliderView 947
        topValue 3
    )
)
(instance volumeSlider of Slider
    (properties
        view 947
        loop 0
        cel 1
        nsLeft 107
        nsTop 37
        signal 128
        helpStr "Adjusts sound volume."
        sliderView 947
        topValue 15
    )
)
(instance speedSlider of Slider
    (properties
        view 947
        loop 0
        cel 1
        nsLeft 147
        nsTop 37
        signal 128
        helpStr "Adjusts the speed of the game's animation (within the limits of your computer's capability)."
        sliderView 947
        bottomValue 15
    )
)
(instance iconSave of ControlIcon
    (properties
        view 947
        loop 2
        cel 0
        nsLeft 8
        nsTop 6
        message 9
        signal 387
        helpStr "Saves your current game."
    )
)
(instance iconRestore of ControlIcon
    (properties
        view 947
        loop 3
        cel 0
        nsLeft 8
        nsTop 26
        message 9
        signal 387
        helpStr "Restores a previously saved game."
    )
)
(instance iconRestart of ControlIcon
    (properties
        view 947
        loop 4
        cel 0
        nsLeft 8
        nsTop 46
        message 9
        signal 387
        helpStr "Restarts the Game."
    )
)
(instance iconQuit of ControlIcon
    (properties
        view 947
        loop 5
        cel 0
        nsLeft 8
        nsTop 66
        message 9
        signal 451
        helpStr "Exits the game."
    )
)
(instance iconAbout of ControlIcon
    (properties
        view 947
        loop 6
        cel 0
        nsLeft 8
        nsTop 86
        message 9
        signal 451
        helpStr "Information about the game."
    )
)
(instance iconHelp of IconI
    (properties)
)
(instance iconOk of IconI
    (properties)
)
