local result
local exitresult

function onTalk()
	makeUnskippable()
    disableRetry()
    disableMovement()
    player.ForceCameraUpdate = true
	celeste.Audio.SetMusicParam("dialog", 1.0)
	celeste.Audio.SetMusicParam("kick", 0.0)
    local luanet = _G.luanet    
    player.Facing = luanet.enum(luanet.import_type("Celeste.Facings"), "Left")
	
repeat
    exitresult = 0
    if not getFlag("TNT-Nova-helpintro") then
        say("TNT_Nova_helpintro")
        setFlag("TNT-Nova-helpintro")
    else
        say("TNT_Nova_helpanyway")
    end
    if getFlag("TNT-Nova-help7") then
		result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow", "TNT_Nova_helpqfingerscrambler", "TNT_Nova_helpqdownsmuggle", "TNT_Nova_helpqtheoladder", "TNT_Nova_helpqhowlong", "TNT_Nova_helpqmalfunction", "TNT_Nova_helpqspikefall", "TNT_Nova_helpqoverwhelmed")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
        elseif result == 5 then
            say("TNT_Nova_helpafingerscrambler")
        elseif result == 6 then
            say("TNT_Nova_helpadownsmuggle")
        elseif result == 7 then
            say("TNT_Nova_helpatheoladder")
        elseif result == 8 then
            say("TNT_Nova_helpahowlong")
        elseif result == 9 then
            say("TNT_Nova_helpamalfunction")
        elseif result == 10 then
            say("TNT_Nova_helpaspikefall")
        elseif result == 11 then
            say("TNT_Nova_helpaoverwhelmed")
		end
    elseif getFlag("TNT-Nova-help6") then
		result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow", "TNT_Nova_helpqfingerscrambler", "TNT_Nova_helpqdownsmuggle", "TNT_Nova_helpqtheoladder", "TNT_Nova_helpqhowlong", "TNT_Nova_helpqmalfunction", "TNT_Nova_helpqspikefall")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
        elseif result == 5 then
            say("TNT_Nova_helpafingerscrambler")
        elseif result == 6 then
            say("TNT_Nova_helpadownsmuggle")
        elseif result == 7 then
            say("TNT_Nova_helpatheoladder")
        elseif result == 8 then
            say("TNT_Nova_helpahowlong")
        elseif result == 9 then
            say("TNT_Nova_helpamalfunction")
        elseif result == 10 then
            say("TNT_Nova_helpaspikefall")
		end
    elseif getFlag("TNT-Nova-help5") then
		result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow", "TNT_Nova_helpqfingerscrambler", "TNT_Nova_helpqdownsmuggle", "TNT_Nova_helpqtheoladder", "TNT_Nova_helpqhowlong", "TNT_Nova_helpqmalfunction")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
        elseif result == 5 then
            say("TNT_Nova_helpafingerscrambler")
        elseif result == 6 then
            say("TNT_Nova_helpadownsmuggle")
        elseif result == 7 then
            say("TNT_Nova_helpatheoladder")
        elseif result == 8 then
            say("TNT_Nova_helpahowlong")
        elseif result == 9 then
            say("TNT_Nova_helpamalfunction")
		end
    elseif getFlag("TNT-Nova-help4") then
		result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow", "TNT_Nova_helpqfingerscrambler", "TNT_Nova_helpqdownsmuggle", "TNT_Nova_helpqtheoladder", "TNT_Nova_helpqhowlong")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
        elseif result == 5 then
            say("TNT_Nova_helpafingerscrambler")
        elseif result == 6 then
            say("TNT_Nova_helpadownsmuggle")
        elseif result == 7 then
            say("TNT_Nova_helpatheoladder")
        elseif result == 8 then
            say("TNT_Nova_helpahowlong")
		end
    elseif getFlag("TNT-Nova-help3") then
		result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow", "TNT_Nova_helpqfingerscrambler", "TNT_Nova_helpqdownsmuggle", "TNT_Nova_helpqtheoladder")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
        elseif result == 5 then
            say("TNT_Nova_helpafingerscrambler")
        elseif result == 6 then
            say("TNT_Nova_helpadownsmuggle")
        elseif result == 7 then
            say("TNT_Nova_helpatheoladder")
		end
    elseif getFlag("TNT-Nova-help2") then
		result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow", "TNT_Nova_helpqfingerscrambler", "TNT_Nova_helpqdownsmuggle")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
        elseif result == 5 then
            say("TNT_Nova_helpafingerscrambler")
        elseif result == 6 then
            say("TNT_Nova_helpadownsmuggle")
		end
	elseif getFlag("TNT-Nova-help1") then
		result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow", "TNT_Nova_helpqfingerscrambler")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
        elseif result == 5 then
            say("TNT_Nova_helpafingerscrambler")
		end
    else
        result = choice("TNT_Nova_helpqexit", "TNT_Nova_helpqwhat", "TNT_Nova_helpqmusic", "TNT_Nova_helpqhow")
		if result == 1 then
			say("TNT_Nova_helpaexit")
			exitresult = 1
		elseif result == 2 then
            say("TNT_Nova_helpawhat")
        elseif result == 3 then
            say("TNT_Nova_helpamusic")
        elseif result == 4 then
            say("TNT_Nova_helpahow")
		end
	end
until exitresult == 1
end
	
function onEnd()
    setFlag("TNT-Nova-helpintro", false)
    player.ForceCameraUpdate = false
	celeste.Audio.SetMusicParam("kick", 1.0)
	celeste.Audio.SetMusicParam("dialog", 0.0)
    enableRetry()
    enableMovement()
end