(version 2)
(include "sci.sh")
(exports
    0 rm80
)
(use "Main")
(use "Class_255_0")
(use "n958")
(use "DPath")
(use "Cycle")
(use "Game")
(use "PicView")
(use "Obj")
(script 80)



(instance public rm80 of Rm
    (properties
        picture 80
    )

    (method (init)
        proc958_0(128 160 33 117)
        Load(rsPIC 81)
        (self:style(3))
        (super:init())
        (if (proc0_12(2))
            proc255_0(80 0)
            proc0_11(2)
        )
        (switch (global123)
            (case 1
                (carrier:view(160))
                (send gEgo:
                    view(33)
                    loop(0)
                )
            )
            (case 2
                (carrier:view(117))
                (send gEgo:
                    view(117)
                    loop(2)
                )
                (send (ScriptID(0 23)):
                    number(57)
                    loop(-1)
                    play()
                )
            )
        )
        proc0_2()
        (send gEgo:
            posn(-42 142)
            setCycle(Fwd)
            cycleSpeed(2)
            setMotion(0)
            setPri(15)
            ignoreHorizon(1)
            ignoreActors(1)
            illegalBits(0)
            setPri(7)
            init()
        )
        (carrier:
            setCycle(Fwd)
            cycleSpeed(1)
            setPri(6)
            init()
            setScript(fly)
        )
    )


    (method (doit param1)
        (super:doit(rest param1))
        (switch (global123)
            (case 1
                (send gEgo:posn((carrier:x) (+ (carrier:y) 61)))
            )
            (case 2
                (send gEgo:posn((+ (carrier:x) 9) (+ (carrier:y) 26)))
            )
        )
    )

)
(instance carrier of Actor
    (properties
        x -42
        y 142
        description 789
    )
)
(instance fly of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (carrier:setMotion(DPath 160 100 330 80 self))
            )
            (case 1
                (send global2:
                    picture(81)
                    style(3)
                    drawPic(81)
                )
                (self:cue())
            )
            (case 2
                (carrier:
                    posn(-42 100)
                    setMotion(DPath 160 100 350 150 self)
                )
            )
            (case 3
                proc0_3()
                (send (ScriptID(0 23)):
                    loop(1)
                    fade()
                )
                (send global2:newRoom(
                    (switch (global123)
                        (case 1
                            48
                        )
                        (case 2
                            90
                        )
                    )
))
            )
        )
    )

)
