示例#1
0
 public WildPokemon(BaseStats p, byte min, byte max, byte r)
 {
     mon      = p;
     minLevel = min;
     maxLevel = max;
     rate     = r;
 }
示例#2
0
        public void Evolve(BaseStats bs)
        {
            baseStats = bs;
            ushort hptemp = maxHP;

            maxHP          = (ushort)((((hpIV + (2 * baseStats.baseHP) + (hpEV >> 2) + 100) * Level) * 0.01) + 10);
            attack         = (ushort)((((attackIV + (2 * baseStats.baseAttack) + (attackEV >> 2)) * Level) * 0.01) + 5);
            defense        = (ushort)((((defenseIV + (2 * baseStats.baseDefense) + (defenseEV >> 2)) * Level) * 0.01) + 5);
            speed          = (ushort)((((speedIV + (2 * baseStats.baseSpeed) + (speedEV >> 2)) * Level) * 0.01) + 5);
            specialAttack  = (ushort)((((specialAttackIV + (2 * baseStats.baseSpecialAttack) + (specialAttackEV >> 2)) * Level) * 0.01) + 5);
            specialDefense = (ushort)((((specialDefenseIV + (2 * baseStats.baseSpecialDefense) + (specialDefenseEV >> 2)) * Level) * 0.01) + 5);
            hp            += (ushort)(maxHP - hptemp);
            int i = 0;

            foreach (LearnableMove m in baseStats.learnset)
            {
                if (Level >= m.level)
                {
                    moveSet[i] = m.move;
                    PP[i]      = m.move.basePP;
                    i          = (i == 3) ? 0 : i + 1;
                }
                else
                {
                    break;
                }
            }
        }
示例#3
0
 public WildPokemon(BaseStats p, byte min, byte max, byte r)
 {
     mon = p;
     minLevel = min;
     maxLevel = max;
     rate = r;
 }
示例#4
0
        public Pokemon(BaseStats bs, int l = 1, Move[] ms = null, string n = null)
        {
            baseStats   = bs;
            personality = (uint)((PRNG.Instance.Next() << 16) + PRNG.Instance.Next());
            nature      = (Nature)(personality % 25);
            happiness   = baseStats.baseHappiness;
            if (baseStats.abilities.Length == 1)
            {
                ability = baseStats.abilities[0];
            }
            else
            {
                ability = baseStats.abilities[personality % 2];
            }

            int iv1 = PRNG.Instance.Next();
            int iv2 = PRNG.Instance.Next();

            hpIV             = (byte)(iv1 & 0x1F);
            attackIV         = (byte)(iv1 & 0x3E0);
            defenseIV        = (byte)(iv1 & 0x7C00);
            specialDefenseIV = (byte)(iv2 & 0x1F);
            specialAttackIV  = (byte)(iv2 & 0x3E0);
            speedIV          = (byte)(iv2 & 0x7C00);
            nickname         = n;

            shiny = ((OTid ^ OTsecretid) ^ ((personality >> 16) ^ (personality & 65535))) < 8 ? true : false;

            for (int i = 0; i < l; i++)
            {
                LevelUp();
            }
            hp = maxHP;

            metLocation = Player.Instance.currentMap;
            metLevel    = Level;

            if (ms == null)
            {
                int i = 0;
                foreach (LearnableMove m in baseStats.learnset)
                {
                    if (Level >= m.level)
                    {
                        moveSet[i] = m.move;
                        PP[i]      = m.move.basePP;
                        i          = (i == 3) ? 0 : i + 1;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else
            {
                moveSet = ms;
            }
        }
示例#5
0
        public Pokemon(BaseStats bs, int l = 1, Move[] ms = null, string n = null)
        {
            baseStats = bs;
            personality = (uint)((PRNG.Instance.Next() << 16) + PRNG.Instance.Next());
            nature = (Nature)(personality % 25);
            happiness = baseStats.baseHappiness;
            if (baseStats.abilities.Length == 1) ability = baseStats.abilities[0];
            else ability = baseStats.abilities[personality % 2];

            int iv1 = PRNG.Instance.Next();
            int iv2 = PRNG.Instance.Next();
            hpIV = (byte)(iv1 & 0x1F);
            attackIV = (byte)(iv1 & 0x3E0);
            defenseIV = (byte)(iv1 & 0x7C00);
            specialDefenseIV = (byte)(iv2 & 0x1F);
            specialAttackIV = (byte)(iv2 & 0x3E0);
            speedIV = (byte)(iv2 & 0x7C00);
            nickname = n;

            shiny = ((OTid ^ OTsecretid) ^ ((personality >> 16) ^ (personality & 65535))) < 8 ? true : false;

            for (int i = 0; i < l; i++) LevelUp();
            hp = maxHP;

            metLocation = Player.Instance.currentMap;
            metLevel = Level;

            if (ms == null)
            {
                int i = 0;
                foreach (LearnableMove m in baseStats.learnset)
                {
                    if (Level >= m.level)
                    {
                        moveSet[i] = m.move;
                        PP[i] = m.move.basePP;
                        i = (i == 3) ? 0 : i + 1;
                    }
                    else break;
                }
            }
            else moveSet = ms;
        }
示例#6
0
 public HappinessEvolution(BaseStats to, int h)
 {
     EvolveTo  = to;
     Happiness = h;
 }
示例#7
0
 public HeldItemEvolution(BaseStats to, Item i)
 {
     EvolveTo = to;
     Item     = i;
 }
示例#8
0
 public LevelEvolution(BaseStats to, int level)
 {
     EvolveTo = to;
     Level    = level;
 }
示例#9
0
 public TradeEvolution(BaseStats to)
 {
     EvolveTo = to;
 }
示例#10
0
 private void pboxPokemon1_Click(object sender, EventArgs e)
 {
     PictureBox pictureBox = sender as PictureBox;
     int num = this.page;
     if (num != 0)
     {
         switch (num)
         {
         case 9:
             if (pictureBox == this.pboxPokemon15)
             {
                 this.currentPokemon = BaseStats.Mewtwo;
             }
             break;
         case 10:
             if (pictureBox == this.pboxPokemon1)
             {
                 this.currentPokemon = BaseStats.Mew;
             }
             break;
         }
     }
     else
     {
         if (pictureBox == this.pboxPokemon1)
         {
             this.currentPokemon = BaseStats.Bulbasaur;
         }
         else
         {
             if (pictureBox == this.pboxPokemon2)
             {
                 this.currentPokemon = BaseStats.Ivysaur;
             }
             else
             {
                 if (pictureBox == this.pboxPokemon2)
                 {
                     this.currentPokemon = BaseStats.Venusaur;
                 }
                 else
                 {
                     if (pictureBox == this.pboxPokemon3)
                     {
                         this.currentPokemon = BaseStats.Charmander;
                     }
                     else
                     {
                         if (pictureBox == this.pboxPokemon4)
                         {
                             this.currentPokemon = BaseStats.Charmeleon;
                         }
                         else
                         {
                             if (pictureBox == this.pboxPokemon5)
                             {
                                 this.currentPokemon = BaseStats.Charizard;
                             }
                             else
                             {
                                 if (pictureBox == this.pboxPokemon6)
                                 {
                                     this.currentPokemon = BaseStats.Squirtle;
                                 }
                                 else
                                 {
                                     if (pictureBox == this.pboxPokemon7)
                                     {
                                         this.currentPokemon = BaseStats.Wartortle;
                                     }
                                     else
                                     {
                                         if (pictureBox == this.pboxPokemon8)
                                         {
                                             this.currentPokemon = BaseStats.Blastoise;
                                         }
                                         else
                                         {
                                             if (pictureBox == this.pboxPokemon9)
                                             {
                                                 this.currentPokemon = BaseStats.Caterpie;
                                             }
                                             else
                                             {
                                                 if (pictureBox == this.pboxPokemon10)
                                                 {
                                                     this.currentPokemon = BaseStats.Metapod;
                                                 }
                                                 else
                                                 {
                                                     if (pictureBox == this.pboxPokemon11)
                                                     {
                                                         this.currentPokemon = BaseStats.Butterfree;
                                                     }
                                                     else
                                                     {
                                                         if (pictureBox == this.pboxPokemon15)
                                                         {
                                                             this.currentPokemon = BaseStats.Pidgey;
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
示例#11
0
 public void Evolve(BaseStats bs)
 {
     baseStats = bs;
     ushort hptemp = maxHP;
     maxHP = (ushort)((((hpIV + (2 * baseStats.baseHP) + (hpEV >> 2) + 100) * Level) * 0.01) + 10);
     attack = (ushort)((((attackIV + (2 * baseStats.baseAttack) + (attackEV >> 2)) * Level) * 0.01) + 5);
     defense = (ushort)((((defenseIV + (2 * baseStats.baseDefense) + (defenseEV >> 2)) * Level) * 0.01) + 5);
     speed = (ushort)((((speedIV + (2 * baseStats.baseSpeed) + (speedEV >> 2)) * Level) * 0.01) + 5);
     specialAttack = (ushort)((((specialAttackIV + (2 * baseStats.baseSpecialAttack) + (specialAttackEV >> 2)) * Level) * 0.01) + 5);
     specialDefense = (ushort)((((specialDefenseIV + (2 * baseStats.baseSpecialDefense) + (specialDefenseEV >> 2)) * Level) * 0.01) + 5);
     hp += (ushort)(maxHP - hptemp);
     int i = 0;
     foreach (LearnableMove m in baseStats.learnset)
     {
         if (Level >= m.level)
         {
             moveSet[i] = m.move;
             PP[i] = m.move.basePP;
             i = (i == 3) ? 0 : i + 1;
         }
         else break;
     }
 }
示例#12
0
 public UseItemEvolution(BaseStats to, Item i)
 {
     EvolveTo = to;
     Item = i;
 }
示例#13
0
 public TradeEvolution(BaseStats to)
 {
     EvolveTo = to;
 }
示例#14
0
 public LevelEvolution(BaseStats to, int level)
 {
     EvolveTo = to;
     Level = level;
 }
示例#15
0
 public HeldItemTradeEvolution(BaseStats to, Item i)
 {
     EvolveTo = to;
     Item = i;
 }
示例#16
0
 public HappinessEvolution(BaseStats to, int h)
 {
     EvolveTo = to;
     Happiness = h;
 }