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


(local
    local0
    local1[2]
    local3[2] = (29 40 )
    local5[2] = (40 84 )

)
(instance public rm7 of Rm
    (properties
        picture 7
        horizon 65
        north 10
        east 6
        south 42
        west 8
    )

    (method (init)
        (asm
            pushi   2
            pushi   128
            pushi   207
            callk   Load, 4
            pushi   31
            pushi   1
            lsg     gGNumber
            dup     
            pToa    north
            eq?     
            bnt     code_0027
            ldi     5
            jmp     code_0048
code_0027:  dup     
            pToa    west
            eq?     
            bnt     code_0033
            ldi     3
            jmp     code_0048
code_0033:  dup     
            pToa    east
            eq?     
            bnt     code_003f
            ldi     2
            jmp     code_0048
code_003f:  dup     
            pToa    south
            eq?     
            bnt     code_0048
            ldi     4
code_0048:  toss    
            push    
            self    6
            pushi   #init
            pushi   0
            super   Rm, 4
            lsg     gGNumber
            dup     
            pToa    north
            eq?     
            bnt     code_007c
            pushi   #posn
            pushi   2
            pushi   3
            pushi   310
            pushi   #x
            pushi   0
            lag     gEgo
            send    4
            push    
            pushi   194
            callb   proc0_17, 6
            push    
            pushi   75
            lag     gEgo
            send    8
            jmp     code_0153
code_007c:  dup     
            pToa    south
            eq?     
            bnt     code_0094
            pushi   #posn
            pushi   2
            pushi   168
            pushi   187
            lag     gEgo
            send    8
            jmp     code_0153
code_0094:  dup     
            pToa    west
            eq?     
            bnt     code_0112
            lsg     global130
            dup     
            ldi     0
            eq?     
            bnt     code_00df
            pushi   #y
            pushi   0
            lag     gEgo
            send    4
            push    
            ldi     95
            lt?     
            bnt     code_00c1
            pushi   #posn
            pushi   2
            pushi   6
            pushi   73
            lag     gEgo
            send    8
            jmp     code_00f8
code_00c1:  pushi   3
            pushi   147
            pushi   #y
            pushi   0
            lag     gEgo
            send    4
            push    
            pushi   72
            callb   proc0_18, 6
            pushi   #x
            pushi   1
            pushi   4
            lag     gEgo
            send    6
            jmp     code_00f8
code_00df:  dup     
            ldi     4
            eq?     
            bnt     code_00f8
            pushi   #y
            pushi   1
            pushi   100
            lag     gEgo
            send    6
            pushi   #x
            pushi   1
            pushi   4
            lag     gEgo
            send    6
code_00f8:  toss    
            pushi   3
            pushi   198
            pushi   #y
            pushi   0
            lag     gEgo
            send    4
            push    
            pTos    horizon
            ldi     4
            add     
            push    
            callb   proc0_17, 6
            jmp     code_0153
code_0112:  dup     
            pToa    east
            eq?     
            bnt     code_0145
            pushi   #posn
            pushi   2
            pushi   314
            pushi   3
            pushi   187
            pushi   3
            pushi   143
            pushi   #y
            pushi   0
            lag     gEgo
            send    4
            push    
            pushi   118
            callb   proc0_18, 6
            push    
            pushi   67
            callb   proc0_17, 6
            push    
            lag     gEgo
            send    8
            jmp     code_0153
code_0145:  pushi   #posn
            pushi   2
            pushi   314
            pushi   157
            lag     gEgo
            send    8
code_0153:  toss    
            pushi   #init
            pushi   0
            lag     gEgo
            send    4
            lag     global130
            not     
            bnt     code_0165
            pushi   0
            callb   proc0_1, 0
code_0165:  pushi   #setRegions
            pushi   1
            pushi   603
            self    6
            ldi     0
            sal     local0
code_0172:  lsl     local0
            lsg     global101
            ldi     1
            ge?     
            bnt     code_0181
            ldi     2
            jmp     code_0183
code_0181:  ldi     1
code_0183:  lt?     
            bnt     code_01e4
            pushi   5
            pushi   #superClass
            pushi   207
            pushi   168
            pushi   1
            pushi   1
            pushi   66
            pushi   1
            pushi   0
            pushi   4
            pushi   1
            lal     local0
            lsli    local3
            pushi   3
            pushi   1
            lsli    local5
            pushi   229
            pushi   1
            push    
            pushi   231
            pushi   1
            pushi   1
            pushi   203
            pushi   1
            lofsa   "waterfall"
            push    
            pushi   93
            pushi   0
            pushi   226
            pushi   0
            pushi   1
            lofsa   Ripple
            push    
            callk   Clone, 2
            push    
            lal     local0
            sali    local1
            send    56
            lsg     global101
            ldi     1
            ge?     
            bnt     code_01df
            pushi   #setCycle
            pushi   1
            class   Fwd
            push    
            lal     local0
            lali    local1
            send    6
code_01df:  +al     local0
            jmp     code_0172
code_01e4:  pushi   #init
            pushi   0
            lofsa   waterfall1
            send    4
            pushi   #init
            pushi   0
            lofsa   waterfall
            send    4
            pushi   #init
            pushi   0
            lofsa   smalltree1
            send    4
            pushi   #init
            pushi   0
            lofsa   smalltree2
            send    4
            pushi   #init
            pushi   0
            lofsa   lake1
            send    4
            pushi   #init
            pushi   0
            lofsa   lake2
            send    4
            pushi   #init
            pushi   0
            lofsa   tree1
            send    4
            pushi   #init
            pushi   0
            lofsa   tree2
            send    4
            pushi   #init
            pushi   0
            lofsa   tree3
            send    4
            pushi   #init
            pushi   0
            lofsa   bush
            send    4
            pushi   #init
            pushi   0
            lofsa   rock1
            send    4
            pushi   #init
            pushi   0
            lofsa   rock2
            send    4
            pushi   #init
            pushi   0
            lofsa   rock3
            send    4
            pushi   #init
            pushi   0
            lofsa   rock4
            send    4
            pushi   #init
            pushi   0
            lofsa   rock5
            send    4
            ret     
        )
    )


    (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>') and Said('[<at,around][/room,ceder]'))
                    proc255_0(7 0)
                )
            )
        )
    )

)
(instance tree1 of NewFeature
    (properties
        x 257
        y 11
        noun 1900
        nsLeft 195
        nsBottom 23
        nsRight 320
        description 1960
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 1965
    )
)
(instance tree2 of NewFeature
    (properties
        x 270
        y 34
        noun 1900
        nsTop 23
        nsLeft 221
        nsBottom 45
        nsRight 319
        description 1960
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 1965
    )
)
(instance tree3 of NewFeature
    (properties
        x 282
        y 90
        noun 1900
        nsTop 46
        nsLeft 268
        nsBottom 135
        nsRight 297
        description 1960
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 1965
    )
)
(instance waterfall1 of NewFeature
    (properties
        x 44
        y 22
        noun 1904
        nsTop 3
        nsLeft 16
        nsBottom 41
        nsRight 73
        description 1946
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2018
    )
)
(instance waterfall of NewFeature
    (properties
        x 58
        y 59
        noun 1904
        nsTop 41
        nsLeft 25
        nsBottom 77
        nsRight 91
        description 1946
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2018
    )
)
(instance lake1 of NewFeature
    (properties
        x 47
        y 95
        noun 1908
        nsTop 79
        nsBottom 111
        nsRight 95
        description 2103
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2108
    )
)
(instance lake2 of NewFeature
    (properties
        x 32
        y 126
        noun 1908
        nsTop 113
        nsBottom 139
        nsRight 65
        description 2103
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2108
    )
)
(instance smalltree1 of NewFeature
    (properties
        x 52
        y 137
        noun 1918
        nsTop 122
        nsLeft 36
        nsBottom 152
        nsRight 69
        description 2153
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2164
    )
)
(instance smalltree2 of NewFeature
    (properties
        x 83
        y 147
        noun 1918
        nsTop 135
        nsLeft 69
        nsBottom 159
        nsRight 97
        description 2153
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2164
    )
)
(instance Ripple of Prop
    (properties)

    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if (Said('look,look/waterfall'))
                proc255_0(7 1)
            )(else
                (super:handleEvent(pEvent))
            )
        )
    )


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

)
(instance bush of NewFeature
    (properties
        x 258
        y 180
        noun 1934
        nsTop 172
        nsLeft 196
        nsBottom 189
        nsRight 320
        description 2267
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2272
    )
)
(instance rock1 of NewFeature
    (properties
        x 59
        y 36
        noun 1938
        nsTop 8
        nsBottom 64
        nsRight 119
        description 2328
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2333
    )
)
(instance rock2 of NewFeature
    (properties
        x 148
        y 43
        noun 1938
        nsTop 23
        nsLeft 119
        nsBottom 64
        nsRight 178
        description 2505
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2333
    )
)
(instance rock3 of NewFeature
    (properties
        x 92
        y 121
        noun 1938
        nsTop 113
        nsLeft 67
        nsBottom 129
        nsRight 118
        description 2328
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2333
    )
)
(instance rock4 of NewFeature
    (properties
        x 110
        y 74
        noun 1938
        nsTop 65
        nsLeft 93
        nsBottom 83
        nsRight 128
        description 2328
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2333
    )
)
(instance rock5 of NewFeature
    (properties
        x 141
        y 96
        noun 1938
        nsTop 92
        nsLeft 124
        nsBottom 101
        nsRight 158
        description 2328
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 2333
    )
)
