public override void ZeroPenalty(float timeScale) { var healthPunishmentAmount = Stats.MaxAmount(Type.Health) * _healthPenaltyPercent; Stats.Remove(Type.Health, healthPunishmentAmount * (timeScale * GameClock.Speed) / GameClock.TimeMultiplier); }
private IEnumerator PracticeWriting() { GameLibOfMethods.cantMove = true; GameLibOfMethods.canInteract = false; GameLibOfMethods.animator.SetBool("Sitting", true); GameLibOfMethods.doingSomething = true; float moodDrainSpeed = MoodDrainPerHour; float energyDrainSpeed = EnergyDrainPerHour; float xpGainSpeed = XpGainGetHour; yield return(new WaitForEndOfFrame()); while (!Input.GetKey(InteractionChecker.Instance.KeyToInteract) && !GameLibOfMethods.passedOut) { GameLibOfMethods.animator.SetBool("Learning", true); float multi = (Time.deltaTime / GameClock.Speed) * GameClock.TimeMultiplier; Stats.AddXP(Type.Writing, xpGainSpeed * multi); Stats.Remove(Status.Type.Energy, energyDrainSpeed * multi); Stats.Remove(Status.Type.Mood, moodDrainSpeed * multi); /*GameLibOfMethods.player.GetComponent<Rigidbody2D>().velocity = Vector3.zero; * * //blackScreen.CrossFadeAlpha(0, 1, false); * * GameLibOfMethods.facingDir = Vector2.left;*/ yield return(new WaitForEndOfFrame()); } PlayExitSound(); GameLibOfMethods.animator.SetBool("Learning", false); yield return(new WaitForEndOfFrame()); PlayerCommands.WalkBackToLastPosition(); //Debug.Log("cant browse, busy doing something else"); }