Changed Player Stats and altered kick hit box

This commit is contained in:
Melbyj1125
2021-12-13 13:06:47 -06:00
parent e8710ba6d9
commit 3c3708f869
19 changed files with 217 additions and 122 deletions

View File

@@ -16,15 +16,32 @@ public class Dash : NetworkBehaviour {
float dashSpeed = 12;
CharacterController characterController;
PlayerMovement pMove;
void Start(){
characterController = this.gameObject.GetComponent<CharacterController>();
characterController = GetComponent<CharacterController>();
pMove = GetComponent<PlayerMovement>();
}
//UPDATE CHECK FOR MOVEMENT ONLY WHEN DASHING
void FixedUpdate(){
if (!IsLocalPlayer) { return; }
if(pMove.pStats.HasDash){
DashMovement();
}
}
private IEnumerator startCoolDown(){
Debug.Log("start corotine");
isOnCoolDown = true;
//driver.startUICooldown("Nitro");
yield return new WaitForSeconds(dashItem.cooldownM);
isOnCoolDown = false;
Debug.Log("end corotine");
}
private void DashMovement(){
if (Input.GetKeyDown(KeyCode.E) && isOnCoolDown == false)
{
currentDashTime = 0;
@@ -43,13 +60,4 @@ public class Dash : NetworkBehaviour {
characterController.Move(moveDirection * Time.deltaTime * dashSpeed);
}
private IEnumerator startCoolDown(){
Debug.Log("start corotine");
isOnCoolDown = true;
//driver.startUICooldown("Nitro");
yield return new WaitForSeconds(dashItem.cooldownM);
isOnCoolDown = false;
Debug.Log("end corotine");
}
}

View File

@@ -33,23 +33,24 @@ public class GrapplingHook : NetworkBehaviour
void Update()
{
if (!IsLocalPlayer) { return; }
if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) //If grapple button is hit
{
if (!isGrappled) //If we are not grappling
if(pStats.HasGrapple){
if (Input.GetKeyDown(KeyCode.E) || Input.GetKeyDown(KeyCode.JoystickButton2)) //If grapple button is hit
{
hookPointIndex = FindHookPoint(); //Find the nearest hook point within max distance
if (hookPointIndex != -1) //If there is a hookpoint
if (!isGrappled) //If we are not grappling
{
hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from
ropeLength = Vector3.Distance(gameObject.transform.position, hookPoint.transform.position) + 0.5f;
isGrappled = true; //toggle grappling state
hookPointIndex = FindHookPoint(); //Find the nearest hook point within max distance
if (hookPointIndex != -1) //If there is a hookpoint
{
hookPoint = hookPoints[hookPointIndex]; //The point we are grappling from
ropeLength = Vector3.Distance(gameObject.transform.position, hookPoint.transform.position) + 0.5f;
isGrappled = true; //toggle grappling state
}
}
else //Else we are grappling
{
//physics tear down?
isGrappled = false; //toggle grappling state to release
}
}
else //Else we are grappling
{
//physics tear down?
isGrappled = false; //toggle grappling state to release
}
}
}