
function onTalk()
    makeUnskippable()

    local session = getLevel().Session

    local index = session:GetCounter("SAJICO_Overtime_Pay_Search") + 1

    session:SetCounter("SAJICO_Overtime_Pay_Search", index)

    local indexString = tostring(index)
    if #indexString == 1 then indexString = "0" .. indexString end

    disableMovement()
    say("SAJICO_Overtime_Pay_Search_" .. indexString)

    setFlag(arguments, true)

    if index == 23 then
        wait(1.5)
        say("SAJICO_Overtime_Pay_Mid")

        setFlag("SAJICO_BASEMENT", true)

        for _, luaTalker in ipairs(getAllEntities("Mod.LuaCutscenes.LuaTalker")) do
            if talker ~= luaTalker then
                luaTalker:RemoveSelf()
            end
        end
    elseif index >= 41 then
        setFlag("SAJICO_FOUND", true)
        setFlag("SAJICO_NOEND", false)

        for _, luaTalker in ipairs(getAllEntities("Mod.LuaCutscenes.LuaTalker")) do
            if talker ~= luaTalker then
                luaTalker:RemoveSelf()
            end
        end
    end
end

function onEnd()
    enableMovement()
end