/// <summary> /// Makes bad stuff happen /// </summary> /// <param name="BadStuffCategories">The categories of which bad stuff happens - "Typing", "Targeting", or "Moving"</param> public void BadStuffHappens(params string[] BadStuffCategories) { if (HitPoints <= 0) { return; } var chosenCategory = new System.Random().Next(0, BadStuffCategories.Length); switch (BadStuffCategories[chosenCategory]) { case "Targeting": Reticle.BadStuffHappens(); break; case "Typing": GameManager.AlphabetManager.BadStuffHappens(); Debug.Log("Make bad stuff happen to typing."); break; case "Moving": if (lastBadStuffTime < Time.time - 0.1f) // For some reason, this fires like, 3 times at once { playerSpeedModifiers.Enqueue(Time.time + slowdownDuration); lastBadStuffTime = Time.time; Debug.Log("Player slowdowns: " + playerSpeedModifiers.Count); ChangeColor(); } break; default: Debug.Log("Bad stuff happened while making bad stuff happen. Or just lose HP."); break; } }