diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffenseAirPunchState.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffenseAirPunchState.cs deleted file mode 100644 index a1ba322..0000000 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffenseAirPunchState.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class dOffenseAirPunchState : dOffenseBaseState -{ - - private float legRotation = 0; // angle for leg rotation - bool kicked = false; // whether they have kicked or not - - public override void EnterState(dOffenseStateManager oSM, dOffenseBaseState previousState){ - - oSM.leg.SetActive(true); // activate leg - legRotation = -90; - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); // rotate leg - kicked = false; // haven't kicked - - //start kicking routine - oSM.StartCoroutine(kicking(8f)); - } - - public override void ExitState(dOffenseStateManager oSM, dOffenseBaseState nextState){ - legRotation = 0; // reset leg angle - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); // rotate leg - oSM.leg.SetActive(false); // reset leg angle - } - - public override void UpdateState(dOffenseStateManager oSM){ - - //if incapacitated then cooldown - if((oSM.mSM.currentState == oSM.mSM.RagdollState || oSM.mSM.currentState == oSM.mSM.SlideState || oSM.mSM.currentState == oSM.mSM.CrouchState || oSM.mSM.currentState == oSM.mSM.CrouchWalkState) || (oSM.aSM.currentState == oSM.aSM.WallRunState || oSM.aSM.currentState == oSM.aSM.WallIdleState || oSM.aSM.currentState == oSM.aSM.GrappleAirState || oSM.aSM.currentState == oSM.aSM.GrappleGroundedState)){ - oSM.SwitchState(oSM.CooldownState); - } - - //if kicked or grounded then cooldown - if(kicked || (oSM.aSM.currentState == oSM.aSM.GroundedState)){ - oSM.SwitchState(oSM.CooldownState); - } - } - - public override void FixedUpdateState(dOffenseStateManager oSM){ - - //jitter player upwards because of a weird issue with collider - oSM.moveController.Move(new Vector3(0,.002f,0)); - } - - //kicking timer - private IEnumerator kicking(float waitTime){ - yield return new WaitForSeconds(waitTime); - kicked = true; - } -} diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffenseAirPunchState.cs.meta b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffenseAirPunchState.cs.meta deleted file mode 100644 index f171d57..0000000 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffenseAirPunchState.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 639f429564de9864292274ce4630d8b8 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffensePunchState.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffensePunchState.cs deleted file mode 100644 index 7d7799a..0000000 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffensePunchState.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class dOffensePunchState : dOffenseBaseState -{ - - float legRotation = 0; // angle for leg rotation - bool kicked = false; // whether they have kicked or not - - - public override void EnterState(dOffenseStateManager oSM, dOffenseBaseState previousState){ - - oSM.leg.SetActive(true); // activate leg - kicked = false; // haven't kicked - - //start kicking routine - oSM.StartCoroutine(kicking(1f)); - } - - public override void ExitState(dOffenseStateManager oSM, dOffenseBaseState nextState){ - legRotation = 0; // reset leg angle - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); // rotate leg - oSM.leg.SetActive(false); // deactivate leg - } - - public override void UpdateState(dOffenseStateManager oSM){ - - //if incapacitated then cooldown - if((oSM.mSM.currentState == oSM.mSM.RagdollState || oSM.mSM.currentState == oSM.mSM.SlideState || oSM.mSM.currentState == oSM.mSM.CrouchState || oSM.mSM.currentState == oSM.mSM.CrouchWalkState) || (oSM.aSM.currentState == oSM.aSM.WallRunState || oSM.aSM.currentState == oSM.aSM.WallIdleState || oSM.aSM.currentState == oSM.aSM.GrappleAirState || oSM.aSM.currentState == oSM.aSM.GrappleGroundedState)){ - oSM.SwitchState(oSM.CooldownState); - } - - //if kicked then cooldown - if(kicked){ - oSM.SwitchState(oSM.CooldownState); - } - } - - public override void FixedUpdateState(dOffenseStateManager oSM){ - - //if leg isn't fully extended rotate it - if(legRotation > -90){ - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); - legRotation -= 20; - } - else{ - legRotation = -90; - } - - //jitter player upwards because of a weird issue with collider - oSM.moveController.Move(new Vector3(0,.002f,0)); - } - - //kicking timer - private IEnumerator kicking(float waitTime){ - yield return new WaitForSeconds(waitTime); - kicked = true; - } -} diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffensePunchState.cs.meta b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffensePunchState.cs.meta deleted file mode 100644 index d5a5cda..0000000 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugKick&Punch/dOffensePunchState.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 190b69b70a6fd684aabaee22d13b1d41 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugOffense/dOffenseNoneState.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugOffense/dOffenseNoneState.cs index a6c9f7e..9fd35ed 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugOffense/dOffenseNoneState.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/DebugOffense/dOffenseNoneState.cs @@ -21,31 +21,14 @@ public class dOffenseNoneState : dOffenseBaseState //if grounded then grounded kick states else if(oSM.aSM.currentState == oSM.aSM.GroundedState && (Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && !oSM.pStats.IsPaused){ - - //if power is above 300 then punch - if(oSM.pStats.KickPow > 300){ - oSM.SwitchState(oSM.PunchState); - } - - //otherwise kick - else{ - oSM.SwitchState(oSM.KickState); - } - + // kick + oSM.SwitchState(oSM.KickState); } //if in the air else if((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && !oSM.pStats.IsPaused){ - - //if power is above 300 air punch - if(oSM.pStats.KickPow > 300){ - oSM.SwitchState(oSM.AirPunchState); - } - - //otherwise air kick - else{ - oSM.SwitchState(oSM.AirKickState); - } + //air kick + oSM.SwitchState(oSM.AirKickState); } } diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs index 7c632c2..6dfca63 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs @@ -18,8 +18,6 @@ public class dOffenseStateManager : NetworkBehaviour //Kick&Punch States public dOffenseKickState KickState = new dOffenseKickState(); public dOffenseAirKickState AirKickState = new dOffenseAirKickState(); - public dOffensePunchState PunchState = new dOffensePunchState(); - public dOffenseAirPunchState AirPunchState = new dOffenseAirPunchState(); //// ////Objects Sections diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffenseAirPunchState.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffenseAirPunchState.cs deleted file mode 100644 index 62671b2..0000000 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffenseAirPunchState.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class OffenseAirPunchState : OffenseBaseState -{ - - private float legRotation = 0; // angle for leg rotation - bool kicked = false; // whether they have kicked or not - - public override void EnterState(OffenseStateManager oSM, OffenseBaseState previousState){ - - oSM.leg.SetActive(true); // activate leg - legRotation = -90; - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); // rotate leg - kicked = false; // haven't kicked - - //start kicking routine - oSM.StartCoroutine(kicking(8f)); - } - - public override void ExitState(OffenseStateManager oSM, OffenseBaseState nextState){ - legRotation = 0; // reset leg angle - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); // rotate leg - oSM.leg.SetActive(false); // reset leg angle - } - - public override void UpdateState(OffenseStateManager oSM){ - - //if incapacitated then cooldown - if((oSM.mSM.currentState == oSM.mSM.RagdollState || oSM.mSM.currentState == oSM.mSM.SlideState || oSM.mSM.currentState == oSM.mSM.CrouchState || oSM.mSM.currentState == oSM.mSM.CrouchWalkState) || (oSM.aSM.currentState == oSM.aSM.WallRunState || oSM.aSM.currentState == oSM.aSM.WallIdleState || oSM.aSM.currentState == oSM.aSM.GrappleAirState || oSM.aSM.currentState == oSM.aSM.GrappleGroundedState)){ - oSM.SwitchState(oSM.CooldownState); - } - - //if kicked or grounded then cooldown - if(kicked || (oSM.aSM.currentState == oSM.aSM.GroundedState)){ - oSM.SwitchState(oSM.CooldownState); - } - } - - public override void FixedUpdateState(OffenseStateManager oSM){ - - //jitter player upwards because of a weird issue with collider - oSM.moveController.Move(new Vector3(0,.002f,0)); - } - - //kicking timer - private IEnumerator kicking(float waitTime){ - yield return new WaitForSeconds(waitTime); - kicked = true; - } -} diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffenseAirPunchState.cs.meta b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffenseAirPunchState.cs.meta deleted file mode 100644 index 8941f53..0000000 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffenseAirPunchState.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 3f00bc672381c3a44b010d905fabe9a0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffensePunchState.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffensePunchState.cs deleted file mode 100644 index fcb4bba..0000000 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffensePunchState.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class OffensePunchState : OffenseBaseState -{ - - float legRotation = 0; // angle for leg rotation - bool kicked = false; // whether they have kicked or not - - - public override void EnterState(OffenseStateManager oSM, OffenseBaseState previousState){ - - oSM.leg.SetActive(true); // activate leg - kicked = false; // haven't kicked - - //start kicking routine - oSM.StartCoroutine(kicking(1f)); - } - - public override void ExitState(OffenseStateManager oSM, OffenseBaseState nextState){ - legRotation = 0; // reset leg angle - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); // rotate leg - oSM.leg.SetActive(false); // deactivate leg - } - - public override void UpdateState(OffenseStateManager oSM){ - - //if incapacitated then cooldown - if((oSM.mSM.currentState == oSM.mSM.RagdollState || oSM.mSM.currentState == oSM.mSM.SlideState || oSM.mSM.currentState == oSM.mSM.CrouchState || oSM.mSM.currentState == oSM.mSM.CrouchWalkState) || (oSM.aSM.currentState == oSM.aSM.WallRunState || oSM.aSM.currentState == oSM.aSM.WallIdleState || oSM.aSM.currentState == oSM.aSM.GrappleAirState || oSM.aSM.currentState == oSM.aSM.GrappleGroundedState)){ - oSM.SwitchState(oSM.CooldownState); - } - - //if kicked then cooldown - if(kicked){ - oSM.SwitchState(oSM.CooldownState); - } - } - - public override void FixedUpdateState(OffenseStateManager oSM){ - - //if leg isn't fully extended rotate it - if(legRotation > -90){ - oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); - legRotation -= 20; - } - else{ - legRotation = -90; - } - - //jitter player upwards because of a weird issue with collider - oSM.moveController.Move(new Vector3(0,.002f,0)); - } - - //kicking timer - private IEnumerator kicking(float waitTime){ - yield return new WaitForSeconds(waitTime); - kicked = true; - } -} diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffensePunchState.cs.meta b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffensePunchState.cs.meta deleted file mode 100644 index c063943..0000000 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Kick&Punch/OffensePunchState.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 994ebfe06000a58488b76579ebf2c4dc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Offense/OffenseNoneState.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Offense/OffenseNoneState.cs index 1d8a030..ec9e593 100644 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Offense/OffenseNoneState.cs +++ b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/Offense/OffenseNoneState.cs @@ -21,30 +21,13 @@ public class OffenseNoneState : OffenseBaseState //if grounded then grounded kick states else if(oSM.aSM.currentState == oSM.aSM.GroundedState && (Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && !oSM.pStats.IsPaused){ - - //if power is above 300 then punch - if(oSM.pStats.KickPow > 300){ - oSM.SwitchState(oSM.PunchState); - } - - //otherwise kick - else{ - oSM.SwitchState(oSM.KickState); - } - + //Regular Kick + oSM.SwitchState(oSM.KickState); } //if in the air else if((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && !oSM.pStats.IsPaused){ - //if power is above 300 air punch - if(oSM.pStats.KickPow > 300){ - oSM.SwitchState(oSM.AirPunchState); - } - - //otherwise air kick - else{ - oSM.SwitchState(oSM.AirKickState); - } + oSM.SwitchState(oSM.AirKickState); } } diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs index 5f289d1..5465d94 100644 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs +++ b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs @@ -18,8 +18,6 @@ public class OffenseStateManager : NetworkBehaviour //Kick&Punch States public OffenseKickState KickState = new OffenseKickState(); public OffenseAirKickState AirKickState = new OffenseAirKickState(); - public OffensePunchState PunchState = new OffensePunchState(); - public OffenseAirPunchState AirPunchState = new OffenseAirPunchState(); //// ////Objects Sections