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(110, 120), 1.75, 1.25)))
    walkTo(3998, false, 1.0, false)
    local luanet = _G.luanet
    player.Facing = luanet.enum(luanet.import_type("Celeste.Facings"), "Left")
	celeste.Audio.SetMusicParam("dialog", 1.0)
	if not (getFlag("bhotel_spawn_1") or getFlag("bhotel_curtain_wind")) then
		say("bhotel_214_note")
		setFlag("bhotel_curtain_wind")
	elseif not getFlag("bhotel_rain_true") then
		say("bhotel_NEVER_note")
		setFlag("bhotel_rain_true")
	else
		say("bhotel_TOO_LATE")
	end
	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