diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/DebugIncapacitated/dMoveRagdollState.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/DebugIncapacitated/dMoveRagdollState.cs index 725dcaa..17d3cb1 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/DebugIncapacitated/dMoveRagdollState.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/DebugIncapacitated/dMoveRagdollState.cs @@ -24,7 +24,7 @@ public class dMoveRagdollState : dMoveBaseState public override void ExitState(dMoveStateManager mSM, dMoveBaseState nextState){ - mSM.pStats.GravVel = 60; // resets gravVel + mSM.pStats.GravVel = 80; // resets gravVel mSM.capCol.enabled = false; // disable capsule collider mSM.moveController.enabled = true; // enable move controller mSM.rB.isKinematic = true; // enable kinematic diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/dMoveStateManager.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/dMoveStateManager.cs index dccd453..33f05aa 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/dMoveStateManager.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugMoveState/dMoveStateManager.cs @@ -119,7 +119,6 @@ public class dMoveStateManager : NetworkBehaviour pStats.CurTraction = pStats.Traction; pStats.CurAcc = pStats.Acc; - pStats.SetWeather(PlayerStats.Weather.Wind, new Vector3(1,0,0)); } // Update is called once per frame diff --git a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs index f2d9ebb..c0caaf4 100644 --- a/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs +++ b/Assets/Scripts/PlayerScripts/DebugStateMachine/DebugOffenseState/dOffenseStateManager.cs @@ -102,7 +102,7 @@ public class dOffenseStateManager : NetworkBehaviour //Collision checker for the leg private void OnCollisionEnter(Collision collision) { - if (!IsLocalPlayer) { return; } + //if (!IsLocalPlayer) { return; } Collider myCollider = collision.contacts[0].thisCollider; if (collision.transform.CompareTag("kickable") && myCollider == legHitbox.GetComponent()){ if(collision.gameObject.GetComponent().isKinematic == true){ @@ -115,5 +115,10 @@ public class dOffenseStateManager : NetworkBehaviour if (collision.transform.CompareTag("destroyable") && myCollider == legHitbox.GetComponent()){ collision.transform.gameObject.GetComponent().damage(pStats.KickPow); } + + // if(collision.transform.CompareTag("ArcherTarget") && myCollider == legHitbox.GetComponent()){ + // Vector3 direction = this.transform.forward; + // collision.gameObject.GetComponent().GetHit(this.transform.forward, 10); + // } } } diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/MovementState/Incapacitated/MoveRagdollState.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/MovementState/Incapacitated/MoveRagdollState.cs index 971b04a..0f932fe 100644 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/MovementState/Incapacitated/MoveRagdollState.cs +++ b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/MovementState/Incapacitated/MoveRagdollState.cs @@ -24,7 +24,7 @@ public class MoveRagdollState : MoveBaseState public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){ - mSM.pStats.GravVel = 60; // resets gravVel + mSM.pStats.GravVel = 80; // resets gravVel mSM.capCol.enabled = false; // disable capsule collider mSM.moveController.enabled = true; // enable move controller mSM.rB.isKinematic = true; // enable kinematic diff --git a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs index c5df95a..6c27175 100644 --- a/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs +++ b/Assets/Scripts/PlayerScripts/NetworkedStateMachines/OffenseState/OffenseStateManager.cs @@ -114,6 +114,12 @@ public class OffenseStateManager : NetworkBehaviour ApplyKickServerRPC(direction, netObjID); } + if(collision.transform.CompareTag("ArcherTarget") && myCollider == legHitbox.GetComponent()){ + Vector3 direction = this.transform.forward; + ulong netObjID = collision.gameObject.GetComponent().NetworkObjectId; + ApplyKickServerRPC(direction, netObjID); + } + if (collision.transform.CompareTag("destroyable") && myCollider == legHitbox.GetComponent()){ collision.transform.gameObject.GetComponent().damage(pStats.KickPow); } @@ -122,6 +128,7 @@ public class OffenseStateManager : NetworkBehaviour [ServerRpc(RequireOwnership = false)] private void ApplyKickServerRPC(Vector3 direction, ulong netObjId) { GameObject[] kickables = GameObject.FindGameObjectsWithTag("kickable"); + GameObject[] players = GameObject.FindGameObjectsWithTag("ArcherTarget"); foreach (GameObject kickedItem in kickables) { // First check to make sure this is the item we kicked @@ -138,5 +145,14 @@ public class OffenseStateManager : NetworkBehaviour return; } } + + foreach(GameObject kickedPlayer in players){ + //First check if the player is kicked + if(kickedPlayer.transform.root.GetComponent() != null && kickedPlayer.transform.root.GetComponent().NetworkObjectId == netObjId && kickedPlayer.transform.root.GetComponent().NetworkObjectId != this.transform.root.GetComponent().NetworkObjectId){ + kickedPlayer.GetComponent().GetHit(direction, 10); + } + + return; + } } } diff --git a/Assets/Scripts/UI/PauseMenu.cs b/Assets/Scripts/UI/PauseMenu.cs index 2b7166d..df42497 100644 --- a/Assets/Scripts/UI/PauseMenu.cs +++ b/Assets/Scripts/UI/PauseMenu.cs @@ -68,6 +68,11 @@ public class PauseMenu : NetworkBehaviour { // Have to use if checks since only the runners have these if (player.GetComponentInChildren() != null) { player.GetComponentInChildren().IsPaused = !newState; + + // Lock the cursor + if(newState){ + Cursor.lockState = CursorLockMode.Locked; + } } // King's Movement @@ -82,9 +87,6 @@ public class PauseMenu : NetworkBehaviour { // Unlock player controls setPlayerControlsStateServerRPC(true); - // Lock the cursor - Cursor.lockState = CursorLockMode.Locked; - // Hide PauseMenu PauseMenuPanel.SetActive(false); }