private static void Download(PokemonProxy pm)
        {
            var sa = pm.CanChangeLv7D(pm, StatType.SpAtk, 1, false) != 0;
            var a  = pm.CanChangeLv7D(pm, StatType.Atk, 1, false) != 0;

            if (sa || a)
            {
                var stats = new List <StatType>();
                foreach (var p in pm.Controller.Board[1 - pm.Pokemon.TeamId].GetAdjacentPokemonsByOppositeX(pm.OnboardPokemon.X))
                {
                    if (p.OnboardPokemon.FiveD.Def > p.OnboardPokemon.FiveD.SpDef)
                    {
                        if (sa)
                        {
                            stats.Add(StatType.SpAtk);
                        }
                    }
                    else if (a)
                    {
                        stats.Add(StatType.Atk);
                    }
                }
                var n = stats.Count;
                if (n != 0)
                {
                    pm.RaiseAbility();
                    pm.ChangeLv7D(pm, stats[pm.Controller.GetRandomInt(0, n - 1)], 1, false);
                }
            }
        }
Example #2
0
 private static void StarfBerry(PokemonProxy pm)
 {
     if (ATs.Gluttony(pm))
     {
         var ss = new List <StatType>(5);
         if (pm.CanChangeLv7D(pm, StatType.Atk, 2, false) != 0)
         {
             ss.Add(StatType.Atk);
         }
         if (pm.CanChangeLv7D(pm, StatType.Def, 2, false) != 0)
         {
             ss.Add(StatType.Def);
         }
         if (pm.CanChangeLv7D(pm, StatType.SpAtk, 2, false) != 0)
         {
             ss.Add(StatType.SpAtk);
         }
         if (pm.CanChangeLv7D(pm, StatType.SpDef, 2, false) != 0)
         {
             ss.Add(StatType.SpDef);
         }
         if (pm.CanChangeLv7D(pm, StatType.Speed, 2, false) != 0)
         {
             ss.Add(StatType.Speed);
         }
         var n = ss.Count;
         if (n != 0)
         {
             ITs.ChangeLv5D(pm, ss[pm.Controller.GetRandomInt(0, n - 1)], 2);
         }
     }
 }