IEnumerator IncreaseMinute() { for (; ;) { Time.IncrementMinute(); AlarmUI.text = ""; CurrentHour = Time.GetHour().ToString(); if (Time.GetMinute() <= 9) { CurrentMin = "0"; CurrentMin += Time.GetMinute().ToString(); } else { CurrentMin = Time.GetMinute().ToString(); } if (Time.Equate(Alarm)) { DoAlarm(); } if (ModeManager.GetMode() != Mode.SET_ALARM) { HoursUI.text = CurrentHour; MinuteUI.text = CurrentMin; } yield return(new WaitForSeconds(60f)); } }
void OnEnable() { // string cA = GameObject.Find("StatsManager").GetComponent<StatsManager>().GetCurrentAttempts(Mode.Main).ToString(); Mode currentMode = modeManager.GetMode(); StatsManager statsManager = GameObject.Find("StatsManager").GetComponent <StatsManager>(); string cA = statsManager.GetCurrentAttempts(currentMode).ToString(); string cT = statsManager.GetCurrentSeconds(currentMode).ToString("f2"); string aA = statsManager.GetAverageAttemptsPerLevel(currentMode).ToString("f2"); string tS = (statsManager.GetModeTimesStarted(currentMode) - 1).ToString(); string newText = rawString; newText = newText.Replace("$", cA); // current attempts newText = newText.Replace("£", cT); // current time in seconds newText = newText.Replace("€", aA); // average attempts per level newText = newText.Replace("^", tS); // time started mode (minus 1) completedMsg.text = newText; // if (cM == null) // { // cM = completedMsg.text.Split("$"[0]); // } // completedMsg.text = cM[0] + cA + cM[1]; }
void ModeUpdated() { switch (modeManager.GetMode()) { case Mode.Main: modeInfoText.text = mainInfo; break; case Mode.Tricky: modeInfoText.text = trickyInfo; break; case Mode.Time: modeInfoText.text = timeInfo; break; case Mode.Lives: modeInfoText.text = livesInfo; break; case Mode.OneShot: modeInfoText.text = oneShotInfo; break; default: modeInfoText.text = ""; break; } }
public void Completed() { switch (modeManager.GetMode()) { default: mainCompleteScreen.SetActive(true); break; case Mode.Time: timeCompleteScreen.SetActive(true); break; case Mode.Lives: livesCompleteScreen.SetActive(true); break; case Mode.OneShot: oneShotCompleteScreen.SetActive(true); break; } }
void Update() { // this is for level skipping in Tricky mode. There may well be a better place for this code, but it lives here for now if (Input.GetButtonDown("NextLevel") && modeManager.GetMode() == Mode.Tricky) { // Messenger.Broadcast("Success"); GameStates.ChangeState("Transition", "Skip"); Messenger <TransitionReason> .Broadcast("Transition", TransitionReason.levelSkip); gameObject.SetActive(false); } }
public static void Main(string[] args) { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += Application_ThreadException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.SetHighDpiMode(HighDpiMode.SystemAware); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); logger = new Logger(); var modeManager = new ModeManager(); var mode = modeManager.GetMode(args); var settingsService = new SettingsService(new MemoryCache(new MemoryCacheOptions()), new RegistryRepository()); if (mode == ModeManager.Mode.Configuration) { var settingsForm = new SettingsForm(); settingsForm.Tag = new SettingsFormPresenter(settingsForm, settingsService); Application.Run(settingsForm); } else if (mode == ModeManager.Mode.Preview) { // No preview mode implemented. Maybe we could use the demo // site at https://piwigo.org/demo/ and show photos from there? Application.Exit(); } else { var galleryService = new PiwigoService(logger, settingsService, new HttpClient()); var mainForm = new MainForm(); var allScreensBoundaries = Screen.AllScreens.Select(x => x.Bounds); mainForm.Tag = new MainFormPresenter(logger, mainForm, galleryService, allScreensBoundaries); Application.Run(mainForm); } }
public void UpdateText() { Mode currentMode = modeManager.GetMode(); if (currentMode != Mode.None) { progress.text = "Level Progress: " + statsManager.GetLevelsCompleted(currentMode) + " / " + statsManager.GetNumberOfLevels(currentMode); currentAttempts.text = "Current Attempts: " + statsManager.GetCurrentAttempts(currentMode); secondsSpendCurrent.text = "Current Seconds: " + statsManager.GetCurrentSeconds(currentMode).ToString("f2"); } else { progress.text = ""; currentAttempts.text = ""; secondsSpendCurrent.text = ""; } // Debug.Log(currentMode); if (currentMode != Mode.None && statsManager.GetModeTimesStarted(currentMode) > 1) { timesStarted.text = "Times Started: " + statsManager.GetModeTimesStarted(currentMode); timesCompleted.text = "Times Completed: " + statsManager.GetModeTimesCompleted(currentMode); bestAttempts.text = "Best Attempts: " + statsManager.GetModeBestAttempts(currentMode); totalAttempts.text = "Total Attempts: " + statsManager.GetModeTotalAttempts(currentMode); totalLevelsCompleted.text = "Total Levels Completed: " + statsManager.GetModeTotalLevelsCompleted(currentMode).ToString(); secondsSpendTotal.text = "Total Seconds: " + statsManager.GetModeTotalSeconds(currentMode).ToString("f2"); secondsSpendBest.text = "Best Seconds: " + statsManager.GetModeBestSeconds(currentMode).ToString("f2"); } else { timesStarted.text = ""; timesCompleted.text = ""; bestAttempts.text = ""; totalAttempts.text = ""; totalLevelsCompleted.text = ""; secondsSpendTotal.text = ""; secondsSpendBest.text = ""; } }
//checks if game is over public bool CheckForGameOver() { // Debug.Log(modeGroups[(int)modeManager.GetMode()].currentLevels.Count); if (modeGroups[(int)modeManager.GetMode()].currentLevels.Count == 0) { Debug.Log("GameOver"); return(true); } return(false); }
public void TimeSetTest() { modeManager.SetMode(Mode.SET_TIME); Assert.AreEqual(Mode.SET_TIME, modeManager.GetMode()); }
public string ChooseText() { // Debug.Log("Choosing Text"); if (controller.gameCompleted == true) { return(completeText); } // this is the text from TextTrigger if (overrideText != "" && ( (overrideCondition == OverrideCondition.levelSuccess && controller.transitionReason == TransitionReason.levelSuccess) || (overrideCondition == OverrideCondition.levelFailure && controller.transitionReason == TransitionReason.levelFailure) || overrideCondition == OverrideCondition.none) ) { return(overrideText); } // GameObject levelGO = GameObject.FindGameObjectWithTag("Level"); // if (levelGO != null) // { // LevelText levelText = levelGO.GetComponent<LevelText>(); // if (levelText != null) // { // Debug.Log("Woop"); // } // } if (controller.modeManager.GetMode() == Mode.Time) { float time = controller.timeChallengeManager.GetTime(); if (time <= 0) { return("Outta Time Baby"); } return(time.ToString("f2")); } if (controller.modeManager.GetMode() == Mode.Lives) { int lives = controller.livesChallengeManager.GetLives(); if (lives <= 0) { return("Outta Lives Baby"); } return(lives.ToString()); } switch (controller.transitionReason) { case TransitionReason.levelSkip: List <string> optionsS = new List <string>(); optionsS.Add("Giving Up?"); optionsS.Add("Ha, Knew It"); optionsS.Add("Come Back To It Later"); optionsS.Add("I Think It's Best"); optionsS.Add("Quitter"); optionsS.Add("Coward"); optionsS.Add("Disappointing"); return(optionsS[Random.Range(0, optionsS.Count)]); //break; case TransitionReason.levelLoad: List <string> optionsL = new List <string>(loadTextOptions); if (controller.gameReset == true) { optionsL.Clear(); optionsL.Add("Another Go?"); optionsL.Add("Clearing Data"); optionsL.Add("Doing A Reset"); optionsL.Add("Back For More?"); optionsL.Add("Do Better This Time"); optionsL.Add("Cleaning Up"); return(optionsL[Random.Range(0, optionsL.Count)]); } return(optionsL[Random.Range(0, optionsL.Count)]); // break; case TransitionReason.levelSuccess: // Check for Unique Level Text // GameObject levelGO = GameObject.FindGameObjectWithTag("Level"); // if (levelGO != null) // { LevelText levelText = GameObject.FindGameObjectWithTag("Level").GetComponent <LevelText>(); if (levelText != null) { int r = Random.Range(0, 10); // might balance this out based on times attempted / number of options / start at 2 add 1 for each option // bool doThis = r < 8 ? true : false; bool doThis = false; List <string> uniqueLevelOptions = new List <string>(); // LevelText levelText = levelGO.GetComponent<LevelText>(); // if (levelText != null) // { if (levelText.bonusSuccessText.Length > 0) { uniqueLevelOptions = new List <string>(levelText.bonusSuccessText); // doThis = r < (7 + uniqueLevelOptions.Count) ? true : false; doThis = r < 8 ? true : false; } // } // if (doThis && uniqueLevelOptions.Count > 0) return uniqueLevelOptions[Random.Range(0, uniqueLevelOptions.Count)]; if (doThis) { return(uniqueLevelOptions[Random.Range(0, uniqueLevelOptions.Count)]); } } // Start of normal text options List <string> options = new List <string>(successTextOptions); //basic ones - TODO: Move others here // options.Add("..."); int currentLevelAttempts = statsManager.GetCurrentLevelCurrentAttempts(); if (currentLevelAttempts == 1) { float r = Random.Range(0.0f, 1f) - statsManager.GetPercentageComplete(modeManager.GetMode()); bool doThis = r < 0.02f ? true : false; if (doThis) { options.Clear(); } options.Add("First Time Lucky!"); options.Add("Beginner's Luck"); options.Add("Hole In One!"); options.Add("We Got Us A Natural"); options.Add("Straight To It"); options.Add("No Messing About"); options.Add("Ooft"); if (doThis) { return(options[Random.Range(0, options.Count)]); } } if (currentLevelAttempts >= 3) { options.Add(GetNumberSuffix(currentLevelAttempts) + " Time Lucky"); options.Add("Whatever"); options.Add("Practice Makes Perfect"); options.Add("That's More Like It"); } if (currentLevelAttempts >= 10) { options.Add("Finally"); options.Add("About Time"); options.Add("Yawn"); options.Add("Proud Of You"); options.Add("Knew You Could Do It"); } switch (statsManager.GetPercentageComplete(modeManager.GetMode()).ToString()) { // case "0.25": // // options.Add("Quarter Done!"); // return "Quarter Done!"; // break; case "0.5": // options.Add("Halfway There!"); return("Halfway There!"); break; case "0.75": // options.Add("Three Quarters Done!"); return("Three Quarters Done!"); break; default: if (statsManager.GetPercentageComplete(modeManager.GetMode()) >= 0.5f) // it's off-putting unless over 50% { options.Add((statsManager.GetPercentageComplete(modeManager.GetMode()) * 100).ToString("f2") + "% Done!"); } break; } if (statsManager.GetPercentageComplete(modeManager.GetMode()) > 0.1f && statsManager.GetPercentageComplete(modeManager.GetMode()) < 0.2f) { options.Add("Only Gets Better From Here"); } if (statsManager.GetPercentageComplete(modeManager.GetMode()) > 0.45f && statsManager.GetPercentageComplete(modeManager.GetMode()) < 0.5f) { options.Add("Nearly Halfway There!"); } if (statsManager.GetPercentageComplete(modeManager.GetMode()) > 0.92f && statsManager.GetPercentageComplete(modeManager.GetMode()) < 0.98f) { options.Add("Not Long To Go Now"); options.Add("Just A Few More"); options.Add("Nearly There"); } if (statsManager.GetPercentageComplete(modeManager.GetMode()) < 0.1f) { options.Add("Just Getting Started"); options.Add("Early Victory"); options.Add("Pfft, That Was Easy"); } if (statsManager.GetPercentageComplete(modeManager.GetMode()) > 0.5f) { options.Add("Way To Go Slugger"); options.Add("CHAMPION"); options.Add("A+ Performance There"); options.Add("Textbook"); options.Add("Back Of The Net"); options.Add("GOOOOOOOAAAAAAL"); options.Add("BRING IT ON"); options.Add("Feeling It Yet?"); options.Add("As If"); options.Add("I Don't Believe It"); } if (statsManager.GetPercentageComplete(modeManager.GetMode()) > 0.75f) { options.Add("Getting There"); options.Add(":D"); } // if (statsManager.GetPercentageComplete(modeManager.GetMode()) > 0.85f) // { // if (statsManager.GetCurrentAttempts(modeManager.GetMode()) < statsManager.GetBestAttempts(modeManager.GetMode()) // && statsManager.GetCurrentAttempts(modeManager.GetMode()) - statsManager.GetBestAttempts(modeManager.GetMode()) >= statsManager.GetNumberOfLevelsRemaining(modeManager.GetMode())) // { // options.Add("Can Still Beat Your Attempts Record!"); // } // if (statsManager.GetCurrentSeconds() < statsManager.GetBestSeconds()) // { // options.Add("Can Still Beat Your Time Record!"); // } // } switch (statsManager.GetNumberOfLevelsRemaining(modeManager.GetMode())) { case 5: options.Add("Final Five"); break; case 4: options.Add("Four More To Go!"); break; case 3: options.Add("Just Three To Go!"); break; case 2: options.Add("Only Two Left!"); break; case 1: options.Add("Last Level!"); break; default: if (statsManager.GetPercentageComplete(modeManager.GetMode()) >= 0.5f) // it's off-putting unless over 50% { options.Add("Just " + statsManager.GetNumberOfLevelsRemaining(modeManager.GetMode()).ToString() + " Levels To Go"); options.Add("Only " + statsManager.GetNumberOfLevelsRemaining(modeManager.GetMode()).ToString() + " Levels Remaining"); options.Add("Now Do That " + statsManager.GetNumberOfLevelsRemaining(modeManager.GetMode()).ToString() + " More Times"); } break; } if (statsManager.GetCurrentStreak() > 9) { float r = Random.Range(0.0f, 1f) - statsManager.GetPercentageComplete(modeManager.GetMode()); bool doThis = r < 0.02f ? true : false; if (doThis) { options.Clear(); } options.Add("You Got The Golden Touch"); options.Add("Wowza!"); options.Add("Gee Wizz"); options.Add("Now This Is Impressive"); if (doThis) { return(options[Random.Range(0, options.Count)]); } } if (statsManager.GetCurrentStreak() > 4) { float r = Random.Range(0.0f, 1f) - statsManager.GetPercentageComplete(modeManager.GetMode()); bool doThis = r < 0.02f ? true : false; if (doThis) { options.Clear(); } options.Add("Hot Streak!"); options.Add("Keep 'em Coming"); options.Add("Hanging Out In The Zone"); options.Add("Oooh Baby"); options.Add("You've Seen The Light"); options.Add("Surely You Can't Keep This Up"); options.Add("Show Off"); options.Add(statsManager.GetCurrentStreak().ToString() + " Done And No Signs Of Slowing"); options.Add(statsManager.GetCurrentStreak().ToString() + " In A Row!"); // if (LoadLevel.GetBestGoodStreak() == LoadLevel.GetCurrentGoodStreak()) // { // options.Add("Best Streak Yet!"); // } if (doThis) { return(options[Random.Range(0, options.Count)]); } } if (statsManager.GetStreakBreak() == true) { // float r = Random.Range(0.0f, 1f) - statsManager.GetPercentageComplete(modeManager.GetMode()); float r = Random.Range(0.0f, 1f); // bool doThis = r < 0.02f ? true : false; bool doThis = r < 0.8f ? true : false; if (doThis) { options.Clear(); } options.Add("That's The Spirit"); options.Add("About Time"); options.Add("Finally"); options.Add("Bad Streak Broken"); options.Add("But Can You Keep It Going?"); options.Add("Ruin My Fun"); options.Add("That Was Some Losing Streak"); options.Add("Glad You're Doing Better"); options.Add("I Knew You Could Do One Of Them"); if (doThis) { return(options[Random.Range(0, options.Count)]); } } // Debug.Log("Best Time: " + LoadLevel.GetCurrentLevelBestTime() + " Last Time: " + LoadLevel.GetLastSeconds() // + " Last Best Time: " + LoadLevel.GetLastBestTime()); // if (LoadLevel.GetCurrentLevelBestTime() == LoadLevel.GetLastSeconds() && LoadLevel.GetLastBestTime() != 0) // { // options.Add("Best Time!"); // options.Add("New Record!"); // options.Add("Better Than Last Time!"); // options.Add(Mathf.Abs(LoadLevel.GetLastTimeDifference()).ToString("f2") + " Seconds Faster!"); // // return Mathf.Abs(LoadLevel.GetLastTimeDifference()).ToString("f2") + " Seconds Faster!"; // } // if (LoadLevel.GetCurrentLevelBestTime() < LoadLevel.GetLastSeconds()) // { // options.Add("Not Your Best Time"); // options.Add(Mathf.Abs(LoadLevel.GetLastTimeDifference()).ToString("f2") + " Seconds Slower"); // // return Mathf.Abs(LoadLevel.GetLastTimeDifference()).ToString("f2") + " Seconds Slower"; // } // if (LoadLevel.GetCurrentLevelBestAttempts() == LoadLevel.GetCurrentLevelCurrentAttempts() && LoadLevel.GetBestAttemptsLast() != 0) // { // options.Add("Best Effort!"); // options.Add("New Record!"); // options.Add("Better Than Last Time!"); // options.Add(Mathf.Abs(LoadLevel.GetLastAttemptsDifference()).ToString() + " Attempts Better!"); // // return Mathf.Abs(LoadLevel.GetLastAttemptsDifference()).ToString() + " Attempts Better!"; // } // if (LoadLevel.GetCurrentLevelBestAttempts() < LoadLevel.GetCurrentLevelCurrentAttempts()) // { // options.Add("Not Your Best Effort"); // options.Add("Took " + LoadLevel.GetLastAttemptsDifference() + " More Attempts"); // } if (statsManager.GetLevelsCompleted(modeManager.GetMode()) > 1) { options.Add(statsManager.GetLevelsCompleted(modeManager.GetMode()).ToString() + " Levels Completed"); } if (statsManager.GetPercentageComplete(modeManager.GetMode()) >= 0.5f) // it's off-putting unless over 50% { options.Add(statsManager.GetLevelsCompleted(modeManager.GetMode()).ToString() + " Down, " + statsManager.GetNumberOfLevelsRemaining(modeManager.GetMode()).ToString() + " To Go"); options.Add(statsManager.GetLevelsCompleted(modeManager.GetMode()).ToString() + " / " + statsManager.GetNumberOfLevels(modeManager.GetMode()).ToString()); } if (statsManager.GetLastSeconds() > 10) { options.Add("Took Your Time"); options.Add("Slowpoke"); options.Add("Well That Wasn't Very Fast"); } options.Add("In Only " + statsManager.GetLastSeconds().ToString("f2") + " Seconds"); options.Add("Your " + GetNumberSuffix(statsManager.GetLevelsCompleted(modeManager.GetMode())) + " Success"); #if UNITY_WSA options.Add("Press B To Return To Menu"); #endif #if UNITY_STANDALONE options.Add("Press Escape To Return To Menu"); #endif return(options[Random.Range(0, options.Count)]); break; case TransitionReason.levelFailure: // Check for Unique Level Text // GameObject levelGO = GameObject.FindGameObjectWithTag("Level"); // if (levelGO != null) // { LevelText levelTextF = GameObject.FindGameObjectWithTag("Level").GetComponent <LevelText>(); if (levelTextF != null) { int r = Random.Range(0, 10); // bool doThis = r < 8 ? true : false; bool doThis = false; List <string> uniqueLevelOptions = new List <string>(); // LevelText levelText = levelGO.GetComponent<LevelText>(); // if (levelText != null) // { if (levelTextF.bonusFailureText.Length > 0) { uniqueLevelOptions = new List <string>(levelTextF.bonusFailureText); doThis = r < (2 + uniqueLevelOptions.Count) ? true : false; } if (statsManager.GetCurrentLevelCurrentAttempts() > 4 && levelTextF.bonusHintText.Length > 0) { for (int i = 0; i < levelTextF.bonusHintText.Length; i++) { uniqueLevelOptions.Add(levelTextF.bonusHintText[i]); } doThis = r < (2 + uniqueLevelOptions.Count) ? true : false; } // } // if (doThis && uniqueLevelOptions.Count > 0) return uniqueLevelOptions[Random.Range(0, uniqueLevelOptions.Count)]; if (doThis) { return(uniqueLevelOptions[Random.Range(0, uniqueLevelOptions.Count)]); } // return uniqueLevelOptions[Random.Range(0, uniqueLevelOptions.Count)]; } List <string> optionsF = new List <string>(failureTextOptions); // basics optionsF.Add("..."); optionsF.Add("Seriously?"); optionsF.Add("Brave Move That"); optionsF.Add("Don't Do That"); if (statsManager.GetCurrentLevelCurrentAttempts() > 1) { optionsF.Add("Again?"); optionsF.Add("History Repeats Itself"); } if (statsManager.GetCurrentLevelCurrentAttempts() > 4) { optionsF.Add(statsManager.GetCurrentLevelCurrentAttempts().ToString() + " Tries Already?"); optionsF.Add("Level Attempts: " + statsManager.GetCurrentLevelCurrentAttempts().ToString()); optionsF.Add("Tricky isn't it?"); optionsF.Add("Struggling?"); optionsF.Add("You're Having Trouble With <i>This</i> One?"); optionsF.Add("This Is An Easy One!"); } if (statsManager.GetCurrentLevelCurrentAttempts() > 6) { optionsF.Add("Ha"); optionsF.Add(":("); optionsF.Add("NOT AGAIN"); } if (statsManager.GetCurrentLevelCurrentAttempts() > 10) { optionsF.Add("I Admire Your Determination"); optionsF.Add("Keep Going!"); optionsF.Add("I Believe In You"); optionsF.Add("I No Longer Believe In You"); optionsF.Add("Give Up"); optionsF.Add("This One Level Eh?"); optionsF.Add("Giving You Real Trouble Isn't It"); optionsF.Add("I Did It First Try"); optionsF.Add("You're Doing It Wrong"); } if (statsManager.GetCurrentAttempts(modeManager.GetMode()) > 20) { optionsF.Add("That's Your " + GetNumberSuffix(statsManager.GetCurrentAttempts(modeManager.GetMode())) + " Attempt"); optionsF.Add(statsManager.GetCurrentAttempts(modeManager.GetMode()).ToString() + " Attempts So Far"); optionsF.Add("That Was Attempt " + statsManager.GetCurrentAttempts(modeManager.GetMode()).ToString()); } if (statsManager.GetCurrentAttempts(modeManager.GetMode()) > 700) { optionsF.Add("This Isn't Going Great"); optionsF.Add("Not Going For A Highscore Eh?"); optionsF.Add("Probably Won't Be #1"); } // if (LoadLevel.GetTimesStarted() >= 1) // { // optionsF.Add("That's Your " + GetNumberSuffix(LoadLevel.GetTotalAttempts()) + " Total Attempt"); // optionsF.Add("At " + LoadLevel.GetTotalSeconds().ToString("f2") + " Seconds Across All Games"); // } // if (LoadLevel.GetTimesCompleted() >= 1) // { // optionsF.Add(LoadLevel.GetTimesCompleted().ToString() ); // } if (statsManager.GetPercentageComplete(modeManager.GetMode()) > 0.5f) { optionsF.Add("Thought You Could Handle It?"); optionsF.Add("Bad"); optionsF.Add("Made A Mistake There"); optionsF.Add("Classic"); optionsF.Add("Oh Boo Hoo"); optionsF.Add("Miss The Easy Levels?"); optionsF.Add("It Doesn't Get Better"); optionsF.Add("Shameful"); optionsF.Add("What Happened There?"); optionsF.Add("I Wouldn't Have Done That"); optionsF.Add("One More Try"); optionsF.Add("C'mon"); optionsF.Add("Ouch"); optionsF.Add("Rookie Mistake"); optionsF.Add("Biffed It"); } if (controller.closeCall == true) { int r = Random.Range(0, 4); bool doThis = r == 0 ? true : false; if (doThis) { optionsF.Clear(); } optionsF.Add("So Close!"); optionsF.Add("You Nearly Had It!"); optionsF.Add("AARRGGHH!"); optionsF.Add("AAAAHHHHH!"); optionsF.Add("WHY!"); optionsF.Add("That's Disappointing!"); if (doThis) { return(optionsF[Random.Range(0, optionsF.Count)]); } } // minus because bad streak is negative, might change if (statsManager.GetCurrentStreak() < -9) { float r = Random.Range(0.0f, 1f) - statsManager.GetPercentageComplete(modeManager.GetMode()); bool doThis = r < 0.02f ? true : false; if (doThis) { optionsF.Clear(); } optionsF.Add("Not Doing So Hot"); optionsF.Add("Doing Real Bad Boss"); optionsF.Add("Failure After Failure"); optionsF.Add("Consistently Awful"); optionsF.Add("Turn It Around"); optionsF.Add("Pattern Of Defeat"); optionsF.Add("Can You Break The Cycle?"); optionsF.Add("Surely You Can Do One Of These?"); optionsF.Add(Mathf.Abs(statsManager.GetCurrentStreak()).ToString() + " Failures And Counting"); optionsF.Add(Mathf.Abs(statsManager.GetCurrentStreak()).ToString() + " Failures In A Row!"); // if (statsManager.GetBestBadStreak() == statsManager.GetCurrentBadStreak()) // { // optionsF.Add("Worst Streak Yet!"); // optionsF.Add("Hopeless!"); // } if (doThis) { return(optionsF[Random.Range(0, optionsF.Count)]); } } if (statsManager.GetStreakBreak() == true) { optionsF.Add("Couldn't Last Forever"); optionsF.Add("You Had A Good Run"); optionsF.Add("Win Some Lose Some"); optionsF.Add("You Deserved That"); optionsF.Add("All Good Things End"); optionsF.Add("Rightly So"); optionsF.Add("About Time"); } // if (LoadLevel.GetCurrentLevelBestAttempts() < LoadLevel.GetCurrentLevelCurrentAttempts()) // { // optionsF.Add("No Record For You"); // optionsF.Add("Taken " + Mathf.Abs(LoadLevel.GetLastAttemptsDifference()).ToString() + " More Attempts Already"); // } optionsF.Add(statsManager.GetLastSeconds().ToString("f2") + " Seconds Wasted"); optionsF.Add(statsManager.GetCurrentSeconds(modeManager.GetMode()).ToString("f2") + " Seconds Of Practice..."); optionsF.Add("Current Running Time: " + statsManager.GetCurrentSeconds(modeManager.GetMode()).ToString("f2") + " Seconds"); optionsF.Add("At " + statsManager.GetCurrentSeconds(modeManager.GetMode()).ToString("f2") + " Seconds And Counting"); if (statsManager.GetCurrentSeconds(modeManager.GetMode()) > 3600) { optionsF.Add("It's Been Over An Hour"); } if (statsManager.GetCurrentLevelCurrentSeconds() > 5) { optionsF.Add("That's " + statsManager.GetCurrentLevelCurrentSeconds().ToString("f2") + " Seconds On This Level Alone"); } // optionsF.Add("Double Press Direction To Boost"); // optionsF.Add("Remember To Boost?"); // optionsF.Add("Did You Boost?"); optionsF.Add("Your " + GetNumberSuffix(statsManager.GetCurrentAttempts(modeManager.GetMode()) - statsManager.GetLevelsCompleted(modeManager.GetMode())) + " Failure"); return(optionsF[Random.Range(0, optionsF.Count)]); break; } return("OH NO SOMETHING HAS GONE WRONG?"); }
IEnumerator Transition() { transitioning = true; if (transitionReason == TransitionReason.levelSuccess) { // Tells LoadLevel a level has been completed, and returns whether that was the last level // gameCompleted = LoadLevel.LevelCompleted(); levelManager.LevelCompleted(); gameCompleted = levelManager.CheckForGameOver(); } if (transitionReason == TransitionReason.levelLoad) { // Tells LoadLevel a level has been completed, and returns whether that was the last level // gameCompleted = LoadLevel.LevelCompleted(); // levelManager.LevelCompleted(); gameReset = levelManager.CheckForGameOver(); if (gameReset == true) { // statsManager.ClearModeStats(modeManager.GetMode()); levelManager.ResetModeLevels(); } if (modeManager.GetMode() == Mode.Time && timeChallengeManager.CheckResetNeed() == true) { levelManager.ResetModeLevels(); } if (modeManager.GetMode() == Mode.Lives && livesChallengeManager.CheckResetNeed() == true) { levelManager.ResetModeLevels(); } } if (transitionReason == TransitionReason.levelFailure) { if (modeManager.GetMode() == Mode.OneShot) { gameOver = true; } if (modeManager.GetMode() == Mode.Time && timeChallengeManager.GetTime() <= 0) { gameOver = true; } if (modeManager.GetMode() == Mode.Lives && livesChallengeManager.GetLives() <= 0) { gameOver = true; } } // if (transitionReason == TransitionReason.levelSuccess) // { // // Reset Game if you start to play and levels are all complete // if (LoadLevel.CheckComplete()) // { // LoadLevel.Reset(); // // Debug.Log("R"); // } // } // Debug.Log("About To Start Phase One"); // Debug.Break(); // HANGS AFTER HERE yield return(transitionScreen.StartPhaseOne()); // Debug.Log("Just After Phase One"); // Debug.Break(); transitionText.UpdateText(); string text = transitionText.GetText(); // string text = "Hello There"; MinMax waitTime = new MinMax(0.25f, 1f); MinMax stringLength = new MinMax(8, 30); float lerpValue = Mathf.InverseLerp(stringLength.min, stringLength.max, text.Length); float actualWaitTime = Mathf.Lerp(waitTime.min, waitTime.max, lerpValue); // Debug.Log("Wait Time: " + actualWaitTime); // yield return transitionScreen.StartPhaseOne(); // BUT BEFORE HERE // Debug.Log("About To Start Phase Two"); // Debug.Break(); yield return(transitionScreen.StartPhaseTwo(actualWaitTime)); // if (gameCompleted) // { // levelManager.ClearLevel(); // } yield return(transitionScreen.StartPhaseThree()); if (gameCompleted == false && gameOver == false) { GameStates.ChangeState("Playing"); } else { GameStates.ChangeState("Complete"); } Messenger.Broadcast("StopConstantShake"); // Debug.Log("Transition Done"); // Debug.Log("T Still running y'all"); transitioning = false; yield return(null); }