private void writeEvo() { int i = carryi; EvolutionList evoXML = new EvolutionList(); evoList.Clear(); evoList = evoXML.createList(pokeList[i].number); rtbInfo.Text = ("Evolutions:" + Environment.NewLine); for (var e = 0; e < evoList.Count; e++) { rtbInfo.Text += "-" + evoList[e].evo + Environment.NewLine; } BasicAbiList basicXML = new BasicAbiList(); AdvAbiList advXML = new AdvAbiList(); HighAbiList highXML = new HighAbiList(); abiList.Clear(); abiList = basicXML.createList(pokeList[i].number); rtbInfo.Text += Environment.NewLine + "Abilities:"; for (var s = 0; s < abiList.Count; s++) { rtbInfo.Text += Environment.NewLine + "Basic Ability - " + abiList[s].basicability; } abiList = advXML.createList(pokeList[i].number); for (var s = 0; s < abiList.Count; s++) { rtbInfo.Text += Environment.NewLine + "Advanced Ability - " + abiList[s].advability; } abiList = highXML.createList(pokeList[i].number); for (var s = 0; s < abiList.Count; s++) { rtbInfo.Text += Environment.NewLine + "High Ability - " + abiList[s].highability; } MegaList megaAbility = new MegaList(); if (viewMega == true) { if (mega == true) { megaList = megaAbility.createList("Mega" + pokeList[i].number); rtbInfo.Text += string.Format(Environment.NewLine + "Mega Ability - " + megaList[0].ability); } else if (megax == true) { if (onMegaX == true) { megaList = megaAbility.createList("MegaX" + pokeList[i].number); rtbInfo.Text += string.Format(Environment.NewLine + "Mega Ability X - " + megaList[0].ability); } else { megaList = megaAbility.createList("MegaY" + pokeList[i].number); rtbInfo.Text += string.Format(Environment.NewLine + "Mega Ability Y - " + megaList[0].ability); } } } }
//Declarations + zeroing out critter poulations and energy levels void Awake() { gameControl = FindObjectOfType<GameController>(); turnTimer = FindObjectOfType<TurnTimer>(); player = FindObjectOfType<Player>(); evoList = GetComponent<EvolutionList>(); SplinterXP = 0; transform.parent = GameObject.FindGameObjectWithTag("Critters").transform; completedPhases = 0; tokenDensity = (200 / gameControl.tokenDensity) * size; breedSeason = GameController.breedSeason; SetBreedRate(GameController.breedRate); UpdateStats(); evoButton = FindObjectOfType<EvolutionButton>(); migrateButton = FindObjectOfType<MigrateAnimControl>(); }
static void Main(string[] args) { Console.WriteLine($"Hewwo Fizztopia, FILES ARE AT {System.IO.Path.GetFullPath(PathToFiles)}"); var logPath = $@"{PathToFiles}\output\log.txt"; Console.WriteLine($@"Outputting log to {logPath}"); File.WriteAllText(logPath, string.Empty); FileStream logStream = new FileStream(logPath, FileMode.OpenOrCreate, FileAccess.Write); StreamWriter logWriter = new StreamWriter(logStream); Console.SetOut(logWriter); var pokemonList = new PokemonList(); var basePokemonList = BasePokemonList.ParseJson(File.ReadAllText($@"{PathToFiles}\helperData\BasePokemonList.json")); var alternateFormList = AlternateFormList.ParseJson(File.ReadAllText($@"{PathToFiles}\helperData\AlternateFormList.json")); var evolutionList = EvolutionList.ParseJson(File.ReadAllText($@"{PathToFiles}\helperData\EvolutionList.json")); var spellingFixes = SpellingFixes.ParseJson(File.ReadAllText($@"{PathToFiles}\helperData\SpellingFixes.json")); pokemonList.InitFromBaseList(basePokemonList); pokemonList.ParseAltFormData(alternateFormList); // Console.WriteLine(JsonConvert.SerializeObject(pokemonList, Formatting.Indented)); Console.WriteLine("Processing Veekun Files..."); foreach (var filePath in Directory.GetFiles($@"{PathToFiles}\rawData", "veekun*.json")) { Console.WriteLine(filePath); var veekunPokemon = VeekunPokemonList.ParseJson(File.ReadAllText(filePath)); Console.WriteLine("Processing Spelling Fixes"); foreach (var moveFix in spellingFixes.MoveFixes) { veekunPokemon.Pokemon.ForEach(p => { if (p.LevelUpMoves != null) { p.LevelUpMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.EggMoves != null) { p.EggMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.TutorMoves != null) { p.TutorMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.MachineMoves != null) { p.MachineMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } }); } pokemonList.ParseVeekunPokemonList(veekunPokemon, filePath); } Console.WriteLine("Processing Serebii Files..."); foreach (var filePath in Directory.GetFiles($@"{PathToFiles}\rawData", "serebii*.json")) { Console.WriteLine(filePath); Console.WriteLine("Processing Spelling Fixes"); var serebiiPokemon = SerebiiPokemonList.ParseJson(File.ReadAllText(filePath)); foreach (var moveFix in spellingFixes.MoveFixes) { serebiiPokemon.Pokemon.ForEach(p => { if (p.LevelUpMoves != null) { p.LevelUpMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.AlolanFormLevelUpMoves != null) { p.AlolanFormLevelUpMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.GalarianFormLevelUpMoves != null) { p.GalarianFormLevelUpMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.AltForms != null) { p.AltForms.ForEach(altForm => altForm.LevelUpMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; })); } if (p.EggMoves != null) { p.EggMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.TutorMoves != null) { p.TutorMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } if (p.MachineMoves != null) { p.MachineMoves.FindAll( m => m.Name.Equals(moveFix.OldName, StringComparison.InvariantCultureIgnoreCase) ).ToList().ForEach(m => { Console.WriteLine($"{p.DexNum}: Fixing {m.Name} to {moveFix.NewName}"); m.Name = moveFix.NewName; }); } }); } var isSwSh = filePath.Contains("swsh"); pokemonList.ParseSerebiiPokemonList(serebiiPokemon, isSwSh, filePath); } Console.WriteLine("Processing Form Name Fixes"); { Dictionary <string, int> fixCount = new Dictionary <string, int>(); spellingFixes.FormFixes.ForEach(fix => fixCount[fix.NewName] = 0); pokemonList.Pokemon.ForEach(p => { var forms = new List <string> { p.DefaultForm }; forms.AddRange(p.AltForms); foreach (var fix in forms.Join(spellingFixes.FormFixes.Where(fix => fix.DexNum == 0 || fix.DexNum == p.DexNum), f => f, fix => fix.OldName, (f, fix) => fix)) { Console.WriteLine($"Fixing {fix.OldName} to {fix.NewName} in {p.Name}"); fixCount[fix.NewName]++; { var index = p.AltForms.FindIndex(f => f == fix.OldName); if (index != -1) { p.AltForms[index] = fix.NewName; } else { p.DefaultForm = fix.NewName; } } p.LevelUpMoveLists.Find(l => l.Form == fix.OldName).Form = fix.NewName; p.EggMoves.ForEach(m => { var index = m.Forms.FindIndex(f => f == fix.OldName); if (index != -1) { m.Forms[index] = fix.NewName; } }); p.TutorMoves.ForEach(m => { var index = m.Forms.FindIndex(f => f == fix.OldName); if (index != -1) { m.Forms[index] = fix.NewName; } }); p.MachineMoves.ForEach(m => { var index = m.Forms.FindIndex(f => f == fix.OldName); if (index != -1) { m.Forms[index] = fix.NewName; } }); } }); foreach (var(k, v) in fixCount) { Console.WriteLine($"Fixed {k} {v} time(s)"); } } Console.WriteLine("Processing Missing Evolution Moves"); pokemonList.ParseEvolutionMissingMoves(evolutionList); Console.WriteLine("Processing Missing Evolution Moves AGAIN (Should be no output)"); pokemonList.ParseEvolutionMissingMoves(evolutionList); Console.WriteLine("Processing Alt Forms with One Additional Move"); pokemonList.ParseAltFormsWithOneAdditionalMoveList(alternateFormList.AltFormsWithSingleAdditionalMove); Console.WriteLine($@"Placing output in {PathToFiles}\output\pokemonMoveList.json"); Directory.CreateDirectory($@"{PathToFiles}\output"); File.WriteAllText($@"{PathToFiles}\output\pokemonMoveList.json", JsonConvert.SerializeObject(pokemonList, Formatting.Indented)); Console.Out.Flush(); }