(version 2)
(include "sci.sh")
(exports
    0 rm78
)
(use "Main")
(use "Class_255_0")
(use "NewFeature")
(use "Game")
(use "User")
(script 78)



(instance public rm78 of Rm
    (properties
        picture 78
        east 77
        west 36
    )

    (method (init)
        (self:style(
            (switch (gGNumber)
                (case west
                    3
                )
                (case east
                    2
                )
            )
))
        (super:init())
        (switch (gGNumber)
            (case east
                (send gEgo:posn(315 proc0_17(158 (send gEgo:y) 142)))
            )
            (case west
                (send gEgo:posn(49 88))
            )
            (default 
                (send gEgo:posn(150 180))
            )
        )
        (send gEgo:init())
        proc0_1()
        (send gEgo:illegalBits(-32766))
        (light:init())
    )


    (method (doit)
        (var temp0)
        (if (& (send gEgo:onControl(1)) $0040)
            (self:newRoom(36))
        )(else
            (if (== (send gEgo:onControl(1)) 2)
                0
            )(else
                (if (script)
                    (send script:doit())
                )(else
                    = temp0 
                        (switch ((send ((User:alterEgo)):edgeHit))
                            (case 1
                                north
                            )
                            (case 2
                                east
                            )
                            (case 3
                                south
                            )
                            (case 4
                                west
                            )
                        )
                    (if (temp0)
                        (self:newRoom((= temp0 
                                (switch ((send ((User:alterEgo)):edgeHit))
                                    (case 1
                                        north
                                    )
                                    (case 2
                                        east
                                    )
                                    (case 3
                                        south
                                    )
                                    (case 4
                                        west
                                    )
                                )
)))
                    )
                )
            )
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if ((Said('look,look/hole') or Said('look,look<in/hole')) or proc0_14(pEvent 32 70 46 84))
                    proc255_0(78 0)
                )(else
                    (if (Said('look,look>'))
                        (if (Said('[<at,around][/room,cave]'))
                            proc255_0(78 1)
                        )(else
                            (if (Said('/path'))
                                proc255_0(78 2)
                            )
                        )
                    )(else
                        (if (Said('go,enter,walk,crawl/hole'))
                            (if (== (send gEgo:script) 779)
                                proc255_0(78 3)
                            )(else
                                proc255_0(78 4)
                            )
                        )(else
                            (if (((== (send pEvent:type) 1) and (& (send pEvent:modifiers) $0003)) and (== OnControl(2 (send pEvent:x) (send pEvent:y)) -32768))
                                proc255_0(78 5)
                            )(else
                                (if (Said('/stalactite,stalactite>'))
                                    (if (Said('get,bend'))
                                        proc255_0(78 6)
                                    )(else
                                        (if (Said('look,look'))
                                            proc255_0(78 5)
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance light of NewFeature
    (properties
        x 47
        y 86
        noun 820
        nsTop 82
        nsLeft 35
        nsBottom 90
        nsRight 60
        description 837
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 843
    )
)
