Exemplo n.º 1
0
 public static BlockingResult RunBlock(int runBlocking, int defenderMove, bool finesseMove, Blocker doubleTeam = null, Blocker chip = null)
 {
     if (doubleTeam == null && chip == null)
     {
         double rating = ((runBlocking - defenderMove) * 3.0 + Random.GetInstance().Next(-100, 101)) / 4.0;
         if (Math.Abs(rating) < 10)
         {
             return(BlockingResult.Blocker_Average);
         }
         else if (rating > 0 && rating < 25)
         {
             return(BlockingResult.Blocker_Forward);
         }
         else if (rating < 0 && rating > -25)
         {
             return(BlockingResult.Blocker_Backward);
         }
         else if (rating < 0)
         {
             return(BlockingResult.Blocker_Pancaked);
         }
         else
         {
             return(BlockingResult.Pancake);
         }
     }
     // Chip help
     else if (doubleTeam == null)
     {
     }
     // double team
     else
     {
         Random r        = Random.GetInstance();
         double blocking = (doubleTeam.GetRunBlocking() + runBlocking) / 1.75;
         if (finesseMove)
         {
             blocking -= defenderMove + (r.GetBool() ? defenderMove * .25 : 0);
         }
         else
         {
             blocking -= defenderMove - (r.GetBool() ? defenderMove * .25 : 0);
         }
         Console.WriteLine(blocking);
     }
     return(BlockingResult.None);
 }