コード例 #1
0
ファイル: RSTE.cs プロジェクト: sherkinator/pk3DS
        private void Setup()
        {
            start = true;
            string[] personalList = Directory.GetFiles("personal");
            personalData = File.ReadAllBytes(personalList[personalList.Length - 1]);
            indexList    = Personal.getPersonalIndexList(personalData, Main.oras);
            personal     = new byte[personalList.Length][];
            for (int i = 0; i < personalList.Length; i++)
            {
                personal[i] = File.ReadAllBytes("personal" + Path.DirectorySeparatorChar + i.ToString("000") + ".bin");
            }
            AltForms = Personal.getFormList(personalData, Main.oras, specieslist, forms, types, itemlist);

            Array.Resize(ref trName, trdatapaths.Length);
            CB_TrainerID.Items.Clear();
            for (int i = 0; i < trdatapaths.Length; i++)
            {
                CB_TrainerID.Items.Add(String.Format("{1} - {0}", i.ToString("000"), trName[i] ?? "UNKNOWN"));
            }

            CB_Trainer_Class.Items.Clear();
            for (int i = 0; i < trClass.Length; i++)
            {
                CB_Trainer_Class.Items.Add(String.Format("{1} - {0}", i.ToString("000"), trClass[i]));
            }

            specieslist[0] = "---";
            abilitylist[0] = itemlist[0] = movelist[0] = "";

            for (int i = 0; i < 6; i++)
            {
                trpk_pkm[i].Items.Clear();
                foreach (string s in specieslist)
                {
                    trpk_pkm[i].Items.Add(s);
                }

                trpk_m1[i].Items.Clear();
                trpk_m2[i].Items.Clear();
                trpk_m3[i].Items.Clear();
                trpk_m4[i].Items.Clear();
                foreach (string s in movelist)
                {
                    trpk_m1[i].Items.Add(s);
                    trpk_m2[i].Items.Add(s);
                    trpk_m3[i].Items.Add(s);
                    trpk_m4[i].Items.Add(s);
                }

                trpk_item[i].Items.Clear();
                foreach (string s in itemlist)
                {
                    trpk_item[i].Items.Add(s);
                }

                trpk_lvl[i].Items.Clear();
                for (int z = 0; z <= 100; z++)
                {
                    trpk_lvl[i].Items.Add((z).ToString());
                }

                trpk_IV[i].Items.Clear();
                for (int z = 0; z < 256; z++)
                {
                    trpk_IV[i].Items.Add(z.ToString());
                }

                trpk_gender[i].Items.Clear();
                trpk_gender[i].Items.Add("- / G/Random");
                trpk_gender[i].Items.Add("♂ / M");
                trpk_gender[i].Items.Add("♀ / F");

                trpk_form[i].Items.Add("");

                trpk_pkm[i].SelectedIndex = 0;
            }
            CB_Item_1.Items.Clear();
            CB_Item_2.Items.Clear();
            CB_Item_3.Items.Clear();
            CB_Item_4.Items.Clear();
            CB_Prize.Items.Clear();
            foreach (string s in itemlist)
            {
                CB_Item_1.Items.Add(s);
                CB_Item_2.Items.Add(s);
                CB_Item_3.Items.Add(s);
                CB_Item_4.Items.Add(s);
                CB_Prize.Items.Add(s);
            }

            CB_AI.Items.Clear(); CB_Money.Items.Clear();
            for (int i = 0; i < 256; i++)
            {
                CB_AI.Items.Add(i.ToString()); CB_Money.Items.Add(i.ToString());
            }

            CB_Battle_Type.Items.Clear();
            CB_Battle_Type.Items.Add("Single");
            CB_Battle_Type.Items.Add("Double");
            CB_Battle_Type.Items.Add("Triple");
            CB_Battle_Type.Items.Add("Rotation");
            CB_Battle_Type.Items.Add("Horde");

            CB_TrainerID.SelectedIndex = 1;
            start = false;
            readFile();
            System.Media.SystemSounds.Asterisk.Play();
        }
コード例 #2
0
        public XYWE()
        {
            InitializeComponent();
            spec = new[]
            {
                CB_Grass1, CB_Grass2, CB_Grass3, CB_Grass4, CB_Grass5, CB_Grass6, CB_Grass7, CB_Grass8, CB_Grass9, CB_Grass10, CB_Grass11, CB_Grass12,
                CB_Yellow1, CB_Yellow2, CB_Yellow3, CB_Yellow4, CB_Yellow5, CB_Yellow6, CB_Yellow7, CB_Yellow8, CB_Yellow9, CB_Yellow10, CB_Yellow11, CB_Yellow12,
                CB_Purple1, CB_Purple2, CB_Purple3, CB_Purple4, CB_Purple5, CB_Purple6, CB_Purple7, CB_Purple8, CB_Purple9, CB_Purple10, CB_Purple11, CB_Purple12,
                CB_Red1, CB_Red2, CB_Red3, CB_Red4, CB_Red5, CB_Red6, CB_Red7, CB_Red8, CB_Red9, CB_Red10, CB_Red11, CB_Red12,
                CB_RT1, CB_RT2, CB_RT3, CB_RT4, CB_RT5, CB_RT6, CB_RT7, CB_RT8, CB_RT9, CB_RT10, CB_RT11, CB_RT12,
                CB_Surf1, CB_Surf2, CB_Surf3, CB_Surf4, CB_Surf5,
                CB_RockSmash1, CB_RockSmash2, CB_RockSmash3, CB_RockSmash4, CB_RockSmash5,
                CB_Old1, CB_Old2, CB_Old3,
                CB_Good1, CB_Good2, CB_Good3,
                CB_Super1, CB_Super2, CB_Super3,
                CB_HordeA1, CB_HordeA2, CB_HordeA3, CB_HordeA4, CB_HordeA5,
                CB_HordeB1, CB_HordeB2, CB_HordeB3, CB_HordeB4, CB_HordeB5,
                CB_HordeC1, CB_HordeC2, CB_HordeC3, CB_HordeC4, CB_HordeC5,
            };
            min = new[]
            {
                NUP_GrassMin1, NUP_GrassMin2, NUP_GrassMin3, NUP_GrassMin4, NUP_GrassMin5, NUP_GrassMin6, NUP_GrassMin7, NUP_GrassMin8, NUP_GrassMin9, NUP_GrassMin10, NUP_GrassMin11, NUP_GrassMin12,
                NUP_YellowMin1, NUP_YellowMin2, NUP_YellowMin3, NUP_YellowMin4, NUP_YellowMin5, NUP_YellowMin6, NUP_YellowMin7, NUP_YellowMin8, NUP_YellowMin9, NUP_YellowMin10, NUP_YellowMin11, NUP_YellowMin12,
                NUP_PurpleMin1, NUP_PurpleMin2, NUP_PurpleMin3, NUP_PurpleMin4, NUP_PurpleMin5, NUP_PurpleMin6, NUP_PurpleMin7, NUP_PurpleMin8, NUP_PurpleMin9, NUP_PurpleMin10, NUP_PurpleMin11, NUP_PurpleMin12,
                NUP_RedMin1, NUP_RedMin2, NUP_RedMin3, NUP_RedMin4, NUP_RedMin5, NUP_RedMin6, NUP_RedMin7, NUP_RedMin8, NUP_RedMin9, NUP_RedMin10, NUP_RedMin11, NUP_RedMin12,
                NUP_RTMin1, NUP_RTMin2, NUP_RTMin3, NUP_RTMin4, NUP_RTMin5, NUP_RTMin6, NUP_RTMin7, NUP_RTMin8, NUP_RTMin9, NUP_RTMin10, NUP_RTMin11, NUP_RTMin12,
                NUP_SurfMin1, NUP_SurfMin2, NUP_SurfMin3, NUP_SurfMin4, NUP_SurfMin5,
                NUP_RockSmashMin1, NUP_RockSmashMin2, NUP_RockSmashMin3, NUP_RockSmashMin4, NUP_RockSmashMin5,
                NUP_OldMin1, NUP_OldMin2, NUP_OldMin3,
                NUP_GoodMin1, NUP_GoodMin2, NUP_GoodMin3,
                NUP_SuperMin1, NUP_SuperMin2, NUP_SuperMin3,
                NUP_HordeAMin1, NUP_HordeAMin2, NUP_HordeAMin3, NUP_HordeAMin4, NUP_HordeAMin5,
                NUP_HordeBMin1, NUP_HordeBMin2, NUP_HordeBMin3, NUP_HordeBMin4, NUP_HordeBMin5,
                NUP_HordeCMin1, NUP_HordeCMin2, NUP_HordeCMin3, NUP_HordeCMin4, NUP_HordeCMin5,
            };
            max = new[]
            {
                NUP_GrassMax1, NUP_GrassMax2, NUP_GrassMax3, NUP_GrassMax4, NUP_GrassMax5, NUP_GrassMax6, NUP_GrassMax7, NUP_GrassMax8, NUP_GrassMax9, NUP_GrassMax10, NUP_GrassMax11, NUP_GrassMax12,
                NUP_YellowMax1, NUP_YellowMax2, NUP_YellowMax3, NUP_YellowMax4, NUP_YellowMax5, NUP_YellowMax6, NUP_YellowMax7, NUP_YellowMax8, NUP_YellowMax9, NUP_YellowMax10, NUP_YellowMax11, NUP_YellowMax12,
                NUP_PurpleMax1, NUP_PurpleMax2, NUP_PurpleMax3, NUP_PurpleMax4, NUP_PurpleMax5, NUP_PurpleMax6, NUP_PurpleMax7, NUP_PurpleMax8, NUP_PurpleMax9, NUP_PurpleMax10, NUP_PurpleMax11, NUP_PurpleMax12,
                NUP_RedMax1, NUP_RedMax2, NUP_RedMax3, NUP_RedMax4, NUP_RedMax5, NUP_RedMax6, NUP_RedMax7, NUP_RedMax8, NUP_RedMax9, NUP_RedMax10, NUP_RedMax11, NUP_RedMax12,
                NUP_RTMax1, NUP_RTMax2, NUP_RTMax3, NUP_RTMax4, NUP_RTMax5, NUP_RTMax6, NUP_RTMax7, NUP_RTMax8, NUP_RTMax9, NUP_RTMax10, NUP_RTMax11, NUP_RTMax12,
                NUP_SurfMax1, NUP_SurfMax2, NUP_SurfMax3, NUP_SurfMax4, NUP_SurfMax5,
                NUP_RockSmashMax1, NUP_RockSmashMax2, NUP_RockSmashMax3, NUP_RockSmashMax4, NUP_RockSmashMax5,
                NUP_OldMax1, NUP_OldMax2, NUP_OldMax3,
                NUP_GoodMax1, NUP_GoodMax2, NUP_GoodMax3,
                NUP_SuperMax1, NUP_SuperMax2, NUP_SuperMax3,
                NUP_HordeAMax1, NUP_HordeAMax2, NUP_HordeAMax3, NUP_HordeAMax4, NUP_HordeAMax5,
                NUP_HordeBMax1, NUP_HordeBMax2, NUP_HordeBMax3, NUP_HordeBMax4, NUP_HordeBMax5,
                NUP_HordeCMax1, NUP_HordeCMax2, NUP_HordeCMax3, NUP_HordeCMax4, NUP_HordeCMax5,
            };
            form = new[]
            {
                NUP_GrassForme1, NUP_GrassForme2, NUP_GrassForme3, NUP_GrassForme4, NUP_GrassForme5, NUP_GrassForme6, NUP_GrassForme7, NUP_GrassForme8, NUP_GrassForme9, NUP_GrassForme10, NUP_GrassForme11, NUP_GrassForme12,
                NUP_YellowForme1, NUP_YellowForme2, NUP_YellowForme3, NUP_YellowForme4, NUP_YellowForme5, NUP_YellowForme6, NUP_YellowForme7, NUP_YellowForme8, NUP_YellowForme9, NUP_YellowForme10, NUP_YellowForme11, NUP_YellowForme12,
                NUP_PurpleForme1, NUP_PurpleForme2, NUP_PurpleForme3, NUP_PurpleForme4, NUP_PurpleForme5, NUP_PurpleForme6, NUP_PurpleForme7, NUP_PurpleForme8, NUP_PurpleForme9, NUP_PurpleForme10, NUP_PurpleForme11, NUP_PurpleForme12,
                NUP_RedForme1, NUP_RedForme2, NUP_RedForme3, NUP_RedForme4, NUP_RedForme5, NUP_RedForme6, NUP_RedForme7, NUP_RedForme8, NUP_RedForme9, NUP_RedForme10, NUP_RedForme11, NUP_RedForme12,
                NUP_RTForme1, NUP_RTForme2, NUP_RTForme3, NUP_RTForme4, NUP_RTForme5, NUP_RTForme6, NUP_RTForme7, NUP_RTForme8, NUP_RTForme9, NUP_RTForme10, NUP_RTForme11, NUP_RTForme12,
                NUP_SurfForme1, NUP_SurfForme2, NUP_SurfForme3, NUP_SurfForme4, NUP_SurfForme5,
                NUP_RockSmashForme1, NUP_RockSmashForme2, NUP_RockSmashForme3, NUP_RockSmashForme4, NUP_RockSmashForme5,
                NUP_OldForme1, NUP_OldForme2, NUP_OldForme3,
                NUP_GoodForme1, NUP_GoodForme2, NUP_GoodForme3,
                NUP_SuperForme1, NUP_SuperForme2, NUP_SuperForme3,
                NUP_HordeAForme1, NUP_HordeAForme2, NUP_HordeAForme3, NUP_HordeAForme4, NUP_HordeAForme5,
                NUP_HordeBForme1, NUP_HordeBForme2, NUP_HordeBForme3, NUP_HordeBForme4, NUP_HordeBForme5,
                NUP_HordeCForme1, NUP_HordeCForme2, NUP_HordeCForme3, NUP_HordeCForme4, NUP_HordeCForme5,
            };

            formlist = new[] { "Unown-A - 0",
                               "Unown-B - 1",
                               "Unown-C - 2",
                               "Unown-D - 3",
                               "Unown-E - 4",
                               "Unown-F - 5",
                               "Unown-G - 6",
                               "Unown-H - 7",
                               "Unown-I - 8",
                               "Unown-J - 9",
                               "Unown-K - 10",
                               "Unown-L - 11",
                               "Unown-M - 12",
                               "Unown-N - 13",
                               "Unown-O - 14",
                               "Unown-P - 15",
                               "Unown-Q - 16",
                               "Unown-R - 17",
                               "Unown-S - 18",
                               "Unown-T - 19",
                               "Unown-U - 20",
                               "Unown-V - 21",
                               "Unown-W - 22",
                               "Unown-X - 23",
                               "Unown-Y - 24",
                               "Unown-Z - 25",
                               "Unown-! - 26",
                               "Unown-? - 27",
                               "",
                               "Castform-Normal - 0",
                               "Castform-Sunny - 1",
                               "Castform-Rainy - 2",
                               "Castform-Snowy - 3",
                               "",
                               "Deoxys-Normal - 0",
                               "Deoxys-Attack - 1",
                               "Deoxys-Defense - 2",
                               "Deoxys-Speed - 3",
                               "",
                               "Burmy-Plant Cloak - 0",
                               "Burmy-Sandy Cloak - 1",
                               "Burmy-Trash Cloak - 2",
                               "",
                               "Wormadam-Plant Cloak - 0",
                               "Wormadam-Sandy Cloak - 1",
                               "Wormadam-Trash Cloak - 2",
                               "",
                               "Cherrim-Overcast - 0",
                               "Cherrim-Sunshine - 1",
                               "",
                               "Shellos-West Sea - 0",
                               "Shellos-East Sea - 1",
                               "",
                               "Gastrodon-West Sea - 0",
                               "Gastrodon-East Sea - 1",
                               "",
                               "Rotom-Normal - 0",
                               "Rotom-Heat - 1",
                               "Rotom-Wash - 2",
                               "Rotom-Frost - 3",
                               "Rotom-Fan - 4",
                               "Rotom-Mow - 5",
                               "",
                               "Giratina-Altered - 0",
                               "Giratina-Origin - 1",
                               "",
                               "Shaymin-Land - 0",
                               "Shaymin-Sky - 1",
                               "",
                               "Arceus-Normal - 0",
                               "Arceus-Fighting - 1",
                               "Arceus-Flying - 2",
                               "Arceus-Poison - 3",
                               "Arceus-Ground - 4",
                               "Arceus-Rock - 5",
                               "Arceus-Bug - 6",
                               "Arceus-Ghost - 7",
                               "Arceus-Steel - 8",
                               "Arceus-Fire - 9",
                               "Arceus-Water - 10",
                               "Arceus-Grass - 11",
                               "Arceus-Electric - 12",
                               "Arceus-Psychic - 13",
                               "Arceus-Ice - 14",
                               "Arceus-Dragon - 15",
                               "Arceus-Dark - 16",
                               "",
                               "Basculin-Red-Striped - 0",
                               "Basculin-Blue-Striped - 1",
                               "",
                               "Darmanitan-Standard Mode - 0",
                               "Darmanitan-Zen Mode - 1",
                               "",
                               "Deerling-Spring - 0",
                               "Deerling-Summer - 1",
                               "Deerling-Autumn - 2",
                               "Deerling-Winter - 3",
                               "",
                               "Sawsbuck-Spring - 0",
                               "Sawsbuck-Summer - 1",
                               "Sawsbuck-Autumn - 2",
                               "Sawsbuck-Winter - 3",
                               "",
                               "Tornadus-Incarnate - 0",
                               "Tornadus-Therian - 1",
                               "",
                               "Thundurus-Incarnate - 0",
                               "Thundurus-Therian - 1",
                               "",
                               "Landorus-Incarnate - 0",
                               "Landorus-Therian - 1",
                               "",
                               "Kyurem-Normal - 0",
                               "Kyurem-White - 1",
                               "Kyurem-Black - 2",
                               "",
                               "Keldeo-Usual - 0",
                               "Keldeo-Resolution - 1",
                               "",
                               "Meloetta-Aria - 0",
                               "Meloetta-Pirouette - 1",
                               "",
                               "Genesect-Normal - 0",
                               "Genesect-Water - 1",
                               "Genesect-Electric - 2",
                               "Genesect-Fire - 3",
                               "Genesect-Ice - 4",
                               "",
                               "Flabebe-Red - 0",
                               "Flabebe-Yellow - 1",
                               "Flabebe-Orange - 2",
                               "Flabebe-Blue - 3",
                               "Flabebe-White - 4",
                               "",
                               "Floette-Red - 0",
                               "Floette-Yellow - 1",
                               "Floette-Orange - 2",
                               "Floette-Blue - 3",
                               "Floette-Wite - 4",
                               "Floette-Eternal - 5",
                               "",
                               "Florges-Red - 0",
                               "Florges-Yellow - 1",
                               "Florges-Orange - 2",
                               "Florges-Blue - 3",
                               "Florges-White - 4",
                               "",
                               "Furfrou- Natural - 0",
                               "Furfrou- Heart - 1",
                               "Furfrou- Star - 2",
                               "Furfrou- Diamond - 3",
                               "Furfrou- Deputante - 4",
                               "Furfrou- Matron - 5",
                               "Furfrou- Dandy - 6",
                               "Furfrou- La Reine- 7",
                               "Furfrou- Kabuki - 8",
                               "Furfrou- Pharaoh - 9",
                               "",
                               "Aegislash- Shield - 0",
                               "Aegislash- Blade - 0",
                               "",
                               "Vivillon-Icy Snow - 0",
                               "Vivillon-Polar - 1",
                               "Vivillon-Tundra - 2",
                               "Vivillon-Continental  - 3",
                               "Vivillon-Garden - 4",
                               "Vivillon-Elegant - 5",
                               "Vivillon-Meadow - 6",
                               "Vivillon-Modern  - 7",
                               "Vivillon-Marine - 8",
                               "Vivillon-Archipelago - 9",
                               "Vivillon-High-Plains - 10",
                               "Vivillon-Sandstorm - 11",
                               "Vivillon-River - 12",
                               "Vivillon-Monsoon - 13",
                               "Vivillon-Savannah  - 14",
                               "Vivillon-Sun - 15",
                               "Vivillon-Ocean - 16",
                               "Vivillon-Jungle - 17",
                               "Vivillon-Fancy - 18",
                               "Vivillon-Poké Ball - 19",
                               "",
                               "Pumpkaboo/Gourgeist-Small - 0",
                               "Pumpkaboo/Gourgeist-Average - 1",
                               "Pumpkaboo/Gourgeist-Large - 2",
                               "Pumpkaboo/Gourgeist-Super - 3",
                               "",
                               "Megas-Normal - 0",
                               "Megas-Mega (X) - 1",
                               "Megas-Mega (Y) - 2", };
            Load_XYWE(null, null);
            openQuick(Directory.GetFiles("encdata"));

            string[] personalList = Directory.GetFiles("personal");
            personalData = File.ReadAllBytes(personalList[personalList.Length - 1]);
            indexList    = Personal.getPersonalIndexList(personalData, Main.oras);
            personal     = new byte[personalList.Length][];
            for (int i = 0; i < personalList.Length; i++)
            {
                personal[i] = File.ReadAllBytes("personal" + Path.DirectorySeparatorChar + i.ToString("000") + ".bin");
            }
        }
コード例 #3
0
ファイル: RSTE.cs プロジェクト: sherkinator/pk3DS
        private void readFile()
        {
            if (start)
            {
                return;
            }
            index   = CB_TrainerID.SelectedIndex;
            loading = true;
            int format;

            if (index == 0)
            {
                return;
            }

            // Load Trainer Data
            using (BinaryReader br = new BinaryReader((Stream)File.OpenRead(trdatapaths[index])))
            {
                // load trainer data
                tabControl1.Enabled = true;
                {
                    format = (Main.oras) ? br.ReadUInt16() : br.ReadByte();
                    CB_Trainer_Class.SelectedIndex = (Main.oras) ? br.ReadUInt16() : br.ReadByte();
                    if (Main.oras)
                    {
                        br.ReadUInt16();
                    }

                    checkBox_Item.Checked  = ((format >> 1) & 1) == 1;
                    checkBox_Moves.Checked = ((format) & 1) == 1;

                    CB_Battle_Type.SelectedIndex = br.ReadByte();
                    CB_numPokemon.SelectedIndex  = br.ReadByte();

                    CB_Item_1.SelectedIndex = br.ReadUInt16();
                    CB_Item_2.SelectedIndex = br.ReadUInt16();
                    CB_Item_3.SelectedIndex = br.ReadUInt16();
                    CB_Item_4.SelectedIndex = br.ReadUInt16();
                    CB_AI.SelectedIndex     = br.ReadByte();
                    br.ReadByte();
                    br.ReadByte();
                    br.ReadByte();

                    checkBox_Healer.Checked = Convert.ToBoolean(br.ReadByte());
                    CB_Money.SelectedIndex  = br.ReadByte();

                    CB_Prize.SelectedIndex = br.ReadUInt16();
                }
            }
            // Load Pokemon Data
            using (BinaryReader br = new BinaryReader((Stream)File.OpenRead(trpokepaths[index])))
            {
                for (int i = 0; i < CB_numPokemon.SelectedIndex; i++)
                {
                    trpk_IV[i].SelectedIndex = br.ReadByte();
                    byte PID = br.ReadByte();
                    trpk_lvl[i].SelectedIndex = br.ReadUInt16();
                    trpk_pkm[i].SelectedIndex = br.ReadUInt16();
                    Personal.setForms(trpk_pkm[i].SelectedIndex, trpk_form[i], AltForms);
                    trpk_form[i].SelectedIndex = br.ReadUInt16() % trpk_form[i].Items.Count; // stupid X/Y bug edge cases (220 / 222)
                    refreshPKMSlotAbility(i);                                                // Repopulate Abilities

                    trpk_abil[i].SelectedIndex   = PID >> 4;
                    trpk_gender[i].SelectedIndex = PID & 3;

                    if (((format >> 1) & 1) == 1) // Items Exist in Data
                    {
                        trpk_item[i].SelectedIndex = br.ReadUInt16();
                    }
                    if (((format) & 1) == 1) // Moves Exist in Data
                    {
                        trpk_m1[i].SelectedIndex = br.ReadUInt16();
                        trpk_m2[i].SelectedIndex = br.ReadUInt16();
                        trpk_m3[i].SelectedIndex = br.ReadUInt16();
                        trpk_m4[i].SelectedIndex = br.ReadUInt16();
                    }
                }
            }
            loading = false;
            changeTrainerType(null, null); // Prompt cleaning update of PKM fields
        }