local timeString = ""
local currentHour = -1
local currentMinute = -1
--local hourString = ""
--local minString = ""
local vector2 = require("#microsoft.xna.framework.vector2")
local coroutineEntity = monocle.Entity()

function onTalk()
    disableMovement()
    player.ForceCameraUpdate = true
	engine.Scene:add(coroutineEntity)
	coroutineEntity:add(monocle.Coroutine(getLevel():ZoomTo(vector2(200, 130), 1.75, 1.25)))
    walkTo(2493, false, 1.0, false)
    local luanet = _G.luanet
    player.Facing = luanet.enum(luanet.import_type("Celeste.Facings"), "Left")
	celeste.Audio.SetMusicParam("dialog", 1.0)
	--say("bhotel_find_clock")
	if getFlag("kosei_irlHour0") then currentHour = 0
	elseif getFlag("kosei_irlHour1") then currentHour = 1
	elseif getFlag("kosei_irlHour2") then currentHour = 2
	elseif getFlag("kosei_irlHour3") then currentHour = 3
	elseif getFlag("kosei_irlHour4") then currentHour = 4
	elseif getFlag("kosei_irlHour5") then currentHour = 5
	elseif getFlag("kosei_irlHour6") then currentHour = 6
	elseif getFlag("kosei_irlHour7") then currentHour = 7
	elseif getFlag("kosei_irlHour8") then currentHour = 8
	elseif getFlag("kosei_irlHour9") then currentHour = 9
	elseif getFlag("kosei_irlHour10") then currentHour = 10
	elseif getFlag("kosei_irlHour11") then currentHour = 11
	elseif getFlag("kosei_irlHour12") then currentHour = 12
	elseif getFlag("kosei_irlHour13") then currentHour = 13
	elseif getFlag("kosei_irlHour14") then currentHour = 14
	elseif getFlag("kosei_irlHour15") then currentHour = 15
	elseif getFlag("kosei_irlHour16") then currentHour = 16
	elseif getFlag("kosei_irlHour17") then currentHour = 17
	elseif getFlag("kosei_irlHour18") then currentHour = 18
	elseif getFlag("kosei_irlHour19") then currentHour = 19
	elseif getFlag("kosei_irlHour20") then currentHour = 20
	elseif getFlag("kosei_irlHour21") then currentHour = 21
	elseif getFlag("kosei_irlHour22") then currentHour = 22
	elseif getFlag("kosei_irlHour23") then currentHour = 23
	end

	if getFlag("kosei_irlMinute00") then currentMinute = 0
	elseif getFlag("kosei_irlMinute01") then currentMinute = 1
	elseif getFlag("kosei_irlMinute02") then currentMinute = 2
	elseif getFlag("kosei_irlMinute03") then currentMinute = 3
	elseif getFlag("kosei_irlMinute04") then currentMinute = 4
	elseif getFlag("kosei_irlMinute05") then currentMinute = 5
	elseif getFlag("kosei_irlMinute06") then currentMinute = 6
	elseif getFlag("kosei_irlMinute07") then currentMinute = 7
	elseif getFlag("kosei_irlMinute08") then currentMinute = 8
	elseif getFlag("kosei_irlMinute09") then currentMinute = 9
	elseif getFlag("kosei_irlMinute10") then currentMinute = 10
	elseif getFlag("kosei_irlMinute11") then currentMinute = 11
	elseif getFlag("kosei_irlMinute12") then currentMinute = 12
	elseif getFlag("kosei_irlMinute13") then currentMinute = 13
	elseif getFlag("kosei_irlMinute14") then currentMinute = 14
	elseif getFlag("kosei_irlMinute15") then currentMinute = 15
	elseif getFlag("kosei_irlMinute16") then currentMinute = 16
	elseif getFlag("kosei_irlMinute17") then currentMinute = 17
	elseif getFlag("kosei_irlMinute18") then currentMinute = 18
	elseif getFlag("kosei_irlMinute19") then currentMinute = 19
	elseif getFlag("kosei_irlMinute20") then currentMinute = 20
	elseif getFlag("kosei_irlMinute21") then currentMinute = 21
	elseif getFlag("kosei_irlMinute22") then currentMinute = 22
	elseif getFlag("kosei_irlMinute23") then currentMinute = 23
	elseif getFlag("kosei_irlMinute24") then currentMinute = 24
	elseif getFlag("kosei_irlMinute25") then currentMinute = 25
	elseif getFlag("kosei_irlMinute26") then currentMinute = 26
	elseif getFlag("kosei_irlMinute27") then currentMinute = 27
	elseif getFlag("kosei_irlMinute28") then currentMinute = 28
	elseif getFlag("kosei_irlMinute29") then currentMinute = 29
	elseif getFlag("kosei_irlMinute30") then currentMinute = 30
	elseif getFlag("kosei_irlMinute31") then currentMinute = 31
	elseif getFlag("kosei_irlMinute32") then currentMinute = 32
	elseif getFlag("kosei_irlMinute33") then currentMinute = 33
	elseif getFlag("kosei_irlMinute34") then currentMinute = 34
	elseif getFlag("kosei_irlMinute35") then currentMinute = 35
	elseif getFlag("kosei_irlMinute36") then currentMinute = 36
	elseif getFlag("kosei_irlMinute37") then currentMinute = 37
	elseif getFlag("kosei_irlMinute38") then currentMinute = 38
	elseif getFlag("kosei_irlMinute39") then currentMinute = 39
	elseif getFlag("kosei_irlMinute40") then currentMinute = 40
	elseif getFlag("kosei_irlMinute41") then currentMinute = 41
	elseif getFlag("kosei_irlMinute42") then currentMinute = 42
	elseif getFlag("kosei_irlMinute43") then currentMinute = 43
	elseif getFlag("kosei_irlMinute44") then currentMinute = 44
	elseif getFlag("kosei_irlMinute45") then currentMinute = 45
	elseif getFlag("kosei_irlMinute46") then currentMinute = 46
	elseif getFlag("kosei_irlMinute47") then currentMinute = 47
	elseif getFlag("kosei_irlMinute48") then currentMinute = 48
	elseif getFlag("kosei_irlMinute49") then currentMinute = 49
	elseif getFlag("kosei_irlMinute50") then currentMinute = 50
	elseif getFlag("kosei_irlMinute51") then currentMinute = 51
	elseif getFlag("kosei_irlMinute52") then currentMinute = 52
	elseif getFlag("kosei_irlMinute53") then currentMinute = 53
	elseif getFlag("kosei_irlMinute54") then currentMinute = 54
	elseif getFlag("kosei_irlMinute55") then currentMinute = 55
	elseif getFlag("kosei_irlMinute56") then currentMinute = 56
	elseif getFlag("kosei_irlMinute57") then currentMinute = 57
	elseif getFlag("kosei_irlMinute58") then currentMinute = 58
	elseif getFlag("kosei_irlMinute59") then currentMinute = 59
	end
	--if currentHour ~= -1 and currentMinute ~= -1 then
		-- if currentHour < 10 then
			-- hourString = "0" .. currentHour
		-- else
			-- hourString = currentHour
		-- end
		-- if currentMinute < 10 then
			-- minString = "0" .. currentMinute
		-- else
			-- minString = currentMinute
		-- end
	timeString = currentHour .. "_" .. currentMinute .. "_time"
	--end
	if getFlag("bhotel_power_on") then
		say(timeString)
	else
		say("bhotel_clock_find")
	end
	--say("bhotel_clock_broken")
	coroutine.yield(getLevel():ZoomBack(0.5))
	end

function onEnd()
	getLevel():remove(coroutineEntity)
    player.ForceCameraUpdate = false
	celeste.Audio.SetMusicParam("dialog", 0.0)
	setPlayerState ("StNormal")
    enableMovement()
end