(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "ulence")
(use "SQRoom")
(use "PolyPath")
(use "Polygon")
(use "Class_950_0")
(use "Cycle")
(use "PicView")
(use "Obj")
(script 613)



(instance public rm613 of SQRoom
    (properties
        picture 613
        east 614
        south 610
        west 612
    )

    (method (init)
        (ulence:roomVer(22891))
        Load(rsVIEW 305)
        Load(rsVIEW 378)
        Load(rsVIEW 617)
        Load(rsSOUND 124)
        Load(rsSOUND 125)
        Load(rsSOUND 142)
        (switch (gWest)
            (case 609
                (send gEgo:
                    x(14)
                    y(185)
                )
            )
            (case 610
                (if (proc0_6(75))
                    (ulence:
                        status(2)
                        bikerComing(1)
                    )
                    Load(rsVIEW 633)
                    Load(rsVIEW 635)
                    Load(rsSOUND 50)
                    (self:setScript(bringInBike))
                )
                (send gLongSong2:
                    number(0)
                    vol(0)
                    stop()
                )
            )
            (case 612
                (if (< (send gEgo:y) 146)
                    (send gEgo:y(134))
                )
            )
            (case 614
                (if (> (send gEgo:y) 171)
                    (send gEgo:y(171))
                )
            )
            (default 
                (send gEgo:
                    setLoop(0)
                    setCel(0)
                    posn(1000 1000)
                )
                (if (proc0_6(75))
                    (ulence:status(1))
                )
                (send gLongSong:flags(1))
                (send gLongSong2:flags(1))
                (self:setScript(landShip))
            )
        )
        (door:
            init()
            setCel(0)
        )
        (ship:init())
        (send gEgo:
            init()
            illegalBits(0)
            ignoreActors(1)
        )
        (super:init())
        (self:
            setFeatures(building)
            setRegions(706)
            addObstacle((send ((Polygon:new())):
                    type(2)
                    init(0 0 319 0 319 162 261 160 225 152 191 136 197 133 205 127 190 122 149 121 144 140 104 140 59 154 38 146 40 124 0 124)
                    yourself()
                )
)
        )
        (if ((> Random(0 100) 20) and (== (ulence:status) 1))
            (ulence:
                status(2)
                bikerComing(1)
            )
            Load(rsVIEW 633)
            Load(rsVIEW 635)
            Load(rsSOUND 50)
        )(else
            (ulence:bikerComing(0))
        )
        (send (ScriptID(706 7)):
            init()
            nsLeft(0)
            nsTop(91)
            nsBottom(189)
            nsRight(319)
        )
        (send (ScriptID(706 8)):
            init()
            nsLeft(0)
            nsTop(0)
            nsBottom(90)
            nsRight(319)
        )
    )


    (method (doit param1)
        (if ((== (ulence:status) 4) and (< (send (ScriptID(706 1)):distanceTo(gEgo)) 15))
            proc0_2()
            (ulence:status(6))
            (send gEgo:setScript(0))
            (ulence:deathLoop(1))
            (self:setScript(ScriptID(706 3)))
        )
        (if (script)
            0
        )(else
            (if ((== (ulence:status) 2) and (send gEgo:inRect(220 170 259 182)))
                proc0_2()
                (ulence:status(3))
                (send (ScriptID(706 1)):
                    view(633)
                    init()
                    hide()
                    posn(0 - (send gEgo:y) 5)
                    setLoop(0)
                    setScript(bikerScriptL)
                )
                (send gEgo:setScript(ScriptID(706 5)))
            )
        )
        (super:doit(rest param1))
    )

)
(instance landShip of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (door:setPri(14))
                (send gEgo:
                    view(378)
                    posn(106 143)
                    illegalBits(0)
                    ignoreActors(1)
                    normal(0)
                )
                = cycles 1
            )
            (case 1
                (send gLongSong2:
                    number(838)
                    loop(1)
                    vol(127)
                    play()
                )
                (send gEgo:show())
                = seconds 2
            )
            (case 2
                (send gLongSong2:
                    number(124)
                    loop(1)
                    play(self)
                )
            )
            (case 3
                (send gLongSong2:
                    number(142)
                    loop(1)
                    play()
                )
                (door:setCycle(End self))
            )
            (case 4
                (send gLongSong2:stop())
                = seconds Random(2 4)
            )
            (case 5
                (send gEgo:setCycle(End self))
            )
            (case 6
                proc0_1((send gEgo:loop) 0)
                (ship:
                    priority(-1)
                    stopUpd()
                )
                = cycles 1
            )
            (case 7
                (send gEgo:setHeading(135 self))
            )
            (case 8
                (send gEgo:
                    setLoop(4)
                    heading(135)
                    setMotion(MoveTo 110 142 self)
                )
            )
            (case 9
                (send gLongSong2:play())
                (door:
                    setPri(5)
                    setCycle(Beg self)
                )
            )
            (case 10
                (send gLongSong2:
                    number(125)
                    play()
                )
                proc0_1((send gEgo:loop) 0)
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance enterPod of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gEgo:
                    illegalBits(0)
                    ignoreActors(1)
                    setMotion(PolyPath 111 147 self)
                )
            )
            (case 1
                (send gLongSong2:
                    vol(127)
                    number(142)
                    loop(1)
                    play()
                )
                (door:setCycle(End self))
            )
            (case 2
                (send gLongSong2:stop())
                (door:setPri(14))
                (send gEgo:
                    setPri(5)
                    posn(110 121)
                    setCel(0)
                    view(378)
                    setLoop(1)
                    cycleSpeed(1)
                )
                = cycles 1
            )
            (case 3
                (send gEgo:setCycle(End self))
            )
            (case 4
                (send gLongSong2:
                    vol(127)
                    play()
                )
                (door:setCycle(Beg self))
            )
            (case 5
                (send gLongSong2:
                    number(125)
                    vol(127)
                    play()
                )
                (send gLongSong:fade())
                DrawStatus(" " global146 0)
                (send global2:newRoom(531))
            )
        )
    )

)
(instance bikerScriptL of Script
    (properties)

    (method (changeState newState)
        (var temp0[2])
        (switch (= state newState)
            (case 0
                (ulence:egoBusy(1))
                (send gLongSong:
                    vol(25)
                    number(50)
                    loop(-1)
                    playBed()
                    fade(127 10 10 0)
                )
                = seconds 3
            )
            (case 1
                (send (ScriptID(706 6)):
                    init()
                    play()
                )
                (send (ScriptID(706 1)):
                    show()
                    setMotion(MoveTo 65 - (send gEgo:y) 5 self)
                )
            )
            (case 2
                (ulence:status(4))
                proc0_3()
                (send (ScriptID(706 1)):
                    setPri(+ (send gEgo:priority) 1)
                    setMotion(MoveTo 338 - (send gEgo:y) 5 self)
                )
            )
            (case 3
                (send gLongSong:fade())
                (send (ScriptID(706 6)):fade())
                (send (ScriptID(706 1)):hide())
                = seconds 3
            )
            (case 4
                (if (<> (ulence:status) 6)
                    (ulence:
                        status(1)
                        fieldOff(0)
                        bikerComing(0)
                        egoBusy(0)
                    )
                    (send gEgo:setScript(0))
                    proc0_3()
                    Print("Boy, that was close!")
                )
                (self:dispose())
            )
        )
    )

)
(instance bringInBike of Script
    (properties)

    (method (changeState newState)
        (var temp0[2])
        (switch (= state newState)
            (case 0
                (send gEgo:
                    posn((send gEgo:x) 238)
                    setMotion(MoveTo (send gEgo:x) 185 self)
                )
            )
            (case 1
                proc0_2()
                (ulence:status(3))
                (send (ScriptID(706 1)):
                    view(632)
                    init()
                    hide()
                    posn(364 179)
                    setLoop(1)
                    setScript(bikerScriptR)
                )
                (send gEgo:setScript(ScriptID(706 4)))
                (self:dispose())
            )
        )
    )

)
(instance bikerScriptR of Script
    (properties)

    (method (changeState newState)
        (var temp0[2])
        (switch (= state newState)
            (case 0
                (ulence:egoBusy(1))
                (send gLongSong:
                    vol(25)
                    number(50)
                    loop(-1)
                    playBed()
                    fade(127 10 10 0)
                )
                = seconds 1
            )
            (case 1
                (send (ScriptID(706 6)):
                    init()
                    play()
                )
                (send (ScriptID(706 1)):
                    show()
                    setMotion(MoveTo 164 179 self)
                )
            )
            (case 2
                (ulence:status(4))
                proc0_3()
                (send (ScriptID(706 1)):
                    setPri(+ (send gEgo:priority) 1)
                    setMotion(MoveTo 65480 - (send gEgo:y) 5 self)
                )
            )
            (case 3
                (send gLongSong:fade())
                (send (ScriptID(706 6)):fade())
                (send (ScriptID(706 1)):hide())
                = seconds 3
            )
            (case 4
                (if (<> (ulence:status) 6)
                    (ulence:
                        status(1)
                        fieldOff(0)
                        bikerComing(0)
                        egoBusy(0)
                    )
                    (send gEgo:setScript(0))
                    proc0_3()
                    Print("Boy, that was close!")
                )
                (self:dispose())
            )
        )
    )

)
(instance ship of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            setPri(4)
            addToPic()
        )
    )


    (method (doVerb param1 param2 param3)
        (switch (param1)
            (case 10
                Print("Licking a timepod that's just emerged from the chronostream is like sticking your tongue in a curling iron.")
            )
            (case 1
                Print("You give the Time Pod a long glance. It's not the most attractive vehicle you've ever seen. It resembles an overgrown titanium tennis shoe. A tinted glass shield seals the top.")
            )
            (case 2
                (if (== (ulence:egoBusy) 1)
                    Print("Not now!")
                )(else
                    proc0_2()
                    (ulence:fieldOff(1))
                    (send global2:setScript(enterPod))
                )
            )
            (case 11
                Print("It smells like a time pod broiling in the Ulence sun.")
            )
            (default 
                (super:doVerb(param1 rest param3))
            )
        )
    )

)
(instance door of Prop
    (properties)
)
(instance building of Feature
    (properties
        y 155
        nsTop 29
        nsLeft 194
        nsBottom 155
        nsRight 319
        description "building"
        sightAngle 180
        onMeCheck 2
        lookStr "This closely resembles the left side of Droids-B-Us."
    )

    (method (doVerb param1 param2 param3)
        (switch (param1)
            (case 11
                Print("It smells like an old lawsuit coming back to haunt the Two Guys From Andromeda.")
            )
            (case 10
                Print("Taste-tempting stucco! And what a nice sanding job it does on your tongue!")
            )
            (default 
                (super:doVerb(param1 rest param3))
            )
        )
    )

)
