public static void ShowPositionInfo() { UI.SeinUI.ShowUI = true; SeinUI.DebugHideUI = false; PracticeManager.ShowMessage("Start Position: " + PracticeManager.StartPosition.ToString() + "\nEnd Position: " + PracticeManager.EndPosition.ToString() + " " + PracticeManager.EndType.ToString() + "\nCurrent Position: " + new Vector2(Characters.Sein.Position.x, Characters.Sein.Position.y).ToString()); }
public static void SetEnd(int type) { PracticeManager.ResetValues(); PracticeManager.EndPosition = new Vector2(Characters.Sein.Position.x, Characters.Sein.Position.y); PracticeManager.EndType = type; PracticeManager.SetEndReadable(); PracticeManager.WriteFile(); PracticeManager.ShowMessage("End set: " + PracticeManager.EndPosition.ToString() + " " + PracticeManager.EndReadable); }
public static void ShowFrameInfo() { UI.SeinUI.ShowUI = true; SeinUI.DebugHideUI = false; PracticeManager.ShowMessage("Frames: " + PracticeManager.FrameCount.ToString() + " Session Best: " + PracticeManager.FrameCountSession.ToString() + " Overall: " + PracticeManager.FrameCountAll.ToString() + "\nExtra: " + PracticeManager.ExtraFrames.ToString() + " Lag: " + PracticeManager.LagFrames.ToString() + " Dropped: " + PracticeManager.DroppedFrames.ToString() + " Max Delta: " + (((float)PracticeManager.MaxDelta + 166667L) / 10000f).ToString() + "ms"); }
public static void SetStart() { PracticeManager.ResetValues(); PracticeManager.StartPosition = new Vector2(Characters.Sein.Position.x, Characters.Sein.Position.y); int slot = SaveSlotsManager.CurrentSlotIndex; SaveSlotsManager.CurrentSlotIndex = 49; SaveSlotsManager.BackupIndex = -1; GameController.Instance.CreateCheckpoint(); GameController.Instance.SaveGameController.PerformSave(); SaveSlotsManager.CurrentSlotIndex = slot; PracticeManager.WriteFile(); PracticeManager.ShowMessage("Start set: " + PracticeManager.StartPosition.ToString(), 5f); }
public static void QueueStart() { int currentSlotIndex = SaveSlotsManager.CurrentSlotIndex; SaveSlotsManager.CurrentSlotIndex = 49; SaveSlotsManager.BackupIndex = -1; GameController.Instance.SaveGameController.PerformLoad(); SaveSlotsManager.CurrentSlotIndex = currentSlotIndex; if (Characters.Sein) { Characters.Sein.Position = PracticeManager.StartPosition; Characters.Sein.Mortality.DamageReciever.IsImmortal = true; UI.Cameras.Current.MoveToTargetCharacter(0f); } PracticeManager.ShowMessage("Ready...", 5f); PracticeManager.Countdown = 60; PracticeManager.ResetStats(); }
public static void ParseSessionFile() { if (!File.Exists("PracticeSession.txt")) { PracticeManager.WriteFile(); } try { string[] lines = File.ReadAllLines("PracticeSession.txt"); string[] start = lines[0].Split(':')[1].Split(','); PracticeManager.StartPosition = new Vector2(float.Parse(start[0]), float.Parse(start[1])); string[] end = lines[1].Split(':')[1].Split(','); PracticeManager.EndPosition = new Vector2(float.Parse(end[0]), float.Parse(end[1])); PracticeManager.EndType = int.Parse(end[2]); PracticeManager.SetEndReadable(); string[] best = lines[2].Split(':'); PracticeManager.FrameCountAll = int.Parse(best[1]); } catch (Exception) { PracticeManager.ShowMessage("Error parsing session file"); } }
public static void Start() { int currentSlotIndex = SaveSlotsManager.CurrentSlotIndex; SaveSlotsManager.CurrentSlotIndex = 49; SaveSlotsManager.BackupIndex = -1; GameController.Instance.SaveGameController.PerformLoad(); SaveSlotsManager.CurrentSlotIndex = currentSlotIndex; if (Characters.Sein) { Characters.Sein.Position = PracticeManager.StartPosition; Characters.Sein.Mortality.DamageReciever.IsImmortal = false; UI.Cameras.Current.MoveToTargetCharacter(0f); } PracticeManager.ShowMessage("$GO$", 1f); PracticeManager.Running = true; PracticeManager.FrameCount = -1; PracticeManager.ExtraTicks = 0L; PracticeManager.ExtraFrames = 0; PracticeManager.LagFrames = 0; PracticeManager.MaxDelta = 0L; PracticeManager.DroppedFrames = 0; }
public static void Update() { PracticeManager.UpdateMessages(); long currentTicks = DateTime.Now.Ticks; long tickDelta = currentTicks - PracticeManager.LastTick - 166667L; PracticeManager.LastTick = currentTicks; if (PracticeManager.Countdown >= 0) { PracticeManager.Countdown--; if (Characters.Sein) { Characters.Sein.Position = PracticeManager.StartPosition; } if (PracticeManager.Countdown == 0) { PracticeManager.Start(); } } if (PracticeManager.Running) { if (PracticeManager.FrameCount == 1) { foreach (Core.Input.InputButtonProcessor button in Core.Input.Buttons) { if (button != Core.Input.AnyStart) { button.IsPressed = false; button.WasPressed = false; } } } PracticeManager.ExtraTicks -= tickDelta; if (PracticeManager.ExtraTicks > 166667L) { PracticeManager.ExtraFrames += 1; PracticeManager.ExtraTicks -= 166667L; } if (PracticeManager.ExtraTicks < -166667L) { PracticeManager.LagFrames += 1; PracticeManager.ExtraTicks += 166667L; } if (tickDelta > 166667L) { PracticeManager.DroppedFrames += (int)(tickDelta / 166667L); } PracticeManager.MaxDelta = Math.Max(PracticeManager.MaxDelta, tickDelta); PracticeManager.FrameCount++; PracticeManager.CheckEnd(); } if (MoonInput.GetKey(KeyCode.LeftAlt) || MoonInput.GetKey(KeyCode.RightAlt)) { if (MoonInput.GetKeyDown(KeyCode.Keypad5) || MoonInput.GetKeyDown(KeyCode.Semicolon)) { PracticeManager.SetStart(); } if (MoonInput.GetKeyDown(KeyCode.R)) { PracticeManager.QueueStart(); } if (MoonInput.GetKeyDown(KeyCode.K)) { PracticeManager.Initialize(); } if (MoonInput.GetKeyDown(KeyCode.I)) { PracticeManager.ShowPositionInfo(); } if (MoonInput.GetKeyDown(KeyCode.T)) { PracticeManager.MessageInQueue = 2; } if (MoonInput.GetKeyDown(KeyCode.E)) { PracticeManager.ShowMessage(PracticeManager.GenerateEfficiencyStats()); } if (MoonInput.GetKeyDown(KeyCode.Keypad1) || MoonInput.GetKeyDown(KeyCode.Comma)) { PracticeManager.SetEnd(1); } if (MoonInput.GetKeyDown(KeyCode.Keypad2) || MoonInput.GetKeyDown(KeyCode.Period)) { PracticeManager.SetEnd(2); } if (MoonInput.GetKeyDown(KeyCode.Keypad3) || MoonInput.GetKeyDown(KeyCode.Slash)) { PracticeManager.SetEnd(3); } if (MoonInput.GetKeyDown(KeyCode.Keypad4) || MoonInput.GetKeyDown(KeyCode.L)) { PracticeManager.SetEnd(4); } if (MoonInput.GetKeyDown(KeyCode.Keypad6) || MoonInput.GetKeyDown(KeyCode.Quote)) { PracticeManager.SetEnd(6); } if (MoonInput.GetKeyDown(KeyCode.Keypad7) || MoonInput.GetKeyDown(KeyCode.P)) { PracticeManager.SetEnd(7); } if (MoonInput.GetKeyDown(KeyCode.Keypad8) || MoonInput.GetKeyDown(KeyCode.LeftBracket)) { PracticeManager.SetEnd(8); } if (MoonInput.GetKeyDown(KeyCode.Keypad9) || MoonInput.GetKeyDown(KeyCode.RightBracket)) { PracticeManager.SetEnd(9); } } }