/// <summary> ///Starts the deadlift exercise start phase. /// </summary> public void StartExercise() { timeRemaining = timeMax; sliderFill.color = Color.green; canStartLift = false; currentPhase = CurrentPhaseDeadlift.DeadliftStart; }
/// <summary> ///The deadlift down phase. /// </summary> public void EccentricPhase() { slider.value = CalculateSliderValue(); SubtractTime(); bool inBounds = CheckBound(); if (!CheckTimerEnded()) { currentPhase = CurrentPhaseDeadlift.DeadliftEnded; // Failed to grind through the rep playerAnimationController.TriggerAnimation("deadlift_failed"); FailedAttempt(); } if (sc.Swipe() == SwipeController.Directions.DOWN_SWIPE) { if (!inBounds) { currentPhase = CurrentPhaseDeadlift.DeadliftEnded; FailedAttempt(); return; } currentPhase = CurrentPhaseDeadlift.DeadliftEnded; playerAnimationController.TriggerAnimation("deadlift_down"); SuccessfulAttempt(); } }
/// <summary> ///The concentric phase. /// </summary> public void ConcentricPhase() { slider.value = CalculateSliderValue(); SubtractTime(); bool inBounds = CheckBound(); if (!CheckTimerEnded()) { currentPhase = CurrentPhaseDeadlift.DeadliftEnded; // Failed to break the floor playerAnimationController.TriggerAnimation("deadlift_failed_idle"); FailedAttempt(); } if (sc.Swipe() == SwipeController.Directions.UP_SWIPE || sc.Swipe() == SwipeController.Directions.UP_SWIPE) { if (!inBounds) { currentPhase = CurrentPhaseDeadlift.DeadliftEnded; FailedAttempt(); return; } playerAnimationController.TriggerAnimation("deadlift_breakfloor"); Invoke("StartSticking", 0.5f); } }
/// <summary> ///Starts the deadlift down phase. /// </summary> public void StartEccentric() { playerAnimationController.TriggerAnimation("deadlift_lockout"); speechController.ActivateSpeechBubble("Down!"); timeRemaining = timeMax; currentPhase = CurrentPhaseDeadlift.DeadliftDown; }
/// <summary> ///Called before the first frame. /// </summary> void Start() { InitializeTimer(); sc = new SwipeController(); ResetExercise(); currentPhase = CurrentPhaseDeadlift.DeadliftNone; // DEBUG USE ONLY if (gameData.CurrentAttempt == 0) { gameData.OverrideAttemptsDebug(ExerciseType.Deadlift); gameplayController.OverrideLoad(); } }
/// <summary> ///The deadlift sticking phase. /// </summary> public void StickingPhase() { slider.value = CalculateSliderValue(); UpdateTimeSticking(); if (!CheckTimerEnded()) { currentPhase = CurrentPhaseDeadlift.DeadliftEnded; // Failed to break the floor playerAnimationController.TriggerAnimation("deadlift_failed_idle"); FailedAttempt(); } else if (timeRemaining == timeMax) { Invoke("StartEccentric", 0.5f); } // Detect input rapid tap/click if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Mouse0)) { playerAnimationController.TriggerAnimation("deadlift_sticking"); } }
/// <summary> ///Starts the deadlift sticking phase. /// </summary> public void StartSticking() { timeRemaining = 1f; currentPhase = CurrentPhaseDeadlift.DeadliftSticking; }