(version 2)
(include "sci.sh")
(exports
    0 rm485
)
(use "Main")
(use "Cycle")
(use "Game")
(use "View")
(use "Obj")
(script 485)



(instance public rm485 of Rm
    (properties
        picture 485
    )

    (method (init)
        proc0_2()
        (send (ScriptID(36 1)):
            view(485)
            x(105)
            y(129)
            loop(0)
            cel(0)
            init()
            setScript(transform)
        )
        (super:init())
    )


    (method (dispose)
        DisposeScript(36)
        (super:dispose())
    )


    (method (cue)
        (if (== (send gLongSong:prevSignal) -1)
            (send global2:newRoom(480))
        )
    )

)
(instance transform of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gLongSong:
                    setLoop(1)
                    changeTo(622 self)
                )
                = seconds 2
            )
            (case 1
                (send (ScriptID(36 1)):setCycle(Fwd))
                = seconds 3
            )
            (case 2
                (if ((== Random(1 50) 25) or proc0_6(161))
                    (egoHead:
                        setCycle(End)
                        init()
                    )
                    (send gLongSong2:
                        number(401)
                        setLoop(1)
                        play(127)
                    )
                )
                (send (ScriptID(36 1)):setCycle(End))
                = seconds 5
            )
            (case 3
            )
            (case 4
                (send global2:newRoom(480))
            )
        )
    )

)
(instance egoHead of Prop
    (properties
        x 210
        y 78
        view 486
    )
)
