Exemplo n.º 1
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");
     }
 }
Exemplo n.º 2
0
 private void OnMouseDown()
 {
     MoneyCounter.reduceAmt(MoneyUpDown4D.betAmt);
     numberBought = gt.text;
     WinningNumber.generateNum();
     GameObject.FindGameObjectWithTag("Fader").GetComponent<ScreenFader>().fade("Phone");
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
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();
     }
 }
Exemplo n.º 5
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;
         }
     }
 }
Exemplo n.º 6
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");
         }
     }
 }
Exemplo n.º 7
0
 private void Update()
 {
     if (index != 0)
     {
         score.text = successful + " / " + index + " : " + (successful * 100f / index) + "%";
     }
     if (part == 0) //initialise
     {
         showBox();
         var x = 0;
         intro[x++] = "Me: Where am I?";
         intro[x++] = "Me: It looks like a brain... within someone's mind...";
         intro[x++] = "...";
         intro[x++] =
             "Mr CIP: You have gathered quite a number of gamblers, \nconsisting of both managing gamblers and problem gamblers.";
         intro[x++] = "Mr CIP: Your mission is to convince them to apply for a casino \nself-exclusion.";
         intro[x++] = "Me: Huh? What is that?";
         intro[x++] =
             "Mr CIP: Casino self-exclusions are procedures by which gamblers \ncan prohibit themselves from entering a casino.";
         intro[x++] =
             "Mr CIP: It is completely voluntary and aims to aid gamblers in \nlimiting or possibility ceasing their gambling problem.";
         intro[x++] =
             "Mr CIP: Studies have shown this measure to be fairly effective \nin changing gamblers' mindsets.";
         intro[x++] =
             "Mr CIP: If you have more questions, the NCPG and other problem \ngambling sites welcome you.";
         intro[x++] = "Mr CIP: So let's begin!";
         intro[x++] = "[Instructions]";
         intro[x++] =
             "Shoot the arrow into the gambling impulse to distract the person \nfrom gambling and to make your message sink in.";
         intro[x++] = "Aim and press the spacebar to shoot.";
         intro[x++] =
             "While the arrow is flying you can press the spacebar again, to \ngive your message an extra boost with a catchphrase.";
         intro[x++] =
             "Good luck! Convince at least 5 gamblers at a minimum of a \n50% success rate to complete this quest.";
         complete = x;
         part++;
     }
     else if (part == 1) //show introductory text
     {
         gt.text = intro[textIndex];
         if (textIndex == complete)
         {
             part++;
             GameObject.Find("Neuron").GetComponent <SpriteRenderer>().enabled = true;
             GameObject.Find("Arrow").GetComponent <SpriteRenderer>().enabled  = true;
             hideBox();
         }
         if (Input.GetKeyDown(KeyCode.Space))
         {
             textIndex++;
         }
     }
     else if (part == 2) //start game
     {
         arrow.activate();
         part++;
     }
     else if (part == 3) //if boost selected
     {
         if (boost == 1)
         {
             Time.timeScale = 0;
             showOptions();
             part++;
         }
         else if (boost == 0)
         {
             options.text = "Press the spacebar for a boost!";
         }
     }
     else if (part == 4) //make selection for boost
     {
         var x = GetInput(0);
         if (!x.Equals(""))
         {
             //100, 150, 200, 250, 300
             var mag = Random.Range(0, 5) * 50;
             mag += 100;
             arrow.boost(mag);
             part           = 3;
             boost          = 2;
             Time.timeScale = 1;
             options.text   = "";
         }
     }
     else if (part == 5)
     {
         GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade("CompleteQuest");
         MoneyCounter.addAmt(1500);
         DayCounter.reduceDays();
         part = 100;
     }
     else if (part == 6)
     {
         var x = 0;
         t[x++]     = "Mr CIP: Looks like the gamblers here are rather stubborn...";
         t[x++]     = "Mr CIP: Well, there are two choices - ";
         makeChoice = x;
         t[x++]     =
             "1) Abort this quest or 2) Donate $100 to the problem gamblers' \nfund and go on to the next room, where there are 20 gamblers.";
         t[x++]   = "Better not to take the risk. Bye!";
         complete = x;
         part++;
         showBox();
         textIndex = 0;
     }
     else if (part == 7)
     {
         gt.text = t[textIndex];
         if (textIndex == makeChoice)
         {
             choice = GetInput(1);
             if (!choice.Equals(""))
             {
                 if (choice.Equals("1"))
                 {
                     t[textIndex + 1] = "Better not to take the risk, right? Bye!";
                 }
                 else
                 {
                     t[textIndex + 1] = "Sure! It's worth a try, let's go!";
                 }
                 textIndex++;
             }
         }
         else if (Input.GetKeyDown(KeyCode.Space))
         {
             textIndex++;
         }
         if (textIndex == complete)
         {
             if (choice.Equals("2"))
             {
                 successful = 0;
                 index      = 1;
                 part++;
                 GameObject.Find("Neuron").GetComponent <SpriteRenderer>().enabled = true;
                 GameObject.Find("Arrow").GetComponent <SpriteRenderer>().enabled  = true;
                 arrow.reset();
                 hideBox();
                 gt.text = "";
                 part2   = true;
                 MoneyCounter.reduceAmt(100);
             }
             else if (choice.Equals("1"))
             {
                 GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade("Home");
             }
         }
     }
     else if (part == 8)
     {
         if (boost == 1)
         {
             Time.timeScale = 0;
             showOptions();
             part++;
         }
         else if (boost == 0)
         {
             options.text = "Press the spacebar for a boost!";
         }
     }
     else if (part == 9)
     {
         var x = GetInput(0);
         if (!x.Equals(""))
         {
             //100, 150, 200, 250, 300
             var mag = Random.Range(0, 5) * 50;
             mag += 100;
             arrow.boost(mag);
             part           = 3;
             boost          = 2;
             Time.timeScale = 1;
             options.text   = "";
         }
     }
 }