コード例 #1
0
ファイル: MapStarter.cs プロジェクト: gkjolin/CriminalTown
        public static void AssignDefaultData()
        {
            //sData
            DataScript.SData.ItemsCount = new int[ItemsOptions.totalAmount];
            for (int i = 0; i < ItemsOptions.totalAmount; i++)
            {
                DataScript.SData.ItemsCount[i] = 5;
            }
            DataScript.SData.Money = 1000000;

            //chData
            Character arrestedChar = CharactersOptions.GetRandomCharacter(5);

            arrestedChar.AddToPolice();
            DataScript.ChData.AddCharacter(arrestedChar);

            Character hospitalChar = CharactersOptions.GetRandomCharacter(6);

            hospitalChar.AddToHospital();
            DataScript.ChData.AddCharacter(hospitalChar);

            Character[] characters = new[] {
                CharactersOptions.GetRandomCharacter(6),
                CharactersOptions.GetRandomCharacter(5),
                CharactersOptions.GetRandomCharacter(4)
            };

            //chData.panelCharacters.Add(CharactersOptions.GetRandomCommonCharacter(8));
            //chData.panelCharacters.Add(CharactersOptions.GetRandomCommonCharacter(9));
            //chData.panelCharacters.Add(CharactersOptions.GetSpecialCharacter(9, 0));
            DataScript.ChData.AddCharacter(CharactersOptions.GetSpecialCharacter(9, 1));
            DataScript.ChData.AddCharacter(characters[0]);
            DataScript.ChData.AddCharacter(characters[1]);
            DataScript.ChData.AddCharacter(characters[2]);


            //eData
            DataScript.EData.PoliceKnowledge = 0;

            RobberiesOptions.GetNewRobberies();

            //pData
            DataScript.PData.IsItemAvailable = new bool[ItemsOptions.totalAmount];
            for (int i = 0; i < ItemsOptions.totalAmount; i++)
            {
                DataScript.PData.IsItemAvailable[i] = true;
            }
            DataScript.PData.Authority = 9;

            DataScript.SaveAll();
        }
コード例 #2
0
ファイル: Hospital.cs プロジェクト: gkjolin/CriminalTown
        public void TryToAddCharacterToHospital(Character character)
        {
            ModalPanelDetails details;

            if (character.Stats.Health <= 90)
            {
                EventButtonDetails yesButton = new EventButtonDetails {
                    buttonText = "Да",
                    action     = () => { character.AddToHospital(); }
                };
                EventButtonDetails noButton = new EventButtonDetails {
                    buttonText = "Нет",
                    action     = UIManager.modalPanel.ClosePanel
                };
                details = new ModalPanelDetails {
                    button0Details = yesButton,
                    button1Details = noButton,
                    imageSprite    = character.Sprite,
                    text           = "Отправить персонажа на принудительное лечение?",
                    titletext      = character.Name
                };
            }
            else
            {
                EventButtonDetails noButton = new EventButtonDetails {
                    buttonText = "Ну ладно...",
                    action     = UIManager.modalPanel.ClosePanel
                };
                details = new ModalPanelDetails {
                    button1Details = noButton,
                    imageSprite    = character.Sprite,
                    text           = "Босс, я не пойду в больницу из-за этой царапины!",
                    titletext      = character.Name
                };
            }
            UIManager.modalPanel.CallModalPanel(details);
        }