Exemplo n.º 1
0
        public void SetPokemon(Pokemon pokemon)
        {
            // fix null pokemon entries
            if (pokemon.PokemonID == 255)
            {
                pokemon           = new Pokemon();
                pokemon.PokemonID = 0;
            }

            Pokemon          = pokemon;
            PictureBox.Image = null;
            PokemonName.Text = "";

            if (pokemon == null)
            {
                return;
            }

            var pinfo = PokemonDatabase.GetPokemonInfoFromID(pokemon.PokemonID);

            PictureBox.Image = PokemonIcons.GetIcon(pokemon.PokemonID);

            PokemonName.Text = pinfo.Name;
            if (pokemon.NickName != "")
            {
                PokemonName.Text = pokemon.NickName;
            }

            PokemonInfo.Text = "Lv: " + pokemon.Level + " " + (pinfo.HasGender() ? (pinfo.IsFemale(pokemon.ATKIV) ? "♀" : "♂") : "-");;
        }
Exemplo n.º 2
0
        private void UpdateFinalStats(object sender, EventArgs e)
        {
            var pokeInfo = PokemonDatabase.GetPokemonInfoFromID(cbSpecies.SelectedIndex);

            if (pokeInfo.HasGender())
            {
                if (pokeInfo.IsFemale((int)nudATKIV.Value))
                {
                    lbGender.Text = "♀";
                }
                else
                {
                    lbGender.Text = "♂";
                }
            }
            else
            {
                lbGender.Text = "-";
            }

            if (IsShiny())
            {
                lbGender.Text += "*";
            }

            tbEXP.Text = pokeInfo.GetEXPForLevel((int)nudLevel.Value).ToString();

            var hpiv = (((int)nudATKIV.Value & 0x1) << 3) | (((int)nudDEFIV.Value & 0x1) << 2) | (((int)nudSPDIV.Value & 0x1) << 1) | ((int)nudSPCIV.Value & 0x1);

            nudHPIV.Value = hpiv;

            lbCalHP.Text     = pokeInfo.CalcuateHP((int)nudLevel.Value, hpiv, (int)nudHPEV.Value).ToString();
            lbCalATK.Text    = pokeInfo.CalcuateATK((int)nudLevel.Value, (int)nudATKIV.Value, (int)nudDEFEV.Value).ToString();
            lbCalDEF.Text    = pokeInfo.CalcuateDEF((int)nudLevel.Value, (int)nudDEFIV.Value, (int)nudDEFEV.Value).ToString();
            lbCalSPCATK.Text = pokeInfo.CalcuateSPCATK((int)nudLevel.Value, (int)nudSPCIV.Value, (int)nudSPCEV.Value).ToString();
            lbCalSPCDEF.Text = pokeInfo.CalcuateSPCDEF((int)nudLevel.Value, (int)nudSPCIV.Value, (int)nudSPCEV.Value).ToString();
            lbCalSPD.Text    = pokeInfo.CalcuateSPD((int)nudLevel.Value, (int)nudSPDIV.Value, (int)nudSPDEV.Value).ToString();

            if (cbSpecies.SelectedIndex == 201)
            {
                pictureBox1.Image = PokemonIcons.GetIcon(cbSpecies.SelectedIndex, CalculateUnownType());
            }
        }
Exemplo n.º 3
0
        public Main()
        {
            InitializeComponent();

            buttonLittleCup.Enabled  = false;
            buttonPokeCup.Enabled    = false;
            buttonPrimeCup.Enabled   = false;
            buttonFreeBattle.Enabled = false;
            buttonGymCastle.Enabled  = false;

            for (int i = 9; i >= 0; i--)
            {
                PartySets[i]      = new GUIParty();
                PartySets[i].Text = "Set " + (i + 1);
                PartySets[i].Dock = DockStyle.Top;
                RegisteredSetPanels.Controls.Add(PartySets[i]);
            }

            for (int i = 0; i < 252; i++)
            {
                cbSpecies.Items.Add(PokemonDatabase.GetPokemonInfoFromID(i).Name);
            }

            foreach (var attack in PokemonDatabase.AttackInfo)
            {
                cbAttack1.Items.Add(attack.Name);
                cbAttack2.Items.Add(attack.Name);
                cbAttack3.Items.Add(attack.Name);
                cbAttack4.Items.Add(attack.Name);
            }

            cbSpecies.SelectedIndex      = 0;
            cbHeldItem.SelectedIndex     = 0;
            cbCaughtTime.SelectedIndex   = 0;
            cbCaughtGender.SelectedIndex = 0;
            cbLocation.SelectedIndex     = 0;
        }