(version 2)
(include "sci.sh")
(exports
    0 rm67
)
(use "Main")
(use "Class_255_0")
(use "NewFeature")
(use "n958")
(use "Cycle")
(use "Game")
(use "User")
(use "Obj")
(script 67)



(instance public rm67 of Rm
    (properties
        picture 67
        horizon 35
        east 68
        west 66
    )

    (method (init)
        proc958_0(128 4 7 56 66 136)
        Load(rsSCRIPT 613)
        Load(rsSOUND 17)
        (if ((send gEgo:has(5)))
            proc958_0(128 38 39)
        )
        (self:style(
            (switch (gGNumber)
                (case west
                    3
                )
                (default 
                    2
                )
            )
))
        (super:init())
        (switch (gGNumber)
            (case west
                (send gEgo:
                    posn(17 186)
                    loop(0)
                )
            )
            (default 
                (send gEgo:posn(299 56))
            )
        )
        proc0_10(0)
        (send gEgo:init())
        proc0_1()
        (walkway1:init())
    )


    (method (doit)
        (var temp0)
        (if (script)
            (send script:doit())
        )(else
            (if (== (send gEgo:priority) 1)
                (send gEgo:setPri(2))
            )(else
                (if (== (send gEgo:onControl(1)) 8)
                    (self:setScript(ScriptID(613 0)))
                )(else
                    (if (== (send gEgo:onControl(1)) 16)
                        (self:setScript(ScriptID(613 1)))
                    )(else
                        (if (== (send gEgo:onControl(1)) 256)
                            (self:setScript(ScriptID(613 2)))
                        )(else
                            (if (== (send gEgo:onControl(1)) 2)
                                (self:setScript(ScriptID(613 3)))
                            )(else
                                (if (== (send gEgo:onControl(1)) 4)
                                    (self:setScript(ScriptID(613 4)))
                                )(else
                                    (if (== (send gEgo:onControl(1)) 1024)
                                        (self:setScript(ScriptID(613 5)))
                                    )(else
                                        (if (== (send gEgo:onControl(1)) 16384)
                                            (self:setScript(ScriptID(613 6)))
                                        )(else
                                            (if ((send gEgo:inRect(0 50 15 61)))
                                                (self:setScript(goingLow))
                                            )(else
                                                (if ((send gEgo:inRect(0 71 15 83)))
                                                    (self:setScript(goingHigh))
                                                )(else
                                                    (if (== (send gEgo:onControl(1)) 8192)
                                                        (self:newRoom(68))
                                                    )(else
                                                        (if (== (send gEgo:onControl(1)) 4096)
                                                            proc0_11(0)
                                                            proc0_11(31)
                                                            (self:newRoom(66))
                                                        )
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if ((((== (send pEvent:type) 1) and (& (send pEvent:modifiers) $0003)) and (& OnControl(4 (send pEvent:x) (send pEvent:y)) $0800)) and (User:canInput()))
                    (send pEvent:claimed(1))
                    proc255_0(67 0)
                )(else
                    (if (Said('look,look>'))
                        (if (Said('[<at,around][/room,cave]'))
                            proc255_0(67 1)
                        )(else
                            (if (Said('/catwalk,path'))
                                proc255_0(67 0)
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance goingLow of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_1()
                (send gEgo:
                    illegalBits(0)
                    loop(0)
                    cel(0)
                    posn(17 78)
                )
                = seconds 2
            )
            (case 1
                (send gEgo:
                    setStep(2 2)
                    setMotion(MoveTo 30 78 self)
                )
            )
            (case 2
                (send gEgo:illegalBits(-32768))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance goingHigh of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_1()
                (send gEgo:
                    illegalBits(0)
                    loop(1)
                    cel(0)
                    posn(17 56)
                )
                = seconds 2
            )
            (case 1
                (send gEgo:
                    setStep(2 2)
                    setMotion(MoveTo 31 56 self)
                )
            )
            (case 2
                (send gEgo:illegalBits(-32768))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance walkway1 of NewFeature
    (properties
        x 164
        y 56
        noun 1247
        nsTop 50
        nsLeft 27
        nsBottom 63
        nsRight 301
        description 1282
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1299
    )
)
