mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-09 02:45:17 -05:00
small adjustment to nitro and player prefabs
This commit is contained in:
@@ -7,6 +7,7 @@ public class dNitro : MonoBehaviour
|
||||
private PlayerStats playerStats;
|
||||
private CoolDown driver;
|
||||
private bool isOnCoolDown = false;
|
||||
private bool isNitroing = false;
|
||||
//this will need to be set from scritable object or something;
|
||||
private float coolDown;
|
||||
|
||||
@@ -22,7 +23,13 @@ public class dNitro : MonoBehaviour
|
||||
//once cooldowns are implemented, put this on one (a long one)
|
||||
if (Input.GetKeyDown(KeyCode.LeftShift) && isOnCoolDown == false && playerStats.HasNitro)
|
||||
{
|
||||
playerStats.CurVel = playerStats.MaxVel;
|
||||
if(playerStats.CurVel < playerStats.HardCapMaxVel){
|
||||
playerStats.CurVel += playerStats.Acc * 10;
|
||||
}
|
||||
else if(playerStats.CurVel > playerStats.HardCapMaxVel){
|
||||
playerStats.CurVel = playerStats.HardCapMaxVel;
|
||||
}
|
||||
|
||||
StartCoroutine(startCoolDown());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public class dWallRun : NetworkBehaviour
|
||||
public float wallBouncing = 3;
|
||||
public float cameraTransitionDuration = 1;
|
||||
|
||||
public float wallGravityDownForce = 5f;
|
||||
public float wallGravityDownForce = 2.8f;
|
||||
|
||||
[Space]
|
||||
dPlayerMovement playerMovementController;
|
||||
|
||||
@@ -254,10 +254,15 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
return pStats.CurVel;
|
||||
}
|
||||
//If the players speed is above or equal to max speed set speed to max
|
||||
else
|
||||
else if (pStats.CurVel >= pStats.MaxVel)
|
||||
{
|
||||
pStats.CurVel = pStats.MaxVel;
|
||||
return pStats.CurVel;
|
||||
|
||||
}
|
||||
else{
|
||||
Debug.Log("Something has gone wrong with the PlayerSpeed()");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +291,7 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
if (Input.GetAxis("Jump") != 0 && !jumpHeld && curJumpNum < pStats.JumpNum && !isSliding)
|
||||
{
|
||||
if(wallRun.IsWallRunning()){
|
||||
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 8f);
|
||||
AddImpact((wallRun.GetWallJumpDirection()), pStats.JumpPow * 8.5f);
|
||||
g = pStats.JumpPow;
|
||||
curJumpNum = 0;
|
||||
}
|
||||
@@ -432,7 +437,7 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
|
||||
//if wallrunning apply different gravity
|
||||
if(wallRun.IsWallRunning()){
|
||||
GravityCalculation(4);
|
||||
GravityCalculation(2);
|
||||
}
|
||||
|
||||
//Normal gravity if not wallrunning
|
||||
@@ -504,6 +509,7 @@ public class dPlayerMovement : NetworkBehaviour
|
||||
|
||||
//Ragdoll Functions
|
||||
public void GetHit(Vector3 dir, float force){
|
||||
//if (!IsLocalPlayer) { return; }
|
||||
if(firstHit == false){
|
||||
EnableRagdoll();
|
||||
dir.Normalize();
|
||||
|
||||
Reference in New Issue
Block a user