(version 2)
(include "sci.sh")
(exports
    0 rm072
)
(use "Main")
(use "Class_255_0")
(use "Cycle")
(use "Game")
(use "Obj")
(script 72)



(instance public rm072 of Rm
    (properties
        picture 72
        north 74
        south 71
    )

    (method (init)
        (var temp0[50])
        proc0_3()
        (self:setRegions(600))
        (super:init())
        (switch (gNorth)
            (case 71
                (send gEgo:
                    init()
                    posn(
                        (if (< (send gEgo:x) 67)
                            67
                        )(else
                            (if (< (send gEgo:x) 193)
                                193
                            )(else
                                (send gEgo:x)
                            )
                        )
 187)
                )
                proc0_10()
                (if (global256)
                    (send gLongSong:
                        number(71)
                        loop(-1)
                        priority(0)
                        play()
                    )
                )(else
                    (send gLongSong:
                        number(51)
                        loop(-1)
                        priority(0)
                        play()
                    )
                )
                proc255_0(72 0)
            )
            (case 74
                (send global2:setScript(EnterScript))
            )
        )
    )


    (method (doit)
        (var temp0)
        (super:doit())
        (if ((== (send gEgo:onControl()) 3) and not (send global2:script))
            (self:setScript(LeaveScript))
        )
    )


    (method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if ((<> (send pEvent:type) 128) or (send pEvent:claimed))
            return 
        )
        (if (Said('look/device,building,generator'))
            (if (not global256)
                (if (global170)
                    proc255_0(72 1)
                )(else
                    proc255_0(72 2)
                )
            )(else
                (if (global170)
                    proc255_0(72 3)
                )(else
                    proc255_0(72 4)
                )
            )
        )(else
            (if (Said('look/beam'))
                (if (not global256)
                    (if (global170)
                        proc255_0(72 5)
                    )(else
                        proc255_0(72 6)
                    )
                )(else
                    proc255_0(72 7)
                )
            )(else
                (if (Said('look/butte'))
                    proc255_0(72 8)
                )
            )
        )
    )

)
(instance EnterScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    setPri(3)
                    setLoop(0)
                    illegalBits(0)
                    posn(217 156)
                    init()
                    setMotion(MoveTo 241 132 self)
                )
            )
            (case 1
                (send gEgo:
                    setLoop(2)
                    setMotion(MoveTo 241 144 self)
                )
            )
            (case 2
                (send gEgo:
                    setLoop(-1)
                    illegalBits(-32768)
                    setPri(-1)
                )
                proc0_3()
                (send global2:setScript(0))
            )
        )
    )

)
(instance LeaveScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    setPri(3)
                    setLoop(1)
                    illegalBits(0)
                    setMotion(MoveTo 217 156 self)
                )
            )
            (case 1
                (send gEgo:setLoop(-1))
                proc0_3()
                (if (global256)
                    ++global593
                )
                (send global2:newRoom(74))
            )
        )
    )

)
