(version 2)
(include "sci.sh")
(exports
    0 rm70
)
(use "Main")
(use "Class_255_0")
(use "NewFeature")
(use "n958")
(use "RFeature")
(use "Cycle")
(use "Game")
(use "User")
(script 70)


(local
    local0
    local1[12]
    local13[11] = (81 205 219 118 135 185 179 95 193 159 133 )
    local24[11] = (46 83 117 108 110 43 34 146 151 48 136 )
    local35[11] = (0 0 0 0 0 0 1 2 2 2 3 )
    local46[11] = (0 2 3 4 5 6 0 0 1 2 )
    local57[11] = (1 4 8 8 7 1 0 10 11 1 9 )

)
(instance public rm70 of Rm
    (properties
        picture 70
        horizon 4
        north 71
    )

    (method (init)
        proc958_0(128 271 8)
        Load(rsSOUND 6)
        (self:south(gGNumber_4))
        (self:style(
            (switch (gGNumber)
                (case north
                    42
                )
                (case south
                    4
                )
            )
))
        (super:init())
        (send (ScriptID(0 23)):
            number(6)
            loop(-1)
            play()
        )
        (switch (gGNumber)
            (case north
                (send gEgo:posn(137 8))
            )
            (default 
                (send gEgo:posn(142 178))
            )
        )
        (self:setRegions(609))
        proc0_10(0)
        (send gEgo:init())
        proc0_1()
        (send gEgo:
            looper(0)
            setCycle(Walk)
            view(8)
            setStep(2 2)
            setPri(11)
        )
        = local0 0
        (while (< local0 11)
            (send local1[local0]:
                view(271)
                x(local13[local0])
                y(local24[= local1[local0] Clone(RPicView)])
                loop(local35[local0])
                cel(local46[local0])
                priority(local57[local0])
                description("leaf")
            )
            (send gAddToPics:
                add(local1[local0])
                eachElementDo(#signal 16384 93)
                doit()
            )
            ++local0
        )
        (if (proc0_12(2))
            proc255_0(70 0)
            proc0_11(2)
        )
        (stalk1:init())
        (stalk2:init())
        (cloud1:init())
        (cloud2:init())
        (cloud3:init())
        (cloud4:init())
        (cloud5:init())
    )


    (method (doit)
        (var temp0)
        (if (== script ScriptID(609 1))
            (send script:doit())
        )
        (if (script and (<> script ScriptID(609 1)))
            (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
                            )
                        )
)))
            )
        )
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if (Said('look,look[<at,around][/room,beanstalk]'))
                    proc255_0(70 1)
                )(else
                    (if (Said('look,look[<down][/grass]'))
                        (if (proc0_12(80))
                            (if (proc0_12(2))
                                proc255_0(70 2)
                            )(else
                                proc255_0(70 3)
                            )
                        )(else
                            proc255_0(70 4)
                        )
                    )
                )
            )
        )
    )

)
(instance stalk1 of NewFeature
    (properties
        x 134
        y 94
        noun 1118
        nsTop -1
        nsLeft 101
        nsBottom 189
        nsRight 167
        description 1140
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1146
    )
)
(instance stalk2 of NewFeature
    (properties
        x 191
        y 90
        noun 1118
        nsTop 43
        nsLeft 168
        nsBottom 137
        nsRight 214
        description 1140
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1146
    )
)
(instance cloud1 of NewFeature
    (properties
        x 45
        y 104
        noun 1122
        nsTop 95
        nsBottom 114
        nsRight 91
        description 1368
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1374
    )
)
(instance cloud2 of NewFeature
    (properties
        x 120
        y 75
        noun 1122
        nsTop 66
        nsBottom 85
        nsRight 241
        description 1368
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1374
    )
)
(instance cloud3 of NewFeature
    (properties
        x 95
        y 55
        noun 1122
        nsTop 44
        nsLeft 38
        nsBottom 66
        nsRight 153
        description 1368
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1374
    )
)
(instance cloud4 of NewFeature
    (properties
        x 259
        y 69
        noun 1122
        nsTop 67
        nsLeft 225
        nsBottom 71
        nsRight 294
        description 1368
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        lookStr 1374
    )
)
(instance cloud5 of NewFeature
    (properties
        x 288
        y 91
        noun 1122
        nsTop 87
        nsLeft 256
        nsBottom 96
        nsRight 320
        description 1368
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1374
    )
)
