local result

function onTalk()
	makeUnskippable()
    disableRetry()
    disableMovement()
    player.ForceCameraUpdate = true
    walkTo(12722, false, 1.0, false)
	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"), "Right")
	
repeat
	if not getFlag("solex_overseerA") then
		say("SJ2021_SOLOIINI_OVERSEER_INTRO")
		setFlag("solex_overseerA")
		setFlag("solex_overseerA2")
		
	elseif getFlag("solex_overseerA2") then
		result = choice("SJ2021_SOLOIINI_OVERSEER00_ASK", "SJ2021_SOLOIINI_OVERSEER_EXIT")
		if result == 1 then
			say("SJ2021_SOLOIINI_OVERSEER00_SAY")
			setFlag("solex_overseerB")
			setFlag("solex_overseerA2", false)
		elseif result == 2 then
			result = 9
		end
	
	elseif getFlag("solex_overseerB") then
		result = choice("SJ2021_SOLOIINI_OVERSEER02_ASK", "SJ2021_SOLOIINI_OVERSEER01_ASK", "SJ2021_SOLOIINI_OVERSEER05_ASK", "SJ2021_SOLOIINI_OVERSEER_EXITB")
		if result == 1 then
			say("SJ2021_SOLOIINI_OVERSEER02_SAY")
			setFlag("solex_overseerC")
			setFlag("solex_overseerB", false)
		elseif result == 2 then
			say("SJ2021_SOLOIINI_OVERSEER01_SAY")
		elseif result == 3 then
			say("SJ2021_SOLOIINI_OVERSEER05_SAY")
		else
			result = 9
		end
	
	elseif getFlag("solex_overseerC") then
		result = choice("SJ2021_SOLOIINI_OVERSEER03_ASK", "SJ2021_SOLOIINI_OVERSEER01_ASK", "SJ2021_SOLOIINI_OVERSEER05_ASK", "SJ2021_SOLOIINI_OVERSEER_EXITB")
		if result == 1 then
			say("SJ2021_SOLOIINI_OVERSEER03_SAY")
			setFlag("solex_overseerD")
			setFlag("solex_overseerC", false)
		elseif result == 2 then
			say("SJ2021_SOLOIINI_OVERSEER01_SAY")
		elseif result == 3 then
			say("SJ2021_SOLOIINI_OVERSEER05_SAY")
		else
			result = 9
		end

	elseif getFlag("solex_overseerD") then
		if not getFlag("solex_fishberries") then
			result = choice("SJ2021_SOLOIINI_OVERSEER03_ASK", "SJ2021_SOLOIINI_OVERSEER01_ASK", "SJ2021_SOLOIINI_OVERSEER05_ASK", "SJ2021_SOLOIINI_OVERSEER_EXITB")
			if result == 1 then
				say("SJ2021_SOLOIINI_OVERSEER03_SAY")
			elseif result == 2 then
				say("SJ2021_SOLOIINI_OVERSEER01_SAY")
			elseif result == 3 then
				say("SJ2021_SOLOIINI_OVERSEER05_SAY")
			else
				result = 9
			end
		else
			result = choice("SJ2021_SOLOIINI_OVERSEER04_ASK", "SJ2021_SOLOIINI_OVERSEER01_ASK", "SJ2021_SOLOIINI_OVERSEER05_ASK", "SJ2021_SOLOIINI_OVERSEER_EXITB")
			if result == 1 then
				say("SJ2021_SOLOIINI_OVERSEER04_SAY")
			elseif result == 2 then
				say("SJ2021_SOLOIINI_OVERSEER01_SAY")
			elseif result == 3 then
				say("SJ2021_SOLOIINI_OVERSEER05_SAY")
			else
				result = 9
			end
		end
	end
	until result == 9
	end
	
function onEnd()
    player.ForceCameraUpdate = false
	celeste.Audio.SetMusicParam("kick", 1.0)
	celeste.Audio.SetMusicParam("dialog", 0.0)
    enableRetry()
    enableMovement()
end