Esempio n. 1
0
 public void Pokemonextend()
 {
     Setmove(move);
     this.Item    = null;
     this.Ability = Pokemondata.GetAbilityName(AbilityList[0]);
     this.Shiny   = false;
     this.EVS     = new Racial();
     this.IVS     = new Racial(31);
     this.Nature  = Pokemondata.getNatureClass(0);
     this.Level   = 50;
 }
Esempio n. 2
0
        // public Pokemon(Pokemon f) {
        //     super(f.name, f.PokemonID, f.NameList, f.TypeId, f.AbilityList, f.FormId, f.RacialValue);
        //     Pokemonextend(f.movelist, f.Item, f.Ability, f.Shiny, f.EVS, f.IVS, f.Level, f.Nature);
        // }
        public void Pokemonextend(string[] move, string Item, string Ability, bool Shiny, Racial EVS, Racial IVS,
                                  int Level, NatureClass Nature)
        {
            Setmove(move);
            this.Item    = Item;
            this.Ability = Ability;
            this.Shiny   = Shiny;

            // this.EVS = new Racial(EVS) ;
            // this.IVS = new Racial(IVS);
            this.EVS    = (EVS);
            this.IVS    = (IVS);
            this.Level  = Level;
            this.Nature = (Nature == null ? Pokemondata.getNatureClass(0) : Nature);
            // this.Nature = new NatureClass(Nature);
        }
Esempio n. 3
0
        public static PokemonInfo PStoPokemon_once(string PStext)
        {
            string[] data        = Regex.Split(PStext.Trim(), "\r*\n");
            string[] NameandItem = Regex.Split(data[0].Trim(), @"\s+@\s+"); // 昵称
            string   Item        = null;
            string   Name        = NameandItem[0];
            string   move        = "";
            string   Ability     = null;
            Racial   EVSfin      = new Racial();

            EVSfin.clear();
            Racial IVsfin = new Racial();

            IVsfin.fill();
            int Level     = 50;
            int Happiness = 160;

            if (NameandItem.Length > 1)
            {
                Item = Pokemondata.GetItemName(Pokemondata.EnglishNametoItemID(NameandItem[1]));
            }
            string[] ntemp    = Regex.Split(Name, @"\s+\(");
            string   nickname = null;
            string   Nature   = "Serious";
            bool     SHINY    = false;

            if (ntemp.Length == 3)
            {
                nickname = ntemp[0];
                Name     = ntemp[1].Substring(0, ntemp[1].Length - 1);
            }
            else if (ntemp.Length == 2)
            {
                if (ntemp[1].Length <= 4)
                {
                    Name = ntemp[0];
                }
                else
                {
                    Name = ntemp[1].Substring(0, ntemp[1].Length - 1);
                }
            }
            int qq = 9;
            //Name = Name.Replace("-Gmax", "");
            PokemonInfo PB = new PokemonInfo(Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(Name.Replace("-Gmax", ""))));

            if (Name.Contains("-Gmax"))
            {
                PB.Gmax = true;
            }
            for (int i = 1; i < data.Length; ++i)
            {
                string[] temp = Regex.Split(data[i].Trim(), @"\s*:\s*");
                switch (temp[0])
                {
                case "Ability":
                    Ability = Pokemondata.GetAbilityName(Pokemondata.EnglishNametoAbilityID(temp[1]));
                    break;

                case "EVs":
                    string[] EVs = Regex.Split(temp[1], @"\s*/\s*");

                    foreach (string item in EVs)
                    {
                        string[] orz = Regex.Split(item, @"\s+");
                        if (title(orz[1]) >= 0)
                        {
                            EVSfin.FromnumToSet(title(orz[1]), int.Parse(orz[0]));
                        }
                    }
                    break;

                case "IVs":
                    string[] IVs = Regex.Split(temp[1], @"\s*/\s*");

                    foreach (string item in IVs)
                    {
                        string[] orz = Regex.Split(item, @"\s+");
                        if (title(orz[1]) >= 0)
                        {
                            IVsfin.FromnumToSet(title(orz[1]), int.Parse(orz[0]));
                        }
                    }
                    break;

                case "Level":
                    Level = int.Parse(temp[1]);
                    break;

                case "Shiny":
                    if (temp[1] == "Yes")
                    {
                        SHINY = true;
                    }

                    break;

                case "Happiness":
                    Happiness = int.Parse(temp[1]);
                    break;

                default:
                    string[] gg = data[i].Split(' ');
                    if (gg[1] == "Nature")
                    {
                        Nature = gg[0];
                    }
                    else
                    {
                        string move1 = Regex.Replace(data[i].Trim(), @"\s*-\s+", "");
                        if (move1.Contains("Hidden Power"))
                        {
                            if (move1.Contains("["))
                            {
                                string wqeeq = move1.Substring(move1.IndexOf("[")
                                                               + 1, move1.Length - move1.IndexOf("[") - 2);
                                move1 = "觉醒力量-" + Pokemondata.GetTypeName
                                            (Pokemondata.GetEngTypeId(move1.Substring(move1.IndexOf("[")
                                                                                      + 1, move1.Length - move1.IndexOf("[") - 2)));
                            }
                            else
                            {
                                move1 = "觉醒力量-" + Pokemondata.GetTypeName(Pokemondata.GetEngTypeId(IVsfin.getHiddenPowerType()));
                            }
                            if (move == "")
                            {
                                move = move1;
                            }
                            else
                            {
                                move += "," + (move1);
                            }
                        }
                        else
                        {
                            if (move == "")
                            {
                                move = Pokemondata.GetMoveName(Pokemondata.EnglishNametoMoveID(move1));
                            }
                            else
                            {
                                move += "," + Pokemondata.GetMoveName(Pokemondata.EnglishNametoMoveID(move1));
                            }
                        }
                        //move1 = Regex.Replace(move1, "\\[.+?\\]", "").Trim();
                    }
                    break;
                }
            }
            string[] movelist = move.Split(',');
            PB.Pokemonextend(movelist, Item, Ability, SHINY, EVSfin, IVsfin, Level, Pokemondata.getNatureClass(Nature));
            return(PB);
        }
Esempio n. 4
0
        public static string PokemontochiPS_once(PokemonInfo poke)
        {
            string team = poke.name;

            if (poke.Gmax)
            {
                team += "-超极巨";
            }
            if (poke.Item != "")
            {
                team += " @ " + poke.Item;
            }
            team += "\r\n";
            if (poke.Ability != "")
            {
                team += "特性: " + poke.Ability + "\r\n";
            }
            team += "等级: 50\r\n";
            if (poke.Happiness != 160)
            {
                team += "亲密度: " + poke.Happiness + "\r\n";
            }

            string aa = "";

            string[] orz = { "HP", "物攻", "物防", "特攻", "特防", "速度" };
            for (int i = 0; i < 6; ++i)
            {
                if (poke.EVS.Value[i] != 0)
                {
                    aa += " " + (poke.EVS.Value[i]).ToString() + " " + orz[i] + " /";
                }
            }
            if (aa != "")
            {
                team += "努力值:" + aa.Substring(0, aa.Length - 1) + "\r\n";
            }
            if (poke.Nature != null)
            {
                team += poke.Nature.name;
            }
            else
            {
                team += Pokemondata.getNatureClass(0);
            }
            team += " 性格\r\n";
            aa    = "";
            for (int i = 0; i < 6; ++i)
            {
                if (poke.IVS.Value[i] != 31)
                {
                    aa += " " + (poke.IVS.Value[i]).ToString() + " " + orz[i] + " /";
                }
            }
            if (aa != "")
            {
                team += "个体值:" + aa.Substring(0, aa.Length - 1) + "\r\n";
            }

            foreach (string i in poke.move)
            {
                if (i != "")
                {
                    team += "- " + i + "\r\n";
                }
            }
            return(team);
        }
Esempio n. 5
0
        public static string PokemontoPS_once(PokemonInfo poke)
        {
            string team = Pokemondata.EnglishName[(int)(Pokemondata.PokemonnameID[poke.name])];

            if (poke.Gmax)
            {
                team += "-Gmax";
            }
            if (poke.Item != "")
            {
                team += " @ " + Pokemondata.ItemEngName[Pokemondata.GetItemId(poke.Item)];
            }
            team += "\r\n";
            if (poke.Ability != "")
            {
                team += "Ability: " + Pokemondata.AbilityEngName[Pokemondata.GetAbilityId(poke.Ability)] + "\r\n";
            }
            team += "Level: 50\r\n";
            if (poke.Happiness != 160)
            {
                team += "Happiness: " + poke.Happiness + "\r\n";
            }
            string aa = "";

            string[] orz = { "HP", "Atk", "Def", "SpA", "SpD", "Spe" };
            for (int i = 0; i < 6; ++i)
            {
                if (poke.EVS.Value[i] != 0)
                {
                    aa += " " + (poke.EVS.Value[i]).ToString() + " " + orz[i] + " /";
                }
            }
            if (aa != "")
            {
                team += "EVs:" + aa.Substring(0, aa.Length - 1) + "\r\n";
            }
            if (poke.Nature != null)
            {
                team += Pokemondata.Engnature[poke.Nature.id];
            }
            else
            {
                team += Pokemondata.Engnature[0];
            }
            team += " Nature\r\n";
            aa    = "";
            for (int i = 0; i < 6; ++i)
            {
                if (poke.IVS.Value[i] != 31)
                {
                    aa += " " + (poke.IVS.Value[i]).ToString() + " " + orz[i] + " /";
                }
            }
            if (aa != "")
            {
                team += "IVs:" + aa.Substring(0, aa.Length - 1) + "\r\n";
            }

            foreach (string i in poke.move)
            {
                if (i != "")
                {
                    if (i.Contains("觉醒力量"))
                    {
                        if (i.Contains("-"))
                        {
                            team += string.Format("Hidden Power [{0}]\r\n", Pokemondata.GetEngTypeName(Pokemondata.GetTypeId(i.Substring(i.IndexOf("-") + 1))));
                        }
                        else
                        {
                            team += string.Format("Hidden Power [{0}]\r\n", poke.getHiddenPowerType());
                        }
                    }
                    else
                    {
                        team += "- " + Pokemondata.MoveEngName[Pokemondata.GetMoveId(i)] + "\r\n";
                    }
                }
            }
            return(team);
        }
Esempio n. 6
0
            public zhuzhuang1(resstruct[] heidi, int x, int y, tjt main)
            {
                min.BorderStyle = BorderStyle.FixedSingle;
                //min.BackColor = Color.Blue;
                min.BackColor   = Color.FromArgb(Pokemondata.MOVEDATA[(int)Pokemondata.EngMoveID[heidi[0].move]].color1 + (0xff << 24));
                max.BorderStyle = BorderStyle.FixedSingle;
                //max.BackColor = Color.Red;
                max.BackColor = Color.FromArgb(Pokemondata.MOVEDATA[(int)Pokemondata.EngMoveID[heidi[0].move]].color2 + (0xff << 24));

                //Color.FromArgb(0xaaaaaa);
                string[] sci = heidi[1].damagebfb.Substring(0, heidi[0].damagebfb.Length - 1).Split('-');

                min.SetBounds(x, y, (int)(5 * double.Parse(sci[0])), 25);
                min.Text      = Pokemondata.GetMoveName(Pokemondata.EnglishNametoMoveID(heidi[0].move));
                min.TextAlign = ContentAlignment.MiddleCenter;
                max.SetBounds(x, y, (int)(5 * double.Parse(sci[1])), 25);
                minimg.SetBounds(x + 10, y + 25, 40, 40);
                while (!Pokemondata.EngPokemonID.Contains(heidi[1].pokemon))
                {
                    heidi[1].pokemon = heidi[1].pokemon.Substring(0, heidi[1].pokemon.LastIndexOf('-'));
                }

                minimg.Image     = (Image)pokeimg.ResourceManager.GetObject(Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(heidi[1].pokemon)).name.Replace('-', 'T'));
                dmgdec.Location  = new Point(x + 50, y + 40);
                statdec.Location = new Point(x + 50, y + 60);
                dmgdec.Text      = Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(heidi[1].pokemon)).name;
                if (heidi[1].item != null)
                {
                    dmgdec.Text += " " + Pokemondata.GetItemName(Pokemondata.EnglishNametoItemID(heidi[1].item));
                }
                dmgdec.Text += "(";
                if (heidi[1].stat > 0)
                {
                    dmgdec.Text += "+";
                    dmgdec.Text += heidi[1].stat.ToString() + " ";
                }
                else if (heidi[1].stat < 0)
                {
                    dmgdec.Text += heidi[1].stat.ToString() + " ";
                }
                if (heidi[1].IVs.Value[2] != -1)
                {
                    string scixing = (heidi[1].IVs.Value[2]).ToString();
                    if (heidi[1].defplus == 1)
                    {
                        scixing += "+";
                    }
                    else if (heidi[1].defplus == -1)
                    {
                        scixing += "-";
                    }
                    dmgdec.Text += string.Format("{0} HP {1} 物防)", heidi[1].IVs.Value[0], scixing);
                }
                else
                {
                    string scixing = (heidi[1].IVs.Value[4]).ToString();
                    if (heidi[1].spaplus == 1)
                    {
                        scixing += "+";
                    }
                    else if (heidi[1].spaplus == -1)
                    {
                        scixing += "-";
                    }
                    dmgdec.Text += string.Format("{0} HP {1} 特防)", heidi[1].IVs.Value[0], scixing);
                }
                dmgdec.Text += "受到 " + Pokemondata.GetMoveName(Pokemondata.EnglishNametoMoveID(heidi[0].move));
                if (heidi[0].movepow != 0)
                {
                    dmgdec.Text += string.Format("({0} 威力)", heidi[0].movepow);
                }
                dmgdec.Text     += " " + heidi[0].damagenum.Trim();
                dmgdec.Text     += string.Format(" ({0})", heidi[0].damagebfb);
                dmgdec.AutoSize  = true;
                statdec.AutoSize = true;
                if (heidi[0].burn)
                {
                    statdec.Text += ",灼伤";
                }
                if (heidi[0].helpinghand)
                {
                    statdec.Text += ",帮助";
                }
                if (heidi[1].reflect)
                {
                    statdec.Text += ",反射壁";
                }
                if (heidi[1].lightscreen)
                {
                    statdec.Text += ",光墙";
                }
                if (heidi[1].auroraveil)
                {
                    statdec.Text += ",极光幕";
                }
                if (heidi[1].friendguard)
                {
                    statdec.Text += ",友情防守";
                }
                if (heidi[1].crit)
                {
                    statdec.Text += ",CT";
                }
                if (heidi[1].protect)
                {
                    statdec.Text += ",保护";
                }
                if (heidi[1].weather != null)
                {
                    statdec.Text += "," + heidi[1].weather;
                }
                if (heidi[1].terrain != null)
                {
                    statdec.Text += "," + heidi[1].terrain;
                }
                if (statdec.Text != "")
                {
                    statdec.Text = "其他附加状态: " + statdec.Text.Substring(1);
                }
                if (heidi[0].damagedec.Contains("HKO"))
                {
                    string mipha = Regex.Split(heidi[0].damagedec, "HKO")[0] + "HKO ";
                    statdec.Text = mipha + statdec.Text;
                }
                main.Controls.Add(min);
                main.Controls.Add(dmgdec);
                main.Controls.Add(statdec);
                main.Controls.Add(max);
                main.Controls.Add(minimg);

                //main.Controls.Add(new Button());
            }
Esempio n. 7
0
        private void tjt_Load(object sender, EventArgs e)
        {
            bd             = new Label();
            pic            = new Panel();
            bd.Paint      += Bd_Paint;
            bd.BorderStyle = BorderStyle.FixedSingle;
            bd.SetBounds(basex, basey, 500, 20 + icefairy.GetLength(0) * 100);
            //pic.Controls.Add(bd);
            this.Height = 150 + icefairy.GetLength(0) * 100;
            pic.SetBounds(0, 0, this.Width, this.Height);

            //g2.DrawLine(p, 0, 100, 100, 100);
            Label[] markx = new Label[11];

            for (int i = 0; i <= 10; ++i)
            {
                markx[i]          = new Label();
                markx[i].Text     = string.Format("{0}%", 10 * i);
                markx[i].Location = new Point(basex + 50 * i - 5, 20 + icefairy.GetLength(0) * 100 + basey);
                markx[i].AutoSize = true;
                Controls.Add(markx[i]);
            }
            Label heidi0821 = new Label();
            Label gazeru    = new Label();

            heidi0821.SetBounds(basex + 60, basey - 40, 40, 40);
            gazeru.Location = new Point(basex + 100, basey - 25);
            gazeru.AutoSize = true;
            if (flag == 0)
            {
                heidi0821.Image = (Image)pokeimg.ResourceManager.GetObject(Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(icefairy[0, 1].pokemon)).name.Replace('-', 'T'));
                gazeru.Text     = "防守方: " + Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(icefairy[0, 1].pokemon)).name;
                int    tempwg = 0;
                string item   = "";
                for (int i = 0; i < icefairy.GetLength(0); ++i)
                {
                    tempwg = Math.Max(tempwg, icefairy[i, 1].IVs.Value[2]);
                    if (icefairy[i, 1].item != "" && icefairy[i, 1].item != null)
                    {
                        item = icefairy[i, 1].item;
                    }
                }
                string wg = tempwg.ToString();
                if (icefairy[0, 1].defplus == 1)
                {
                    wg += "+";
                }
                else if (icefairy[0, 1].defplus == -1)
                {
                    wg += "-";
                }
                int temptg = 0;
                for (int i = 0; i < icefairy.GetLength(0); ++i)
                {
                    temptg = Math.Max(temptg, icefairy[i, 1].IVs.Value[4]);
                }
                string tg = temptg.ToString();
                if (icefairy[0, 1].spdplus == 1)
                {
                    tg += "+";
                }
                else if (icefairy[0, 1].spdplus == -1)
                {
                    tg += "-";
                }

                gazeru.Text += string.Format("({2} HP {0} 物防 {1} 特防)", wg, tg, icefairy[0, 1].IVs.Value[0]);
                if (item != "")
                {
                    gazeru.Text += " @ " + Pokemondata.GetItemName(Pokemondata.EnglishNametoItemID(item));
                }
            }
            else
            {
                heidi0821.Image = (Image)pokeimg.ResourceManager.GetObject(Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(icefairy[0, 0].pokemon)).name.Replace('-', 'T'));
                //heidi0821.Image = (Image)pokeimg.ResourceManager.GetObject(Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(icefairy[0, 1].pokemon)).name.Replace('-', 'T'));
                gazeru.Text = "进攻方: " + Pokemondata.GetPokemonBase(Pokemondata.EnglishNametopokeID(icefairy[0, 0].pokemon)).name;
                int    tempwg = 0;
                string item   = "";
                for (int i = 0; i < icefairy.GetLength(0); ++i)
                {
                    tempwg = Math.Max(tempwg, icefairy[i, 0].IVs.Value[1]);
                    if (icefairy[i, 0].item != "" && icefairy[i, 0].item != null)
                    {
                        item = icefairy[i, 0].item;
                    }
                }
                string wg = tempwg.ToString();
                if (icefairy[0, 0].atkplus == 1)
                {
                    wg += "+";
                }
                else if (icefairy[0, 0].atkplus == -1)
                {
                    wg += "-";
                }
                int temptg = 0;
                for (int i = 0; i < icefairy.GetLength(0); ++i)
                {
                    temptg = Math.Max(temptg, icefairy[i, 0].IVs.Value[3]);
                }
                string tg = temptg.ToString();
                if (icefairy[0, 1].spaplus == 1)
                {
                    tg += "+";
                }
                else if (icefairy[0, 1].spaplus == -1)
                {
                    tg += "-";
                }
                gazeru.Text += string.Format("({0} 攻击 {1} 特攻)", wg, tg);
                if (item != "")
                {
                    gazeru.Text += " @ " + Pokemondata.GetItemName(Pokemondata.EnglishNametoItemID(item));
                }
            }
            Controls.Add(heidi0821);
            Controls.Add(gazeru);
            for (int i = 0; i < icefairy.GetLength(0); ++i)
            {
                if (flag == 0)
                {
                    zhuzhuang aa = new zhuzhuang(new resstruct[] { icefairy[i, 0], icefairy[i, 1] }, basex, basey + 20 + 100 * i, this);
                }
                else
                {
                    zhuzhuang1 aa = new zhuzhuang1(new resstruct[] { icefairy[i, 0], icefairy[i, 1] }, basex, basey + 20 + 100 * i, this);
                }
            }

            Controls.Add(bd);
            Pen pen2 = new Pen(Color.Blue, 3);

            pen2.DashStyle   = DashStyle.Custom;
            pen2.DashPattern = new float[] { 1f, 1f };
            Graphics g2 = bd.CreateGraphics();

            g2.DrawLine(pen2, 125, 0, 125, 3000);
            //Controls.Add(pic);
        }