public void InheritancePopup() { PlayerController2 player = GetPlayer(turnNum); int inheritance; if (player.GetClass() == 0) { inheritance = 100; } else if (player.GetClass() == 1) { inheritance = 200; } else { inheritance = 600; } player.ChangeWealth(inheritance); popup.SetButtonNum(1); popup.title.SetText("You have inherited: $" + inheritance + "\nFor a total of: $" + player.GetWealth()); popup.buttons[0].textBox.SetText("Roll for Education"); popup.buttons[0].SetListener(EducationPopup); OpenPopup(); }
public void FuneralPopup() { PlayerController2 player = GetPlayer(turnNum); popup.SetButtonNum(1); player.ChangeWealth(-1 * funeralCosts[player.GetClass()]); string funeralText = "We mourn the passing of Player " + turnNum + ", who is survived by their heir, Player " + turnNum + " Jr.\n" + "The funeral costs: " + funeralCosts[player.GetClass()]; if (player.GetRemainingBalance() > 0) { funeralText += "\nTheir remaining student loan balance of " + player.GetRemainingBalance() + " is taken out of their estate."; player.PayRemainingBalance(); } popup.title.SetText(funeralText); popup.buttons[0].textBox.SetText("Determine New Class"); popup.buttons[0].SetListener(NextClassPopup); }
public void EducationPopup() { PlayerController2 player = GetPlayer(turnNum); if (player.GetClass() == 0) { player.SetEducation(ChooseRandom(lowEducationChances)); } else if (player.GetClass() == 1) { player.SetEducation(ChooseRandom(medEducationChances)); } else { player.SetEducation(ChooseRandom(highEducationChances)); } popup.SetButtonNum(1); popup.title.SetText("You receive a " + player.namedEducation() + " education\nAnd will have an income of $" + incomeLevels[player.GetEducation()]); popup.buttons[0].textBox.SetText("Collect Income"); popup.buttons[0].SetListener(IncomePopup); OpenPopup(); }
public void PersonalEventPopup() { PlayerController2 player = GetPlayer(turnNum); EventController chosenEvent = personalEvents.events[Random.Range(0, personalEvents.events.Count)]; popup.SetImage(chosenEvent.eventImage); popup.title.SetText(chosenEvent.description); if (chosenEvent.special == EventController.SpecialEffect.None) { int effect = chosenEvent.effectsByClass[player.GetClass()]; popup.buttons[0].textBox.SetText(player.namedClass() + ": $" + effect.ToString()); player.ChangeWealth(effect); } else if (chosenEvent.special == EventController.SpecialEffect.Scholarship) { if (player.GetEducation() < 2) { player.SetEducation(player.GetEducation() + 1); popup.buttons[0].textBox.SetText("Get a Free " + player.namedEducation() + " Degree"); } else { popup.buttons[0].textBox.SetText("Nothing Happens"); } } else if (chosenEvent.special == EventController.SpecialEffect.Divorce) { player.ChangeWealth(-1 * player.GetWealth() / 2); popup.buttons[0].textBox.SetText("Lose Half of your Wealth"); } popup.buttons[0].SetListener(ClosePopup); popup.buttons[0].GetOnClick().AddListener(DisableImage); OpenPopup(); }