Esempio n. 1
0
 public void exitShop()
 {
     // PlayerPrefs.SetInt ("MoneyAmount", moneyAmount);
     SEAttributesController.AdjustCurrency(player, -player.PlayerCurrency);
     SEAttributesController.AdjustCurrency(player, moneyAmount);
     for (int i = 0; i < amount; i++)
     {
         SEAttributesController.DecreaseHunger(player);
     }
     SceneManager.LoadScene("GeneralRoom");
 }
Esempio n. 2
0
    public static void TimeEvent(int gameMinutes, SEAttributes player)
    {
        if (gameMinutes % 7 == 0 && gameMinutes != prevtime) // In ~ 12 hours (1 day), their hunger, tiredness and fitness will be at 0
        {
            for (int i = 0; i >= 0; i -= 15)
            {
                SEAttributesController.IncreaseTired(player);
                SEAttributesController.DecreaseFitness(player);
            }

            SEAttributesController.IncreaseHunger(player);
            SEAttributesController.DecreaseMood(player);

            if (alt)
            {
                if (AddItem.isTree)
                {
                    SEAttributesController.IncreaseMood(player);
                    SEAttributesController.DecreaseHunger(player);
                }
                if (AddItem.isPlant)
                {
                    SEAttributesController.IncreaseMood(player);
                }
            }
            alt = !alt;
        }
        if (player.currState != "" && gameMinutes % 4 == 0 && gameMinutes != prevtime)
        {
            if (player.currState == "entertainment")
            {
                SEAttributesController.IncreaseMood(player);
                if (gameMinutes % 2 == 0 && ChangeTv.upgrade)
                {
                    SEAttributesController.IncreaseMood(player);
                }
            }

            else if (player.currState == "working")
            {
                SEAttributesController.DecreaseMood(player);
                if (gameMinutes % 2 == 0)
                {
                    SEAttributesController.IncreaseTired(player);
                    if (gameMinutes % (6 - ChangeChair.upgrade) == 0)
                    {
                        SEAttributesController.DecreaseTired(player);
                    }
                }
            }

            else if (player.currState == "exercising")
            {
                SEAttributesController.IncreaseFitness(player);
                UnityEngine.Debug.Log("happening");
                if (AddItem.isTread && gameMinutes % 2 == 0)
                {
                    SEAttributesController.IncreaseFitness(player);
                }
            }

            else if (player.currState == "sleeping")
            {
                SEAttributesController.Rest(player);
                SEAttributesController.IncreaseMood(player);
            }
        }
        //UnityEngine.Debug.Log(gameMinutes);
        if (gameMinutes % 25 == 0 && gameMinutes != prevtime)
        {
            //factor = ((double)player.Mood + player.Hunger + player.Tired + player.Fitness)/400;
            player.PlayerAge = player.PlayerAge + 1;
            SaveSEAttributes.SavePlayer(player);
            //UnityEngine.Debug.Log("worked" + player.PlayerAge);
            //UnityEngine.Debug.Log(factor);
        }
        prevtime = gameMinutes;
        CheckDeath(player);
    }