Updated nitro restoring functionality and buffing

This commit is contained in:
Melbyj1125
2022-02-01 21:07:45 -06:00
parent c5ae603e8f
commit bf874ddc84
10 changed files with 224 additions and 58 deletions

View File

@@ -94,6 +94,9 @@ public class dPlayerMovement : NetworkBehaviour
//Grapple
private dGrapplingHook grapple;
//Nitro
private dNitro nitro;
//Animation controller
@@ -114,6 +117,7 @@ public class dPlayerMovement : NetworkBehaviour
wallRun = GetComponent<dWallRun>(); //Wallrun
blink = GetComponent<dBlink>(); //Blink
grapple = GetComponent<dGrapplingHook>();
nitro = GetComponent<dNitro>();
//Get parents up direction
up = GetComponentInParent<Transform>().up;
@@ -255,12 +259,15 @@ public class dPlayerMovement : NetworkBehaviour
return pStats.CurVel;
}
//If the players speed is above or equal to max speed set speed to max
else if (pStats.CurVel >= pStats.MaxVel)
else if (pStats.CurVel >= pStats.MaxVel && nitro.isNitroing == false)
{
pStats.CurVel = pStats.MaxVel;
return pStats.CurVel;
}
else if(nitro.isNitroing){
return pStats.CurVel;
}
else{
Debug.Log("Something has gone wrong with the PlayerSpeed()");
return -1;