(version 2)
(include "sci.sh")
(exports
    0 rm94
)
(use "Main")
(use "Class_255_0")
(use "Follow")
(use "Sound")
(use "Cycle")
(use "Game")
(use "User")
(use "Feature")
(use "Obj")
(script 94)


(local
    local0
    local1

)
(instance public rm94 of Rm
    (properties
        picture 94
        style 0
    )

    (method (init)
        (User:
            canInput(1)
            canControl(1)
        )
        Load(128 68)
        Load(128 102)
        Load(128 195)
        Load(128 196)
        (super:init())
        (ship:
            init()
            stopUpd()
        )
        (ramp:
            init()
            stopUpd()
        )
        (switch (gNorth)
            (case 93
                (send global10:add(ship1 ship2 ship3 ship4 ship5))
                (send global10:doit())
                (send gEgo:
                    view(68)
                    posn(67 121)
                    init()
                    setMotion(MoveTo 300 121 self)
                )
            )
            (case 120
                (User:
                    canInput(0)
                    canControl(0)
                )
                = global159 1
                Load(132 38)
                Load(132 40)
                (send global10:add(ship1 ship2 ship3 ship4 ship5 robo))
                (send global10:doit())
                (send gEgo:
                    view(68)
                    setLoop(-1)
                    setCel(-1)
                    setStep(6 3)
                    setPri(14)
                    posn(52 176)
                    init()
                )
                (Scott:
                    init()
                    setScript(ScottScript)
                )
                (Mark:
                    init()
                    setMotion(Follow Scott 10)
                )
                (self:setScript(RunAway))
            )
            (default 
                (User:
                    canInput(0)
                    canControl(0)
                )
                = global159 1
                Load(132 38)
                Load(132 40)
                (send global10:add(ship1 ship2 ship3 ship4 ship5 robo))
                (send global10:doit())
                (send gEgo:
                    view(68)
                    setLoop(-1)
                    setCel(-1)
                    setStep(6 3)
                    setPri(14)
                    posn(52 176)
                    init()
                )
                (Scott:
                    init()
                    setScript(ScottScript)
                )
                (Mark:
                    init()
                    setMotion(Follow Scott 10)
                )
                (self:setScript(RunAway))
            )
        )
    )


    (method (doit)
        (if (== (send gEgo:onControl()) 3)
            (send global2:newRoom(93))
        )
        (super:doit())
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )
        (switch ((send pEvent:type))
            (case 128
                (if (Said('look>'))
                    (if (Said('[/area]'))
                        proc255_0(94 0)
                    )(else
                        (if (Said('/craft,aluminum'))
                            proc255_0(94 1)
                        )(else
                            (if (Said('/bow'))
                                proc255_0(94 2)
                            )(else
                                (if (Said('/air'))
                                    proc255_0(94 3)
                                )
                            )
                        )
                    )
                )(else
                    (if (Said('climb[/down,up]'))
                        proc255_0(94 4)
                    )
                )
            )
        )
        (super:handleEvent(pEvent))
    )

)
(instance RunAway of Script
    (properties)

    (method (doit)
        (super:doit())
        (if ((== local0 1) and (== (liftOff:prevSignal) -1))
            = local0 0
            (self:changeState(9))
        )
        (if ((== local0 2) and (== (warpOut:prevSignal) -1))
            (send global2:newRoom(14))
        )
    )


    (method (changeState newState)
        (var temp0[50])
        (switch (= state newState)
            (case 0
                (send gEgo:setMotion(MoveTo 200 182 self))
            )
            (case 1
                (balloon:
                    init()
                    stopUpd()
                )
                (send gEgo:setMotion(MoveTo 261 182 self))
            )
            (case 2
                (send gEgo:setMotion(MoveTo 269 174 self))
            )
            (case 3
                (send gEgo:dispose())
            )
            (case 4
                (liftOff:play())
                (ramp:dispose())
                (Scott:dispose())
                (Mark:dispose())
                (ship:setCel(1))
                = seconds 5
            )
            (case 5
                (ship:setMotion(MoveTo 228 115 self))
            )
            (case 6
                (ship:
                    setCel(2)
                    setMotion(MoveTo 228 45 self)
                )
            )
            (case 7
                (ship:
                    setCel(3)
                    setMotion(MoveTo 228 -11 self)
                )
            )
            (case 8
                = local0 1
                (balloon:dispose())
            )
            (case 9
                (warpOut:play())
                (ship:
                    setLoop(5)
                    setCel(0)
                    posn(279 -14)
                    setStep(4 6)
                    setMotion(MoveTo 243 15 self)
                )
            )
            (case 10
                (ship:
                    setCycle(End)
                    setMotion(MoveTo 215 43 self)
                )
            )
            (case 11
                (ship:setMotion(MoveTo 215 -5 self))
            )
            (case 12
                = local0 2
            )
        )
    )

)
(instance ScottScript of Script
    (properties)

    (method (changeState newState)
        (var temp0[50])
        (switch (= state newState)
            (case 0
                = cycles 10
            )
            (case 1
                (Scott:setMotion(MoveTo 261 150 self))
            )
            (case 2
                (Scott:setMotion(MoveTo 269 142 self))
            )
            (case 3
                (RunAway:changeState(4))
            )
        )
    )

)
(instance Scott of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(195)
            loop(0)
            posn(52 144)
            setCycle(Walk)
            setStep(6 3)
            setPri(14)
            illegalBits(0)
            ignoreActors(1)
        )
    )

)
(instance Mark of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(196)
            loop(0)
            posn(52 144)
            setCycle(Walk)
            setStep(6 3)
            setPri(14)
            illegalBits(0)
            ignoreActors(1)
        )
    )

)
(instance ship of Act
    (properties)

    (method (init)
        (super:init())
        (self:
            view(102)
            setLoop(0)
            setCel(0)
            posn(228 165)
            setStep(6 6)
            setPri(15)
            illegalBits(0)
            ignoreHorizon(1)
            ignoreActors(1)
        )
    )

)
(instance ramp of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(102)
            setLoop(1)
            setCel(0)
            posn(266 182)
            setPri(13)
            setCycle(0)
            ignoreActors(1)
        )
    )

)
(instance balloon of Prop
    (properties)

    (method (init)
        (super:init())
        (self:
            view(102)
            setLoop(4)
            setCel(1)
            posn(79 162)
            setPri(15)
            setCycle(0)
            ignoreActors(1)
        )
    )

)
(instance ship1 of PV
    (properties
        y 176
        x 146
        view 102
        loop 2
        signal 16384
    )
)
(instance ship2 of PV
    (properties
        y 157
        x 176
        view 102
        loop 2
        cel 1
        signal 16384
    )
)
(instance ship3 of PV
    (properties
        y 140
        x 204
        view 102
        loop 2
        cel 2
        signal 16384
    )
)
(instance ship4 of PV
    (properties
        y 139
        x 263
        view 102
        loop 3
        signal 16384
    )
)
(instance ship5 of PV
    (properties
        y 139
        x 312
        view 102
        loop 3
        signal 16384
    )
)
(instance robo of PV
    (properties
        y 179
        x 41
        view 102
        loop 4
        priority 15
        signal 16384
    )
)
(instance warpOut of Sound
    (properties
        number 38
        priority 1
    )
)
(instance liftOff of Sound
    (properties
        number 40
        priority 1
    )
)
