mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-23 19:04:32 -05:00
Updated nitro restoring functionality and buffing
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user