aaaaaaaaaaaaaaa

This commit is contained in:
Vladdie
2022-05-02 10:54:07 -05:00
parent 1b84ca68e1
commit cbaecc839c
9 changed files with 193 additions and 14 deletions

View File

@@ -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){

View File

@@ -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();
}
}