示例#1
0
        public bool ThrowBall(Pokeball b)
        {
            double rateMod = captureRate * b.RateModifier;
            double statMod = 0;

            this.Experience = (int)Math.Pow(level, 3);

            if (Status == StatusType.Burn || Status == StatusType.Paralyze || Status == StatusType.Poison)
            {
                statMod = 5;
            }
            else if (Status == StatusType.Frozen || Status == StatusType.Sleep)
            {
                statMod = 10;
            }
            double prob = Math.Max(((3 * HP) - (2 * CurrentHP)) * (rateMod / (3 * HP)), 1) + statMod;

            Random r = new Random();
            int    i = r.Next(255);


            if (i <= prob)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
 public BattleAction(Func <Pokeball, Pokemon, bool> capt, Pokeball b, Pokemon w, string text)
 {
     this.capt = capt;
     this.b    = b;
     this.w    = w;
     this.desc = text;
 }