(version 2)
(include "sci.sh")
(exports
    0 rm760
)
(use "Main")
(use "Scaler")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "Cycle")
(use "Game")
(use "View")
(use "Obj")
(script 760)



(instance public rm760 of Rm
    (properties
        noun 1
        picture 760
        vanishingY -200
    )

    (method (init)
        (if (not == (send gLongSong:number) 750)
            (send gLongSong:
                number(750)
                setLoop(-1)
                play()
            )
        )
        (if (not == (send gLongSong2:number) 391)
            (send gLongSong2:
                number(391)
                setLoop(-1)
                play(90)
            )
        )
        (send gOwner:
            normalize()
            setScale(Scaler 40 25 190 0)
        )
        (switch (gGClientModNum)
            (case 750
                (send global2:setScript(enterFr750))
            )
            (case 770
                (send global2:setScript(enterFr770))
            )
            (default 
                (send global2:setScript(enterFr780))
            )
        )
        (send global2:addObstacle((send ((Polygon:new())):
                type(3)
                init(276 189 237 164 192 149 174 134 145 129 119 132 76 132 63 115 45 112 70 105 80 95 97 91 113 89 141 82 168 99 194 99 187 92 170 97 141 79 115 85 120 76 127 73 139 70 156 56 190 46 190 44 164 36 180 34 186 31 181 25 118 25 118 31 128 27 179 27 182 31 167 34 151 35 186 45 157 53 140 67 123 72 117 76 111 87 99 87 76 94 68 104 45 109 41 114 61 117 74 134 100 134 117 134 143 132 173 136 191 152 239 168 270 189)
                yourself()
            )
))
        (super:init())
        (falls:init())
        (leftTree:init())
        (littleTree:init())
        (lowerCave:init())
        (upperCave:init())
        (theExit:init())
        (waterFall:
            init()
            cycleSpeed(7)
            setCycle(Fwd)
        )
    )

)
(instance enterFr750 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:
                    x(266)
                    y(185)
                    code(outCheck)
                    init()
                )
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance enterFr780 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    x(124)
                    y(25)
                    init()
                    setMotion(PolyPath 130 25 self)
                )
            )
            (case 1
                (send gOwner:code(outCheck))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance enterFr770 of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:
                    x(179)
                    y(97)
                    init()
                    setPri(8)
                    setMotion(MoveTo 181 98 self)
                )
            )
            (case 1
                (send gOwner:code(outCheck))
                proc0_3()
                (self:dispose())
            )
        )
    )

)
(instance waterFall of Prop
    (properties
        x 87
        y 100
        view 760
        priority 9
        signal $4010
    )
)
(instance falls of Feature
    (properties
        x 107
        y 64
        noun 7
        nsTop 31
        nsLeft 100
        nsBottom 97
        nsRight 114
        sightAngle 180
    )
)
(instance leftTree of Feature
    (properties
        x 21
        y 74
        noun 2
        nsTop 37
        nsLeft 2
        nsBottom 111
        nsRight 40
        sightAngle 180
    )
)
(instance littleTree of Feature
    (properties
        x 151
        y 109
        noun 3
        nsTop 91
        nsLeft 138
        nsBottom 128
        nsRight 165
        sightAngle 180
    )
)
(instance lowerCave of Feature
    (properties
        x 186
        y 87
        noun 4
        nsTop 76
        nsLeft 170
        nsBottom 98
        nsRight 203
        sightAngle 180
    )
)
(instance upperCave of Feature
    (properties
        x 123
        y 17
        noun 5
        nsTop 2
        nsLeft 111
        nsBottom 32
        nsRight 135
        sightAngle 180
    )
)
(instance theExit of Feature
    (properties
        x 283
        y 177
        noun 6
        nsTop 166
        nsLeft 259
        nsBottom 189
        nsRight 308
        sightAngle 180
    )
)
(instance outCheck of Code
    (properties)

    (method (doit)
        (var temp0)
        (if (GameIsRestarting())
            (send gLongSong:
                number(750)
                setLoop(-1)
                play(127)
            )
            (send gLongSong2:
                number(391)
                setLoop(-1)
                play(90)
            )
        )
        = temp0 (send gOwner:onControl(1))
        (if (== temp0 4)
            (send global2:newRoom(750))
        )(else
            (if (== temp0 8)
                (send global2:newRoom(780))
            )(else
                (if (== temp0 16)
                    (send global2:newRoom(770))
                )(else
                    (if ((== temp0 64) and not (& (send gOwner:signal) $0010))
                        (send gOwner:setPri(7))
                    )(else
                        (if (== temp0 32)
                            (send gOwner:setPri(-1))
                        )(else
                            (if ((== temp0 32) and not (== (send gOwner:priority) 8))
                                (send gOwner:setPri(8))
                            )
                        )
                    )
                )
            )
        )
    )

)
