public void ProcessConsequence(ConsequenceObject aConsequence) { SetAllButtonsEnabled(false); m_bIsConsequenceBeingShown = true; m_bIsTextBeingShown = true; m_DialogueManager.StartDialogue(aConsequence.m_ConsequenceText); m_CurrentGlobalTemperature += aConsequence.m_TempEffect; if (m_CurrentGlobalTemperature >= 5.0f) { m_CurrentGlobalTemperature = 5.0f; List <string> loseText = new List <string>(); loseText.Add("You have lost."); loseText.Add("The average global temperature has hit 5.0C"); loseText.Add("The effects around the globe are devistating."); loseText.Add("Ocean Acidity levels by 2050 will increase by over 50% killing large populations of oceanlife."); loseText.Add("All ice in the north and south pole have melted by 2050."); loseText.Add("The frequency of warm weather extremes over land has increased by 600% by 2050."); loseText.Add("The average drought length has become over 1 year."); loseText.Add("All land animals, plantation, and insects have lost more than half of their species."); loseText.Add("Damages from floods are at an annual cost of over 12 trillion dollars"); PlayerFailed(loseText); } m_CurrentPopulation += aConsequence.m_PopulationEffect; if (m_CurrentPopulation <= 0) { m_CurrentPopulation = 0; List <string> loseText = new List <string>(); loseText.Add("You have lost."); loseText.Add("Every human on Earth is dead."); PlayerFailed(loseText); } m_CurrentHappiness += aConsequence.m_HappinessEffect; if (m_CurrentHappiness <= 0) { m_CurrentHappiness = 0; List <string> loseText = new List <string>(); loseText.Add("You have lost."); loseText.Add("The global population is unhappy with you and has kicked you out of office from decision making."); PlayerFailed(loseText); } if (m_CurrentHappiness >= 100) { m_CurrentHappiness = 100; } }
public void OnChoicePressed(int aButtonID) { m_bIsChoiceBeingShown = false; List <ConsequenceObject> consequences = m_CurrentEvent.m_ChoicesFromEvent[aButtonID].m_Consequences; if (consequences.Count > 1) { int randomConsequence = Random.Range(0, consequences.Count); ConsequenceObject consequence = consequences[randomConsequence]; ProcessConsequence(consequence); } else { ProcessConsequence(consequences[0]); } m_EventImage.SetActive(false); m_EventImage.GetComponent <Image>().sprite = null; }