(version 2)
(include "sci.sh")
(exports
    0 rm071
)
(use "Main")
(use "Class_255_0")
(use "Game")
(use "TheMenuBar")
(script 71)



(instance public rm071 of Rm
    (properties
        picture 71
        north 72
        west 70
    )

    (method (init)
        (var temp0[50])
        proc0_3()
        (self:setRegions(600))
        (super:init())
        (switch (gNorth)
            (case 70
                (send gEgo:
                    init()
                    posn(2 
                        (if (== (send gEgo:y) 74)
                            75
                        )(else
                            (if ((> (send gEgo:y) 87) and (< (send gEgo:y) 99))
                                99
                            )(else
                                (if ((> (send gEgo:y) 118) and (< (send gEgo:y) 137))
                                    137
                                )(else
                                    (send gEgo:y)
                                )
                            )
                        )
)
                )
            )
            (case 72
                (send gEgo:
                    posn(
                        (if (< (send gEgo:x) 87)
                            88
                        )(else
                            (if (> (send gEgo:x) 156)
                                155
                            )(else
                                (send gEgo:x)
                            )
                        )
 + (send global2:horizon) 10)
                    init()
                )
                (send gLongSong:
                    number(71)
                    loop(-1)
                    priority(0)
                    play()
                )
            )
        )
        (TheMenuBar:draw())
        (SL:enable())
    )


    (method (doit)
        (var gEgoOnControl)
        (super:doit())
        (if (== (send global2:script) 0)
            = gEgoOnControl (send gEgo:onControl())
            (if (== gEgoOnControl 3)
                (send gEgo:
                    setPri(14)
                    posn((send gEgo:x) + (send gEgo:y) 2)
                    illegalBits(0)
                )
                = global180 1
            )(else
                (if (== gEgoOnControl 5)
                    (send gEgo:
                        setPri(9)
                        posn((send gEgo:x) (send gEgo:y))
                        illegalBits(0)
                    )
                    = global180 1
                )
            )
        )
    )


    (method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if ((<> (send pEvent:type) 128) or (send pEvent:claimed))
            return 
        )
        (if (Said('look[/area,around]'))
            (if (== gNorth 72)
                proc255_0(71 0)
            )(else
                proc255_0(71 1)
            )
        )
    )


    (method (newRoom newRoomNumber)
        (if (not script)
            (if (global256)
                ++global593
            )
            (super:newRoom(newRoomNumber))
        )
    )

)
