예제 #1
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());
            }
        }
예제 #2
0
 private void cbSpecies_SelectedIndexChanged(object sender, EventArgs e)
 {
     pictureBox1.Image = PokemonIcons.GetIcon(cbSpecies.SelectedIndex);
     UpdateFinalStats(null, null);
 }