(version 2)
(include "sci.sh")
(exports
    0 rm72
)
(use "Main")
(use "Class_255_0")
(use "cloudRoom")
(use "NewFeature")
(use "n958")
(use "Cycle")
(use "Obj")
(script 72)



(instance public rm72 of cloudRoom
    (properties
        picture 72
        east 56
    )

    (method (init)
        Load(rsVIEW 8)
        proc958_0(132 7 6)
        (self:style(
            (switch (gGNumber)
                (case east
                    2
                )
                (default 
                    43
                )
            )
))
        (super:init())
        proc0_10(0)
        (switch (gGNumber)
            (case east
                proc0_1()
                (send gEgo:
                    posn(317 168)
                    init()
                )
            )
            (default 
                (send global2:setScript(climbUpStalk))
            )
        )
        (stalk1:init())
        (stalk2:init())
        (stalk3:init())
        (stalk4:init())
        (stalk5:init())
        (cloud1:init())
        (cloud2:init())
        (cloud3:init())
        (cloud4:init())
        (cloud5:init())
        (cloud6:init())
        (cloud7:init())
        (cloud8:init())
    )


    (method (handleEvent pEvent)
        (if ((send pEvent:claimed))
            return 
        )(else
            (if ((super:handleEvent(pEvent)))
                return 
            )(else
                (if (Said('look,look[<at,around][/beanstalk,room]'))
                    proc255_0(72 0)
                )(else
                    (if (Said('look,look[<down][/grass,goat]'))
                        proc255_0(72 1)
                    )(else
                        (if (Said('climb,climb'))
                            (if (not (send gEgo:inRect(40 150 274 188)))
                                proc0_4()
                            )(else
                                (if (proc0_12(1))
                                    proc255_0(72 2)
                                )(else
                                    (if ((send global2:script))
                                        proc255_0(72 3)
                                    )(else
                                        (send global2:setScript(climbDownStalk))
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

)
(instance climbDownStalk of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_10(48)
                (send gEgo:
                    looper(0)
                    setCycle(Walk)
                    ignoreActors()
                    illegalBits(0)
                )
                (if (> (send gEgo:y) 167)
                    (self:changeState(3))
                )(else
                    (if (< (send gEgo:x) 66)
                        (self:changeState(2))
                    )(else
                        (if (> (send gEgo:x) 160)
                            (self:changeState(2))
                        )(else
                            (self:cue())
                        )
                    )
                )
            )
            (case 1
                (send gEgo:setMotion(MoveTo 65 (send gEgo:y) self))
            )
            (case 2
                (send gEgo:setMotion(MoveTo (send gEgo:x) 171 self))
            )
            (case 3
                (send gEgo:setMotion(MoveTo 140 171 self))
            )
            (case 4
                (send gEgo:
                    posn(140 136)
                    view(8)
                    setPri(14)
                    setStep(2 2)
                    moveSpeed(1)
                    cycleSpeed(1)
                    setCycle(Walk)
                    setMotion(MoveTo 139 199 self)
                )
            )
            (case 5
                proc0_3()
                (send global2:newRoom(71))
            )
        )
    )

)
(instance climbUpStalk of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gEgo:
                    illegalBits(0)
                    ignoreActors()
                    posn(139 199)
                    view(8)
                    init()
                    setPri(14)
                    setStep(2 2)
                    moveSpeed(1)
                    cycleSpeed(1)
                    setCycle(Walk)
                    setMotion(MoveTo 139 136 self)
                )
            )
            (case 1
                proc0_11(48)
                proc0_1()
                (send gEgo:posn(142 171))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance stalk1 of NewFeature
    (properties
        x 94
        y 76
        noun 1791
        nsTop 23
        nsLeft 61
        nsBottom 130
        nsRight 127
        description 1837
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1843
    )
)
(instance stalk2 of NewFeature
    (properties
        x 129
        y 148
        noun 1791
        nsTop 130
        nsLeft 96
        nsBottom 166
        nsRight 162
        description 1837
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1843
    )
)
(instance stalk3 of NewFeature
    (properties
        x 134
        y 123
        noun 1791
        nsTop 117
        nsLeft 127
        nsBottom 130
        nsRight 141
        description 1837
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1843
    )
)
(instance stalk4 of NewFeature
    (properties
        x 141
        y 59
        noun 1791
        nsTop 21
        nsLeft 128
        nsBottom 98
        nsRight 154
        description 1837
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1843
    )
)
(instance stalk5 of NewFeature
    (properties
        x 49
        y 105
        noun 1791
        nsTop 87
        nsLeft 38
        nsBottom 124
        nsRight 60
        description 1837
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1843
    )
)
(instance cloud1 of NewFeature
    (properties
        x 94
        y 54
        noun 1795
        nsTop 34
        nsBottom 74
        nsRight 188
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
(instance cloud2 of NewFeature
    (properties
        x 240
        y 59
        noun 1795
        nsTop 48
        nsLeft 188
        nsBottom 71
        nsRight 292
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
(instance cloud3 of NewFeature
    (properties
        x 223
        y 17
        noun 1795
        nsTop 13
        nsLeft 184
        nsBottom 22
        nsRight 262
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
(instance cloud4 of NewFeature
    (properties
        x 249
        y 88
        noun 1795
        nsTop 82
        nsLeft 178
        nsBottom 94
        nsRight 320
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
(instance cloud5 of NewFeature
    (properties
        x 306
        y 77
        noun 1795
        nsTop 72
        nsLeft 293
        nsBottom 82
        nsRight 320
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
(instance cloud6 of NewFeature
    (properties
        x 160
        y 167
        noun 1795
        nsTop 145
        nsBottom 189
        nsRight 320
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
(instance cloud7 of NewFeature
    (properties
        x 246
        y 135
        noun 1795
        nsTop 125
        nsLeft 173
        nsBottom 145
        nsRight 320
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
(instance cloud8 of NewFeature
    (properties
        x 300
        y 116
        noun 1795
        nsTop 107
        nsLeft 280
        nsBottom 125
        nsRight 320
        description 1989
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1995
    )
)
