public float MaxSpeedBoost; //the maximum amount we can speed up by /// Uses the status effect public override void StartStatusEffect(PlayerParameters player) { Debug.Log("<color=cyan>Using </color>" + StatusEffectName.ToString() + " on " + player.name + "!"); if (SpeedBoost < MinSpeedBoost || SpeedBoost > MaxSpeedBoost || SpeedBoost == 0) { Debug.Log("<color=red><b>SpeedBoost is not within acceptable range. Setting to halfway point.</b></color>"); SpeedBoost = (MinSpeedBoost + MaxSpeedBoost) / 2; } player.ApplyStatusEffect(this); player.GetComponent <PlayerMovement> ().SpeedUp(SpeedBoost, Duration); }
public float MaxTimeChange = 10.0f; //the maximum amount we can speed up by /// Uses the status effect public override void StartStatusEffect(PlayerParameters player) { Debug.Log("<color=cyan>Using </color>" + StatusEffectName.ToString() + " on " + player.name + "!"); if (TimeChange < MinTimeChange || TimeChange > MaxTimeChange) { Debug.Log("<color=red><b>TimeScale is not within acceptable range. Setting to halfway point.</b></color>"); TimeChange = (MinTimeChange + MaxTimeChange) / 2; } player.ApplyStatusEffect(this); player.TimeScaleChange(TimeChange, Duration); }
// #region Enums // public enum ActiveEffects{ // //Movement // SpeedBoost, // SpeedSlow, // //Jumping // GravityUp, // GravityDown, // //Time Scale // TimeSpeedUp, // TimeSlowdown, // } // // public enum PassiveEffects{ // SpeedUp, // SpeedDown, // //Features // DoubleJump, // } // #endregion Enums #region Functions /// Starts the status effect. public virtual void StartStatusEffect(PlayerParameters player) { player.ApplyStatusEffect(this); }