(version 2)
(include "sci.sh")
(exports
    0 rm021
)
(use "Main")
(use "Sound")
(use "Cycle")
(use "Game")
(use "TheMenuBar")
(use "Feature")
(use "Obj")
(script 21)


(local
    local0

)
(instance public rm021 of Rm
    (properties)

    (method (init)
        (var temp0[50])
        = global17 0
        proc0_2()
        = global159 1
        (TheMenuBar:hide())
        (SL:disable())
        Load(128 52)
        Load(132 38)
        (switch (global210)
            (case 6
                Load(129 112)
                (self:drawPic(112))
                (self:setScript(PhleebScript))
            )
            (case 5
                Load(129 113)
                (self:drawPic(113))
                (self:setScript(OrtegaScript))
            )
            (case 8
                Load(129 114)
                (self:drawPic(114))
                (self:setScript(MoonScript))
            )
        )
        (super:init())
    )

)
(instance PhleebScript of Script
    (properties)

    (method (doit)
        (super:doit())
        (if ((== local0 1) and (== (warpOut:prevSignal) -1))
            = local0 0
            (send global2:newRoom(14))
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 5
            )
            (case 1
                (ship:
                    posn(260 204)
                    setLoop(1)
                    init()
                    setStep(3 6)
                    setMotion(MoveTo 260 152 self)
                )
            )
            (case 2
                (warpOut:play())
                (ship:
                    setStep(3 3)
                    setCycle(End)
                    setMotion(MoveTo 235 136 self)
                )
            )
            (case 3
                (ship:setMotion(MoveTo 199 100 self))
            )
            (case 4
                = local0 1
            )
        )
    )

)
(instance OrtegaScript of Script
    (properties)

    (method (doit)
        (super:doit())
        (if ((== local0 1) and (== (warpOut:prevSignal) -1))
            = local0 0
            (send global2:newRoom(14))
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 5
            )
            (case 1
                (ship:
                    posn(50 204)
                    setLoop(0)
                    setPri(6)
                    init()
                    setStep(3 6)
                    setMotion(MoveTo 50 157 self)
                )
            )
            (case 2
                (warpOut:play())
                (ship:
                    setStep(3 3)
                    setCycle(End)
                    setMotion(MoveTo 89 118 self)
                )
            )
            (case 3
                (ship:
                    setPri(4)
                    setMotion(MoveTo 145 102 self)
                )
            )
            (case 4
                = local0 1
            )
        )
    )

)
(instance MoonScript of Script
    (properties)

    (method (doit)
        (super:doit())
        (if ((== local0 1) and (== (warpOut:prevSignal) -1))
            = local0 0
            (send global2:newRoom(14))
        )
    )


    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = cycles 5
            )
            (case 1
                (ship:
                    posn(124 204)
                    setLoop(0)
                    setPri(6)
                    init()
                    setStep(3 6)
                    setMotion(MoveTo 124 157 self)
                )
            )
            (case 2
                (warpOut:play())
                (ship:
                    setStep(5 5)
                    setCycle(End)
                    setMotion(MoveTo 230 75 self)
                )
            )
            (case 3
                (ship:
                    setPri(4)
                    setMotion(MoveTo 241 71 self)
                )
            )
            (case 4
                (ship:
                    setStep(3 3)
                    setMotion(MoveTo 252 74 self)
                )
            )
            (case 5
                (ship:setMotion(MoveTo 261 78 self))
            )
            (case 6
                (ship:setMotion(MoveTo 285 102 self))
            )
            (case 7
                (ship:
                    setPri(6)
                    setMotion(MoveTo 284 107 self)
                )
            )
            (case 8
                (ship:setMotion(MoveTo 278 106 self))
            )
            (case 9
                (ship:setMotion(MoveTo 261 97 self))
            )
            (case 10
                (ship:setMotion(MoveTo 249 81 self))
            )
            (case 11
                (ship:
                    setPri(4)
                    setMotion(MoveTo 253 78 self)
                )
            )
            (case 12
                (ship:setMotion(MoveTo 260 82 self))
            )
            (case 13
                = local0 1
            )
        )
    )

)
(instance ship of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(52)
            setCel(0)
            ignoreActors(1)
            illegalBits(0)
            setCycle(0)
        )
    )

)
(instance warpOut of Sound
    (properties
        number 38
        priority 2
    )
)
