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



(instance public rm14 of Rm
    (properties
        picture 14
        horizon 65
        north 19
        east 15
        south 3
        west 13
    )

    (method (init)
        proc958_0(128 19 18)
        proc958_0(132 70 95 2)
        (self:style(
            (switch (gGNumber)
                (case north
                    5
                )
                (case west
                    3
                )
                (case east
                    2
                )
                (case south
                    4
                )
            )
))
        (super:init())
        (if (proc0_12(46))
            proc0_11(46)
            (send global2:setScript(skyDiver))
        )(else
            (if (<> (send (ScriptID(0 23)):number) 98)
                (send (ScriptID(0 23)):
                    number(2)
                    loop(-1)
                    play()
                )
            )
            (switch (gGNumber)
                (case north
                    (send gEgo:posn(proc0_17(319 (send gEgo:x) 159) (+ horizon 2)))
                    proc0_1()
                )
                (case south
                    (send gEgo:posn(proc0_17(319 (send gEgo:x) 151) 188))
                    proc0_1()
                )
                (case west
                    (send gEgo:posn(3 proc0_17(104 (send gEgo:y) (+ horizon 2))))
                    proc0_1()
                )
                (case east
                    (send gEgo:x(317))
                    proc0_1()
                )
                (default 
                    (send global2:setScript(downTree))
                )
            )
        )
        (send gEgo:init())
        (farTree1:init())
        (farTree2:init())
        (farTree3:init())
        (farTree:init())
        (tree5:init())
        (tree4:init())
        (tree3:init())
        (tree2:init())
        (tree1:init())
        (tree:init())
        (rock:init())
        (rock1:init())
        (rock2:init())
        (rock3:init())
    )


    (method (doit)
        (var temp0)
        (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>'))
                    (if (Said('[<at,around][/room,ceder]'))
                        proc255_0(14 0)
                    )
                )(else
                    (if (Said('climb,climb[/ceder,oak,branch]'))
                        (if (proc0_12(1))
                            proc255_0(14 1)
                        )(else
                            (if (proc0_12(2))
                                proc255_0(14 2)
                            )(else
                                (if ((send gEgo:inRect(54 142 98 172)))
                                    proc255_0(14 3)
                                    (if ((send global2:script))
                                        proc255_0(14 4)
                                    )(else
                                        (send global2:setScript(climbTree))
                                    )
                                )(else
                                    proc255_0(14 5)
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance climbTree of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    illegalBits(0)
                    ignoreHorizon()
                    setMotion(MoveTo 88 162 self)
                )
            )
            (case 1
                (send gEgo:
                    view(19)
                    setPri(11)
                    setStep(1 3)
                    loop(0)
                    cel(0)
                    setCycle(Fwd)
                    setPri(12)
                    cycleSpeed(1)
                    moveSpeed(1)
                    setMotion(MoveTo 100 133 self)
                )
            )
            (case 2
                (send gEgo:setMotion(MoveTo 149 57 self))
            )
            (case 3
                (send gEgo:setMotion(0))
                proc0_19(101 2)
                proc0_3()
                (send global2:newRoom(63))
            )
        )
    )

)
(instance downTree of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    view(19)
                    setPri(12)
                    setStep(1 3)
                    loop(0)
                    cel(0)
                    setCycle(Fwd)
                    ignoreHorizon()
                    illegalBits(0)
                    cycleSpeed(1)
                    moveSpeed(1)
                    posn(149 57)
                    setMotion(MoveTo 100 133 self)
                )
            )
            (case 1
                (send gEgo:
                    loop(0)
                    setCycle(Fwd)
                    setMotion(MoveTo 88 162 self)
                )
            )
            (case 2
                proc0_3()
                proc0_1()
                (send gEgo:
                    view(0)
                    loop(3)
                )
                proc0_11(1)
                (self:dispose())
            )
        )
    )

)
(instance skyDiver of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    init()
                    ignoreHorizon(1)
                    view(18)
                    loop(0)
                    cel(0)
                    posn(182 -40)
                    yStep(14)
                    illegalBits(0)
                    setCycle(0)
                    setMotion(MoveTo 182 133 self)
                )
            )
            (case 1
                (send (ScriptID(0 23)):
                    number(2)
                    loop(-1)
                    play()
                )
                (send (ScriptID(0 21)):
                    number(95)
                    loop(1)
                    play()
                )
                (send gEgo:
                    setLoop(1)
                    cycleSpeed(1)
                    posn(181 132)
                    setCycle(CT 2 1 self)
                )
            )
            (case 2
                ShakeScreen(6)
                (send gEgo:setCycle(End))
                = seconds 3
            )
            (case 3
                (send gEgo:
                    setLoop(2)
                    setCel(0)
                    posn(181 132)
                )
                = cycles 2
            )
            (case 4
                (send (ScriptID(0 21)):
                    number(70)
                    loop(-1)
                    play()
                )
                (send gEgo:
                    cycleSpeed(2)
                    setCycle(End self)
                )
            )
            (case 5
                (send (ScriptID(0 21)):stop())
                (send gEgo:view(0))
                proc0_11(1)
                proc0_1()
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance tree of NewFeature
    (properties
        x 159
        y 19
        noun 2503
        nsTop -1
        nsBottom 40
        nsRight 319
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2570
    )
)
(instance tree1 of NewFeature
    (properties
        x 119
        y 50
        noun 2503
        nsTop 40
        nsLeft 79
        nsBottom 61
        nsRight 160
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2570
    )
)
(instance tree2 of NewFeature
    (properties
        x 110
        y 70
        noun 2503
        nsTop 61
        nsLeft 68
        nsBottom 79
        nsRight 153
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2570
    )
)
(instance tree3 of NewFeature
    (properties
        x 99
        y 86
        noun 2503
        nsTop 79
        nsLeft 59
        nsBottom 94
        nsRight 140
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2570
    )
)
(instance tree4 of NewFeature
    (properties
        x 80
        y 130
        noun 2503
        nsTop 95
        nsLeft 28
        nsBottom 145
        nsRight 133
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2570
    )
)
(instance tree5 of NewFeature
    (properties
        x 157
        y 154
        noun 2503
        nsTop 154
        nsLeft 117
        nsBottom 169
        nsRight 153
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2570
    )
)
(instance rock1 of NewFeature
    (properties
        x 14
        y 103
        noun 2510
        nsTop 58
        nsBottom 149
        nsRight 28
        description 2774
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2779
    )
)
(instance rock of NewFeature
    (properties
        x 43
        y 85
        noun 2510
        nsTop 77
        nsLeft 28
        nsBottom 94
        nsRight 58
        description 2774
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2779
    )
)
(instance farTree of NewFeature
    (properties
        x 259
        y 47
        noun 2517
        nsTop 41
        nsLeft 211
        nsBottom 54
        nsRight 308
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2850
    )
)
(instance farTree1 of NewFeature
    (properties
        x 220
        y 69
        noun 2517
        nsTop 54
        nsLeft 215
        nsBottom 85
        nsRight 226
        description 2920
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2850
    )
)
(instance farTree2 of NewFeature
    (properties
        x 261
        y 80
        noun 2517
        nsTop 54
        nsLeft 257
        nsBottom 107
        nsRight 266
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2850
    )
)
(instance farTree3 of NewFeature
    (properties
        x 282
        y 85
        noun 2517
        nsTop 54
        nsLeft 277
        nsBottom 117
        nsRight 287
        description 2565
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2850
    )
)
(instance rock2 of NewFeature
    (properties
        x 74
        y 158
        noun 2524
        nsTop 149
        nsLeft 62
        nsBottom 167
        nsRight 87
        description 2774
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2947
    )
)
(instance rock3 of NewFeature
    (properties
        x 146
        y 151
        noun 2524
        nsTop 148
        nsLeft 138
        nsBottom 155
        nsRight 154
        description 2774
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2947
    )
)
