(include "sci.sh")
(use "Main")
(use "AnimDialog")
(use "Blink")
(use "Scaler")
(use "Osc")
(use "Polygon")
(use "CueObj")
(use "n958")
(use "Sound")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 620)


(local
    local0
    local1
    local2
    local3
    local4 = 1

)
(instance theMusic3 of Sound
    (properties)
)
(instance theMusic4 of Sound
    (properties)
)
(instance public rm620 of Rm
    (properties
        noun theMusic3
        picture 100
    )

    (method (init)
        proc958_0(143 number)
        proc958_0(128 22 18)
        = style 
            (switch (gGModNum)
                (case 640
                    (12  )
                )
                (default 
                    (32778 )
                )
            )
        (super:init())
        (send gEgo:edgeHit(0))
        (send gRoom:addObstacle((send ((Polygon:new())):
                type(3)
                init(0 142 19 144 47 150 149 181 176 189 319 189 319 123 281 126 258 126 189 126 177 129 227 132 241 143 239 158 232 164 213 168 177 169 118 159 100 153 80 150 49 142 0 132 0 141)
                yourself()
            )
 (send ((Polygon:new())):
                type(3)
                init(0 113 50 110 89 113 127 105 104 94 121 91 148 96 198 88 182 77 171 70 154 77 141 80 110 75 95 66 65 69 98 85 83 87 0 73 0 112)
                yourself()
            )
))
        (if (<> global142 0)
            (pod:init())
            (podDoor:
                init()
                setOnMeCheck(1 (podDoor:onMeCheck))
            )
            (mist1:init())
            (mist2:init())
            (stems:
                init()
                setOnMeCheck(1 (stems:onMeCheck))
            )
            (path:
                init()
                setOnMeCheck(1 (path:onMeCheck))
            )
            (bigStem:
                init()
                setOnMeCheck(1 (bigStem:onMeCheck))
            )
            (chasm:
                init()
                setOnMeCheck(1 (chasm:onMeCheck))
            )
            (if (== global142 1)
                (podHeat:init())
            )
        )
        (switch (gGModNum)
            (case 640
                (
                (if (proc0_1(91))
                    (self:setScript(sEnterHigh))
                )(else
                    (self:setScript(sEnterLow))
                )
 )
            )
            (default 
                (
                (if (proc0_1(109))
                    (send gRoom:setScript(sFromShip))
                )(else
                    (send gRoom:setScript(sNoMask))
                )
 )
            )
        )
    )


    (method (doit)
        (if (not script)
            (if (& (= local3 (send gEgo:onControl(1))) $0008)
                (send gRoom:setScript(sExitLow))
            )(else
                (if (& local3 $0004)
                    (send gRoom:setScript(sExitHigh))
                )
            )
        )
        (super:doit())
    )


    (method (doVerb param1 param2)
        (switch (param1)
            (case 1
                (
                (if (== (send gRoom:curPic) 101)
                    (send gTestMessager:say(5 1 0 0))
                )(else
                    (send gTestMessager:say(14 1 0 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance sYourDead of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) proc0_6(553) (send gEgo:
                    init()
                    setLoop(9)
                    cel(0)
                    x(119)
                    y(75)
                    setCycle(End self)
                )
  )
            )
            (case 1
                ((theMusic3:
                    number(260)
                    setLoop(1)
                    play()
                )
 (puker1:
                    init()
                    setCycle(End self)
                )
 (puker2:
                    init()
                    setCycle(End self)
                )
 (puker3:
                    init()
                    setCycle(End self)
                )
  )
            )
            (case 2
                (0  )
            )
            (case 3
                (0  )
            )
            (case 4
                ((puker1:
                    setLoop(3)
                    setCel(0)
                )
 (puker2:
                    setLoop(1)
                    setCel(0)
                )
 (puker3:
                    setLoop(0)
                    setCel(0)
                )
 = seconds 2  )
            )
            (case 5
                ((send gSq5Music1:
                    number(102)
                    setLoop(1)
                    play()
                )
 (theMusic3:
                    number(32)
                    setLoop(1)
                    play()
                )
 (send gEgo:
                    setLoop(10)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 6
                (= seconds 1  )
            )
            (case 7
                ((send gSq5Music1:
                    number(519)
                    setLoop(1)
                    play()
                )
 (thePuke:
                    init()
                    setCycle(End self)
                )
  )
            )
            (case 8
                ((send gEgo:
                    setLoop(11)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 9
                (= seconds 2  )
            )
            (case 10
                (proc0_9(29) )
            )
        )
    )

)
(instance sFromShip of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gSq5Music1:
                    number(30)
                    setLoop(-1)
                    play()
                )
 = seconds 4  )
            )
            (case 1
                ((send gSq5Music2:
                    number(260)
                    setLoop(1)
                    play()
                )
 (slug:init()) proc0_6(22) (send gEgo:
                    init()
                    ignoreActors(1)
                    posn(231 132)
                    setCycle(End self)
                )
  )
            )
            (case 2
                ((send gEgo:setScript(sBreath)) 
                (if ((<> global142 0) and not proc0_1(29))
                    (myBut:
                        init()
                        hide()
                    )
                    (pod:setScript(sBeep))
                )
 proc0_6(18) (send gEgo:setHeading(180)) (send gSQ5:handsOn()) (send gSq5IconBar:curIcon((send gSq5IconBar:at(0)))) (send gSQ5:setCursor(980)) (self:dispose()) )
            )
        )
    )

)
(instance sNoMask of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) = seconds 4  )
            )
            (case 1
                ((theMusic3:
                    number(260)
                    setLoop(1)
                    play()
                )
 proc0_6(6) (send gEgo:
                    init()
                    ignoreActors(1)
                    setScale(Scaler 100 87 181 123)
                    posn(231 132)
                    setCycle(End self)
                )
  )
            )
            (case 2
                (proc0_6(553 5) (send gEgo:
                    scaleSignal(0)
                    scaleX(128)
                    scaleY(128)
                    setHeading(180)
                )
 = seconds 1  )
            )
            (case 3
                ((send gEgo:setCycle(End self))  )
            )
            (case 4
                (= seconds 2  )
            )
            (case 5
                (proc0_9(28) )
            )
        )
    )

)
(instance sExitLow of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (proc0_3(91) (send gRoom:newRoom(640)) )
            )
        )
    )

)
(instance sExitHigh of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) proc0_2(91) (send gEgo:setMotion(MoveTo 65516 100 self))  )
            )
            (case 1
                ((send gSQ5:handsOn()) (send gRoom:newRoom(640)) )
            )
        )
    )

)
(instance sEnterHigh of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) 
                (if ((<> global142 0) and not proc0_1(29))
                    (myBut:
                        init()
                        hide()
                    )
                    (pod:setScript(sBeep))
                )
 proc0_6(18 0) (send gEgo:
                    edgeHit(0)
                    init()
                    ignoreActors(1)
                    setScript(sBreath)
                    posn(6 100)
                    setScale(Scaler 93 71 122 75)
                    setMotion(MoveTo 75 89 self)
                )
  )
            )
            (case 1
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sEnterLow of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) 
                (if ((<> global142 0) and not proc0_1(29))
                    (myBut:
                        init()
                        hide()
                    )
                    (pod:setScript(sBeep))
                )
 proc0_6(18 0) (send gEgo:
                    init()
                    ignoreActors(1)
                    posn(65506 140)
                    setScale(Scaler 100 87 181 123)
                    setScript(sBreath)
                    setMotion(MoveTo 31 140 self)
                )
  )
            )
            (case 1
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance sLocateTimer of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 10  )
            )
            (case 1
                (
                (if (local0)
                    (self:dispose())
                )
 )
            )
        )
    )

)
(instance sFinishLook of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds 1  )
            )
            (case 1
                ((send gEgo:setCycle(Beg self))  )
            )
            (case 2
                (proc0_6(18) (send gEgo:
                    setScale(Scaler 93 71 122 75)
                    setHeading(180)
                )
 (send gEgo:setScript(sBreath)) (self:dispose()) )
            )
        )
    )

)
(instance sMoveSlug of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= seconds Random(2 10)  )
            )
            (case 1
                ((slug:show()) = seconds 1  )
            )
            (case 2
                ((slug:setCycle(End self))  )
            )
            (case 3
                ((slugEyes:
                    init()
                    setCycle(Osc 3 self)
                )
  )
            )
            (case 4
                ((slugEyes:dispose()) (slug:
                    setLoop(4)
                    setCycle(End self)
                )
  )
            )
            (case 5
                ((slug:dispose()) )
            )
        )
    )

)
(instance sBurnMe of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) 
                (if (& $0040 (send gEgo:onControl(1)))
                    = cycles 1
                )(else
                    (send gEgo:setMotion(MoveTo 104 82 self))
                )
 )
            )
            (case 1
                ((send gEgo:
                    scaleSignal(0)
                    scaleX(128)
                    scaleY(128)
                    view(553)
                    loop(3)
                    cel(1)
                    setCycle(End self)
                )
  )
            )
            (case 2
                ((send gEgo:
                    loop(4)
                    cel(0)
                    setCycle(End self)
                )
 (send gSq5Music1:
                    number(31)
                    setLoop(1)
                    play()
                )
 (theMusic3:
                    number(102)
                    setLoop(1)
                    play()
                )
  )
            )
            (case 3
                (= seconds 2  )
            )
            (case 4
                (
                (if (< global145 3)
                    ++global145
                )
 proc0_6(18) (send gEgo:setScale(Scaler 93 71 122 75)) (theMusic3:stop()) (send gSq5Music1:
                    number(30)
                    setLoop(-1)
                    play()
                )
 (send gTestMessager:say(12 4 0 global145 self))  )
            )
            (case 5
                ((send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance public sUseComm of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) = local2 
                    (if ((== global142 0) or proc0_1(104))
                        8
                    )(else
                        10
                    )
 (theMusic3:
                    number(603)
                    setLoop(1)
                    play()
                )
 (send gEgo:
                    view(553)
                    loop(8)
                    cel(0)
                    setCycle(End self)
                )
  )
            )
            (case 1
                ((floTalker:
                    normal(0)
                    keepWindow(1)
                    curNoun(local2)
                    curVerb(0)
                    curCase(4)
                )
 = cycles 1  )
            )
            (case 2
                ((send gSQ5:handsOn()) (send gSq5IconBar:select((send gSq5IconBar:at(2)))) (send gSQ5:setCursor(982)) (send gTestMessager:say(local2 0 4 0 self))  )
            )
            (case 3
                ((floTalker:
                    normal(1)
                    keepWindow(0)
                )
 (send gTestMessager:say(local2 0 (= local1 
                        (switch ((floTalker:whichSelect))
                            (case 1
                                (1  )
                            )
                            (case 2
                                (2  )
                            )
                            (case 3
                                (3 )
                            )
                        )
) 0 self))  )
            )
            (case 4
                ((send gEgo:setCycle(Beg self))  )
            )
            (case 5
                (proc0_6(18) (send gEgo:setHeading(180)) 
                (if (not 
                (if (== local1 1)
                    == local2 8
                )
)
                    (send gSQ5:handsOn())
                    (self:dispose())
                )(else
                    = seconds 1
                )
 )
            )
            (case 6
                ((send gEgo:
                    view(6)
                    setLoop(0)
                    cel(15)
                    setCycle(Beg self)
                )
  )
            )
            (case 7
                ((send gEgo:dispose()) = seconds 2  )
            )
            (case 8
                ((send gSQ5:handsOn()) (send gRoom:newRoom(240)) )
            )
        )
    )

)
(instance sPodScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSQ5:handsOff()) (send gEgo:setMotion(MoveTo 103 78 self))  )
            )
            (case 1
                ((send gEgo:
                    scaleSignal(0)
                    scaleX(128)
                    scaleY(128)
                    view(553)
                    loop(6)
                    cel(4)
                    setCycle(End self)
                )
  )
            )
            (case 2
                (= seconds 2  )
            )
            (case 3
                ((send gCast:eachElementDo(102)) (send gEgo:dispose()) (send gRoom:drawPic(101 100)) 
                (if (not (send gEgo:has(19)) and not proc0_1(29))
                    (frock:init())
                )
 (beltRight:
                    init()
                    cycleSpeed(16)
                    setCycle(Fwd)
                )
 (dashLights:
                    init()
                    cycleSpeed(8)
                    setCycle(Fwd)
                )
 (beltLeft:
                    init()
                    cycleSpeed(17)
                    setCycle(Fwd)
                )
 (send gSQ5:handsOn()) = ticks 20  )
            )
            (case 4
                ((outside:
                    init()
                    setOnMeCheck(1 (outside:onMeCheck))
                )
  )
            )
            (case 5
                ((send gSQ5:handsOff()) 
                (if (not proc0_1(29))
                    = next sYourDead
                )
 (send gRoom:drawPic(100 100)) (send gCast:eachElementDo(224)) (frock:dispose()) (myBut:dispose()) (beltRight:dispose()) (dashLights:dispose()) (beltLeft:dispose()) (outside:dispose()) = cycles 1  )
            )
            (case 6
                (
                (if (proc0_1(29))
                    (send gEgo:
                        init()
                        setScript(sFinishLook)
                    )
                )
 (send gSQ5:handsOn()) (self:dispose()) )
            )
        )
    )

)
(instance frock of View
    (properties
        x 92
        y 123
        noun 3
        view 565
        loop 4
        signal 20480
    )

    (method (doVerb param1)
        (switch (param1)
            (case 4
                (proc0_10(223 10) (send gEgo:get(19)) (self:dispose())  )
            )
            (default 
                ((super:doVerb(param1)) )
            )
        )
    )

)
(instance myBut of Prop
    (properties
        x 74
        y 140
        noun 1
        view 565
        loop 3
        priority 3
        signal 16
    )

    (method (doVerb param1)
        (switch (param1)
            (case 4
                ((sBeep:dispose()) proc0_10(224 35) proc0_2(29) (self:dispose())  )
            )
            (default 
                ((super:doVerb(param1)) )
            )
        )
    )


    (method (hide)
        (if (== (send gRoom:curPic) 101)
            = cel 1
        )(else
            = cel 1
            (super:hide())
        )
    )


    (method (show)
        (if (== (send gRoom:curPic) 101)
            = cel 0
            (super:show())
        )(else
            = cel 0
        )
    )

)
(instance pod of Prop
    (properties
        x 109
        y 69
        z 20
        noun 12
        view 554
        loop 5
        signal 20480
    )

    (method (doVerb param1)
        (switch (param1)
            (case 4
                (
                (if (< (send gEgo:y) 120)
                    (if (== global142 1)
                        (send gRoom:setScript(sBurnMe))
                    )(else
                        (send gRoom:setScript(sPodScript))
                    )
                )(else
                    (send gTestMessager:say(4 4 0 0))
                )
 )
            )
            (case 1
                ((send gTestMessager:say(4 1 0 0))  )
            )
            (default 
                ((super:doVerb(param1)) )
            )
        )
    )

)
(instance outside of Feature
    (properties
        x 180
        y 130
        onMeCheck 4096
    )

    (method (doVerb param1 param2)
        (switch (param1)
            (case 3
                ((sPodScript:cue())  )
            )
            (case 4
                ((sPodScript:cue())  )
            )
            (default 
                ((super:doVerb(param1 rest param2)) )
            )
        )
    )

)
(instance mist1 of Prop
    (properties
        x 177
        y 156
        view 554
        loop 3
        cel 3
        cycleSpeed 15
        detailLevel 3
    )

    (method (init)
        (super:init())
        (self:setCycle(Fwd))
    )

)
(instance mist2 of Prop
    (properties
        x 92
        y 189
        view 554
        loop 2
        cel 1
        cycleSpeed 15
        detailLevel 3
    )

    (method (init)
        (super:init())
        (self:setCycle(Fwd))
    )

)
(instance slug of Prop
    (properties
        x 277
        y 139
        noun 16
        view 554
        priority 15
        signal 16
        cycleSpeed 60
    )

    (method (init)
        (super:init())
        (self:
            hide()
            setScript(sMoveSlug)
        )
    )

)
(instance slugEyes of Prop
    (properties
        x 296
        y 135
        view 554
        loop 1
        cel 1
        priority 15
        signal 16
        cycleSpeed 15
        detailLevel 3
    )
)
(instance puker1 of Actor
    (properties
        x 158
        y 83
        view 561
        loop 9
    )
)
(instance puker2 of Actor
    (properties
        x 84
        y 90
        view 561
        loop 8
    )
)
(instance puker3 of Actor
    (properties
        x 73
        y 72
        view 561
        loop 7
    )
)
(instance podHeat of Prop
    (properties
        x 136
        y 54
        noun 17
        view 553
        cel 1
        signal 20480
        detailLevel 3
    )

    (method (init)
        (super:init())
        (self:setCycle(Fwd))
    )

)
(instance chasm of Feature
    (properties
        x 124
        y 113
        noun 2
        onMeCheck 256
    )
)
(instance stems of Feature
    (properties
        x 24
        y 57
        noun 18
        onMeCheck 4096
    )
)
(instance bigStem of Feature
    (properties
        x 285
        y 59
        noun 19
        onMeCheck 2048
    )
)
(instance path of Feature
    (properties
        x 79
        y 154
        noun 9
        onMeCheck 8192
    )
)
(instance podDoor of Feature
    (properties
        x 120
        y 155
        z 100
        noun 9
        onMeCheck 2
    )

    (method (doVerb param1)
        (switch (param1)
            (case 1
                (
                (if (< (send gEgo:y) 120)
                    (send gRoom:setScript(sPodScript))
                )(else
                    (send gTestMessager:say(4 1 0 0))
                )
 )
            )
            (default 
                ((super:doVerb(param1)) )
            )
        )
    )

)
(instance thePuke of Actor
    (properties
        x 124
        y 56
        view 561
        loop 11
        priority 15
        signal 16
    )
)
(instance dashLights of Prop
    (properties
        x 212
        y 41
        noun 11
        view 565
        cel 3
    )
)
(instance beltLeft of Prop
    (properties
        x 123
        y 95
        noun 15
        view 565
        loop 1
        cel 2
        cycleSpeed 15
    )
)
(instance beltRight of Prop
    (properties
        x 209
        y 94
        noun 15
        view 565
        loop 2
        cel 2
        cycleSpeed 20
    )
)
(instance public floTalker of ChoiceTalker
    (properties
        x 10
        y 15
        view 1008
        signal 16
        talkWidth 180
        keepWindow 1
        textX 100
        normal 1
    )

    (method (init param1)
        = font gFont
        (super:init(floBust floEyes floMouth rest param1))
    )


    (method (dispose param1)
        = gSq5Win gSq5Win_2
        (super:dispose(rest param1))
    )

)
(instance floBust of Prop
    (properties
        view 1008
    )
)
(instance floEyes of Prop
    (properties
        nsTop 33
        nsLeft 39
        view 1008
        loop 2
        signal 16384
    )
)
(instance floMouth of Prop
    (properties
        nsTop 43
        nsLeft 45
        view 1008
        loop 1
        signal 16384
    )
)
(instance sBreath of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                ((send gSq5Music2:
                    number(550)
                    setLoop(1)
                    play(self)
                )
  )
            )
            (case 1
                (= state -1 = seconds Random(2 4) )
            )
        )
    )

)
(instance sBeep of Script
    (properties)

    (method (dispose)
        (theMusic4:dispose())
        (myBut:dispose())
        (super:dispose())
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (
                (if (== (send gRoom:curPic) 101)
                    (myBut:show())
                )
 (theMusic4:
                    number(124)
                    setLoop(1)
                    play(self)
                    setVol(proc999_2(127 proc999_3(40 - 130 (send gEgo:distanceTo(pod)))))
                )
  )
            )
            (case 1
                ((myBut:hide()) = state -1 = seconds 2 )
            )
        )
    )

)
(instance public myRogTalker of Talker
    (properties
        x 10
        y 25
        view 556
        loop 5
        talkWidth 150
        back 5
        textX 120
        textY 2
    )

    (method (init param1)
        = font gFont
        (super:init(rogBust 0 rogMouth rest param1))
    )


    (method (dispose param1)
        (super:dispose(rest param1))
    )

)
(instance rogBust of Prop
    (properties
        view 556
    )
)
(instance rogMouth of Prop
    (properties
        nsTop 18
        nsLeft 43
        view 556
        loop 2
    )
)
