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



(instance public rm90 of Rm
    (properties
        picture 65
    )

    (method (init)
        proc958_0(128 18 265 115)
        proc958_0(132 17 88 70 95)
        (self:style(5))
        (super:init())
        (send global2:setScript(dropIn))
        (send (ScriptID(0 23)):
            number(88)
            loop(-1)
            play()
        )
        (stool:init())
        (door:
            init()
            cel(
                (if (proc0_12(15))
                    3
                )(else
                    0
                )
)
            setPri(2)
            stopUpd()
        )
        (if (not proc0_12(77))
            (note:
                setPri(7)
                init()
            )
        )
        (fire:
            init()
            setCycle(Fwd)
        )
        (bubble:
            init()
            setCycle(Fwd)
        )
        (smoke:
            setPri(4)
            init()
            setScript(smokeFace)
        )
    )

)
(instance witch of Actor
    (properties
        x 94
        y 85
        view 115
        loop 1
    )
)
(instance fire of Prop
    (properties
        x 43
        y 82
        view 265
    )
)
(instance bubble of Prop
    (properties
        x 62
        y 67
        view 265
        loop 1
    )
)
(instance smoke of Prop
    (properties
        x 62
        y 62
        view 265
        loop 2
        cycleSpeed 1
    )
)
(instance door of Prop
    (properties
        x 119
        y 33
        view 265
        loop 3
        cycleSpeed 2
    )
)
(instance stool of View
    (properties
        x 92
        y 94
        view 265
        loop 5
        cel 2
    )
)
(instance rmCheese of View
    (properties
        x 112
        y 44
        description 1698
        view 265
        loop 5
    )
)
(instance note of View
    (properties
        x 240
        y 98
        view 265
        loop 5
        cel 1
    )
)
(instance smokeFace of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (smoke:
                    loop(2)
                    setCycle(Fwd)
                )
                = cycles Random(50 100)
            )
            (case 1
                (smoke:
                    loop(4)
                    cel(0)
                    setCycle(End self)
                )
            )
            (case 2
                (self:changeState(0))
            )
        )
    )

)
(instance dropIn of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send (ScriptID(0 21)):
                    number(17)
                    init()
                    play()
                )
                (send gEgo:
                    illegalBits(0)
                    ignoreActors(1)
                    ignoreHorizon(1)
                    view(18)
                    init()
                    setLoop(1)
                    setCycle(0)
                    cel(0)
                    posn(161 -3)
                    setCycle(0)
                    setStep(2 8)
                    setPri(2)
                    setMotion(MoveTo 163 56 self)
                )
            )
            (case 1
                (send (ScriptID(0 21)):
                    number(95)
                    play()
                )
                (send gEgo:
                    cycleSpeed(2)
                    setCycle(CT 2 1 self)
                )
            )
            (case 2
                ShakeScreen(6)
                (send gEgo:setCycle(End))
                = seconds 3
            )
            (case 3
                proc255_0(90 0)
                (send (ScriptID(0 21)):
                    number(70)
                    play()
                )
                (send gEgo:
                    loop(2)
                    cel(0)
                    setCycle(End self)
                )
            )
            (case 4
                proc255_0(90 1)
                proc0_1()
                (send gEgo:loop(2))
                (witch:
                    init()
                    illegalBits(-32768)
                    setCycle(Walk)
                    posn(36 126)
                    loop(0)
                    setMotion(MoveTo 68 122 self)
                )
            )
            (case 5
                proc0_3()
                (send global2:newRoom(95))
            )
        )
    )

)
