(include "sci.sh")
(use "Main")
(use "Scaler")
(use "n958")
(use "Cycle")
(use "Sounds")
(use "View")
(use "Obj")
(script 106)



(instance public rm106 of Rm
    (properties
        picture 35
        style 10
        horizon eurek
        vanishingX 255
        vanishingY eurek
    )

    (method (init)
        (send gRoom:setRegions(210))
        proc958_0(128 156 158)
        (send gSQ5:setScript(sGo))
        (send gSQ5:handsOff())
        (super:init())
    )

)
(instance eurek of Actor
    (properties
        x 176
        y 87
        view 158
        signal 24576
    )

    (method (init param1)
        (self:
            setLoop(0)
            setCel(0)
            moveSpeed(4)
            setStep(8 8)
            setScale(Scaler 100 15 134 86)
        )
        (super:init(rest param1))
    )

)
(instance ship of Prop
    (properties
        view 156
        signal 24576
    )
)
(instance ship1 of Prop
    (properties
        view 156
        cel 1
        signal 24576
    )
)
(instance ship2 of Prop
    (properties
        view 156
        cel 2
        signal 24576
    )
)
(instance ship3 of Prop
    (properties
        view 156
        cel 3
        signal 24576
    )
)
(instance ship4 of Prop
    (properties
        view 156
        cel rm106
        signal 24576
    )
)
(instance ship5 of Prop
    (properties
        view 156
        cel 5
        signal 24576
    )
)
(instance door of Prop
    (properties
        x 174
        y 84
        view 158
        loop 2
        cel 2
    )
)
(instance sCyclePal of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (Palette(6 251 253 1) Palette(6 253 255 1) = cycles 3  )
            )
            (case 1
                (= state (- state 2) = cycles 1 )
            )
        )
    )

)
(instance sCycleLights of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (Palette(6 250 255 10) = cycles 1  )
            )
            (case 1
                (= state (- state 2) = cycles 1 )
            )
        )
    )

)
(instance sGo of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (= cycles 1  )
            )
            (case 1
                (= seconds 1 (self:setScript(sCyclePal)) (send gSq5Music1:
                    number(44)
                    loop(-1)
                    play()
                )
  )
            )
            (case 2
                ((door:
                    init()
                    setLoop(4)
                    cel(2)
                    setCycle(Beg self)
                )
  )
            )
            (case 3
                (= seconds 2  )
            )
            (case 4
                (Palette(1 1060 2) (eurek:
                    init()
                    setMotion(MoveTo 81 158 self)
                )
  )
            )
            (case 5
                ((door:setCycle(End)) (eurek:
                    setScale(0)
                    setCycle(End self)
                    cycleSpeed(4)
                )
  )
            )
            (case 6
                ((eurek:
                    posn(203 144)
                    setLoop(1)
                    setCycle(End self)
                )
  )
            )
            (case 7
                ((eurek:
                    posn(264 129)
                    setLoop(2)
                    setCycle(End self)
                )
  )
            )
            (case 8
                ((eurek:
                    posn(269 60)
                    setLoop(3)
                    setCycle(End self)
                )
 (send gSq5Music2:
                    number(163)
                    loop(1)
                    play()
                )
  )
            )
            (case 9
                ((eurek:
                    setLoop(5)
                    cel(1)
                    x(271)
                    y(42)
                    setCycle(Beg self)
                )
  )
            )
            (case 10
                ((eurek:setCycle(End self)) (send gSq5Music2:fade())  )
            )
            (case 11
                ((eurek:dispose()) (send gSq5Music1:fade()) = seconds 4  )
            )
            (case 12
                ((ship:
                    init()
                    addToPic()
                )
 DrawPic(35 9) (send gSq5Music1:
                    number(35)
                    loop(-1)
                    play()
                )
 = cycles 1  )
            )
            (case 13
                ((ship3:
                    init()
                    addToPic()
                )
 DrawPic(35 9) = cycles 1  )
            )
            (case 14
                ((ship5:
                    init()
                    addToPic()
                )
 DrawPic(35 9) = cycles 1  )
            )
            (case 15
                (= seconds 3  )
            )
            (case 16
                ((send gRoom:newRoom(107)) (self:dispose()) )
            )
        )
    )

)
