Пример #1
0
        /// <summary>
        ///     Called when all instances has been loaded for initialized members in instance.
        /// </summary>
        public override void LoadingFinished()
        {
            if (!string.IsNullOrEmpty(this.Arena))
            {
                this.ArenaData = CsvFiles.Get(Gamefile.Arenas).GetData <ArenaData>(this.Arena);

                if (this.ArenaData == null)
                {
                    throw new Exception("Arena " + this.Arena + " does not exist.");
                }
            }

            if (!string.IsNullOrEmpty(this.BaseChest))
            {
                this.BaseTreasureChestData = this.CsvTable.GetData <TreasureChestData>(this.BaseChest);
            }

            if (!string.IsNullOrEmpty(this.GuaranteedSpells[0]))
            {
                this.GuaranteedSpellsData = new SpellData[this.GuaranteedSpells.Length];

                for (int I = 0; I < this.GuaranteedSpells.Length; I++)
                {
                    this.GuaranteedSpellsData[I] = CsvFiles.GetSpellDataByName(this.GuaranteedSpells[I]);
                }
            }
            else
            {
                this.GuaranteedSpellsData = new SpellData[0];
            }

            this.TotalTimeTakenSeconds = this.TimeTakenDays * 86400 + this.TimeTakenHours * 3600 + this.TimeTakenMinutes * 60 + this.TimeTakenSeconds;

            if (this.BaseTreasureChestData != null)
            {
                if (!this.InShop)
                {
                    this.InShop = this.BaseTreasureChestData.InShop;
                }

                if (this.TotalTimeTakenSeconds == 0)
                {
                    this.TotalTimeTakenSeconds = this.BaseTreasureChestData.TotalTimeTakenSeconds;
                }
            }
        }
Пример #2
0
        /// <summary>
        ///     Called when all instances has been loaded for initialized members in instance.
        /// </summary>
        public void ConfigureSpells()
        {
            this.PvPLocationData        = CsvFiles.Get(Gamefile.Locations).GetData <LocationData>(this.PvpLocation);
            this.TeamVsTeamLocationData = CsvFiles.Get(Gamefile.Locations).GetData <LocationData>(this.TeamVsTeamLocation);

            this.UnlockedSpellsData = new List <SpellData> [CsvFiles.Get(Gamefile.Rarities).Datas.Count];

            for (int I = 0; I < this.UnlockedSpellsData.Length; I++)
            {
                this.UnlockedSpellsData[I] = new List <SpellData>();

                foreach (SpellData Data in CsvFiles.Get(Gamefile.SpellsCharacters).Datas)
                {
                    if (Data.IsUnlockedInArena(this))
                    {
                        if (Data.RarityData == CsvFiles.Get(Gamefile.Rarities).Datas[I])
                        {
                            this.UnlockedSpellsData[I].Add(Data);
                        }
                    }
                }

                foreach (SpellData Data in CsvFiles.Get(Gamefile.SpellsBuildings).Datas)
                {
                    if (Data.IsUnlockedInArena(this))
                    {
                        if (Data.RarityData == CsvFiles.Get(Gamefile.Rarities).Datas[I])
                        {
                            this.UnlockedSpellsData[I].Add(Data);
                        }
                    }
                }

                foreach (SpellData Data in CsvFiles.Get(Gamefile.SpellsOther).Datas)
                {
                    if (Data.IsUnlockedInArena(this))
                    {
                        if (Data.RarityData == CsvFiles.Get(Gamefile.Rarities).Datas[I])
                        {
                            this.UnlockedSpellsData[I].Add(Data);
                        }
                    }
                }

                foreach (SpellData Data in CsvFiles.Get(Gamefile.SpellsOther).Datas)
                {
                    if (Data.IsUnlockedInArena(this))
                    {
                        if (Data.RarityData == CsvFiles.Get(Gamefile.Rarities).Datas[I])
                        {
                            this.UnlockedSpellsData[I].Add(Data);
                        }
                    }
                }
            }

            if (!this.TrainingCamp)
            {
                foreach (TreasureChestData Data in CsvFiles.Get(Gamefile.TreasureChests).Datas)
                {
                    if (Data.Arena == this.Name)
                    {
                        switch (Data.BaseChest)
                        {
                        case "Free":
                        {
                            this.FreeChestData = Data;
                            break;
                        }

                        case "Star":
                        {
                            this.StarChestData = Data;
                            break;
                        }

                        case "StarBoosted":
                        {
                            this.StarBoostedChestData = Data;
                            break;
                        }

                        case "Magic":
                        {
                            this.MagicChestData = Data;
                            break;
                        }

                        case "Super":
                        {
                            this.SuperMagicalChestData = Data;
                            break;
                        }

                        case "Silver":
                        {
                            this.SilverChestData = Data;
                            break;
                        }

                        case "Gold":
                        {
                            this.GoldChestData = Data;
                            break;
                        }

                        case "Giant":
                        {
                            this.GiantChestData = Data;
                            break;
                        }

                        case "Epic":
                        {
                            this.EpicChestData = Data;
                            break;
                        }

                        case "Survival_Bronze":
                        {
                            this.SurvivalBronzeChestData = Data;
                            break;
                        }

                        case "Survival_Gold":
                        {
                            this.SurvivalGoldChestData = Data;
                            break;
                        }

                        case "ClanCrownChest":
                        {
                            this.ClanCrownChestData = Data;
                            break;
                        }

                        case "Tournament1st":
                        {
                            this.Tournament1st = Data;
                            break;
                        }

                        case "Tournament2nd":
                        {
                            this.Tournament2nd = Data;
                            break;
                        }

                        case "Tournament3rd":
                        {
                            this.Tournament3rd = Data;
                            break;
                        }

                        case "TournamentOther":
                        {
                            this.TournamentOther = Data;
                            break;
                        }
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(this.ChestArena))
            {
                this.ChestArenaData = CsvFiles.Get(Gamefile.Arenas).GetData <ArenaData>(this.ChestArena);
            }
            else
            {
                this.ChestArenaData = this;
            }
        }