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



(instance public rm8 of Rm
    (properties
        picture 8
        horizon 54
        north 9
        east 7
        south 41
        west 83
    )

    (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(204 (+ horizon 4)))
            )
            (case south
                (send gEgo:posn(proc0_17(315 (send gEgo:x) 33) 186))
            )
            (case west
                (send gEgo:posn(37 proc0_17(195 (send gEgo:y) 96)))
            )
            (case east
                (if ((== global130 0) and (< (send gEgo:y) 90))
                    (send gEgo:y(60))
                )(else
                    (send gEgo:y(proc0_17(198 (send gEgo:y) 86)))
                )
                (send gEgo:x(317))
            )
            (default 
                (send gEgo:posn(3 137))
            )
        )
        (send gEgo:init())
        (if (not global130)
            proc0_1()
        )
        (self:setRegions(603))
        (bigtree1:init())
        (bigtree2:init())
        (smalltree1:init())
        (lake1:init())
        (lake2:init())
        (lake3:init())
        (underbrush:init())
        (bush:init())
        (rock1:init())
        (rock2:init())
        (rock3:init())
        (rock4:init())
        (rock5: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('look,look>'))
                    (if (Said('[<at,around][/room]'))
                        proc255_0(8 0)
                    )(else
                        (if (Said('/waterfall'))
                            proc255_0(8 1)
                        )(else
                            (if (Said('/blossom'))
                                proc255_0(8 2)
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance ripple of Prop
    (properties
        x 185
        y 122
        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(8 3)
            )
        )
    )

)
(instance fishJump of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (fish:
                    posn(Random(145 275) Random(100 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(8 4)
                )(else
                    proc255_0(8 5)
                )
            )
            (case 7
                proc255_0(8 6)
            )
        )
    )

)
(instance bigtree1 of NewFeature
    (properties
        x 101
        y 14
        noun 2217
        nsLeft 2
        nsBottom 29
        nsRight 170
        description 2287
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2292
    )
)
(instance bigtree2 of NewFeature
    (properties
        x 110
        y 43
        noun 2217
        nsTop 29
        nsLeft 33
        nsBottom 58
        nsRight 170
        description 2287
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2292
    )
)
(instance smalltree1 of NewFeature
    (properties
        x 274
        y 31
        noun 2226
        nsTop 1
        nsLeft 240
        nsBottom 55
        nsRight 289
        description 2287
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2343
    )
)
(instance lake1 of NewFeature
    (properties
        x 222
        y 108
        noun 2233
        nsTop 73
        nsLeft 125
        nsBottom 143
        nsRight 319
        description 2409
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2414
    )
)
(instance lake2 of NewFeature
    (properties
        x 109
        y 114
        noun 2233
        nsTop 89
        nsLeft 94
        nsBottom 140
        nsRight 124
        description 2409
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2414
    )
)
(instance lake3 of NewFeature
    (properties
        x 86
        y 111
        noun 2233
        nsTop 101
        nsLeft 79
        nsBottom 122
        nsRight 94
        description 2409
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2414
    )
)
(instance underbrush of NewFeature
    (properties
        x 88
        y 68
        noun 2243
        nsTop 45
        nsBottom 91
        nsRight 176
        description 2465
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2476
    )
)
(instance bush of NewFeature
    (properties
        x 106
        y 151
        noun 2250
        nsTop 142
        nsLeft 79
        nsBottom 161
        nsRight 134
        description 2588
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2593
    )
)
(instance rock1 of NewFeature
    (properties
        x 291
        y 79
        noun 2254
        nsTop 76
        nsLeft 262
        nsBottom 83
        nsRight 320
        description 2639
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2644
    )
)
(instance rock2 of NewFeature
    (properties
        x 277
        y 64
        noun 2254
        nsTop 52
        nsLeft 234
        nsBottom 76
        nsRight 320
        description 2639
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2644
    )
)
(instance rock3 of NewFeature
    (properties
        x 281
        y 47
        noun 2254
        nsTop 42
        nsLeft 243
        nsBottom 52
        nsRight 319
        description 2639
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2644
    )
)
(instance rock4 of NewFeature
    (properties
        x 311
        y 30
        noun 2254
        nsTop 16
        nsLeft 303
        nsBottom 45
        nsRight 320
        description 2639
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2644
    )
)
(instance rock5 of NewFeature
    (properties
        x 285
        y 36
        noun 2254
        nsTop 30
        nsLeft 280
        nsBottom 42
        nsRight 291
        description 2639
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2644
    )
)
