diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroCooldownState.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroCooldownState.cs index 4982115..a0f618d 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroCooldownState.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroCooldownState.cs @@ -4,8 +4,12 @@ using UnityEngine; public class NitroCooldownState : NitroBaseState { - public override void EnterState(NitroStateManager nSM, NitroBaseState previousState){ + bool cooldown = false; + + public override void EnterState(NitroStateManager nSM, NitroBaseState previousState){ + cooldown = false; + nSM.StartCoroutine(startCoolDown(nSM)); } public override void ExitState(NitroStateManager nSM, NitroBaseState nextState){ @@ -13,10 +17,21 @@ public class NitroCooldownState : NitroBaseState } public override void UpdateState(NitroStateManager nSM){ - + if(cooldown && (nSM.mSM.currentState == nSM.mSM.RagdollState || nSM.mSM.currentState == nSM.mSM.RecoveringState)){ + nSM.SwitchState(nSM.IncapacitatedState); + } + else if(cooldown){ + nSM.SwitchState(nSM.NoneState); + } } public override void FixedUpdateState(NitroStateManager nSM){ } + + private IEnumerator startCoolDown(NitroStateManager nSM){ + //driver.startUICooldown("Nitro"); + yield return new WaitForSeconds(nSM.nitroItem.cooldownM); + cooldown = true; + } } diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroIncapacitatedState.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroIncapacitatedState.cs index e36fc0e..e27cc49 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroIncapacitatedState.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroIncapacitatedState.cs @@ -13,7 +13,9 @@ public class NitroIncapacitatedState : NitroBaseState } public override void UpdateState(NitroStateManager nSM){ - + if(nSM.mSM.currentState != nSM.mSM.RagdollState && nSM.mSM.currentState != nSM.mSM.RecoveringState){ + nSM.SwitchState(nSM.NoneState); + } } public override void FixedUpdateState(NitroStateManager nSM){ diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNitroingState.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNitroingState.cs index 27b6f6a..226a46f 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNitroingState.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNitroingState.cs @@ -4,16 +4,36 @@ using UnityEngine; public class NitroNitroingState : NitroBaseState { - public override void EnterState(NitroStateManager nSM, NitroBaseState previousState){ + private float tempTimer; + private float actualMaxVel; + private float actualAcc; + + public override void EnterState(NitroStateManager nSM, NitroBaseState previousState){ + actualMaxVel = nSM.pStats.MaxVel; + actualAcc = nSM.pStats.Acc; + nSM.pStats.Acc += nSM.nitroAccBoost; + nSM.pStats.MaxVel += nSM.nitroVelBoost; + + tempTimer = 5; } public override void ExitState(NitroStateManager nSM, NitroBaseState nextState){ - + nSM.pStats.Acc = actualAcc; + nSM.pStats.MaxVel = actualMaxVel; } public override void UpdateState(NitroStateManager nSM){ + if(tempTimer > 0){ + tempTimer -= .02f; + } + else{ + nSM.SwitchState(nSM.CooldownState); + } + if(nSM.mSM.currentState == nSM.mSM.RagdollState){ + nSM.SwitchState(nSM.CooldownState); + } } public override void FixedUpdateState(NitroStateManager nSM){ diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNoneState.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNoneState.cs index dd9c124..ebe2283 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNoneState.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/Nitro/NitroNoneState.cs @@ -13,7 +13,18 @@ public class NitroNoneState : NitroBaseState } public override void UpdateState(NitroStateManager nSM){ + if(nSM.pStats.HasNitro){ + if ((Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.JoystickButton8))) + { + nSM.SwitchState(nSM.NitroingState); + } + + if(nSM.mSM.currentState == nSM.mSM.RagdollState){ + nSM.SwitchState(nSM.IncapacitatedState); + } + } + } public override void FixedUpdateState(NitroStateManager nSM){ diff --git a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/NitroStateManager.cs b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/NitroStateManager.cs index 0d874c7..c80aba6 100644 --- a/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/NitroStateManager.cs +++ b/Assets/Scripts/PlayerScripts/DebugPlayer/DebugStateStuff/NitroState/NitroStateManager.cs @@ -31,6 +31,14 @@ public class NitroStateManager : MonoBehaviour public MoveStateManager mSM; //// + ////Items Section + public SpecialItem nitroItem; + //// + + ////Variables Section + public float nitroVelBoost = 40; + public float nitroAccBoost = .4f; + void Awake(){ ////Initialize Player Components diff --git a/Assets/Scripts/PlayerScripts/PlayerItems/SpecialItem.cs b/Assets/Scripts/PlayerScripts/PlayerItems/SpecialItem.cs index 94cc09f..dfc83fa 100644 --- a/Assets/Scripts/PlayerScripts/PlayerItems/SpecialItem.cs +++ b/Assets/Scripts/PlayerScripts/PlayerItems/SpecialItem.cs @@ -45,9 +45,6 @@ public class SpecialItem : Item if(hasWallrunM != false){ p.HasWallrun = hasWallrunM; } - if(hasBlinkM != false){ - p.HasBlink = hasBlinkM; - } if(hasGrappleM != false){ p.HasGrapple = hasGrappleM; } @@ -93,9 +90,6 @@ public class SpecialItem : Item if(hasWallrunM != false){ p.HasWallrun = false; } - if(hasBlinkM != false){ - p.HasBlink = false; - } if(hasGrappleM != false){ p.HasGrapple = false; } diff --git a/Assets/Scripts/PlayerScripts/PlayerStats.cs b/Assets/Scripts/PlayerScripts/PlayerStats.cs index c4a7f64..6015996 100644 --- a/Assets/Scripts/PlayerScripts/PlayerStats.cs +++ b/Assets/Scripts/PlayerScripts/PlayerStats.cs @@ -89,13 +89,6 @@ public class PlayerStats : MonoBehaviour set{ gravVel = value; } } - //If The Player Has Blink - [SerializeField] private bool hasBlink = false; - public bool HasBlink{ - get{ return hasBlink; } - set{ hasBlink = value; } - } - //If The Player Has Glider [SerializeField] private bool hasGlider = false; public bool HasGlider{ diff --git a/Assets/Scripts/SetInvScene/InvSceneSettings.cs b/Assets/Scripts/SetInvScene/InvSceneSettings.cs index 862cc9e..6f627aa 100644 --- a/Assets/Scripts/SetInvScene/InvSceneSettings.cs +++ b/Assets/Scripts/SetInvScene/InvSceneSettings.cs @@ -109,8 +109,6 @@ public class InvSceneSettings : MonoBehaviour //Enables Script on player //NEEDS TO BE CLEANED UP AND IMPROVED public void itemToEnable(){ - if(pStats.HasBlink != player1.GetComponent().enabled) - player1.GetComponent().enabled = pStats.HasBlink; if(pStats.HasDash != player1.GetComponent().enabled) player1.GetComponent().enabled = pStats.HasDash; if(pStats.HasWallrun != player1.GetComponent().enabled)