Ejemplo n.º 1
0
        private void UpdateDataAfterNight()
        {
            foreach (NightRobberyData nightRobDat in m_robberies)
            {
                DataScript.EData.PoliceKnowledge++;
                DataScript.SData.Money += nightRobDat.Money;
                foreach (int itemNum in nightRobDat.Awards.Keys)
                {
                    DataScript.SData.ItemsCount[itemNum] += nightRobDat.Awards[itemNum];
                }

                foreach (Character character in nightRobDat.Robbery.Characters)
                {
                    if (character.Stats.Health <= 0)
                    {
                        character.AddToHospital();
                    }
                    character.SetDefaultStatus();
                }
                UIManager.robberyWindow.RemoveAllItemsFromRoobbery(nightRobDat.Robbery.RobberyType, nightRobDat.Robbery.LocationNum);
            }
            m_robberies.Clear();
            NightEventsOptions.ClearUsedEvents();
            //todo: delete
            RobberiesOptions.GetNewRobberies();
        }
Ejemplo n.º 2
0
        private void ShowNode(NightEventNode eventNode)
        {
            Choice = -1;

            Button0.gameObject.SetActive(false);
            Button1.gameObject.SetActive(false);


            AwardsAndMoney.gameObject.SetActive(false);

            TitleText.text       = eventNode.TitleText;
            DescriptionText.text = eventNode.Description;
            Image.sprite         = NightEventsOptions.GetNightEventSprite(eventNode.SpriteType, eventNode.SpriteId, eventNode.CharSpriteType);

            if (eventNode.Buttons.Count > 0)
            {
                Button0.onClick.RemoveAllListeners();
                Button0.onClick.AddListener(() => { Night.Instance.MakeChoice(0); });
                Button0.onClick.AddListener(CloseWindow);
                Button0Text.text = eventNode.Buttons[0].ButtonText;
                Button0.gameObject.SetActive(true);
            }
            if (eventNode.Buttons.Count > 1)
            {
                Button1.onClick.RemoveAllListeners();
                Button1.onClick.AddListener(() => { Night.Instance.MakeChoice(1); });
                Button1.onClick.AddListener(CloseWindow);
                Button1Text.text = eventNode.Buttons[1].ButtonText;
                Button1.gameObject.SetActive(true);
            }

            gameObject.transform.SetAsLastSibling();
            gameObject.SetActive(true);
        }
Ejemplo n.º 3
0
 //Constructor
 public NightRobberyData(Robbery robbery)
 {
     this.m_robbery    = robbery;
     nightEvent        = NightEventsOptions.GetRandomEvent(robbery.RobberyType);
     m_eventStatus     = EventStatus.InProgress;
     m_chance          = RobberiesOptions.CalculatePreliminaryChance(robbery);
     m_policeChance    = Random.Range(0, 51);
     m_hospitalChance  = Random.Range(0, 51);
     m_money           = RobberiesOptions.GetRobberyMoneyRewardAtTheCurrentMoment(robbery.RobberyType);
     m_awards          = RobberiesOptions.GetRobberyAwardsAtTheCurrentMoment(robbery.RobberyType);
     m_policeKnowledge = 1;
 }
Ejemplo n.º 4
0
 public void Initialize()
 {
     m_instance = GetComponent <NightEventsOptions>();
     m_nightEventsCollection = NightEventsSerialization.GetNightEventsCollection();
     m_usedEvents            = new Dictionary <RobberyType, List <int> >();
 }