Пример #1
0
 internal void addForm(PokemonDP pokemon)
 {
     Forms.Add(pokemon);
 }
Пример #2
0
        internal static void PopulatePokemonTables()
        {
            // Instanciate tables
            pokemonGSTable      = new PokemonGS[PokemonGS.RELEASED_POKEMON + 1];
            pokemonCrystalTable = new PokemonCrystal[PokemonCrystal.RELEASED_POKEMON + 1];
            pokemonRSTable      = new PokemonRS[PokemonRS.RELEASED_POKEMON + 1];
            pokemonEmeraldTable = new PokemonEmerald[PokemonEmerald.RELEASED_POKEMON + 1];
            pokemonFRLGTable    = new PokemonFRLG[PokemonFRLG.RELEASED_POKEMON + 1];
            pokemonDPTable      = new PokemonDP[PokemonDP.RELEASED_POKEMON + 1];
            pokemonPtTable      = new PokemonPt[PokemonPt.RELEASED_POKEMON + 1];
            pokemonHGSSTable    = new PokemonHGSS[PokemonHGSS.RELEASED_POKEMON + 1];
            pokemonBWTable      = new PokemonBW[PokemonBW.RELEASED_POKEMON + 1];
            pokemonB2W2Table    = new PokemonB2W2[PokemonB2W2.RELEASED_POKEMON + 1];
            pokemonXYTable      = new PokemonXY[PokemonXY.RELEASED_POKEMON + 1];
            pokemonORASTable    = new PokemonORAS[PokemonORAS.RELEASED_POKEMON + 1];
            pokemonSuMoTable    = new PokemonSuMo[PokemonSuMo.RELEASED_POKEMON + 1];
            pokemonUSUMTable    = new PokemonUSUM[PokemonUSUM.RELEASED_POKEMON + 1];

            // Populate tables
            // Gen 2-3 tables now use gen 4 Pokémon data.
            // TODO: Change data to match gen when they'll be added.
            for (short i = 0; i <= PokemonGS.RELEASED_POKEMON; i++)
            {
                pokemonGSTable[i] = new PokemonGS(i, Properties.Resources.PokemonInfo4.Skip(PokemonGS.SIZE * i).Take(PokemonGS.SIZE).ToArray());
                setNames(pokemonGSTable[i]);
            }

            for (short i = 0; i <= PokemonCrystal.RELEASED_POKEMON; i++)
            {
                pokemonCrystalTable[i] = new PokemonCrystal(i, Properties.Resources.PokemonInfo4.Skip(PokemonCrystal.SIZE * i).Take(PokemonCrystal.SIZE).ToArray());
                setNames(pokemonCrystalTable[i]);
            }

            for (short i = 0; i <= PokemonRS.RELEASED_POKEMON; i++)
            {
                pokemonRSTable[i] = new PokemonRS(i, Properties.Resources.PokemonInfo4.Skip(PokemonRS.SIZE * i).Take(PokemonRS.SIZE).ToArray());
                setNames(pokemonRSTable[i]);
            }

            for (short i = 0; i <= PokemonEmerald.RELEASED_POKEMON; i++)
            {
                pokemonEmeraldTable[i] = new PokemonEmerald(i, Properties.Resources.PokemonInfo4.Skip(PokemonEmerald.SIZE * i).Take(PokemonEmerald.SIZE).ToArray());
                setNames(pokemonEmeraldTable[i]);
            }

            for (short i = 0; i <= PokemonFRLG.RELEASED_POKEMON; i++)
            {
                pokemonFRLGTable[i] = new PokemonFRLG(i, Properties.Resources.PokemonInfo4.Skip(PokemonFRLG.SIZE * i).Take(PokemonFRLG.SIZE).ToArray());
                setNames(pokemonFRLGTable[i]);
            }

            for (short i = 0; i <= PokemonDP.RELEASED_POKEMON; i++)
            {
                pokemonDPTable[i] = new PokemonDP(i, Properties.Resources.PokemonInfo4.Skip(PokemonDP.SIZE * i).Take(PokemonDP.SIZE).ToArray());
                setNames(pokemonDPTable[i]);
            }

            for (short i = 0; i <= PokemonPt.RELEASED_POKEMON; i++)
            {
                pokemonPtTable[i] = new PokemonPt(i, Properties.Resources.PokemonInfo4.Skip(PokemonPt.SIZE * i).Take(PokemonPt.SIZE).ToArray());
                setNames(pokemonPtTable[i]);
            }

            for (short i = 0; i <= PokemonHGSS.RELEASED_POKEMON; i++)
            {
                pokemonHGSSTable[i] = new PokemonHGSS(i, Properties.Resources.PokemonInfo4.Skip(PokemonHGSS.SIZE * i).Take(PokemonHGSS.SIZE).ToArray());
                setNames(pokemonHGSSTable[i]);
            }

            for (short i = 0; i <= PokemonBW.RELEASED_POKEMON; i++)
            {
                pokemonBWTable[i] = new PokemonBW(i, Properties.Resources.PokemonInfo5.Skip(PokemonBW.SIZE * i).Take(PokemonBW.SIZE).ToArray());
                setNames(pokemonBWTable[i]);
            }

            for (short i = 0; i <= PokemonB2W2.RELEASED_POKEMON; i++)
            {
                pokemonB2W2Table[i] = new PokemonB2W2(i, Properties.Resources.PokemonInfo5.Skip(PokemonB2W2.SIZE * i).Take(PokemonB2W2.SIZE).ToArray());
                setNames(pokemonB2W2Table[i]);
            }

            for (short i = 0; i <= PokemonXY.RELEASED_POKEMON; i++)
            {
                pokemonXYTable[i] = new PokemonXY(i, Properties.Resources.PokemonInfo6.Skip(PokemonXY.SIZE * i).Take(PokemonXY.SIZE).ToArray());
                if (new[] { 382, 383 }.Contains(i))
                {
                    pokemonXYTable[i].CatchRate = 5;
                }
                if (i == 384)
                {
                    pokemonXYTable[i].CatchRate = 3;
                }
                setNames(pokemonXYTable[i]);
            }

            for (short i = 0; i <= PokemonORAS.RELEASED_POKEMON; i++)
            {
                pokemonORASTable[i] = new PokemonORAS(i, Properties.Resources.PokemonInfo6.Skip(PokemonORAS.SIZE * i).Take(PokemonORAS.SIZE).ToArray());
                setNames(pokemonORASTable[i]);
            }

            for (short i = 0; i <= PokemonSuMo.RELEASED_POKEMON; i++)
            {
                pokemonSuMoTable[i] = new PokemonSuMo(i, Properties.Resources.PokemonInfo7.Skip(PokemonSuMo.SIZE * i).Take(PokemonSuMo.SIZE).ToArray());
                setNames(pokemonSuMoTable[i]);
            }

            for (short i = 0; i <= PokemonUSUM.RELEASED_POKEMON; i++)
            {
                pokemonUSUMTable[i] = new PokemonUSUM(i, Properties.Resources.PokemonInfoU.Skip(PokemonUSUM.SIZE * i).Take(PokemonUSUM.SIZE).ToArray());
                setNames(pokemonUSUMTable[i]);
            }

            // Add forms
            // Gen 2-3 tables now use gen 4 Pokémon data.
            // TODO: Change data to match gen when they'll be added.
            for (short f = 0; f < PokemonGS.RELEASED_FORMS; f++)
            {
                PokemonGS p = new PokemonGS(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonGS.SIZE * (PokemonGS.RELEASED_POKEMON + f + 1))
                                            .Take(PokemonGS.SIZE).ToArray());
                pokemonGSTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonGSTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonCrystal.RELEASED_FORMS; f++)
            {
                PokemonCrystal p = new PokemonCrystal(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonCrystal.SIZE * (PokemonCrystal.RELEASED_POKEMON + f + 1))
                                                      .Take(PokemonCrystal.SIZE).ToArray());
                pokemonCrystalTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonCrystalTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonRS.RELEASED_FORMS; f++)
            {
                PokemonRS p = new PokemonRS(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonRS.SIZE * (PokemonRS.RELEASED_POKEMON + f + 1))
                                            .Take(PokemonRS.SIZE).ToArray());
                pokemonRSTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonRSTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonEmerald.RELEASED_FORMS; f++)
            {
                PokemonEmerald p = new PokemonEmerald(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonEmerald.SIZE * (PokemonEmerald.RELEASED_POKEMON + f + 1))
                                                      .Take(PokemonEmerald.SIZE).ToArray());
                pokemonEmeraldTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonEmeraldTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonFRLG.RELEASED_FORMS; f++)
            {
                PokemonFRLG p = new PokemonFRLG(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonFRLG.SIZE * (PokemonFRLG.RELEASED_POKEMON + f + 1))
                                                .Take(PokemonFRLG.SIZE).ToArray());
                pokemonFRLGTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonFRLGTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonDP.RELEASED_FORMS; f++)
            {
                PokemonDP p = new PokemonDP(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonDP.SIZE * (PokemonDP.RELEASED_POKEMON + f + 1))
                                            .Take(PokemonDP.SIZE).ToArray());
                pokemonDPTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonDPTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonPt.RELEASED_FORMS; f++)
            {
                PokemonPt p = new PokemonPt(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonPt.SIZE * (PokemonPt.RELEASED_POKEMON + f + 1))
                                            .Take(PokemonPt.SIZE).ToArray());
                pokemonPtTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonPtTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonHGSS.RELEASED_FORMS; f++)
            {
                PokemonHGSS p = new PokemonHGSS(FormTable[f], Properties.Resources.PokemonInfo4.Skip(PokemonHGSS.SIZE * (PokemonHGSS.RELEASED_POKEMON + f + 1))
                                                .Take(PokemonHGSS.SIZE).ToArray());
                pokemonHGSSTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonHGSSTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonBW.RELEASED_FORMS; f++)
            {
                PokemonBW p = new PokemonBW(FormTable[f], Properties.Resources.PokemonInfo5.Skip(PokemonBW.SIZE * (PokemonBW.RELEASED_POKEMON + f + 1))
                                            .Take(PokemonBW.SIZE).ToArray());
                pokemonBWTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonBWTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonB2W2.RELEASED_FORMS; f++)
            {
                PokemonB2W2 p = new PokemonB2W2(FormTable[f], Properties.Resources.PokemonInfo5.Skip(PokemonB2W2.SIZE * (PokemonB2W2.RELEASED_POKEMON + f + 1))
                                                .Take(PokemonB2W2.SIZE).ToArray());
                pokemonB2W2Table[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonB2W2Table[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonXY.RELEASED_FORMS; f++)
            {
                PokemonXY p = new PokemonXY(FormTable[f], Properties.Resources.PokemonInfo6.Skip(PokemonXY.SIZE * (PokemonXY.RELEASED_POKEMON + f + 1))
                                            .Take(PokemonXY.SIZE).ToArray());
                pokemonXYTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonXYTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonORAS.RELEASED_FORMS; f++)
            {
                PokemonORAS p = new PokemonORAS(FormTable[f], Properties.Resources.PokemonInfo6.Skip(PokemonORAS.SIZE * (PokemonORAS.RELEASED_POKEMON + f + 1))
                                                .Take(PokemonORAS.SIZE).ToArray());
                pokemonORASTable[FormTable[f]].addForm(p);

                p.Form = (byte)pokemonORASTable[FormTable[f]].Forms.Count;
                setFormNames(p, (short)(PokemonORAS.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonSuMo.RELEASED_FORMS; f++)
            {
                PokemonSuMo p = new PokemonSuMo(FormTableSuMo[f], Properties.Resources.PokemonInfo7.Skip(PokemonSuMo.SIZE * (PokemonSuMo.RELEASED_POKEMON + f + 1))
                                                .Take(PokemonSuMo.SIZE).ToArray());
                pokemonSuMoTable[FormTableSuMo[f]].addForm(p);

                p.Form = (byte)pokemonSuMoTable[FormTableSuMo[f]].Forms.Count;
                setFormNames(p, (short)(PokemonSuMo.RELEASED_POKEMON + f));
            }

            for (short f = 0; f < PokemonUSUM.RELEASED_FORMS; f++)
            {
                PokemonUSUM p = new PokemonUSUM(FormTableUSUM[f], Properties.Resources.PokemonInfoU.Skip(PokemonUSUM.SIZE * (PokemonUSUM.RELEASED_POKEMON + f + 1))
                                                .Take(PokemonUSUM.SIZE).ToArray());
                pokemonUSUMTable[FormTableUSUM[f]].addForm(p);

                p.Form = (byte)pokemonUSUMTable[FormTableUSUM[f]].Forms.Count;
                setFormNames(p, (short)(PokemonUSUM.RELEASED_POKEMON + f));
            }

            // Other Sun/moon forms
            for (short f = 0; f < OtherFormTableSuMo.Length; f++)
            {
                PokemonSuMo p = new PokemonSuMo(OtherFormTableSuMo[f], Properties.Resources.PokemonInfo7.Skip(PokemonSuMo.SIZE * (OtherFormTableSuMo[f]))
                                                .Take(PokemonSuMo.SIZE).ToArray());
                pokemonSuMoTable[OtherFormTableSuMo[f]].addForm(p);

                p.Form = (byte)pokemonSuMoTable[OtherFormTableSuMo[f]].Forms.Count;
                setFormNames(p, (short)(PokemonSuMo.RELEASED_POKEMON + PokemonSuMo.RELEASED_FORMS + f));

                // USUM
                PokemonUSUM u = new PokemonUSUM(OtherFormTableSuMo[f], Properties.Resources.PokemonInfoU.Skip(PokemonUSUM.SIZE * (OtherFormTableSuMo[f]))
                                                .Take(PokemonUSUM.SIZE).ToArray());
                pokemonUSUMTable[OtherFormTableSuMo[f]].addForm(u);

                u.Form = (byte)pokemonUSUMTable[OtherFormTableSuMo[f]].Forms.Count;
                setFormNames(u, (short)(PokemonUSUM.RELEASED_POKEMON + PokemonUSUM.RELEASED_FORMS + f));
            }
        }