예제 #1
0
 public Random_Event()
 {
     thriftyness_multiplier = Game_Manager.instance.Player.Player_Traits.Thriftyness;
     Event_Array[0] = new Random_Event("Your car has broken down, $"+(int)(-500 * thriftyness_multiplier), (int)(-500 * thriftyness_multiplier), -5);
     Event_Array[1] = new Random_Event("Steam Sale. You know the drill $"+(int)(-50 * thriftyness_multiplier), (int)(-50 * thriftyness_multiplier), 0);
     Event_Array[2] = new Random_Event("You've won the lottery! $"+(int)(1000 * thriftyness_multiplier)+"!", (int)(1000 * thriftyness_multiplier), 10);
     Event_Array[3] = new Random_Event("It is your cousins birthday, better not make Thanksgiving awkward..."+(int)(-25 * thriftyness_multiplier)+"", (int)(-25 * thriftyness_multiplier), 0);
     Event_Array[4] = new Random_Event("Your Alternative Game Development Teacher is the Best. Of course you have to buy him a gift!" + (int)(-25 * thriftyness_multiplier) + "", (int)(-25 * thriftyness_multiplier), 0);
 }
예제 #2
0
    public void Execute_Day()
    {
        Random_Event Event = new Random_Event();
        string Description = Event.Execute_Event();

        Panel.SetActive(false);
        Fun_Toggle.SetActive(false);
        Work_Toggle.SetActive(false);

        // Increase happiness when fun is ticked
        if(Fun_Toggle.GetComponent<Toggle>().isOn)
        {
            Game_Manager.instance.Player.Happiness++;
            GameObject.Find("Happiness").GetComponent<Text>().text = "Happiness: " + Game_Manager.instance.Player.Happiness.ToString();
        }

        // Increase money, decrease happiness when working
        else
        {
            Game_Manager.instance.Player.Happiness--;
            GameObject.Find("Happiness").GetComponent<Text>().text = "Happiness: " + Game_Manager.instance.Player.Happiness.ToString();

            Game_Manager.instance.Player.Debt += Game_Manager.instance.Player.Player_Job.Hourly_Wage * 8;
            GameObject.Find("Debt_Amount").GetComponent<Text>().text = "$" + Game_Manager.instance.Player.Debt.ToString("N0");
        }

        // Random event when returned string isnt empty
        if(Description != "")
        {
            GameObject.Find("Happiness").GetComponent<Text>().text = "Happiness: " + Game_Manager.instance.Player.Happiness.ToString();
            GameObject Debt_Amount = GameObject.Find("Debt_Amount");
            Debt_Amount.GetComponent<Text>().text = "$" + Game_Manager.instance.Player.Debt.ToString("N0");
            GameObject.Find("Pay").GetComponent<Text>().text = "Current Pay: $" + Game_Manager.instance.Player.Player_Job.Hourly_Wage.ToString() + "/hr";

            // Display the message returned by Description.
            GameObject.Find("Random_Event").GetComponent<Text>().text = Description;
        }
    }