(version 2)
(include "sci.sh")
(exports
    0 rm210
)
(use "Main")
(use "OccasionalCycle")
(use "FPRoom")
(use "Scaler")
(use "RandCycle")
(use "Polygon")
(use "CueObj")
(use "n958")
(use "DPath")
(use "Cycle")
(use "View")
(use "Obj")
(script 210)


(local
    local0 =     1

)
(instance public rm210 of FPRoom
    (properties
        noun 6
        picture 210
        east 220
        west 200
    )

    (method (init)
        proc958_0(128 211 212)
        (switch (gGNumber)
            (case west
                = style 12
                (send gGame:handsOn())
            )
            (case east
                = east 0
                = style 11
                (send gGame:handsOn())
            )
            (case 680
                (send gGame:handsOn())
            )
            (default 
                = style 100
                (send gEgo:
                    x(281)
                    y(121)
                )
                (send gGame:handsOn())
            )
        )
        (send gEgo:
            init()
            setScale(Scaler 100 50 175 95)
            normalize()
        )
        (super:init())
        (send gGameMusic2:
            number(2210)
            loop(-1)
            play()
        )
        (if (< global119 24)
            (if (< global119 18)
                Load(rsSOUND 2114)
                (animal1:loop(0))
                (animal2:loop(1))
            )(else
                (if (< global119 22)
                    Load(rsSOUND 2120)
                    (animal1:loop(2))
                    (animal2:loop(3))
                )(else
                    (if (< global119 24)
                        Load(rsSOUND 2114)
                        (animal1:loop(4))
                        (animal2:loop(5))
                    )
                )
            )
            (animal1:
                setCycle(OccasionalCycle 1 30 120 2 6)
                init()
            )
            (animal2:
                setCycle(OccasionalCycle 1 30 120 2 6)
                init()
            )
        )
        (send global2:addObstacle((send ((Polygon:new())):
                type(2)
                init(0 81 319 143 319 189 0 189)
                yourself()
            )
 (send ((Polygon:new())):
                type(2)
                init(0 0 319 0 319 110 275 113 0 67)
                yourself()
            )
))
        (tracks:
            init()
            approachVerbs(1 4)
            setOnMeCheck(1 16)
        )
        (bridge:
            init()
            approachVerbs(1 4)
            setOnMeCheck(1 4)
        )
        (rapids:
            init()
            setOnMeCheck(1 2)
        )
        (corral:
            init()
            setOnMeCheck(1 32)
        )
        (river:
            setCycle(Fwd)
            init()
        )
        (cliff:
            init()
            setOnMeCheck(1 8)
        )
        (board:
            init()
            stopUpd()
            ignoreActors()
        )
        (if (not proc0_2(1) and (== Random(2 10) 4))
            (smallChild:
                setLoop(Random(0 1))
                setCycle(RandCycle)
                init()
            )
        )
        (if (proc0_2(52))
            (dummyCredits:
                init()
                setScript(ScriptID(32 0))
            )
        )
    )


    (method (doit)
        (super:doit())
        (if (script)
        )(else
            (if ((send gEgo:inRect(103 90 155 119)) and local0)
                (board:setScript(sBoardFall))
            )(else
                (if (== (send gEgo:edgeHit) 2)
                    (send global2:setScript(sExitEast))
                )
            )
        )
    )


    (method (dispose)
        DisposeScript(32)
        (super:dispose())
    )


    (method (newRoom newRoomNumber)
        (send gGameMusic2:fade())
        (send gFpMessager:caller(0))
        (send gNarrator:dispose(0))
        (super:newRoom(rest newRoomNumber))
    )

)
(instance sExitEast of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gGame:handsOff())
                (send gEgo:setMotion(MoveTo (+ (send gEgo:x) 20) (send gEgo:y) self))
            )
            (case 1
                (send global2:newRoom(220))
            )
        )
    )

)
(instance sBoardFall of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (send gIconBar:disable())
                Load(rsSOUND 2938)
                (send gNarrator:modeless(1))
                = local0 0
                (board:
                    setCycle(Fwd)
                    setMotion(MoveTo 120 140 self)
                )
            )
            (case 1
                (board:
                    setPri(9)
                    setMotion(MoveTo 130 185 self)
                )
            )
            (case 2
                (splashSound:play())
                (board:
                    setLoop(1)
                    setCel(0)
                    setCycle(End self)
                )
            )
            (case 3
                (board:
                    setLoop(2)
                    setMotion(DPath 152 166 210 136)
                )
                (send gFpMessager:say(2 3 3 0 self))
            )
            (case 4
                (if (== global119 14)
                    (send gGameMusic1:play())
                )
                = cycles 1
            )
            (case 5
                (send gNarrator:modeless(0))
                UnLoad(132 2938)
                (board:dispose())
                (send gIconBar:enable())
                (self:dispose())
            )
        )
    )

)
(instance smallChild of Prop
    (properties
        x 295
        y 106
        noun 8
        view 107
        detailLevel 2
    )
)
(instance animal1 of Prop
    (properties
        x 281
        y 101
        z 62
        noun 9
        view 213
        detailLevel 2
    )

    (method (doit)
        (super:doit())
        (if ((== cel 1) and (== (heepSound:prevSignal) -1))
            (switch (loop)
                (case 0
                    (heepSound:number(2114))
                )
                (case 2
                    (heepSound:number(2120))
                )
            )
            (heepSound:play())
        )
    )


    (method (doVerb theVerb param2)
        (if (proc999_5(theVerb 4 1 2))
            (switch ((animal1:loop))
                (case 0
                    (send gFpMessager:say(noun theVerb 13))
                )
                (case 2
                    (send gFpMessager:say(noun theVerb 4))
                )
                (case 4
                    (send gFpMessager:say(noun theVerb 15))
                )
            )
        )(else
            (super:doVerb(theVerb rest param2))
        )
    )

)
(instance animal2 of Prop
    (properties
        x 300
        y 101
        z 44
        noun 10
        view 213
        detailLevel 2
    )

    (method (doVerb theVerb param2)
        (if (proc999_5(theVerb 4 1 2))
            (switch ((animal2:loop))
                (case 1
                    (send gFpMessager:say(noun theVerb 13))
                )
                (case 3
                    (send gFpMessager:say(noun theVerb 4))
                )
                (case 5
                    (send gFpMessager:say(noun theVerb 15))
                )
            )
        )(else
            (super:doVerb(theVerb rest param2))
        )
    )

)
(instance river of Prop
    (properties
        x 132
        y 171
        noun 4
        view 211
        cel 2
        priority 1
        signal $4010
        cycleSpeed 20
        detailLevel 2
    )
)
(instance board of Actor
    (properties
        x 110
        y 103
        yStep 10
        view 212
        priority 4
        signal $4010
        scaleSignal $0005
    )

    (method (init param1)
        (self:setScale(Scaler 36 100 189 100))
        (super:init(rest param1))
    )

)
(instance dummyCredits of Prop
    (properties
        x -10
        y -10
        view 996
    )
)
(instance tracks of Feature
    (properties
        x 212
        y 174
        noun 1
        sightAngle 40
        approachX 212
        approachY 174
    )

    (method (doVerb theVerb)
        (switch (theVerb)
            (case 4
                (send gFpMessager:say(1 4 11))
            )
            (default 
                (super:doVerb(theVerb))
            )
        )
    )

)
(instance bridge of Feature
    (properties
        x 136
        y 89
        noun 2
        sightAngle 40
        approachX 136
        approachY 89
    )
)
(instance rapids of Feature
    (properties
        x 136
        y 160
        noun 4
        sightAngle 40
    )
)
(instance cliff of Feature
    (properties
        x 136
        y 160
        noun 5
        sightAngle 40
    )
)
(instance corral of Feature
    (properties
        x 160
        y 100
        noun 3
        sightAngle 40
    )

    (method (doVerb theVerb param2)
        (if (proc999_5(theVerb 4 1 2))
            (if (< global119 18)
                (send gFpMessager:say(noun theVerb 8))
            )(else
                (if (< global119 22)
                    (send gFpMessager:say(noun theVerb 9))
                )(else
                    (if (< global119 24)
                        (send gFpMessager:say(noun theVerb 7))
                    )(else
                        (send gFpMessager:say(noun theVerb 12))
                    )
                )
            )
        )(else
            (super:doVerb(theVerb rest param2))
        )
    )

)
(instance heepSound of FPSound
    (properties
        flags $0001
        number 2114
    )
)
(instance splashSound of FPSound
    (properties
        flags $0001
        number 2938
    )
)
