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; } } }
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"); }
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"); } }
private int withdraw(int x) { if (balance < x) { x = balance; } balance -= x; MoneyCounter.addAmt(x); text[4] = "$" + x + text[4]; return(x); }
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"); } }
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; } } }
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; } } }
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"); } } }
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; } } }
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 = ""; } } }
// Update is called once per frame private void Update() { if (check && choice == 1) { timestop = Random.Range(50, 101); check = false; } if (choice == 1) { pos1 = go.transform.position.y; } if (choice == 2) { pos2 = go.transform.position.y; } Spin(); if (reelSpeed != 0 && time > timestop) { reelSpeed--; } if (reelSpeed == 0 && check2) { if ((int)Mathf.Round(go.transform.position.y) % 2 == 0) { reelSpeed = 0; check2 = false; go.transform.position = new Vector3(go.transform.position.x, Mathf.Round(go.transform.position.y)); } } if (reelSpeed == 0) { if ((int)Mathf.Round(go.transform.position.y) % 2 == 0) { go.transform.position = new Vector3(go.transform.position.x, Mathf.Round(go.transform.position.y)); } else { go.transform.position = new Vector3(go.transform.position.x, Mathf.Round(go.transform.position.y - 1)); } } if (choice == 2) { if ((int)pos1 == -8 && (int)go.transform.position.y == 12) { go.transform.position = new Vector3(go.transform.position.x, 10); } if ((int)pos1 == -12 && (int)go.transform.position.y == 8) { go.transform.position = new Vector3(go.transform.position.x, 6); } if ((int)pos1 == 10 && go.transform.position.y == -6) { go.transform.position = new Vector3(go.transform.position.x, -8); } if (pos1 == 8 && go.transform.position.y == -8) { go.transform.position = new Vector3(go.transform.position.x, -10); } if (pos1 == 6 && go.transform.position.y == -10) { go.transform.position = new Vector3(go.transform.position.x, -12); } } if (choice == 1) { if (pos2 == -8 && go.transform.position.y == 12) { go.transform.position = new Vector3(go.transform.position.x, 10); } if (pos2 == -12 && go.transform.position.y == 8) { go.transform.position = new Vector3(go.transform.position.x, 6); } if (pos2 == 10 && go.transform.position.y == -6) { go.transform.position = new Vector3(go.transform.position.x, -8); } if (pos2 == 8 && go.transform.position.y == -8) { go.transform.position = new Vector3(go.transform.position.x, -10); } if (pos2 == 6 && go.transform.position.y == -10) { go.transform.position = new Vector3(go.transform.position.x, -12); } } time++; if (((pos1 == -6 || pos2 == -6) && (scrolling2.pos1 == 4 || scrolling2.pos2 == 4) && (scrolling3.pos1 == 4 || scrolling3.pos2 == 4)) || ((pos1 == -8 || pos2 == -8) && (scrolling2.pos1 == 2 || scrolling2.pos2 == 2) && (scrolling3.pos1 == 2 || scrolling3.pos2 == 2)) || ((pos1 == -10 || pos2 == -10) && (scrolling2.pos1 == 0 || scrolling2.pos2 == 0) && (scrolling3.pos1 == 0 || scrolling3.pos2 == 0)) ) { MoneyCounter.addAmt(150); } if (((pos1 == -6 || pos2 == -6) && (scrolling2.pos1 == -6 || scrolling2.pos2 == -6) && (scrolling3.pos1 == -2 || scrolling3.pos2 == -2)) || ((pos1 == -8 || pos2 == -8) && (scrolling2.pos1 == -8 || scrolling2.pos2 == -8) && (scrolling3.pos1 == -4 || scrolling3.pos2 == -4)) || ((pos1 == -4 || pos2 == -4) && (scrolling2.pos1 == -4 || scrolling2.pos2 == -4) && (scrolling3.pos1 == 0 || scrolling3.pos2 == 0)) ) { MoneyCounter.addAmt(200); } if (((pos1 == -2 || pos2 == -2) && (scrolling2.pos1 == 6 || scrolling2.pos2 == 6) && (scrolling3.pos1 == 2 || scrolling3.pos2 == 2)) || ((pos1 == -4 || pos2 == -4) && (scrolling2.pos1 == 4 || scrolling2.pos2 == 4) && (scrolling3.pos1 == 0 || scrolling3.pos2 == 0)) || ((pos1 == -6 || pos2 == -6) && (scrolling2.pos1 == 2 || scrolling2.pos2 == 2) && (scrolling3.pos1 == -2 || scrolling3.pos2 == -2)) ) { MoneyCounter.addAmt(500); } if (((pos1 == 0 || pos2 == 0) && (scrolling2.pos1 == 8 || scrolling2.pos2 == 8) && (scrolling3.pos1 == -6 || scrolling3.pos2 == -6)) || ((pos1 == -2 || pos2 == -2) && (scrolling2.pos1 == 6 || scrolling2.pos2 == 6) && (scrolling3.pos1 == -8 || scrolling3.pos2 == -8)) || ((pos1 == -4 || pos2 == -4) && (scrolling2.pos1 == 4 || scrolling2.pos2 == 4) && (scrolling3.pos1 == -10 || scrolling3.pos2 == -10)) ) { MoneyCounter.addAmt(250); } if (((pos1 == 2 || pos2 == 2) && (scrolling2.pos1 == 2 || scrolling2.pos2 == 2) && (scrolling3.pos1 == 6 || scrolling3.pos2 == 6)) || ((pos1 == 0 || pos2 == 0) && (scrolling2.pos1 == 0 || scrolling2.pos2 == 0) && (scrolling3.pos1 == 4 || scrolling3.pos2 == 4)) || ((pos1 == -2 || pos2 == -2) && (scrolling2.pos1 == -2 || scrolling2.pos2 == -2) && (scrolling3.pos1 == 2 || scrolling3.pos2 == 2)) ) { MoneyCounter.addAmt(3000); } if (((pos1 == 4 || pos2 == 4) && (scrolling2.pos1 == -6 || scrolling2.pos2 == -6) && (scrolling3.pos1 == 8 || scrolling3.pos2 == 8)) || ((pos1 == 2 || pos2 == 2) && (scrolling2.pos1 == -8 || scrolling2.pos2 == -8) && (scrolling3.pos1 == 6 || scrolling3.pos2 == 6)) || ((pos1 == 0 || pos2 == 0) && (scrolling2.pos1 == -10 || scrolling2.pos2 == -10) && (scrolling3.pos1 == 4 || scrolling3.pos2 == 4)) ) { MoneyCounter.addAmt(350); } if (((pos1 == 6 || pos2 == 6) && (scrolling2.pos1 == -2 || scrolling2.pos2 == -2) && (scrolling3.pos1 == -2 || scrolling3.pos2 == -2)) || ((pos1 == 4 || pos2 == 4) && (scrolling2.pos1 == -4 || scrolling2.pos2 == -4) && (scrolling3.pos1 == -4 || scrolling3.pos2 == -4)) || ((pos1 == 2 || pos2 == 2) && (scrolling2.pos1 == -6 || scrolling2.pos2 == -6) && (scrolling3.pos1 == -6 || scrolling3.pos2 == -6)) ) { MoneyCounter.addAmt(400); } if (((pos1 == 8 || pos2 == 8) && (scrolling2.pos1 == 0 || scrolling2.pos2 == 0) && (scrolling3.pos1 == -4 || scrolling3.pos2 == -4)) || ((pos1 == 6 || pos2 == 6) && (scrolling2.pos1 == -2 || scrolling2.pos2 == -2) && (scrolling3.pos1 == -6 || scrolling3.pos2 == -6)) || ((pos1 == 4 || pos2 == 4) && (scrolling2.pos1 == -4 || scrolling2.pos2 == -4) && (scrolling3.pos1 == -8 || scrolling3.pos2 == -8)) ) { MoneyCounter.addAmt(1000); } if (((pos1 == 10 || pos2 == 10) && (scrolling2.pos1 == 10 || scrolling2.pos2 == 10) && (scrolling3.pos1 == 10 || scrolling3.pos2 == 10)) || ((pos1 == 8 || pos2 == 8) && (scrolling2.pos1 == 8 || scrolling2.pos2 == 8) && (scrolling3.pos1 == 8 || scrolling3.pos2 == 8)) || ((pos1 == 6 || pos2 == 6) && (scrolling2.pos1 == 6 || scrolling2.pos2 == 6) && (scrolling3.pos1 == 6 || scrolling3.pos2 == 6)) ) { MoneyCounter.addAmt(450); } }
private void Update() { if (!hidden) { if (text[index] != null) { gt.text = text[index]; } UpdateScore(); if (index == complete) { Time.timeScale = 1; scoreboard.text = ""; hidden = true; index++; DayCounter.reduceDays(); if (score[0] > score[1]) { MoneyCounter.addAmt(1000); } else if (score[0] == score[1]) { MoneyCounter.addAmt(500); } else { MoneyCounter.addAmt(100); } GameObject.FindGameObjectWithTag("Fader").GetComponent <ScreenFader>().fade("CompleteQuest"); } if (index == choose[qIndex]) { var choice = getChoice(); Debug.Log(choice); if (choice.Equals("")) { return; } if (choice.Equals(ans[qIndex])) { index++; for (var i = 1; i < 4; i++) { score[i] += opp[qIndex, i]; } qIndex++; score[0]++; } else { index++; for (var i = 1; i < 4; i++) { score[i] += opp[qIndex, i]; } qIndex++; } } else if (Input.GetKeyDown(KeyCode.Space)) { index++; } else if (Input.GetKeyDown(KeyCode.B)) { //index--; } } }
private void Update() { if (Input.GetKey(KeyCode.S) && Input.GetKey(KeyCode.M)) { Application.LoadLevel("slotmachine"); } if (Input.GetKey(KeyCode.H) && Input.GetKeyDown(KeyCode.P)) { GameObject.Find("ScreenFader").GetComponent <ScreenFader>().fade("Phone"); } if (Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.I) && Input.GetKey(KeyCode.N)) { MoneyCounter.addAmt(10000); } if (Input.GetKey(KeyCode.L) && Input.GetKeyDown(KeyCode.O)) { DayCounter.reduceDays(); } if (Input.GetKey(KeyCode.T) && Input.GetKey(KeyCode.O) && Input.GetKey(KeyCode.W) && Input.GetKey(KeyCode.N)) { Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Q)) { if (Input.GetKey(KeyCode.Alpha0)) { QuestStatus.questIndex = 0; QuestStatus.questLoc = 4; Application.LoadLevel("Casino"); } if (Input.GetKey(KeyCode.Alpha1)) { QuestStatus.questIndex = 1; QuestStatus.questLoc = 1; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha2)) { QuestStatus.questIndex = 2; QuestStatus.questLoc = 1; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha3)) { QuestStatus.questIndex = 3; QuestStatus.questLoc = 1; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha4)) { QuestStatus.questIndex = 4; QuestStatus.questLoc = 1; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha5)) { QuestStatus.questIndex = 5; QuestStatus.questLoc = 1; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha6)) { QuestStatus.questIndex = 6; QuestStatus.questLoc = 1; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha7)) { QuestStatus.questIndex = 7; QuestStatus.questLoc = 0; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha8)) { QuestStatus.questIndex = 8; QuestStatus.questLoc = 3; Application.LoadLevel("Town"); } if (Input.GetKey(KeyCode.Alpha9)) { QuestStatus.questIndex = 9; QuestStatus.questLoc = 2; Application.LoadLevel("Town"); } } if (Input.GetKey(KeyCode.F) && Input.GetKey(KeyCode.O) && Input.GetKey(KeyCode.R)) { Application.LoadLevel("Forest3D"); } if (Input.GetKey(KeyCode.O) && Input.GetKey(KeyCode.F) && Input.GetKey(KeyCode.I)) { Application.LoadLevel("Office"); } if (Input.GetKey(KeyCode.C) && Input.GetKey(KeyCode.A) && Input.GetKey(KeyCode.S)) { Application.LoadLevel("Casino"); } if (Input.GetKey(KeyCode.D) && Input.GetKey(KeyCode.U) && Input.GetKey(KeyCode.N)) { Application.LoadLevel("Dungeon"); } if (Input.GetKey(KeyCode.B) && Input.GetKey(KeyCode.A) && Input.GetKey(KeyCode.N) && Input.GetKey(KeyCode.K)) { Application.LoadLevel("Bank"); } }