(version 2)
(include "sci.sh")
(exports
    0 rm150
)
(use "Main")
(use "PanoRoom")
(use "PolyPath")
(use "Polygon")
(use "CueObj")
(use "Rev")
(use "Cycle")
(use "View")
(use "Obj")
(script 150)


(local
    local0

)
(instance public rm150 of PanoRoom
    (properties
        noun 7
        picture 150
    )

    (method (init param1)
        (if (== gGClientModNum 330)
            (fire:
                init()
                hide()
            )
            proc0_4(88)
            (send gLongSong:
                number(285)
                setLoop(-1)
                play(127)
            )
        )(else
            (send gLongSong:
                number(150)
                setLoop(-1)
                play(127)
            )
        )
        (if (proc0_6(85) or (== gGClientModNum 160))
            = east 160
        )
        proc0_2()
        (self:
            setRegions(50)
            addObstacle((send ((Polygon:new())):
                    type(2)
                    init(319 189 0 189 0 0 319 0 319 54 139 49 79 59 65 74 125 69 156 78 99 86 121 95 116 113 129 134 170 141 238 173 319 173)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(284 118 284 126 255 126 244 126 244 118)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(262 75 264 85 204 85 194 75 238 69)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(184 52 225 56 225 61 184 61)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(142 101 169 101 226 115 206 122 220 128 187 138 170 128 189 120 169 112 128 106)
                    yourself()
                )
 (send ((Polygon:new())):
                    type(2)
                    init(141 119 159 118 159 126 141 126)
                    yourself()
                )
)
            setScript(
                (switch (gGClientModNum)
                    (case 400
                        (send gOwner:posn(gGOwnerX gGOwnerY))
                        fromSavanna
                    )
                    (case 380
                        fromVines
                    )
                    (case east
                        = style 11
                        fromSimbaniPanorama
                    )
                    (default 
                        fromTarna
                    )
                )
)
        )
        ({river#1}:
            init()
            setCycle(Rev)
        )
        ({river#2}:
            init()
            setCycle(Rev)
        )
        ({river#3}:
            init()
            setCycle(Rev)
        )
        ({river#4}:
            init()
            setCycle(Rev)
        )
        (tarna:init())
        (rockPile:init())
        (smallRockPile:init())
        (mountains:init())
        (if (proc0_6(99) and (== gGClientModNum_2 gClientModNum))
            (honeyTree:
                x(gGOwnerX_3)
                y(gGOwnerY_3)
                init()
                stopUpd()
            )
        )
        (super:init(rest param1))
        (if (not proc0_6(208))
            (send gGame:save(1))
        )
        (send gOwner:solvePuzzle(208 3))
    )


    (method (doit param1)
        (super:doit(rest param1))
        (if (& (send gOwner:onControl()) $0010)
            (send gOwner:setMotion(0))
            (send global2:newRoom(200))
        )(else
            (if ((send gOwner:inRect(244 118 292 128)))
                (send gOwner:setMotion(0))
                (self:newRoom(380))
            )
        )
    )


    (method (dispose)
        DisposeScript(35)
        (super:dispose())
    )


    (method (cue)
        (if (& (send gOwner:onControl()) $0010)
            (send gOwner:setMotion(0))
            (self:newRoom(200))
        )(else
            (if ((send gOwner:inRect(244 118 292 128)))
                (self:newRoom(380))
            )(else
                (if ((> (send gOwner:x) 315) and (== gGClientModNum 330))
                    (self:setScript(toSimbani))
                )(else
                    (if ((proc0_6(99) and (== gGClientModNum_2 gClientModNum)) and (send gOwner:inRect(gGOwnerX_3 (- gGOwnerY_3 20) (+ gGOwnerX_3 20) gGOwnerY_3)))
                        proc0_4(143)
                        = global365 2
                        (self:newRoom(400))
                    )(else
                        (if (& (send gOwner:onControl()) $0400)
                            proc0_4(143)
                            = global365 999
                            (self:newRoom(400))
                        )(else
                            (self:newRoom(0))
                        )
                    )
                )
            )
        )
    )

)
(instance noEnterTarna of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gQg3Messager:say(3 6 10 0 self))
            )
            (case 1
                (if (> (send gOwner:y) (send gOwner:yLast))
                    (send gOwner:setMotion(PolyPath (+ (send gOwner:x) 5) (- (send gOwner:y) 5) self))
                )(else
                    (send gOwner:setMotion(PolyPath (+ (send gOwner:x) 5) (+ (send gOwner:y) 5) self))
                )
            )
            (case 2
                proc0_3(6 3)
                (self:dispose())
            )
        )
    )

)
(instance toSimbani of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_2()
                (send gOwner:setMotion(PolyPath 319 (send gOwner:y) self))
            )
            (case 1
                (send global2:newRoom(160))
            )
        )
    )

)
(instance mustLeave of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:code(0))
                (send gQg3Messager:say(3 6 1 0 self))
            )
            (case 1
                (send global2:newRoom(310))
            )
        )
    )

)
(instance fromTarna of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if (proc0_6(88))
                    (send gOwner:view(153))
                )
                (send gOwner:
                    posn(117 87)
                    setMotion(PolyPath 131 91 self)
                )
            )
            (case 1
                (if (proc0_6(88))
                    (send global2:setScript(rakeeshWalk))
                )(else
                    (self:cue())
                )
            )
            (case 2
                proc0_3(6 3)
                (self:dispose())
            )
        )
    )

)
(instance rakeeshWalk of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_5(6)
                (send gOwner:setMotion(PolyPath 150 95 self))
            )
            (case 1
                (send gQg3Messager:say(2 6 9 0 self))
            )
            (case 2
                proc0_5(6)
                (send gOwner:setMotion(PolyPath 170 91 self))
            )
            (case 3
                (send gQg3Messager:say(2 6 3 0 self))
            )
            (case 4
                proc0_5(6)
                (send gOwner:setMotion(PolyPath 205 95 self))
            )
            (case 5
                (send gQg3Messager:say(2 6 4 0 self))
            )
            (case 6
                proc0_5(6)
                (send gOwner:setMotion(PolyPath 240 93 self))
            )
            (case 7
                (send gQg3Messager:say(2 6 5 0 self))
            )
            (case 8
                proc0_5(6)
                (send gOwner:setMotion(PolyPath 265 95 self))
            )
            (case 9
                (send gQg3Messager:say(2 6 6 0 self))
            )
            (case 10
                proc0_5(6)
                (send gOwner:setMotion(PolyPath 286 94 self))
            )
            (case 11
                (send gOwner:setMotion(PolyPath 290 94 self))
            )
            (case 12
                (send gOwner:setMotion(PolyPath 319 91 self))
            )
            (case 13
                (send global2:newRoom(160))
            )
        )
    )

)
(instance fromVines of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:
                    posn(262 129)
                    setMotion(PolyPath 258 140 self)
                )
            )
            (case 1
                proc0_3(6 3)
                (self:dispose())
            )
        )
    )

)
(instance fromSimbaniPanorama of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_3(6 3)
                (send gOwner:
                    x(318)
                    setMotion(MoveTo 314 (send gOwner:y))
                )
                (self:dispose())
            )
        )
    )

)
(instance fromSavanna of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gOwner:setMotion(0))
                = cycles 10
            )
            (case 1
                proc0_3(6 3)
                (self:dispose())
            )
        )
    )

)
(instance fire of Prop
    (properties
        x 295
        y 94
        view 150
    )
)
(instance honeyTree of Prop
    (properties
        view 150
        loop 1
        cel 2
        signal $4000
    )
)
(instance tarna of Feature
    (properties
        x 114
        y 75
        noun 1
        onMeCheck $0010
    )
)
(instance rockPile of Feature
    (properties
        x 230
        y 76
        noun 4
        nsTop 67
        nsLeft 201
        nsBottom 85
        nsRight 260
    )
)
(instance smallRockPile of Feature
    (properties
        x 264
        y 121
        noun 5
        nsTop 116
        nsLeft 245
        nsBottom 127
        nsRight 283
    )
)
(instance mountains of Feature
    (properties
        x 218
        y 16
        noun 6
        nsTop 6
        nsLeft 118
        nsBottom 26
        nsRight 319
    )
)
(instance {river#1} of Prop
    (properties
        x 190
        y 189
        noun 8
        view 150
        loop 3
        cel 2
        priority 15
        signal $0010
        cycleSpeed 7
    )
)
(instance {river#2} of Prop
    (properties
        x 165
        y 167
        noun 9
        view 150
        loop 4
        cel 3
        priority 15
        signal $0010
        cycleSpeed 7
    )
)
(instance {river#3} of Prop
    (properties
        x 94
        y 114
        noun 10
        view 150
        loop 5
        cel 3
        priority 15
        signal $0010
        cycleSpeed 10
    )
)
(instance {river#4} of Prop
    (properties
        x 49
        y 75
        noun 11
        view 150
        loop 6
        cel 2
        priority 15
        signal $0010
        cycleSpeed 11
    )
)
