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


(local
    local0
    local1[6]
    local7[5] = (174 212 170 148 26 )
    local12[5] = (162 130 134 110 150 )
    local17[5] = (2 3 3 3 )

)
(instance public rm43 of Rm
    (properties
        picture 43
        horizon 50
        north 6
        east 44
        south 38
        west 42
    )

    (method (init)
        Load(rsVIEW 243)
        (if (>= global101 1)
            Load(rsVIEW 302)
        )
        (self:style(
            (switch (gGNumber)
                (case north
                    5
                )
                (case west
                    3
                )
                (case east
                    2
                )
                (case south
                    4
                )
            )
))
        (super:init())
        (switch (gGNumber)
            (case north
                (if (> (send gEgo:x) 263)
                    (send gEgo:posn((+ 190 (- (send gEgo:x) 264)) (+ horizon 2)))
                )(else
                    (send gEgo:posn((/ (* (send gEgo:x) 18) 25) (+ horizon 2)))
                )
            )
            (case south
                (send gEgo:y(188))
            )
            (case west
                (if (< (send gEgo:y) 140)
                    (send gEgo:posn(3 proc0_17(108 (send gEgo:y) (+ horizon 2))))
                )(else
                    (send gEgo:posn(3 proc0_17(188 (send gEgo:y) 175)))
                )
            )
            (case east
                (send gEgo:posn(317 proc0_17(188 proc0_18(78 (send gEgo:y) 67) 61)))
            )
            (default 
                (send gEgo:posn(3 178))
            )
        )
        (send gEgo:init())
        (if (not global130)
            proc0_1()
        )(else
            (send gEgo:setCycle(Fwd))
        )
        (rock:init())
        (lake1:init())
        (lake2:init())
        (lake3:init())
        (lake4:init())
        (lake5:init())
        (tree1:init())
        (tree2:init())
        (tree3:init())
        (bush1:init())
        (bush2:init())
        (self:setRegions(612))
        = local0 
            (if (>= global101 1)
                0
            )(else
                4
            )
        (while (< local0 5)
            (send (= local1[local0] Clone(Ripple)):
                view(243)
                cycleSpeed(1)
                setPri(0)
                x(local7[local0])
                y(local12[local0])
                setLoop(local17[local0])
                setCycle(Fwd)
                ignoreActors(1)
                description("ripple")
                init()
            )
            ++local0
        )
        (if (>= global101 1)
            (fish:init())
        )
    )


    (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 ((== global130 4) and (& (send gEgo:onControl(1)) $2000))
                    (send gEgo:
                        cycleSpeed(1)
                        moveSpeed(1)
                    )
                )(else
                    (if ((== global130 4) and (& (send gEgo:onControl(1)) $4000))
                        (send gEgo:
                            cycleSpeed(2)
                            moveSpeed(2)
                        )
                    )(else
                        (if (== global130 4)
                            (if (not 
                            (if (& (send gEgo:onControl(1)) $2000)
                            )(else
                                & (send gEgo:onControl(1)) $4000
                            )
)
                                (send gEgo:
                                    cycleSpeed(0)
                                    moveSpeed(0)
                                )
                            )
                        )
                    )
                )
            )
        )
        (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/boulder') or proc0_14(pEvent 232 131 263 148)) or proc0_14(pEvent 264 113 289 135))
                    proc255_0(43 0)
                )(else
                    (if (Said('look,look>'))
                        (if (Said('[<at,around][/room,lake,water,lake]'))
                            proc255_0(43 1)
                        )(else
                            (if (Said('/clearing'))
                                proc255_0(43 2)
                            )(else
                                (if (Said('/brook'))
                                    proc255_0(43 3)
                                )(else
                                    (if (Said('/ceder'))
                                        proc255_0(43 4)
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance fishJump of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (fish:
                    posn(Random(30 155) Random(100 150))
                    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(43 5)
                )(else
                    proc255_0(43 6)
                )
            )
            (case 7
                proc255_0(43 7)
            )
        )
    )

)
(instance lake1 of NewFeature
    (properties
        x 74
        y 105
        noun 2484
        nsTop 47
        nsBottom 163
        nsRight 148
        description 2544
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2549
    )
)
(instance lake2 of NewFeature
    (properties
        x 169
        y 105
        noun 2484
        nsTop 51
        nsLeft 148
        nsBottom 160
        nsRight 191
        description 2544
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2549
    )
)
(instance lake3 of NewFeature
    (properties
        x 202
        y 104
        noun 2484
        nsTop 61
        nsLeft 191
        nsBottom 147
        nsRight 213
        description 2544
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2549
    )
)
(instance lake4 of NewFeature
    (properties
        x 221
        y 101
        noun 2484
        nsTop 70
        nsLeft 212
        nsBottom 133
        nsRight 231
        description 2544
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2549
    )
)
(instance lake5 of NewFeature
    (properties
        x 241
        y 101
        noun 2484
        nsTop 91
        nsLeft 231
        nsBottom 112
        nsRight 251
        description 2544
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2549
    )
)
(instance Ripple of Prop
    (properties)

    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if (Said('look,look/lake,water'))
                proc255_0(43 1)
            )(else
                (super:handleEvent(pEvent))
            )
        )
    )


    (method (doVerb theVerb)
        (switch (theVerb)
            (case 1
                proc255_0(43 1)
            )
        )
    )

)
(instance tree1 of NewFeature
    (properties
        x 281
        y 28
        noun 2459
        nsLeft 256
        nsBottom 57
        nsRight 307
        description 2640
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2645
    )
)
(instance tree2 of NewFeature
    (properties
        x 163
        y 27
        noun 2459
        nsTop 12
        nsLeft 146
        nsBottom 43
        nsRight 180
        description 2640
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2645
    )
)
(instance tree3 of NewFeature
    (properties
        x 161
        y 5
        noun 2459
        nsTop -1
        nsLeft 84
        nsBottom 12
        nsRight 238
        description 2640
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2645
    )
)
(instance rock of NewFeature
    (properties
        x 19
        y 162
        noun 2506
        nsTop 153
        nsBottom 172
        nsRight 38
        description 2759
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2764
    )
)
(instance bush1 of NewFeature
    (properties
        x 297
        y 61
        noun 2510
        nsTop 46
        nsLeft 274
        nsBottom 76
        nsRight 320
        description 2844
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2849
    )
)
(instance bush2 of NewFeature
    (properties
        x 276
        y 103
        noun 2510
        nsTop 91
        nsLeft 256
        nsBottom 115
        nsRight 296
        description 2844
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 2849
    )
)
