mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-28 13:24:07 -05:00
aaaaaaaaaaaaaaa
This commit is contained in:
@@ -7,6 +7,7 @@ public class NitroNitroingState : NitroBaseState
|
||||
|
||||
private float tempTimer; // temporary timer
|
||||
private float actualMaxVel; // actual max velocity
|
||||
public AudioSource nitroSound;
|
||||
|
||||
public override void EnterState(NitroStateManager nSM, NitroBaseState previousState){
|
||||
actualMaxVel = nSM.pStats.MaxVel; // saves previous max velocity
|
||||
@@ -14,12 +15,16 @@ public class NitroNitroingState : NitroBaseState
|
||||
nSM.pStats.CurAcc += nSM.nitroAccBoost; // increases acceleration
|
||||
nSM.pStats.MaxVel += nSM.nitroVelBoost; // increases max velocity
|
||||
|
||||
|
||||
nSM.isNitroing = true;
|
||||
tempTimer = 5; // how long we will be sped up
|
||||
|
||||
}
|
||||
|
||||
public override void ExitState(NitroStateManager nSM, NitroBaseState nextState){
|
||||
nSM.pStats.CurAcc = nSM.pStats.Acc; // reset acceleration
|
||||
nSM.pStats.MaxVel = actualMaxVel; // reset maximum velocity
|
||||
nSM.isNitroing = false;
|
||||
}
|
||||
|
||||
public override void UpdateState(NitroStateManager nSM){
|
||||
|
||||
@@ -44,6 +44,7 @@ public class NitroStateManager : NetworkBehaviour
|
||||
public float nitroAccBoost = .4f;
|
||||
|
||||
public AudioSource boostSound;
|
||||
public bool isNitroing = false;
|
||||
|
||||
void Awake(){
|
||||
|
||||
@@ -104,5 +105,6 @@ public class NitroStateManager : NetworkBehaviour
|
||||
currentState = state;
|
||||
animationManager.updateCurrentPriority();
|
||||
currentState.EnterState(this, previousState);
|
||||
boostSound.Play();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user