(include "sci.sh")
(use "Main")
(use "Class_255_0")
(use "Cycle")
(use "Game")
(use "PV")
(script 65)



(instance public Room65 of Rm
    (properties
        picture 65
        style 16
    )

    (method (init)
        Load(rsVIEW 648)
        Load(rsVIEW 536)
        (self:setRegions(603))
        (super:init())
        (send ((View:new())):
            view(536)
            loop(5)
            cel(0)
            posn(238 81)
            setPri(4)
            addToPic()
        )
        (if (global100)
            (send ((View:new())):
                view(648)
                loop(5)
                cel(0)
                posn(280 105)
                setPri(6)
                addToPic()
            )
            (send ((Prop:new())):
                view(536)
                loop(1)
                posn(237 74)
                setPri(4)
                init()
                setCycle(Fwd)
            )
        )
        (if ((== gPicture 64) or (== gPicture 0))
            (send gEgo:
                posn(245 161)
                view(4)
                xStep(4)
                yStep(1)
                init()
            )
        )
        (if (((< 0 global134) and (< global134 255)) and (== global133 gGNewPropX))
            proc0_12(603 -1)
        )
    )


    (method (doit)
        (super:doit())
        (if (& (send gEgo:onControl(0)) $0040)
            (send global2:newRoom(64))
        )
    )


    (method (handleEvent pEvent)
        return 
            (if ((send pEvent:claimed()))
                return 1
            )(else
                (if (== (send pEvent:type()) 128)
                    (if (Said('look[<around][/!*]') or Said('look/room,kitchen'))
                        Print(65 0)
                    )(else
                        (if (Said('look>'))
                            (if (Said('/pantry'))
                                Print(65 1)
                            )(else
                                (if (Said('/fireplace'))
                                    Print(65 2)
                                )(else
                                    (if (Said('/caldron'))
                                        Print(65 3)
                                    )(else
                                        (if (Said('/butterchurn'))
                                            Print(65 4)
                                        )(else
                                            (if (Said('/window'))
                                                (if ((send gEgo:inRect(229 124 277 146)))
                                                    Print(65 5)
                                                )(else
                                                    Print(65 6)
                                                )
                                            )(else
                                                (if (Said('/barrel'))
                                                    Print(65 7)
                                                )(else
                                                    (if (Said('/shelf'))
                                                        Print(65 8)
                                                    )(else
                                                        (if (Said('/chandelier'))
                                                            Print(65 9)
                                                        )(else
                                                            (if (Said('/wall'))
                                                                Print(65 10)
                                                            )(else
                                                                (if (Said('/dirt') or Said('<down'))
                                                                    Print(65 11)
                                                                )(else
                                                                    (if (Said('/ladder'))
                                                                        Print(65 12)
                                                                    )(else
                                                                        (if (Said('/crumbs'))
                                                                            Print(65 13)
                                                                        )(else
                                                                            (if (Said('/bottle'))
                                                                                (if ((send gEgo:has(31)))
                                                                                    (send pEvent:claimed(0))
                                                                                )(else
                                                                                    Print(800 2)
                                                                                )
                                                                            )(else
                                                                                (send pEvent:claimed(0))
                                                                            )
                                                                        )
                                                                    )
                                                                )
                                                            )
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )(else
                            (if (Said('get>'))
                                (if (Said('/caldron'))
                                    Print(65 14)
                                )(else
                                    (if (Said('/butterchurn'))
                                        Print(65 4)
                                    )(else
                                        (if (Said('/barrel'))
                                            Print(65 7)
                                        )(else
                                            (if (Said('/crumbs'))
                                                Print(65 15)
                                            )(else
                                                (send pEvent:claimed(0))
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
    )

)
