-- Code by Ja
-- It accepts a table containing information about all possible choices 
-- and their requirements.
function onBegin()
    disableMovement()
    say("VoiceContest_Museum_Winner_Intro")
    choiceDialog({
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_SpeechOption1",
            onChosen = function ()
                wait(0.5)
                say("VoiceContest_Museum_Winner_ChoiceThanks")
                closeChoiceDialog()
            end
        },
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_SpeechOption2",
            onChosen = function ()
                wait(0.5)
                say("VoiceContest_Museum_Winner_ChoiceShout")
                closeChoiceDialog()
            end
        },
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_SpeechOption3",
            onChosen = function ()
                wait(0.5)
                say("VoiceContest_Museum_Winner_ChoiceRude")
                closeChoiceDialog()
            end
        }
    })
    say("VoiceContest_Museum_Winner_AfterChoice")
    choiceDialog({
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_VoteOption1",
            onChosen = function ()
                jump(0.2)
                wait()
                waitUntilOnGround()
                say("VoiceContest_Museum_Winner_Granny")
                closeChoiceDialog()
            end
        },
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_VoteOption2",
            onChosen = function ()
                jump(0.2)
                wait()
                waitUntilOnGround()
                say("VoiceContest_Museum_Winner_Theo")
                closeChoiceDialog()
            end
        },
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_VoteOption3",
            onChosen = function ()
                jump(0.2)
                wait()
                waitUntilOnGround()
                say("VoiceContest_Museum_Winner_Badeline")
                closeChoiceDialog()
            end
        },
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_VoteOption4",
            onChosen = function ()
                jump(0.2)
                wait()
                waitUntilOnGround()
                say("VoiceContest_Museum_Winner_Bird")
                closeChoiceDialog()
            end
        },
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_VoteOption5",
            onChosen = function ()
                jump(0.2)
                wait()
                waitUntilOnGround()
                say("VoiceContest_Museum_Winner_Bumper")
                closeChoiceDialog()
            end
        },
        {
            -- This choice will not display a dialog, and instead run the code in 'onChosen'
            "VoiceContest_Museum_VoteOption6",
            onChosen = function ()
                jump(0.2)
                wait()
                waitUntilOnGround()
                say("VoiceContest_Museum_Winner_Everyone")
                closeChoiceDialog()
            end
        }
    })
    playSound("event:/game/07_summit/checkpoint_confetti")
    wait(0.5)
end

function onEnd()
  setFlag("EndTeleFlag", true)
  enableMovement()
end