(version 2)
(include "sci.sh")
(exports
    0 rm62
)
(use "Main")
(use "Class_255_0")
(use "cloudRoom")
(use "NewFeature")
(use "Cycle")
(use "Obj")
(script 62)



(procedure (localproc_04bc param1 param2)
    return == (send ((send gInv:at(param1))):owner) 
        (if (== paramTotal 1)
            gNumber
        )(else
            param2
        )
)


(instance public rm62 of cloudRoom
    (properties
        picture 62
        horizon 100
        north 59
        west 61
    )

    (method (init)
        Load(rsVIEW 67)
        (super:init())
        proc610_1(proc0_18(96 proc0_17(222 (send gEgo:x) 3) 60) + horizon 4 0 0 0 0 3 proc0_17(148 (send gEgo:y) + horizon 2) 299)
        (send gEgo:init())
        proc0_1()
        (hole:init())
        (cave:init())
        (tree1:init())
        (tree2:init())
        (tree3:init())
        (tree4:init())
        (tree5:init())
        (cloud1:init())
        (cloud2:init())
        (cloud3:init())
        (cloud4:init())
        (cloud5:init())
        (cloud6:init())
    )


    (method (handleEvent pEvent)
        return 
            (if ((super:handleEvent(pEvent)))
                return 1
            )(else
                (if (Said('look,look/ceder'))
                    proc255_0(62 0)
                )(else
                    (if (Said('look,look/hole'))
                        (if (not (send gEgo:inRect(214 129 268 138)))
                            proc255_0(62 1)
                        )(else
                            (if (localproc_04bc(10))
                                proc255_0(62 2)
                            )(else
                                proc255_0(62 3)
                            )
                        )
                    )(else
                        (if (Said('get,get/shot'))
                            (if (not localproc_04bc(10))
                                proc255_0(62 4)
                            )(else
                                (if (not (send gEgo:inRect(214 129 268 138)))
                                    proc0_4()
                                )(else
                                    (send global2:setScript(getSlingshot))
                                )
                            )
                        )(else
                            (if (Said('look,look/shot'))
                                (if (localproc_04bc(10) and (send gEgo:inRect(214 129 268 138)))
                                    proc255_0(62 5)
                                )(else
                                    (send pEvent:claimed(0))
                                )
                            )
                        )
                    )
                )
            )
    )

)
(instance getSlingshot of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                proc0_15(gEgo 248 117)
                (self:cue())
            )
            (case 1
                (send gEgo:
                    view(67)
                    loop(+ 
                        (if (proc0_12(1))
                            2
                        )(else
                            0
                        )
 
                        (if (< (send gEgo:x) 248)
                            0
                        )(else
                            1
                        )
)
                    cel(0)
                    setMotion(0)
                    cycleSpeed(1)
                    setCycle(End)
                )
                = cycles 7
            )
            (case 2
                (send (ScriptID(0 21)):
                    number(105)
                    loop(1)
                    init()
                    play()
                )
                proc255_0(62 6)
                proc0_19(85 2)
                (send gEgo:
                    get(10)
                    setCycle(Beg self)
                )
            )
            (case 3
                proc0_1()
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance tree1 of NewFeature
    (properties
        x 63
        y 132
        nsTop 103
        nsLeft 48
        nsBottom 162
        nsRight 78
        description 1656
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1661
    )
)
(instance tree2 of NewFeature
    (properties
        x 72
        y 80
        nsTop 56
        nsLeft 57
        nsBottom 104
        nsRight 88
        description 1656
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1661
    )
)
(instance tree3 of NewFeature
    (properties
        x 88
        y 29
        nsBottom 59
        nsRight 176
        description 1656
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1661
    )
)
(instance tree4 of NewFeature
    (properties
        x 231
        y 21
        nsTop -1
        nsLeft 208
        nsBottom 44
        nsRight 254
        description 1656
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1661
    )
)
(instance tree5 of NewFeature
    (properties
        x 250
        y 81
        nsTop 45
        nsLeft 223
        nsBottom 118
        nsRight 272
        description 1656
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1661
    )
)
(instance hole of NewFeature
    (properties
        x 256
        y 114
        nsTop 104
        nsLeft 249
        nsBottom 124
        nsRight 264
        description 1738
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1743
    )
)
(instance cave of NewFeature
    (properties
        x 305
        y 22
        noun 1622
        nsTop -1
        nsLeft 291
        nsBottom 45
        nsRight 319
        description 1797
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1803
    )
)
(instance cloud1 of NewFeature
    (properties
        x 22
        y 161
        noun 1629
        nsTop 134
        nsBottom 189
        nsRight 45
        description 1863
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1869
    )
)
(instance cloud2 of NewFeature
    (properties
        x 182
        y 174
        noun 1629
        nsTop 159
        nsLeft 45
        nsBottom 189
        nsRight 320
        description 1863
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1869
    )
)
(instance cloud3 of NewFeature
    (properties
        x 302
        y 103
        noun 1629
        nsTop 48
        nsLeft 285
        nsBottom 159
        nsRight 320
        description 1863
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1869
    )
)
(instance cloud4 of NewFeature
    (properties
        x 261
        y 149
        noun 1629
        nsTop 140
        nsLeft 237
        nsBottom 159
        nsRight 285
        description 1863
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1869
    )
)
(instance cloud5 of NewFeature
    (properties
        x 234
        y 99
        noun 1629
        nsTop 93
        nsLeft 184
        nsBottom 105
        nsRight 285
        description 1863
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1869
    )
)
(instance cloud6 of NewFeature
    (properties
        x 277
        y 84
        noun 1629
        nsTop 76
        nsLeft 271
        nsBottom 92
        nsRight 284
        description 1863
        sightAngle 360
        getableDist 320
        seeableDist 320
        shiftClick 369
        contClick 371
        lookStr 1869
    )
)
