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



(instance public rm31 of Rm
    (properties
        picture 31
        north 34
        east 32
        south 18
        west 30
    )

    (method (init)
        (if (not proc0_12(81))
            proc958_0(128 231 1)
        )
        (self:style(
            (switch (gGNumber)
                (case north
                    5
                )
                (case west
                    3
                )
                (case east
                    2
                )
                (case south
                    4
                )
            )
))
        (super:init())
        (switch (gGNumber)
            (case north
                (send gEgo:posn(proc0_17(170 (send gEgo:x) 141) 61))
            )
            (case south
                (send gEgo:y(188))
            )
            (case west
                (send gEgo:posn(3 proc0_17(188 proc0_18(131 (send gEgo:y) 116) 72)))
            )
            (case east
                (send gEgo:x(317 proc0_17(188 (send gEgo:y) 76)))
            )
            (default 
                (send gEgo:posn(3 137))
            )
        )
        (send gEgo:init())
        proc0_1()
        (if (not proc0_12(81))
            (bowl:init())
        )
        (pinetree1:init())
        (pinetree2:init())
        (pinetree3:init())
        (pinetree4:init())
        (pinetree6:init())
        (pinetree7:init())
        (pinetree8:init())
        (pinetree9:init())
        (pinetree10:init())
        (pinetree11:init())
        (pinetree12:init())
        (pinetree13:init())
        (pinetree14:init())
        (pinetree15:init())
        (pinetree16:init())
        (pinetree17:init())
        (pinetree18:init())
        (pinetree19:init())
        (pinetree20:init())
        (pinetree21:init())
        (pinetree22:init())
        (pinetree23:init())
        (tree1:init())
        (tree2:init())
        (tree3:init())
        (tree4:init())
        (tree5:init())
        (tree6:init())
        (tree7:init())
        (tree8:init())
        (tree9:init())
        (tree10:init())
        (tree11:init())
        (tree12:init())
        (tree13:init())
        (plant1:init())
        (plant2:init())
        (plant3:init())
        (plant4:init())
        (plant5:init())
    )


    (method (doit)
        (var temp0)
        (if (script)
            (send script:doit())
        )(else
            (if (((& (send gEgo:onControl(1)) $0200) and (<> (send gEgo:script) climbHill)) and not proc0_12(48))
                (send gEgo:setScript(climbHill))
            )(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('climb,climb,get,get/ceder[<pine]'))
                    proc255_0(31 0)
                )(else
                    (if (Said('get,get,get,pick/blossom'))
                        proc255_0(31 1)
                    )(else
                        (if (Said('look,look/bowl[<ceramic]') or proc255_5(bowl pEvent 3))
                            (if ((send gEgo:has(7)))
                                (send pEvent:claimed(0))
                            )(else
                                proc255_0(31 2)
                            )
                        )(else
                            (if (Said('look,look<down[/grass]') or Said('look,look[<down]/grass'))
                                (if (not proc0_12(81))
                                    (if (< (send gEgo:distanceTo(bowl)) 20)
                                        proc255_0(31 3)
                                    )(else
                                        proc255_0(31 4)
                                    )
                                )(else
                                    proc255_0(31 5)
                                )
                                (if (== gGNumber_4 gNumber)
                                    proc255_0(31 6)
                                )
                            )(else
                                (if (Said('look,look>'))
                                    (if (Said('[<at,around][/grass,room,ceder,clearing]'))
                                        (if (== gGNumber_4 gNumber)
                                            proc255_0(31 7)
                                        )(else
                                            (if (not (send gEgo:has(7)))
                                                proc255_0(31 8)
                                            )(else
                                                proc255_0(31 9)
                                            )
                                        )
                                    )(else
                                        (if (Said('/grass'))
                                            proc255_0(31 5)
                                        )
                                    )
                                )(else
                                    (if (Said('get,get/bowl'))
                                        (if (proc0_12(81))
                                            proc255_0(31 10)
                                        )(else
                                            (if (> (send gEgo:distanceTo(bowl)) 20)
                                                proc0_4()
                                            )(else
                                                (if (proc0_12(1))
                                                    proc255_0(31 11)
                                                )(else
                                                    (if (script)
                                                        (send script:doit())
                                                        proc255_0(31 12)
                                                    )(else
                                                        (send global2:setScript(getBowl))
                                                    )
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance bowl of View
    (properties
        x 92
        y 135
        view 231
        signal $0100
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                proc255_0(31 3)
            )
        )
    )

)
(instance getBowl of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_15(gEgo bowl)
                = cycles 2
            )
            (case 1
                (send gEgo:
                    view(1)
                    setMotion(0)
                    setCycle(End self)
                )
            )
            (case 2
                (send (ScriptID(0 21)):
                    number(105)
                    loop(1)
                    init()
                    play()
                )
                proc0_19(81 3)
                (send gEgo:get(7))
                (bowl:dispose())
                = cycles 4
            )
            (case 3
                (send gEgo:setCycle(Beg self))
            )
            (case 4
                proc0_1()
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance climbHill of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    illegalBits(0)
                    setLoop(3)
                    setPri(1)
                    setMotion(MoveTo (send gEgo:x) + (send gEgo:y) 15 self)
                )
            )
            (case 1
                proc0_1()
                proc0_3()
                (send global2:newRoom((send global2:north)))
                (self:dispose())
            )
        )
    )

)
(instance pinetree1 of NewFeature
    (properties
        x 54
        y 109
        noun 4156
        nsTop 93
        nsLeft 18
        nsBottom 126
        nsRight 91
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree2 of NewFeature
    (properties
        x 49
        y 81
        noun 4156
        nsTop 69
        nsLeft 30
        nsBottom 93
        nsRight 69
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree3 of NewFeature
    (properties
        x 46
        y 58
        noun 4156
        nsTop 48
        nsLeft 36
        nsBottom 69
        nsRight 56
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree4 of NewFeature
    (properties
        x 228
        y 88
        noun 4156
        nsTop 68
        nsLeft 200
        nsBottom 109
        nsRight 257
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree6 of NewFeature
    (properties
        x 222
        y 57
        noun 4156
        nsTop 47
        nsLeft 206
        nsBottom 68
        nsRight 239
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree7 of NewFeature
    (properties
        x 218
        y 41
        noun 4156
        nsTop 35
        nsLeft 213
        nsBottom 47
        nsRight 224
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance plant1 of NewFeature
    (properties
        x 242
        y 157
        noun 4165
        nsTop 151
        nsLeft 211
        nsBottom 163
        nsRight 273
        description 4344
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4350
    )
)
(instance plant2 of NewFeature
    (properties
        x 218
        y 140
        noun 4165
        nsTop 135
        nsLeft 213
        nsBottom 145
        nsRight 224
        description 4344
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4350
    )
)
(instance plant3 of NewFeature
    (properties
        x 243
        y 135
        noun 4165
        nsTop 130
        nsLeft 238
        nsBottom 140
        nsRight 248
        description 4344
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4350
    )
)
(instance plant4 of NewFeature
    (properties
        x 250
        y 141
        noun 4165
        nsTop 137
        nsLeft 245
        nsBottom 146
        nsRight 255
        description 4344
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4350
    )
)
(instance plant5 of NewFeature
    (properties
        x 271
        y 143
        noun 4165
        nsTop 138
        nsLeft 266
        nsBottom 148
        nsRight 276
        description 4344
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4350
    )
)
(instance pinetree8 of NewFeature
    (properties
        x 40
        y 35
        noun 4156
        nsTop -1
        nsLeft 23
        nsBottom 71
        nsRight 58
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree9 of NewFeature
    (properties
        x 65
        y 28
        noun 4156
        nsTop 24
        nsLeft 58
        nsBottom 32
        nsRight 72
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree10 of NewFeature
    (properties
        x 67
        y 43
        noun 4156
        nsTop 40
        nsLeft 64
        nsBottom 46
        nsRight 71
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree11 of NewFeature
    (properties
        x 60
        y 41
        noun 4156
        nsTop 35
        nsLeft 58
        nsBottom 47
        nsRight 63
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree12 of NewFeature
    (properties
        x 67
        y 59
        noun 4156
        nsTop 47
        nsLeft 58
        nsBottom 71
        nsRight 76
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree13 of NewFeature
    (properties
        x 81
        y 68
        noun 4156
        nsTop 62
        nsLeft 76
        nsBottom 74
        nsRight 86
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree14 of NewFeature
    (properties
        x 90
        y 71
        noun 4156
        nsTop 68
        nsLeft 86
        nsBottom 74
        nsRight 95
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree15 of NewFeature
    (properties
        x 19
        y 15
        noun 4156
        nsTop 13
        nsLeft 17
        nsBottom 18
        nsRight 22
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree16 of NewFeature
    (properties
        x 19
        y 6
        noun 4156
        nsTop 4
        nsLeft 17
        nsBottom 9
        nsRight 22
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree17 of NewFeature
    (properties
        x 18
        y 32
        noun 4156
        nsTop 28
        nsLeft 14
        nsBottom 36
        nsRight 22
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree18 of NewFeature
    (properties
        x 17
        y 45
        noun 4156
        nsTop 43
        nsLeft 12
        nsBottom 48
        nsRight 22
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree19 of NewFeature
    (properties
        x 13
        y 62
        noun 4156
        nsTop 54
        nsLeft 5
        nsBottom 70
        nsRight 22
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree20 of NewFeature
    (properties
        x 17
        y 51
        noun 4156
        nsTop 50
        nsLeft 12
        nsBottom 53
        nsRight 23
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance tree1 of NewFeature
    (properties
        x 78
        y 11
        noun 4169
        nsTop -1
        nsLeft 57
        nsBottom 23
        nsRight 99
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree2 of NewFeature
    (properties
        x 85
        y 28
        noun 4169
        nsTop 24
        nsLeft 71
        nsBottom 33
        nsRight 100
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree3 of NewFeature
    (properties
        x 76
        y 36
        noun 4169
        nsTop 32
        nsLeft 63
        nsBottom 41
        nsRight 89
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree4 of NewFeature
    (properties
        x 77
        y 44
        noun 4169
        nsTop 41
        nsLeft 71
        nsBottom 47
        nsRight 84
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree5 of NewFeature
    (properties
        x 79
        y 53
        noun 4169
        nsTop 47
        nsLeft 76
        nsBottom 60
        nsRight 83
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree6 of NewFeature
    (properties
        x 283
        y 9
        noun 4169
        nsTop -1
        nsLeft 246
        nsBottom 19
        nsRight 320
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree7 of NewFeature
    (properties
        x 281
        y 29
        noun 4169
        nsTop 20
        nsLeft 248
        nsBottom 38
        nsRight 315
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree8 of NewFeature
    (properties
        x 298
        y 43
        noun 4169
        nsTop 39
        nsLeft 282
        nsBottom 47
        nsRight 314
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree9 of NewFeature
    (properties
        x 266
        y 47
        noun 4169
        nsTop 39
        nsLeft 261
        nsBottom 55
        nsRight 271
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree10 of NewFeature
    (properties
        x 5
        y 25
        noun 4169
        nsTop -2
        nsBottom 53
        nsRight 11
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree11 of NewFeature
    (properties
        x 14
        y 12
        noun 4169
        nsTop -1
        nsLeft 11
        nsBottom 26
        nsRight 18
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree12 of NewFeature
    (properties
        x 230
        y 15
        noun 4169
        nsLeft 213
        nsBottom 31
        nsRight 247
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance tree13 of NewFeature
    (properties
        x 241
        y 43
        noun 4169
        nsTop 32
        nsLeft 234
        nsBottom 54
        nsRight 248
        description 4572
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4577
    )
)
(instance pinetree21 of NewFeature
    (properties
        x 105
        y 48
        noun 4173
        nsTop 41
        nsLeft 84
        nsBottom 55
        nsRight 126
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree22 of NewFeature
    (properties
        x 104
        y 37
        noun 4173
        nsTop 35
        nsLeft 91
        nsBottom 40
        nsRight 117
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
(instance pinetree23 of NewFeature
    (properties
        x 121
        y 61
        noun 4173
        nsTop 57
        nsLeft 113
        nsBottom 65
        nsRight 129
        description 4216
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 4226
    )
)
