static IEnumerator <float> WakeUpHospital() { GameTime.Clock.ResetSpeed(); yield return(MEC.Timing.WaitForSeconds(2)); player.GetComponent <Animator>().enabled = true; Stats.Status(Type.Hunger).Set(float.MaxValue); Stats.Status(Type.Energy).Set(float.MaxValue); Stats.Status(Type.Health).Set(float.MaxValue); Stats.Status(Type.Mood).Set(float.MaxValue); Stats.Status(Type.Bladder).Set(100); Stats.Status(Type.Hunger).Set(100); Stats.Status(Type.Hygiene).Set(100); Vector3 tempRotation = new Vector3(0, 0, 0); player.transform.rotation = Quaternion.Euler(tempRotation); Stats.RemoveMoney(HospitalFee); player.transform.position = new Vector2(HospitalRespawnPoint.position.x, HospitalRespawnPoint.position.y); blackScreen.CrossFadeAlpha(0, 2, false); cantMove = false; CameraFollow.Instance.ResetCamera(); player.GetComponent <Animator>().SetBool("PassOut", false); _passingOut = false; }
public static IEnumerator <float> WakeUpHospital() { GameTime.Clock.ResetSpeed(); GameLibOfMethods.blackScreen.CrossFadeAlpha(1, 0.5f, false); yield return(MEC.Timing.WaitForSeconds(2)); Player.anim.enabled = true; foreach (PlayerStats.Status.Type type in Stats.PlayerStatus.Keys) { Stats.Add(type, float.MaxValue); } Player.transform.rotation = Quaternion.Euler(0, 0, 0); Stats.RemoveMoney(GameLibOfMethods.HospitalFee); Vector3 SpawnPosition = GameLibOfMethods.HospitalRespawnPoint.position; SpawnPosition.z = Player.transform.position.z; Player.transform.position = SpawnPosition; GameLibOfMethods.blackScreen.CrossFadeAlpha(0, 2, false); GameLibOfMethods.cantMove = false; CameraFollow.Instance.ResetCamera(); PlayerAnimationHelper.ResetPlayer(); }
public bool Deposit(float amount) { if (amount > Stats.Money) { GameLibOfMethods.CreateFloatingText("Not enough money!", 3); return(false); } Stats.RemoveMoney(amount); MoneyInBank += amount; UpdateBalance(); return(true); }
private void BuyConsumable(bool Food = false) { var virtualShopItems = GameObject.Find("Career Scripts").GetComponent <Items.Shops.GeneralStore>().Items; List <InventorySystem.ItemList.ItemInfo> shopList = new List <InventorySystem.ItemList.ItemInfo>(); InventorySystem.ItemList.ItemInfo itemToBuy = new InventorySystem.ItemList.ItemInfo(); float price = -1; foreach (var Item in virtualShopItems) { if (Item.Name == "Water" && !Food) { price = Item.price * 2; } else if (Item.Name != "Water" && Food) { if (Item.ItemType == Items.ItemType.Food) { price = ItemIngredientPrice(Item); } } if (Stats.Money >= price && price > 0) { Stats.RemoveMoney(price); itemToBuy.itemCode = Item.code; itemToBuy.count = 1; shopList.Add(itemToBuy); InventorySystem.Inventory.PlaceOnBag(shopList); ConsumeItem(Item.name, 1); return; } else if (Item.Name == "Water" && !Food) { return; } } }