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



(instance public rm20 of Rm
    (properties
        picture 20
        horizon 57
        north 29
        east 19
        south 13
        west 21
    )

    (method (init)
        (if (>= global101 1)
            proc958_0(128 302 700)
        )
        (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(302 proc0_18(276 (send gEgo:x) 200) 0) (+ horizon 2)))
            )
            (case south
                (send gEgo:y(188))
            )
            (case west
                (send gEgo:posn(3 proc0_18(118 proc0_18(98 (send gEgo:y) 72) 112)))
            )
            (case east
                (send gEgo:posn(317 proc0_17(189 (send gEgo:y) 90)))
            )
            (default 
                (send gEgo:posn(3 137))
            )
        )
        (send gEgo:init())
        proc0_1()
        (self:setRegions(603))
        (tree1:init())
        (tree2:init())
        (tree3:init())
        (tree4:init())
        (tree5:init())
        (tree6:init())
        (tree7:init())
        (bush1:init())
        (bush2:init())
        (bush3:init())
        (bush4:init())
        (bush5:init())
        (lake1:init())
        (lake2:init())
        (lake3:init())
        (lake4:init())
        (if (>= global101 1)
            (fish:init())
            (ripple:
                init()
                cycleSpeed(global101)
                setCycle(Fwd)
            )
        )
    )


    (method (doit)
        (var temp0)
        (if (script and not global130)
            (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
                            )
                        )
)))
            )(else
                (if (script and global130)
                    (send script:doit())
                )
            )
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if (Said('/beaver,animal'))
                    proc255_0(20 0)
                )(else
                    (if (Said('look,look>'))
                        (if (Said('[<at,around][/room]'))
                            proc255_0(20 1)
                        )(else
                            (if (Said('/stump'))
                                proc255_0(20 2)
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance ripple of Prop
    (properties
        x 94
        y 104
        view 700
        signal $4000
    )

    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if (Said('look,look/ripple'))
                    (self:doVerb(1))
                )
            )
        )
    )


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

)
(instance fishJump of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (fish:
                    posn(Random(85 145) Random(120 135))
                    loop(Random(0 1))
                    setCycle(End self)
                )
            )
            (case 1
                (fish:stopUpd())
                (self:dispose())
            )
        )
    )

)
(instance fish of Prop
    (properties
        view 302
    )

    (method (init)
        (self:
            cycleSpeed(
                (if (>= global101 1)
                    1
                )(else
                    0
                )
)
            ignoreActors()
            stopUpd()
        )
        (super:init())
    )


    (method (doit)
        (super:doit())
        (if (((< Random(1 100) 3) and not (fish:script)) and not global130)
            (fish:setScript(fishJump))
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if (Said('look,look/fish'))
                    (self:doVerb(1))
                )(else
                    (if (Said('get,get,capture/fish'))
                        (self:doVerb(7))
                    )
                )
            )
        )
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                (if ((fish:script))
                    proc255_0(20 4)
                )(else
                    proc255_0(20 5)
                )
            )
            (case 7
                proc255_0(20 6)
            )
        )
    )

)
(instance tree1 of NewFeature
    (properties
        x 211
        y 100
        noun 2382
        nsTop 84
        nsLeft 181
        nsBottom 117
        nsRight 241
        description 2430
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2435
    )
)
(instance tree2 of NewFeature
    (properties
        x 211
        y 65
        noun 2382
        nsTop 46
        nsLeft 193
        nsBottom 84
        nsRight 229
        description 2430
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2435
    )
)
(instance tree3 of NewFeature
    (properties
        x 259
        y 56
        noun 2382
        nsTop 42
        nsLeft 238
        nsBottom 70
        nsRight 281
        description 2430
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2435
    )
)
(instance tree4 of NewFeature
    (properties
        x 256
        y 33
        noun 2382
        nsTop 25
        nsLeft 243
        nsBottom 42
        nsRight 270
        description 2430
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2435
    )
)
(instance tree5 of NewFeature
    (properties
        x 258
        y 17
        noun 2382
        nsTop 11
        nsLeft 251
        nsBottom 24
        nsRight 265
        description 2430
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2435
    )
)
(instance tree6 of NewFeature
    (properties
        x 209
        y 39
        noun 2382
        nsTop 33
        nsLeft 202
        nsBottom 45
        nsRight 216
        description 2430
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2435
    )
)
(instance tree7 of NewFeature
    (properties
        x 223
        y 128
        noun 2382
        nsTop 117
        nsLeft 217
        nsBottom 139
        nsRight 230
        description 2430
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2435
    )
)
(instance lake1 of NewFeature
    (properties
        x 124
        y 84
        noun 2386
        nsTop 61
        nsLeft 68
        nsBottom 108
        nsRight 181
        description 2520
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2525
    )
)
(instance lake2 of NewFeature
    (properties
        x 51
        y 86
        noun 2386
        nsTop 69
        nsLeft 36
        nsBottom 103
        nsRight 67
        description 2520
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2525
    )
)
(instance lake3 of NewFeature
    (properties
        x 108
        y 121
        noun 2386
        nsTop 104
        nsLeft 47
        nsBottom 131
        nsRight 170
        description 2520
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2525
    )
)
(instance lake4 of NewFeature
    (properties
        x 90
        y 143
        noun 2386
        nsTop 131
        nsLeft 45
        nsBottom 156
        nsRight 136
        description 2520
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2525
    )
)
(instance bush1 of NewFeature
    (properties
        x 8
        y 71
        noun 2396
        nsTop 25
        nsBottom 117
        nsRight 16
        description 2669
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2674
    )
)
(instance bush2 of NewFeature
    (properties
        x 24
        y 78
        noun 2396
        nsTop 37
        nsLeft 16
        nsBottom 119
        nsRight 32
        description 2669
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2674
    )
)
(instance bush3 of NewFeature
    (properties
        x 38
        y 67
        noun 2396
        nsTop 47
        nsLeft 31
        nsBottom 87
        nsRight 45
        description 2669
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2674
    )
)
(instance bush4 of NewFeature
    (properties
        x 54
        y 76
        noun 2396
        nsTop 66
        nsLeft 45
        nsBottom 86
        nsRight 63
        description 2669
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2674
    )
)
(instance bush5 of NewFeature
    (properties
        x 42
        y 109
        noun 2396
        nsTop 101
        nsLeft 31
        nsBottom 117
        nsRight 54
        description 2669
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2674
    )
)
