private void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.tag == "Player")
     {
         MoneyCounter.reducePercentage(10);
     }
 }
Exemple #2
0
 public void selectionMade(string name)
 {
     for (var i = 0; i < 5; i++)
     {
         bins[i].GetComponent <Quest5Bins>().setCheck(this, false);
     }
     if (name.Equals("Bin (2)"))
     {
         var gt = GetComponent <GUIText>();
         gt.font     = change;
         gt.fontSize = 40;
         gt.color    = Color.white;
         gt.text     = "Thanks for \nyour help!";
         MoneyCounter.addAmt(1500);
         DayCounter.reduceDays();
         GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest");
     }
     else
     {
         Debug.Log(name);
         var gt = GetComponent <GUIText>();
         gt.font     = change;
         gt.fontSize = 40;
         gt.color    = Color.white;
         gt.text     = "You were caught \nand attacked \nby an Ah Long...";
         MoneyCounter.reduceAmt(200);
         DayCounter.reduceDays();
         GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("FailQuest");
     }
 }
Exemple #3
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemple #4
0
 void OnMouseDown()
 {
     SelectionOkay.numberBought = "";
     MoneyCounter.addAmt(SelectionOkay.amount * 20);
     transform.position = new Vector3(transform.position.x, transform.position.y, -20);
     GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("Home");
 }
Exemple #5
0
 void Start()
 {
     repu          = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Reputation>();
     money         = GameObject.FindGameObjectWithTag("GameManager").GetComponent <MoneyCounter>();
     passangerData = GameObject.FindGameObjectWithTag("Notepad").GetComponent <StorePassangerData>();
     currentState  = driverState.waiting;
 }
 void Start()
 {
     masterCounter = this;
     unassignedPool = INIT_MAX;
     reserve = INIT_RESERVES;
     while (!UpdateVisual()) {}
 }
Exemple #7
0
 private void Update()
 {
     if (!hidden)
     {
         if (text[index] != null)
         {
             gt.text = text[index];
         }
         if (index == showBack)
         {
             GameObject.Find("Darkness").GetComponent <GUITexture>().enabled = false;
             background.position = new Vector3(Camera.main.transform.position.x, 0, Camera.main.transform.position.z);
         }
         if (Input.GetKeyDown(KeyCode.Space))
         {
             index++;
         }
         if (index == complete)
         {
             DayCounter.reduceDays();
             MoneyCounter.addAmt(1200);
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest");
             QuestStatus.questIndex = -1;
             QuestStatus.questLoc   = -1;
             index++;
             Time.timeScale = 1;
         }
     }
 }
Exemple #8
0
 private void OnMouseDown()
 {
     MoneyCounter.reduceAmt(MoneyUpDown4D.betAmt);
     numberBought = gt.text;
     WinningNumber.generateNum();
     GameObject.FindGameObjectWithTag("Fader").GetComponent<ScreenFader>().fade("Phone");
 }
 // Use this for initialization
 void Start()
 {
     gameManager = GameObject.Find("GameManager").GetComponent <Transform>();
     mc          = gameManager.GetComponentInChildren <MoneyCounter>();
     recipie     = this.GetComponentsInChildren <AbstractFood>(true);
     source      = GetComponent <AudioSource> ();
     result      = true;
 }
Exemple #10
0
    private void Start()
    {
        /*text1 = "\t\t\t\t\t Game Over\n\n" +
         *     "You ran out of time to repay your debts!\n" +
         *      "As you've experienced in our game,\n" +
         *      "it is not easy to clear the debts\n" +
         *      "from gambling!\n\n" +
         *      "Remember that addiction to gambling\n" +
         *      "can start at an early age, from\n" +
         *      "the little things such as playing \n" +
         *      "with a slot machine on your phone.\n" +
         *      "Even when you bet with small amounts\n" +
         *      "in 4D, remember that it is still gambling!";
         *
         * text2 = "\t\t\t\t\t Game Over\n\n" +
         *      "We hope you have enjoyed our game! \n" +
         *      "As you've experienced in our game,\n" +
         *      "it is not easy to clear the debts\n" +
         *      "from gambling!\n\n" +
         *      "Remember that addiction to gambling\n" +
         *      "can start at an early age, from\n" +
         *      "the little things such as playing \n" +
         *      "with a slot machine on your phone\n" +
         *      "Even when you bet with small amounts\n" +
         *      "in 4D, remember that it is still gambling!";*/

        text1 = "\t\t\t\t\t Game Over\n\n" +
                "You ran out of time to repay your debts! \n" +
                "As you've experienced in our game,\n" +
                "it is not easy to clear debts incurred from gambling.\n\n" +
                "Bob later put in this 200% in order to earn enough to repay his debts\n" +
                "He would like to enforce that gambling\n" +
                "is not always dangerous, but it is\n" +
                "when the high risks come into play.\n" +
                "It's all about the Time, Money, \n" +
                "Energy and Motivation.";

        text2 = "\t\t\t\tGame Over\n\n" +
                "We hope you've enjoyed our game! As you've experienced in our game,\n" +
                "it is not easy to clear debts incurred from gambling.\n\n" +
                "Bob later designed many creative campaigns, \n" +
                "games and apps to combat problem gambling,\n" +
                "but has yet to release them to the public.\n" +
                "He would like to enforce that gambling\n" +
                "is not always dangerous, but it is\n" +
                "when the high risks come into play.\n" +
                "It's all about the Time, Money, \n" +
                "Energy and Motivation.";

        if (MoneyCounter.getResult())
        {
            results = 0;
        }
        else
        {
            results = 1;
        }
    }
Exemple #11
0
 void Start()
 {
     cursorToolRect = transform.Find("CursorTool");
     moneyCounter   = GameObject.Find("MoneyCounterText").GetComponent <MoneyCounter> ();
     inventory      = new Inventory();
     shop_Inventory = new Shop_Inventory();
     UI_Inventory.setInventory(inventory);
     UI_Shop_Inventory.setInventory(shop_Inventory);
 }
Exemple #12
0
 void Start()
 {
     AudioSource[] sources = GetComponents<AudioSource>();
     coinSound = sources[0];
     player = GameObject.Find("Player").transform;
     moneyCounter = player.GetComponent<MoneyCounter>();
     _transform = transform;
     hasMoney = true;
 }
 void Start()
 {
     masterCounter  = this;
     unassignedPool = INIT_MAX;
     reserve        = INIT_RESERVES;
     while (!UpdateVisual())
     {
     }
 }
Exemple #14
0
    private bool CheckMissionComplete()
    {
        MoneyCounter moneyCounter = FindObjectOfType <MoneyCounter>();

        if (moneyCounter.NoMoneyRemain)
        {
            return(true);
        }
        return(false);
    }
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
Exemple #16
0
 private void Update()
 {
     barDisplay = (float)currHealth / totalHealth;
     if (currHealth < 1 && !won)
     {
         won = true;
         MoneyCounter.addAmt(3000);
         DayCounter.reduceDays();
         GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest");
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        banknotesMade = 0;
        totalIncome   = 0;

        moneyCounter = MoneyCounter.instance;
        shopScript   = BuildingItems.instance;
        timerScript  = Timer.instance;

        Update();
    }
Exemple #18
0
 private int deposit(int x)
 {
     if (MoneyCounter.getAmt() < x)
     {
         x = MoneyCounter.getAmt();
     }
     balance += x;
     MoneyCounter.reduceAmt(x);
     text[2] = "$" + x + text[2];
     return(x);
 }
Exemple #19
0
 private int withdraw(int x)
 {
     if (balance < x)
     {
         x = balance;
     }
     balance -= x;
     MoneyCounter.addAmt(x);
     text[4] = "$" + x + text[4];
     return(x);
 }
Exemple #20
0
 void Start()
 {
     AudioSource[] sources = GetComponents<AudioSource>();
     coinSound = sources[0];
     player = GameObject.Find("Player").transform;
     model = transform.FindChild("char_generic");
     move = GetComponent<Move>();
     moneyCounter = player.GetComponent<MoneyCounter>();
     _transform = transform;
     hasMoney = true;
     hasConfidence = true;
 }
 // Use this for initialization
 private void Start()
 {
     Camera.main.transform.position = new Vector3(8.8f, 0.1f, -10);
     if (MoneyCounter.getResult())
     {
         GameObject.Find("Win").GetComponent <AudioSource>().Play();
     }
     else
     {
         GameObject.Find("Lose").GetComponent <AudioSource>().Play();
     }
 }
Exemple #22
0
 private void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.tag == "Player")
     {
         MoneyCounter.reducePercentage(10);
         var m = cube.gameObject.GetComponent <MoveToPoint2>();
         if (m)
         {
             m.pause();
         }
     }
 }
Exemple #23
0
 private void OnMouseUp()
 {
     if (isColliding)
     {
         MoneyCounter.reduceAmt(100);
         check      = true;
         anim.speed = 1;
         scrolling1One.leverPulled();
         scrolling1Two.leverPulled();
         scrolling2One.leverPulled();
         scrolling2Two.leverPulled();
         scrolling3One.leverPulled();
         scrolling3Two.leverPulled();
     }
 }
Exemple #24
0
 private void Update()
 {
     if (!hidden)
     {
         if (text[index] != null)
         {
             gt.text = text[index];
         }
         if (index == getChoice)
         {
             if (Input.GetKeyDown(KeyCode.Y))
             {
                 choice = 0;
                 text[getChoice + 1] =
                     "Mr Bets: Your sincerity is too touching! I'll give you $1000 instead.\nI'll work hard to earn it back.";
                 index++;
             }
             else if (Input.GetKeyDown(KeyCode.N))
             {
                 choice = 1;
                 text[getChoice + 1] =
                     "Mr Bets: I see, you're in debt too... I'm so sorry my friend, \nbut my debt is double yours. Forgive me...";
                 index++;
             }
         }
         else if (Input.GetKeyDown(KeyCode.Space))
         {
             index++;
         }
         if (index == complete)
         {
             DayCounter.reduceDays();
             if (choice == 0)
             {
                 MoneyCounter.addAmt(1000);
             }
             else if (choice == 1)
             {
                 MoneyCounter.addAmt(500);
             }
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest");
             QuestStatus.questIndex = -1;
             QuestStatus.questLoc   = -1;
             index++;
             Time.timeScale = 1;
         }
     }
 }
Exemple #25
0
 private void Update()
 {
     if (!hidden)
     {
         if (text[index] != null)
         {
             gt.text = text[index];
         }
         if (index == showBack)
         {
             background.position = new Vector3(Camera.main.transform.position.x, 0, Camera.main.transform.position.z);
         }
         if (index == getChoice)
         {
             if (Input.GetKeyDown(KeyCode.Y))
             {
                 choice = 0;
                 text[getChoice + 1] =
                     "Mr Smokey: Thanks again! This would be enough for 5 sticks a day, \nI guess...";
                 MoneyCounter.reduceAmt(50);
                 index++;
             }
             else if (Input.GetKeyDown(KeyCode.N))
             {
                 choice = 1;
                 text[getChoice + 1] =
                     "Mr Smokey: Huh? Well, suppose you're low on budget too...";
                 index++;
             }
         }
         else if (Input.GetKeyDown(KeyCode.Space))
         {
             index++;
         }
         if (index == complete)
         {
             DayCounter.reduceDays();
             MoneyCounter.addAmt(1000);
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest");
             QuestStatus.questIndex = -1;
             QuestStatus.questLoc   = -1;
             index++;
             Time.timeScale = 1;
         }
     }
 }
Exemple #26
0
 private void OnMouseDown()
 {
     if (buttonNum == 1)
     {
         if (betAmt < MoneyCounter.getAmt())
         {
             betAmt += 10;
         }
     }
     else
     {
         if (betAmt > 10)
         {
             betAmt -= 10;
         }
     }
     gt.text = betAmt + "";
 }
Exemple #27
0
 private void Update()
 {
     if (!hidden)
     {
         barDisplay = (float)currHealth / totalHealth;
         if (currHealth < 1 && !lost)
         {
             lost = true;
             MoneyCounter.reducePercentage(20);
             DayCounter.reduceDays();
             GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade("FailQuest");
         }
         else if (currHealth < 1 && !Application.loadedLevelName.Equals("FailQuest"))
         {
             GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade("FailQuest");
         }
     }
 }
Exemple #28
0
    public void Init()
    {
        EventManager = EventManager.InstancePublic;
        TowerShop    = new TowerShop(this)
        {
            Price = 400
        };
        MoneyCounter = new MoneyCounter(this, 1000);
        LivesCounter = new LivesCounter(this, 100);
        //temp, parse
        var tempList = new List <TowerInfo>()
        {
            new TowerInfo("tower_1_square", 500, 650),
            new TowerInfo("tower_2_square", 900, 1100),
            new TowerInfo("tower_3_square", 0, 1500)
        };

        TowerMenu = new TowerMenu(this, tempList);
    }
Exemple #29
0
 private void Update()
 {
     if (isTriggered)
     {
         if (Input.GetKeyDown(KeyCode.Y))
         {
             var percentLoss = 5;
             Time.timeScale = 1;
             MoneyCounter.reducePercentage(percentLoss);
             DayCounter.reduceDays();
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("ExitQuest");
         }
         else if (Input.GetKeyDown(KeyCode.N))
         {
             Time.timeScale   = 1;
             textbox.position = new Vector3(textbox.position.x, 20, textbox.position.z);
             isTriggered      = false;
         }
     }
 }
Exemple #30
0
 private void Update()
 {
     amount = textboxMoney.number;
     if (textbox2.selection != 6)
     {
         transform.position = new Vector3(0, 0, 5);
     }
     else
     {
         transform.position = new Vector3(3.08f, -2.039f, -2);
         if (Input.GetKey(KeyCode.Space))
         {
             textbox2.selection = 1;
             MoneyCounter.reduceAmt(amount);
             numberBought = gt.text;
             WinningNumber.generateNum();
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("Phone");
         }
     }
 }
Exemple #31
0
 private void Update()
 {
     if (!hidden)
     {
         if (text[index] != null)
         {
             gt.text = text[index];
         }
         if (Input.GetKeyDown(KeyCode.Space))
         {
             index++;
         }
         if (index == complete && !won)
         {
             Time.timeScale = 1;
             won            = true;
             DayCounter.reduceDays();
             MoneyCounter.addAmt(1800);
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest");
         }
     }
 }
Exemple #32
0
 private void Update()
 {
     if (!hidden)
     {
         if (text[index] != null)
         {
             gt.text = text[index];
         }
         if (Input.GetKeyDown(KeyCode.Space))
         {
             index++;
         }
         if (index == complete)
         {
             DayCounter.reduceDays();
             MoneyCounter.addAmt(1000);
             GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest");
             QuestStatus.questIndex = -1;
             QuestStatus.questLoc   = -1;
             index++;
             Time.timeScale = 1;
         }
     }
 }
Exemple #33
0
        public override void BuildBurger()
        {
            Random rnd            = new Random();
            int    randomMaxMeats = rnd.Next(_maxItems[0]);

            for (int i = 0; i < randomMaxMeats; i++)
            {
                int randMeat = rnd.Next(3);
                switch (randMeat)
                {
                case 0:
                    Beef b = new Beef {
                        Weight = rnd.NextDouble() * rnd.Next(5), Name = "говядина"
                    };
                    Burger.AddMeat(b);
                    Console.WriteLine("Добавили говядины");
                    MoneyCounter.LogBuyes(b);
                    break;

                case 1:
                    Ham h = new Ham {
                        Weight = rnd.NextDouble() * rnd.Next(5), Name = "ветчина"
                    };
                    Burger.AddMeat(h);
                    Console.WriteLine("Добавили ветчины");
                    MoneyCounter.LogBuyes(h);
                    break;

                case 2:
                    Sausage s = new Sausage {
                        Weight = rnd.NextDouble() * rnd.Next(5), Name = "сосиска"
                    };
                    Burger.AddMeat(s);
                    Console.WriteLine("Добавили сосиску");
                    MoneyCounter.LogBuyes(s);
                    break;
                }
                Thread.Sleep(40);
            }

            int randomMaxVegetables = rnd.Next(_maxItems[1]);

            for (int i = 0; i < randomMaxVegetables; i++)
            {
                int randVegetable = rnd.Next(3);
                switch (randVegetable)
                {
                case 0:
                    Vegetable Tomato = new Vegetable()
                    {
                        Weight        = rnd.NextDouble(),
                        VegetableType = TypeOfVegetable.Tomato,
                        Name          = "красный помидор"
                    };
                    Burger.AddVegetable(Tomato);
                    Console.WriteLine("Добавили красного помидора");
                    MoneyCounter.LogBuyes(Tomato);
                    break;

                case 1:
                    Vegetable Onion = new Vegetable()
                    {
                        Weight        = rnd.NextDouble(),
                        VegetableType = TypeOfVegetable.Onion,
                        Name          = "лук репчатый"
                    };
                    Burger.AddVegetable(Onion);
                    Console.WriteLine("Добавили лука репчатого");
                    MoneyCounter.LogBuyes(Onion);
                    break;

                case 2:
                    Vegetable Cucumber = new Vegetable()
                    {
                        Weight        = rnd.NextDouble(),
                        VegetableType = TypeOfVegetable.Cucumber,
                        Name          = "соленый огурчик"
                    };
                    Burger.AddVegetable(Cucumber);
                    Console.WriteLine("Добавили соленого огурчика");
                    MoneyCounter.LogBuyes(Cucumber);
                    break;
                }
                Thread.Sleep(40);
            }

            int randomMaxCheeseSlices = rnd.Next(_maxItems[2]);

            for (int i = 0; i < randomMaxCheeseSlices; i++)
            {
                MoneyCounter.LogBuyes(Burger.AddCheeseSlice());
                Thread.Sleep(40);
            }
            Console.WriteLine("Ура ваш бургер был собран");
        }