예제 #1
0
        public void Alerter_GetTodaysEvents_TestableDateTimeWorks()
        {
            // configure the test.  Our test will pretend that today is 4th May 2020
            TestableDateTimeSource dateTimeSource = new TestableDateTimeSource(new DateTime(2020, 5, 4, 0, 0, 0, DateTimeKind.Local));
            // inject the TestableDateTimeSource into the business object
            Alerter alerter = new Alerter(dateTimeSource);

            // add 4 events, two of which will be on the day of interest
            alerter.AddEvent(new AlertableEvent()
            {
                When = new DateTime(1066, 9, 28, 0, 0, 0, DateTimeKind.Local), Description = "William lands"
            });
            alerter.AddEvent(new AlertableEvent()
            {
                When = new DateTime(1215, 6, 15, 0, 0, 0, DateTimeKind.Local), Description = "Magna carta agreed"
            });
            alerter.AddEvent(new AlertableEvent()
            {
                When = new DateTime(2020, 5, 4, 18, 10, 0, DateTimeKind.Local), Description = "I am writing this test"
            });
            alerter.AddEvent(new AlertableEvent()
            {
                When = new DateTime(2020, 5, 4, 19, 0, 0, DateTimeKind.Local), Description = "I will start dinner"
            });

            // call the function under test
            var events = alerter.GetTodaysEvents();

            // we expect to find 2 events for the 4th May 2020
            Assert.AreEqual(2, events.Count);
        }
예제 #2
0
        private void SendTwilioUpdate(string text, string link)
        {
            // plug in call to Bill's thing here
            var response = Alerter.AlertUsers(link, text);

            System.Diagnostics.Debug.WriteLine(response);
        }
        internal void ProcessInputs(int?qty, string barcodeText)
        {
            if (!qty.HasValue)
            {
                return;
            }
            if (!TryParseBarcode(barcodeText, out ulong bCode))
            {
                return;
            }

            var skuDesc = _skus.FindDescription(bCode);

            if (skuDesc.IsBlank())
            {
                Alerter.ShowError("Unregistered Barcode",
                                  $"Barcode is not in Products Master List:{L.f}“{bCode}”");
                return;
            }

            var row = new ItemCountRow
            {
                TimeScanned = DateTime.Now,
                Quantity    = qty.Value,
                Barcode     = bCode,
                Description = skuDesc,
            };

            row.DeleteCmd = R2Command.Relay(()
                                            => ItemCounts.Remove(row));

            ItemCounts.Insert(0, row);
        }
예제 #4
0
        /// <summary>
        /// Delete an alert
        /// </summary>
        /// <param name="alerter">Alert to delete</param>
        /// <returns>Boolean of deletion</returns>
        public async Task <bool> Delete(Alerter alerter)
        {
            var entity = ContractToEntity(alerter);
            var result = await _alertRepo.Delete(entity);

            return(result);
        }
예제 #5
0
        private R1Executable FindLocalExe()
        {
            var exePath = "";

            var args = Environment.GetCommandLineArgs();

            if (args.Length > 1)
            {
                exePath = args[1];
                if (!File.Exists(exePath))
                {
                    return(Alerter.Warn(
                               $"Exe path from argument is invalid:{L.f}   {exePath}"));
                }
            }
            else
            {
                var exes = ValidExeFile.FindAll();
                if (exes.Count != 1)
                {
                    return(Alerter.Warn((exes.Count == 0
                    ? "No" : "More than 1") + " .exe file found."));
                }
                exePath = exes[0];
            }

            var exe = R1Exe.FromFile(exePath);

            return(exe);
        }
예제 #6
0
        private static async Task <List <string> > ExtractSoloArchive(string archivePath, string targetDir)
        {
            if (!SetLibraryPath(EXTRACTOR_LIB))
            {
                return(null);
            }

            var tcs  = new TaskCompletionSource <List <string> >();
            var zpr  = new SevenZipExtractor(archivePath);
            var list = new List <string>();

            zpr.FileExtractionFinished += (s, e)
                                          => list.Add(e.FileInfo.FileName);

            zpr.ExtractionFinished += (s, e) => tcs.SetResult(list);

            zpr.ExtractArchive(targetDir);

            var contents = await tcs.Task;

            if (contents == null)
            {
                return(Alerter.Warn("Content list is NULL."));
            }
            if (contents.Count == 0)
            {
                return(Alerter.Warn("Archive did not contain any file."));
            }

            return(contents);
        }
예제 #7
0
        /// <summary>
        /// Update an alert
        /// </summary>
        /// <param name="alerter">Alert to update</param>
        /// <returns>Updated alert</returns>
        public async Task <Alerter> Update(Alerter alerter)
        {
            var entity = ContractToEntity(alerter);

            entity = await _alertRepo.Update(entity);

            return(EntityToContract(entity));
        }
예제 #8
0
        protected override void OnResume()
        {
            base.OnResume();

            _subscriptions.Add(
                Mvx.Resolve <IMvxMessenger>().SubscribeOnMainThread <ToastMvxMessage>(msg => {
                Alerter.Create(this).SetText(msg.Message).SetBackgroundColor(Resource.Color.primaryDark).SetIcon(Resource.Drawable.il2).Show();
            }));
        }
예제 #9
0
        /// <summary>
        /// Add an alert
        /// </summary>
        /// <param name="alerter">Alert to add</param>
        /// <returns>Added alert</returns>
        public async Task <Alerter> Add(Alerter alerter)
        {
            var entity = ContractToEntity(alerter);

            entity = await _alertRepo.Add(entity);

            alerter.AlertId = entity.Id;
            return(alerter);
        }
        private bool TryParseBarcode(string barcodeText, out ulong bCode)
        {
            var ok = ulong.TryParse(barcodeText, out bCode);

            if (!ok)
            {
                Alerter.ShowError("Invalid barcode value",
                                  $"Not a valid number:{L.f}“{barcodeText}”");
            }
            return(ok);
        }
예제 #11
0
 private object TryResolveMainWindowVM(ILifetimeScope scope)
 {
     try
     {
         return(ResolveMainWindowVM(scope));
     }
     catch (DependencyResolutionException ex)
     {
         Alerter.ShowError("Resolver Error", ex.GetMessage());
         return(null);
     }
 }
예제 #12
0
        private async void CallBank()
        {
            string bankNumber = ResourceProvider.MyProfilePage_BankPhoneNumber;
            var    action     = await Alerter.CallBankPopUp(bankNumber);

            switch (action)
            {
            case "Call":
                this.CallingService.Call(bankNumber);
                break;
            }
        }
예제 #13
0
        private async Task <byte[]> GetPartContentByHash(string partHash)
        {
            var list = await ViewsList <SplitPartContentByHashDTO>(partHash);

            if (list == null)
            {
                return(null);
            }
            if (list.Count == 0)
            {
                return(Alerter.Warn($"No content found for ‹{partHash}›"));
            }

            return(Convert.FromBase64String(list[0].Base64Content));
        }
예제 #14
0
    public void Add(boolean rAscend, double value, int size)
    {
        Map <Double, Alerter> map = rAscend ? mAscend : mDescend;
        Alerter to = map.get(value);

        if (to != null)
        {
            Alerter.size += size;
        }
        else
        {
            to = new Alerter(size);
            map.put(value, to);
        }
    }
예제 #15
0
        private Alerter EntityToContract(Entities.Portfolio.Alerter entity)
        {
            var contract = new Alerter
            {
                AlertId   = entity.Id,
                Created   = entity.Created,
                Direction = entity.Direction,
                Enabled   = entity.Enabled,
                Exchange  = entity.Exchange,
                Hit       = entity.Hit,
                Pair      = entity.Pair,
                Price     = entity.Price
            };

            return(contract);
        }
예제 #16
0
        private Entities.Portfolio.Alerter ContractToEntity(Alerter contract)
        {
            var entity = new Entities.Portfolio.Alerter
            {
                Id        = contract.AlertId,
                Created   = contract.Created,
                Direction = contract.Direction,
                Enabled   = contract.Enabled,
                Exchange  = contract.Exchange,
                Hit       = contract.Hit,
                Pair      = contract.Pair,
                Price     = contract.Price
            };

            return(entity);
        }
예제 #17
0
        private async Task <bool> ValidateDownload(List <R1SplitPart> splitParts, string expectedHash)
        {
            var downloaded = await _downloadr.DownloadAndExtract(splitParts, expectedHash);

            if (downloaded.IsBlank())
            {
                return(Alerter.Warn("Failed to download/assemble/validate the file.", false));
            }

            //if (downloaded.SHA1ForFile() != expectedHash)
            //    return Alerter.Warn("Hash of downloaded file is different.", false);

            File.Delete(downloaded);

            Status = "Uploaded files validated successfully.";
            return(true);
        }
예제 #18
0
    public void Remove(boolean rAscend, double value, int size)
    {
        Map <Double, Alerter> map = rAscend ? mAscend : mDecend;
        Alerter to = map.get(value);

        if (to != null)
        {
            long nsize = to.size - size;
            if (nsize <= 0)
            {
                map.remove(value);
            }
            else
            {
                to.size = nsize;
            }
        }
    }
예제 #19
0
파일: App.xaml.cs 프로젝트: peterson1/Repo2
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            SetDataTemplates();

            var win = new MainWindow();

            try
            {
                win.DataContext = GetMainWindowVM(e);
                win.Show();
            }
            catch (DependencyResolutionException ex)
            {
                Alerter.ShowError("Resolver Error", ex.GetMessage());
                win.Close();
            }
        }
예제 #20
0
파일: App.xaml.cs 프로젝트: peterson1/Repo2
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var win = new MainWindow();

            try
            {
                using (var scope = Repo2IoC.BeginScope(this, "testDownloader1_open"))
                    win.DataContext = new MainWindowVM(scope, e.Args);

                win.Show();
            }
            catch (DependencyResolutionException ex)
            {
                Alerter.ShowError("Resolver Error", ex.GetMessage());
                win.Close();
            }
        }
        public ReconnectionHandler Build()
        {
            var outputBus = new InMemoryBus("OutputBus");
            var mainQueue = new QueuedHandler(outputBus, "Main Queue");

            // TIMER
            var timer = new TimerService(new ThreadBasedScheduler(new RealTimeProvider()));
            outputBus.Subscribe(timer);

            //ALERTER
            var alerter = new Alerter();
            outputBus.Subscribe<AlertReconnectingForTooLong>(alerter);
            outputBus.Subscribe<AlertFalseAlarm>(alerter);

            var connectionHandler = new ReconnectionHandler(mainQueue);
            outputBus.Subscribe(connectionHandler);
            mainQueue.Start();
            return connectionHandler;
        }
예제 #22
0
        async Task ExecuteLoadItemsCommand()
        {
            IsBusy = true;

            try
            {
                var reminders = await App.BraindumpRestClient
                                .GetRemindersAsync(DateTimeOffset.Now + TimeSpan.FromDays(14));

                Reminders.ReplaceWith(reminders);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                Alerter.Alert(ex.Message);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #23
0
        //private string _pkgPath;

        public UploaderTabVM(IR2RestClient restClient,
                             IPackageUploader packageUploader,
                             PreviousVersionsPopupVM previousVersionsPopupVM,
                             AccessCheckerVM accessCheckerVM,
                             PackageCheckerVM packageCheckerVM,
                             PackageUploaderVM packageUploaderVM)
        {
            PkgChecker    = packageCheckerVM;
            AccessChecker = accessCheckerVM;
            PkgUploader   = packageUploaderVM;
            Previous      = previousVersionsPopupVM;

            restClient.OnRetry += (s, e)
                                  => ClientStatus += $"{L.f}{e}";

            //ConfigLoader.PackagePathChanged += async (a, b) =>
            //{
            //    PkgUploader.DisableUpload();
            //    _pkgPath = b;
            //    await VerifyPackage();
            //};

            PkgChecker.PackageVerified += (a, pkg)
                                          => PkgUploader.EnableUpload(pkg);

            PkgUploader.UploadFinished += (a, r) =>
            {
                PkgUploader.DisableUpload();
                Alerter.Show(r, "Package Upload");

                if (r.IsSuccessful)
                {
                    PkgChecker.CheckPackageCmd.ExecuteIfItCan();
                }

                CommandManager.InvalidateRequerySuggested();
            };
        }
예제 #24
0
        internal async Task <bool> UploadNew
            (R1Executable localExe, double?maxVolumeSizeMB)
        {
            IsBusy = true;
            Status = "Compressing ...";
            var tmpCopy    = CopyToTemp(localExe.FullPathOrURL);
            var splitParts = new List <R1SplitPart>();
            var partPaths  = await SevenZipper1.Compress(tmpCopy, null, maxVolumeSizeMB, ".data");

            for (int i = 0; i < partPaths.Count; i++)
            {
                Status = $"Uploading part {i + 1} of {partPaths.Count} ...";

                var r1Part = FilePart.ToR1Part(partPaths[i],
                                               localExe, i + 1, partPaths.Count);

                var node = await Create(r1Part,
                                        () => GetSplitPartIDsByHash(r1Part.PartHash));

                if (node == null)
                {
                    return(false);
                }
                splitParts.Add(r1Part);
            }

            var ok = await ValidateDownload(splitParts, localExe.FileHash);

            if (!ok)
            {
                //todo: delete corrupted uploaded parts
                return(Alerter.Warn("Uploaded parts are invalid.", false));
            }

            IsBusy = false;
            return(true);
        }
예제 #25
0
        //pass in email you wish to send Weather Alert to
        static void Main(string[] args)
        {
            string recipientEmail;

#if DEBUG
            recipientEmail = "*****@*****.**";
#endif
            //todo test this
#if !DEBUG
            //this hasnt been tested
            if (args.Length == 0)
            {
                Console.WriteLine("Recepient Email required");
                Console.ReadLine();
                return;
            }
            else
            {
                recipientEmail = args[0];
            }
#endif

            //i did have ot change my email to allow less secure apps and i also click somewhere for gmail to recognize this machine. not sure if both of these are necessary or not.
            try
            {
                //get fiveday forecast, currently does kansas city (can change in app.config, need to check open weather for valid cities)
                //doesn't pull whatever is left of today will need to make second api call for that.
                //second api call won't help, it can only do current so there is no way to know the high for a day in the morning.
                //tempted to add some storage for this adn story min max in the database and can pull it from there. probably easier to find another api.
                //this pulls 40 records no matter what time it is called - 40 records = (24hrs / 3 hrs) * 5 days
                FiveDay forecast = OpenWeatherAPIRequests.GetFiveDayForecast().Result;

                //get the date
                List <DateTime> fiveDays = forecast.list.Select(x => DateTimeOffset.FromUnixTimeSeconds(x.dt).Date).Distinct().OrderBy(y => y.Date).ToList();

                //get the max values for that date
                //currently just sends the 1st day and the forecast for every 3 hours
                // was considering sending the high and lows for the next 5 days
                DateTime day1Date = fiveDays[0];//today. they are ordered, otherwise we could do fiveDays.Min();
                //DateTime day2Date = fiveDays[1];
                //DateTime day3Date = fiveDays[2];
                //DateTime day4Date = fiveDays[3];
                //DateTime day5Date = fiveDays[4];

                var day1 = forecast.list.Where(x => DateTimeOffset.FromUnixTimeSeconds(x.dt).Date == day1Date).ToList();
                //var day2 = forecast.list.Where(x => DateTimeOffset.FromUnixTimeSeconds(x.dt).Date == day2Date).ToList();
                //var day3 = forecast.list.Where(x => DateTimeOffset.FromUnixTimeSeconds(x.dt).Date == day3Date).ToList();
                //var day4 = forecast.list.Where(x => DateTimeOffset.FromUnixTimeSeconds(x.dt).Date == day4Date).ToList();
                //var day5 = forecast.list.Where(x => DateTimeOffset.FromUnixTimeSeconds(x.dt).Date == day5Date).ToList();

                //double day1Max = HelperMethods.KelvinToFahrenheit(day1.Max(x => x.main.temp));
                //double day1Min = HelperMethods.KelvinToFahrenheit(day1.Min(x => x.main.temp));
                //double day2Max = HelperMethods.KelvinToFahrenheit(day2.Max(x => x.main.temp));
                //double day2Min = HelperMethods.KelvinToFahrenheit(day2.Min(x => x.main.temp));
                //double day3Max = HelperMethods.KelvinToFahrenheit(day3.Max(x => x.main.temp));
                //double day3Min = HelperMethods.KelvinToFahrenheit(day3.Min(x => x.main.temp));
                //double day4Max = HelperMethods.KelvinToFahrenheit(day4.Max(x => x.main.temp));
                //double day4Min = HelperMethods.KelvinToFahrenheit(day4.Min(x => x.main.temp));
                //double day5Max = HelperMethods.KelvinToFahrenheit(day5.Max(x => x.main.temp));
                //double day5Min = HelperMethods.KelvinToFahrenheit(day5.Min(x => x.main.temp));

                //https://stackoverflow.com/questions/1202981/select-multiple-fields-from-list-in-linq
                //anonymus types
                string day1title = "Forecast for " + day1Date.Date.ToString("dd MMM yyyy") + "\n";
                string day1text  = "";

                foreach (List threehourperiod in day1)
                {
                    day1text += "\n" + Convert.ToDateTime(threehourperiod.dt_txt).ToString("HH:mm");;      //dt.ToString("HH:mm"); // 15:14
                    day1text += "\n" + HelperMethods.KelvinToFahrenheit(threehourperiod.main.temp) + " F"; //todo trim this
                    foreach (Weather w in threehourperiod.weather)
                    {
                        day1text += "\n" + w.description;
                    }
                    day1text += "\n";
                }

                forecast.list.Where(x => x.main.temp == forecast.list.Max(y => y.main.temp));
                //string body = "Forecast for " + forecast.city + ": " + forecast.list[0].main.

                //https://home.openweathermap.org/api_keys
                //open360weather
                //https://stackoverflow.com/questions/31246531/can-i-send-sms-messages-from-a-c-sharp-application

                string  weatherAlerterName  = ConfigurationManager.AppSettings.Get("WeatherAlerterName");
                string  weatherAlerterEmail = ConfigurationManager.AppSettings.Get("WeatherAlerterEmail");
                Alerter weatherAlerter      = new Alerter();

                weatherAlerter.Recipient = new Recipient
                {
                    Email = recipientEmail
                };

                weatherAlerter.Sender = new Sender
                {
                    Name     = ConfigurationManager.AppSettings.Get("WeatherAlerterName"),
                    Email    = ConfigurationManager.AppSettings.Get("WeatherAlerterEmail"),
                    Password = ConfigurationManager.AppSettings.Get("WeatherAlerterEmailPassword")
                };

                weatherAlerter.Body = day1title + day1text;

                weatherAlerter.SendAlert();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
예제 #26
0
 private void Start()
 {
     alerter = new Alerter();
 }
예제 #27
0
 protected virtual void OnError(Exception error)
 => Alerter.ShowError($"Error on task :  “{_origLabel}”",
                      error.Info(false, true));
예제 #28
0
    private IEnumerator Start()
    {
        alerter  = new Alerter();
        desktop  = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
        username = Environment.UserName;

        // Debug.Log(File.Exists)

        audio.PlayOneShot(doorOpen);

        yield return(new WaitForSecondsRealtime(3f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 1.5f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));

        Directory.CreateDirectory(desktop + "/Cauldron");
        audio.PlayOneShot(clang);
        yield return(new WaitForSecondsRealtime(1f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.5f));

        left.speakSpeed  = 30f;
        right.speakSpeed = 30f;

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.5f));

        yield return(new WaitForSecondsRealtime(right.Speak()));

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.5f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.5f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.3f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.3f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.3f)); // bg

        background.SetTrigger("Throw");
        yield return(new WaitForSecondsRealtime(1f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f)); // ship

        player.SetTrigger("Throw");
        yield return(new WaitForSecondsRealtime(1f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.5f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.5f)); // catch

        roidCage.SetActive(false);
        yield return(new WaitForSecondsRealtime(left.Speak() + 1.5f)); // buffoon

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.3f)); // have sb

        scoreboard.SetTrigger("Throw");
        yield return(new WaitForSecondsRealtime(1.2f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f)); // help

        left.speakSpeed = 60f;
        left.Speak(); // aaa
        left.speakSpeed = 10f;
        yield return(new WaitForSecondsRealtime(0.2f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.4f)); // shut up

        right.speakSpeed = 10f;
        yield return(new WaitForSecondsRealtime(right.Speak() + 1f)); // shoosh

        left.speakSpeed  = 1f;
        right.speakSpeed = 1f;

        left.Speak(); // ...
        yield return(new WaitForSecondsRealtime(right.Speak() + 8f));

        // Application.Quit();

        left.speakSpeed  = 20f;
        right.speakSpeed = 20f;

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));  // do you think the player noticed?

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f)); // nah

        left.speakSpeed  = 30f;
        right.speakSpeed = 30f;

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f)); // they probably thought it was a long loading screen

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));  // shame they'll never find out that this isn't a game

        audio.PlayOneShot(campfire);

        yield return(new WaitForSecondsRealtime(4f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));    // why asteroids?

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));   // you said to make this look like a game

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));    // but asteroids is *soo* 19th century

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.5f)); // whateveerr the player seems to like it

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));

        // potential branching

        yield return(new WaitForSecondsRealtime(left.Speak() + 3f)); // harrumph fine

        audio.PlayOneShot(bubble);
        yield return(new WaitForSecondsRealtime(2f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));   // aight, the cauldron's ready

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));  // *fi**nal**ly*

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));  // oh shoot i dropped the heart

        yield return(new WaitForSecondsRealtime(left.Speak() + 1.5f)); // where'd it go?

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));  // dunno, i'm looking for it

        yield return(new WaitForSecondsRealtime(left.Speak() + 5f));   // why are you like this

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));  // found it!

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));  // stale

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));

        audio.PlayOneShot(splash);
        Directory.CreateDirectory(desktop + "/Cauldron");
        FileStream heart = File.Create(desktop + "/Cauldron/Heart");

        heart.Close();
        yield return(new WaitForSecondsRealtime(1.5f));

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));  // ready

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f)); // no looking back

        yield return(new WaitForSecondsRealtime(left.Speak() + 2f));

        StartCoroutine(FadeMusic());

        for (int j = 0; j < 3; j++)
        {
            left.Speak();
            yield return(new WaitForSecondsRealtime(right.Speak() + 1f));
        }

        left.speakSpeed  = 15f;
        right.speakSpeed = 15f;

        left.Speak();
        yield return(new WaitForSecondsRealtime(right.Speak() + 2.5f));

        left.speakSpeed  = 20f;
        right.speakSpeed = 20f;

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f)); // weird

        left.speakSpeed  = 30f;
        right.speakSpeed = 30f;

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f)); // did it work?

        right.Speak();                                               // I thi- YES
        yield return(new WaitForSecondsRealtime(0.4f));

        audio.pitch = 1.1f - UnityEngine.Random.value * 0.2f;
        audio.PlayOneShot(error);
        alerter.Error();
        yield return(new WaitForSecondsRealtime(left.Speak() + 0.3f));  // by pope

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f)); // foundation

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.3f));  // take out

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.4f));

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f)); // incredulous

        yield return(new WaitForSecondsRealtime(left.Speak() + 0.3f));  // yes take th

        yield return(new WaitForSecondsRealtime(right.Speak() + 0.3f));

        Time.timeScale = 0f;
        yield return(new WaitForSecondsRealtime(0.5f));


        Threaten("Too late.");
        Threaten("While my heart rests in the cauldron, I am IMMORTAL!");
        Threaten("AND NOW THE BICKERING FOOLS ARE FROZEN IN TIME AND UNABLE TO STOP ME");
        Threaten("MUA HAHA HA HA H-");
        Threaten("*cough* *wheeze*");
        yield return(new WaitForSecondsRealtime(1f));

        Threaten("As for you...");
        Threaten(username + ".");
        yield return(new WaitForSecondsRealtime(1f));

        int i = 0;

        while (true)
        {
            if (Threaten("YOUR SOUL IS NOW MINE"))
            {
                break;
            }
            yield return(new WaitForSecondsRealtime(0.3f));

            if (Threaten("MAKE PEACE WITH YOUR GOD, FOR THIS IS THE DAY THEY DIE"))
            {
                break;
            }
            yield return(new WaitForSecondsRealtime(0.3f));

            if (Threaten("I HOPE YOU ENJOY BEING ON FIRE FOREVER"))
            {
                break;
            }
            yield return(new WaitForSecondsRealtime(0.3f));

            i++;
            if (i > 2)
            {
                alerter.Alert("check your computer's desktop for any sketchy cauldrons with hearts in them ;)", "the developer!");
            }
        }

        audio.pitch = 1.1f - UnityEngine.Random.value * 0.2f;
        audio.PlayOneShot(error);
        Threaten("Wait.");
        Threaten("where is my heart.");
        Threaten("NOOOOOOOOOOOO");
        Threaten("OOOOOoo");
        Threaten("ooo");
        yield return(new WaitForSecondsRealtime(2f));

        Threaten("o");

        Time.timeScale = 1f;

        left.speakSpeed  = 1f;
        right.speakSpeed = 1f;

        StartCoroutine(UnFadeMusic());

        left.Speak(); // ...
        yield return(new WaitForSecondsRealtime(right.Speak() + 1f));

        left.speakSpeed = 10f;
        yield return(new WaitForSecondsRealtime(left.Speak() + 1f)); // welp

        right.speakSpeed = 20f;
        yield return(new WaitForSecondsRealtime(right.Speak() + 2f)); // sums it up

        left.speakSpeed  = 25f;
        right.speakSpeed = 25f;

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));  // wanna grab bubble tea?

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f)); // yeah

        left.Shrink();
        right.Shrink();

        yield return(new WaitForSecondsRealtime(right.Speak() + 1f)); // that was fun tho

        yield return(new WaitForSecondsRealtime(left.Speak() + 1f));  // again?

        yield return(new WaitForSecondsRealtime(right.Speak() + 2f)); // heck yeah

        audio.pitch = 1f;
        audio.PlayOneShot(doorClose);

        yield return(new WaitForSecondsRealtime(2f));

        Application.Quit();
    }
예제 #29
0
 public Checker(Alerter alert)
 {
     this.alerter = alert;
 }