(version 2)
(include "sci.sh")
(exports
    0 closeCredits
)
(use "Main")
(use "Class_255_0")
(use "n958")
(use "DCIcon")
(use "Gauge")
(use "Cycle")
(use "Game")
(use "MenuBar")
(use "PicView")
(use "Obj")
(script 85)


(local
    local0
    theGNewSpeed
    local2

)
(procedure (localproc_000c)
    = local2 
        (switch ((send (ScriptID(0 23)):number))
            (case 101
                1
            )
            (case 102
                2
            )
            (case 103
                3
            )
        )
)


(instance public closeCredits of Rm
    (properties
        picture 900
        style $0000
    )

    (method (init)
        proc958_0(128 907 908 909 910 911 912)
        proc0_10(40)
        (super:init())
        SetMenu(773 112 0)
        = theGNewSpeed gNewSpeed
        = local0 
            (if (proc0_24())
                1
            )(else
                (if (proc0_24(1))
                    3
                )(else
                    (if (proc0_24(0))
                        6
                    )
                )
            )
        proc0_2()
        (SL:
            disable()
            state(0)
        )
        (MenuBar:
            hide()
            state(1)
        )
        SetCursor(gCursorNumber 0)
        localproc_000c()
        (self:setScript(closingCredits))
    )

)
(instance closingCredits of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                = gNewSpeed 0
                (if (not script)
                    (self:setScript(endSongScript))
                )
                (animators:
                    posn(156 48)
                    yStep(local0)
                    setMotion(MoveTo 156 65)
                    init()
                )
                (JEFFCROWE:
                    posn(158 170)
                    yStep(local0)
                    setMotion(MoveTo 158 64)
                    init()
                )
                (CHERILOYD:
                    posn(157 182)
                    yStep(local0)
                    setMotion(MoveTo 157 64 self)
                    init()
                )
            )
            (case 1
                (JEFFCROWE:dispose())
                (CHERILOYD:dispose())
                (animators:setMotion(MoveTo 156 48 self))
            )
            (case 2
                (animators:dispose())
                (backgroundArtists:
                    posn(158 48)
                    yStep(local0)
                    setMotion(MoveTo 158 65)
                    init()
                )
                (CINDYWALKER:
                    posn(158 170)
                    yStep(local0)
                    setMotion(MoveTo 158 64)
                    init()
                )
                (JEFFCROWE2:
                    posn(157 182)
                    yStep(local0)
                    setMotion(MoveTo 157 64)
                    init()
                )
                (JENNIFER:
                    posn(156 194)
                    yStep(local0)
                    setMotion(MoveTo 156 64 self)
                    init()
                )
            )
            (case 3
                (JENNIFER:dispose())
                (JEFFCROWE2:dispose())
                (CINDYWALKER:dispose())
                (backgroundArtists:setMotion(MoveTo 158 48 self))
            )
            (case 4
                (backgroundArtists:dispose())
                (programmers:
                    posn(159 48)
                    yStep(local0)
                    setMotion(MoveTo 159 65)
                    init()
                )
                (GARYK:
                    posn(160 170)
                    yStep(local0)
                    setMotion(MoveTo 160 64)
                    init()
                )
                (RANDY:
                    posn(159 182)
                    yStep(local0)
                    setMotion(MoveTo 159 64)
                    init()
                )
                (MARKWILDEN:
                    posn(159 194)
                    yStep(local0)
                    setMotion(MoveTo 159 64 self)
                    init()
                )
            )
            (case 5
                (MARKWILDEN:dispose())
                (RANDY:dispose())
                (GARYK:dispose())
                (programmers:setMotion(MoveTo 159 48 self))
            )
            (case 6
                (programmers:dispose())
                (development:
                    posn(158 48)
                    yStep(local0)
                    setMotion(MoveTo 158 65)
                    init()
                )
                (SET1:
                    posn(156 194)
                    yStep(local0)
                    setMotion(MoveTo 156 64)
                    init()
                )
                (SET2:
                    posn(155 227)
                    yStep(local0)
                    setMotion(MoveTo 155 64)
                    init()
                )
                (SET3:
                    posn(156 260)
                    yStep(local0)
                    setMotion(MoveTo 156 64)
                    init()
                )
                (MARKHOOD:
                    posn(154 272)
                    yStep(local0)
                    setMotion(MoveTo 154 64)
                    init()
                )
                (ERICHART:
                    posn(156 284)
                    yStep(local0)
                    setMotion(MoveTo 156 64 self)
                    init()
                )
            )
            (case 7
                (ERICHART:dispose())
                (MARKHOOD:dispose())
                (SET3:dispose())
                (SET2:dispose())
                (SET1:dispose())
                (development:setMotion(MoveTo 158 48 self))
            )
            (case 8
                (development:dispose())
                (soundEffects:
                    posn(161 48)
                    yStep(local0)
                    setMotion(MoveTo 161 65)
                    init()
                )
                (KENALLEN2:
                    posn(160 170)
                    yStep(local0)
                    setMotion(MoveTo 160 64 self)
                    init()
                )
            )
            (case 9
                (KENALLEN2:dispose())
                (soundEffects:setMotion(MoveTo 161 48 self))
            )
            (case 10
                (soundEffects:dispose())
                (ELLEN:
                    posn(160 180)
                    yStep(local0)
                    setMotion(MoveTo 160 48 self)
                    init()
                )
            )
            (case 11
                (ELLEN:dispose())
                (self:changeState(0))
            )
        )
    )


    (method (handleEvent pEvent)
        (var temp0)
        (super:handleEvent(pEvent))
        (if (== (send pEvent:type) 4)
            (switch ((send pEvent:message))
                (case 15360
                    (if (GetMenu(1282 113))
                        DoSound(sndSET_SOUND 0)
                        SetMenu(1282 113 0 110 "Turn on")
                    )(else
                        DoSound(sndSET_SOUND 1)
                        SetMenu(1282 113 1 110 "Turn off")
                    )
                )
                (case 22
                    = temp0 (send ((Gauge:new())):
                            description("Use the mouse or right and left arrow keys to set the sound volume.")
                            text("Sound Volume")
                            minimum(0)
                            normal(12)
                            maximum(15)
                            higher("Louder")
                            lower("Softer")
                            doit(DoSound(sndVOLUME))
                        )
                    DoSound(sndVOLUME temp0)
                    DisposeScript(987)
                )
                (case 16640
                    SetCursor(gCursorNumber 1)
                    (send gGame:restore())
                )
                (case 17152
                    (if (proc255_0(85 0 80 "Restart" 33 0 82 movingIcon 81 "Restart" 1 81 "Oops" 0))
                        (send gGame:restart())
                    )
                )
                (case 17
                    = global4 proc255_0(85 1 80 "Quit" 33 0 82 movingIcon 81 "Quit" 1 81 "Oops" 0)
                )
                (default 
                    (send pEvent:claimed(1))
                )
            )
        )
    )

)
(instance endSongScript of Script
    (properties)

    (method (changeState newState)
        (switch (= state newState)
            (case 0
                (if (local2)
                    (self:changeState(local2))
                )(else
                    = cycles 1
                )
            )
            (case 1
                (if (== local2 1)
                    (if (== (send (ScriptID(0 23)):prevSignal) -1)
                        = local2 2
                        (send (ScriptID(0 23)):
                            number(102)
                            loop(1)
                            play(self)
                        )
                    )(else
                        = cycles 1
                    )
                )(else
                    = cycles 1
                )
            )
            (case 2
                (if (== local2 2)
                    (if (== (send (ScriptID(0 23)):prevSignal) -1)
                        = local2 1
                        (send (ScriptID(0 23)):
                            number(103)
                            loop(1)
                            play(self)
                        )
                    )(else
                        = cycles 1
                    )
                )(else
                    = cycles 1
                )
            )
            (case 3
                (self:changeState(local2))
            )
        )
    )

)
(instance animators of Actor
    (properties
        view 907
        signal $7800
    )
)
(instance JEFFCROWE of Actor
    (properties
        view 907
        loop 1
        priority 1
        signal $7810
    )
)
(instance CHERILOYD of Actor
    (properties
        view 907
        loop 2
        priority 1
        signal $7810
    )
)
(instance backgroundArtists of Actor
    (properties
        view 908
        signal $7800
    )
)
(instance CINDYWALKER of Actor
    (properties
        view 908
        loop 1
        priority 1
        signal $7810
    )
)
(instance JEFFCROWE2 of Actor
    (properties
        view 908
        loop 2
        priority 1
        signal $7810
    )
)
(instance JENNIFER of Actor
    (properties
        view 908
        loop 3
        priority 1
        signal $7810
    )
)
(instance programmers of Actor
    (properties
        view 909
        signal $7800
    )
)
(instance GARYK of Actor
    (properties
        view 909
        loop 1
        priority 1
        signal $7810
    )
)
(instance RANDY of Actor
    (properties
        view 909
        loop 2
        priority 1
        signal $7810
    )
)
(instance MARKWILDEN of Actor
    (properties
        view 909
        loop 3
        priority 1
        signal $7810
    )
)
(instance development of Actor
    (properties
        view 910
        signal $7800
    )
)
(instance SET1 of Actor
    (properties
        view 910
        loop 1
        priority 1
        signal $7810
    )
)
(instance SET2 of Actor
    (properties
        view 910
        loop 2
        priority 1
        signal $7810
    )
)
(instance SET3 of Actor
    (properties
        view 910
        loop 3
        priority 1
        signal $7810
    )
)
(instance MARKHOOD of Actor
    (properties
        view 910
        loop 4
        priority 1
        signal $7810
    )
)
(instance ERICHART of Actor
    (properties
        view 910
        loop 5
        priority 1
        signal $7810
    )
)
(instance soundEffects of Actor
    (properties
        view 911
        signal $7800
    )
)
(instance KENALLEN2 of Actor
    (properties
        view 911
        loop 1
        priority 1
        signal $7810
    )
)
(instance ELLEN of Actor
    (properties
        view 912
        signal $7800
    )
)
(instance movingIcon of DCIcon
    (properties
        view 699
        loop 2
    )

    (method (init)
        (super:init())
        (self:cycleSpeed(
            (if (> global101 2)
                10
            )(else
                6
            )
))
    )

)
