(version 2)
(include "sci.sh")
(exports
    0 rm205
)
(use "Main")
(use "FPRoom")
(use "ROsc")
(use "n958")
(use "Cycle")
(use "View")
(use "Obj")
(script 205)


(local
    local0

)
(instance public rm205 of FPRoom
    (properties
        picture 205
    )

    (method (init)
        proc958_0(132 2204 2938 2208 2209 2207 2205)
        proc958_0(128 208 207)
        (super:init())
        (fallSound:
            number(2207)
            loop(1)
            play()
        )
        (send gGame:handsOff())
        ++global119
        (send gEgo:put(40))
        (send gEgo:get(-1 18))
        (freddy:addToPic())
        (snails:
            init()
            setScript(sSnails)
        )
        (people:
            init()
            setCycle(Fwd)
            setScript(sRandomHiccup)
        )
        (vulture:
            init()
            stopUpd()
            setScript(sGiggle)
        )
    )


    (method (dispose)
        (send gGameMusic1:fade(0 30 12 1))
        (super:dispose())
    )

)
(instance sRandomHiccup of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = ticks Random(240 480)
            )
            (case 1
                (hiccupSound:
                    number(Random(2208 2209))
                    play()
                )
                (self:changeState(0))
            )
        )
    )

)
(instance sSnails of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = seconds 2
            )
            (case 1
                (send gGameMusic1:
                    number(206)
                    flags(1)
                    loop(-1)
                    play()
                )
                = cycles 1
            )
            (case 2
                (send client:setCycle(End self))
            )
            (case 3
                (send ((faller:new())):
                    init()
                    setScript((sMarch:new()))
                )
                (send client:cel(0))
                (self:changeState(2))
            )
        )
    )

)
(instance sGiggle of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                proc0_9(200)
                = seconds 30
            )
            (case 1
                (send client:setCycle(End self))
            )
            (case 2
                (giggleSound:play())
                = local0 1
                (people:setScript(0))
                (send client:setCycle(ROsc 8 1 3 self))
            )
            (case 3
                = ticks 30
            )
            (case 4
                (giggleSound:stop())
                (send global2:newRoom(200))
            )
        )
    )

)
(instance sMarch of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if ((== Random(1 10) 5) and not local0)
                    (fallSound:
                        number(2205)
                        play()
                    )
                )
                (send client:
                    cycleSpeed(6)
                    ignoreActors()
                    setCycle(Fwd)
                    setLoop(3)
                    setMotion(MoveTo 70 60 self)
                )
            )
            (case 1
                (send client:
                    setLoop(4)
                    cel(0)
                    setCycle(End self)
                )
            )
            (case 2
                (send client:
                    cycleSpeed(30)
                    setCycle(Fwd)
                    setLoop(1)
                    cel(0)
                    setMotion(MoveTo 88 60 self)
                )
            )
            (case 3
                (if ((== Random(1 10) 5) and not local0)
                    (fallSound:
                        number(2205)
                        play()
                    )
                )
                (send client:
                    cycleSpeed(6)
                    setCycle(Fwd)
                    setLoop(3)
                    cel(0)
                    setMotion(MoveTo 93 90 self)
                )
            )
            (case 4
                (send client:
                    setLoop(4)
                    cel(0)
                    setCycle(End self)
                )
            )
            (case 5
                (send client:
                    cycleSpeed(30)
                    setCycle(Fwd)
                    setLoop(1)
                    cel(0)
                    setMotion(MoveTo 106 90 self)
                )
            )
            (case 6
                (if ((== Random(1 10) 5) and not local0)
                    (fallSound:
                        number(2205)
                        play()
                    )
                )
                (send client:
                    cycleSpeed(6)
                    setCycle(Fwd)
                    setLoop(3)
                    cel(0)
                    setMotion(MoveTo 111 124 self)
                )
            )
            (case 7
                (send client:
                    setLoop(4)
                    cel(0)
                    setCycle(End self)
                )
            )
            (case 8
                (send client:
                    cycleSpeed(30)
                    setCycle(Fwd)
                    ignoreActors()
                    setLoop(1)
                    cel(0)
                    setMotion(MoveTo 149 124 self)
                )
            )
            (case 9
                (send client:
                    setCycle(Fwd)
                    setLoop(2)
                    cel(0)
                    setMotion(MoveTo 107 124 self)
                )
            )
            (case 10
                (if ((== Random(1 10) 5) and not local0)
                    (fallSound:
                        number(2205)
                        play()
                    )
                )
                (send client:
                    cycleSpeed(6)
                    setLoop(5)
                    cel(0)
                    posn(82 144)
                    setCycle(End self)
                )
            )
            (case 11
                (if (not local0)
                    (splashSound:play())
                )
                (send client:dispose())
                (self:dispose())
            )
        )
    )

)
(instance faller of Actor
    (properties
        x 65
        y 40
        yStep 8
        view 207
        loop 3
        cel 1
        xStep 2
    )
)
(instance snails of Prop
    (properties
        y 40
        view 207
        cycleSpeed 30
    )
)
(instance people of Prop
    (properties
        x 238
        y 32
        view 208
        cel 1
        cycleSpeed 10
    )
)
(instance vulture of Prop
    (properties
        x 216
        y 89
        view 208
        loop 1
    )
)
(instance freddy of View
    (properties
        x 44
        y 35
        view 208
        loop 2
    )
)
(instance fallSound of FPSound
    (properties
        flags $0001
        number 2205
    )
)
(instance hiccupSound of FPSound
    (properties
        flags $0001
        number 2208
    )
)
(instance splashSound of FPSound
    (properties
        flags $0001
        number 2938
    )
)
(instance giggleSound of FPSound
    (properties
        flags $0001
        number 2204
        loop -1
    )
)
