(version 2)
(include "sci.sh")
(exports
    0 rm95
)
(use "Main")
(use "n958")
(use "RFeature")
(use "Sound")
(use "Cycle")
(use "Game")
(use "PicView")
(use "Obj")
(script 95)



(instance public rm95 of Rm
    (properties
        picture 28
    )

    (method (init)
        (send (ScriptID(0 23)):stop())
        proc958_0(132 16 15 83)
        proc958_0(128 115 116 228)
        (self:style(7))
        (super:init())
        (send gAddToPics:
            add(cookie1 cookie2 cookie3)
            eachElementDo(#init)
            doit()
        )
        (witch:
            setPri(8)
            view(116)
            setLoop(0)
            posn(123 129)
            init()
        )
        (door:
            setPri(9)
            init()
        )
        (cane:
            setPri(9)
            init()
        )
        (self:setScript(openIt))
    )

)
(instance witch of Actor
    (properties)
)
(instance cane of View
    (properties
        x 182
        y 112
        description 1541
        view 228
        loop 1
    )
)
(instance door of Prop
    (properties
        x 111
        y 131
        view 228
    )
)
(instance closeIt of Script
    (properties
        cycles 1
    )

    (method (changeState newState)
        (switch (= state newState)
            (case 1
                proc0_2()
                (doorSound:
                    number(16)
                    loop(1)
                    play()
                )
                (door:
                    cel(4)
                    cycleSpeed(0)
                    setCycle(CT 1 -1 self)
                )
            )
            (case 2
                (doorSound:
                    number(83)
                    play()
                )
                (door:setCycle(Beg self))
            )
            (case 3
                (door:stopUpd())
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance openIt of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (doorSound:
                    number(15)
                    loop(1)
                    play()
                )
                (door:
                    cel(0)
                    cycleSpeed(2)
                    setCycle(End self)
                )
            )
            (case 1
                (door:stopUpd())
                (witch:
                    setPri(-1)
                    illegalBits(0)
                    ignoreActors()
                    setCycle(Walk)
                    setMotion(MoveTo 141 149 self)
                )
            )
            (case 2
                (witch:setMotion(MoveTo 178 169 self))
            )
            (case 3
                (witch:setMotion(MoveTo 178 186 self))
            )
            (case 4
                (doorSound:stop())
                (witch:
                    setLoop(1)
                    setCycle(End self)
                )
            )
            (case 5
                (send gEgo:
                    view(116)
                    posn(187 186)
                    ignoreActors()
                    loop(2)
                    cel(0)
                    init()
                )
                (witch:
                    view(115)
                    ignoreActors()
                    setLoop(-1)
                    setCycle(Walk)
                    setMotion(MoveTo 178 169 self)
                )
            )
            (case 6
                (send gEgo:stopUpd())
                (witch:setMotion(MoveTo 141 149 self))
            )
            (case 7
                (witch:setMotion(MoveTo 125 131 self))
            )
            (case 8
                (witch:setMotion(MoveTo 125 125 self))
            )
            (case 9
                (witch:loop(2))
                = cycles 1
            )
            (case 10
                (door:setScript(closeIt self))
            )
            (case 11
                proc0_16("The witch has turned you into a gingerbread man.  Or is that a Graham cracker?")
                (self:dispose())
            )
        )
    )

)
(instance cookie1 of RPicView
    (properties
        x 218
        y 169
        description 1652
        view 228
        loop 2
    )
)
(instance cookie2 of RPicView
    (properties
        x 120
        y 175
        description 1652
        view 228
        loop 2
        cel 1
    )
)
(instance cookie3 of RPicView
    (properties
        x 102
        y 160
        description 1652
        view 228
        loop 2
        cel 2
    )
)
(instance doorSound of Sound
    (properties
        priority 10
    )
)
