예제 #1
0
 public void Prone()
 {
     proned = true;
     if (HoldingBall != null)
     {
         HoldingBall.PositionX = posX;
         HoldingBall.PositionY = posY;
         RollHandler.ScatterBall(1, false, HoldingBall, false);
     }
 }
예제 #2
0
        static void Main(string[] args)
        {
            RenderHandler.Render();
            RollHandler.ScatterBall(1, true, ball, false);
            Player lineman  = new Player(999, 3, 0, 9, 0, 0, "away", "L");
            Player lineman2 = new Player(6, 3, 3, 9, 5, 5, "home", "L");
            Player lineman3 = new Player(6, 3, 3, 9, 3, 5, "home", "L");

            lineman.Move();
            Console.ReadKey();
            lineman2.Move();
            lineman3.Move();
        }
예제 #3
0
 public bool Dodge()
 {
     if (RollHandler.AgRoll(+1, this))
     {
         return(true);
     }
     else
     {
         Console.WriteLine("dodge failed");
         Prone();
         TurnHandler.turnOver = true;
         return(false);
     }
 }
예제 #4
0
 public bool Pickup(Ball ball)
 {
     if (RollHandler.AgRoll(+1, this))
     {
         HoldingBall = ball;
         PitchHandler.pitch[posX, posY].ballOnTile = null;
         return(true);
     }
     else
     {
         RollHandler.ScatterBall(1, false, ball, false);
         TurnHandler.turnOver = true;
         return(false);
     }
 }
예제 #5
0
파일: Ball.cs 프로젝트: cynialk/dotnetbbrp
 public void PickUp(Player player)
 {
     if (player.posX == PositionX && player.posY == PositionY)
     {
         if (RollHandler.AgRoll(+1, player))
         {
             PitchHandler.pitch[PositionX, PositionY].playerOnThisTile.HoldingBall = this;
             PitchHandler.pitch[PositionX, PositionY].ballOnTile = null;
         }
         Console.WriteLine("Ball picked up");
         Console.ReadKey();
     }
     else
     {
         TurnHandler.turnOver = true;
         RollHandler.ScatterBall(1, false, this, false);
     }
 }
예제 #6
0
파일: Ball.cs 프로젝트: cynialk/dotnetbbrp
        public void Move(int xTiles, int yTiles, string reason)
        {
            string direction = "";

            if (PositionX > 26)
            {
                direction = "left";
            }
            else if (PositionX < 0)
            {
                direction = "right";
            }
            else if (PositionY > 15)
            {
                direction = "up";
            }
            else
            {
                direction = "down";
            }

            try
            {
                PositionY += yTiles;
                PositionX += xTiles;
                PitchHandler.pitch[PositionX, PositionY].ballOnTile = this;
            }
            catch (IndexOutOfRangeException)
            {
                if (TurnHandler.state == "kickoff")
                {
                    Console.WriteLine("reminder: fix touchback function for turnhandler");
                    Console.ReadKey();
                    //turnHandler.touchback(ball)
                }
                else
                {
                    RollHandler.ThrowInBall(this, direction);
                }
            }
            try { PitchHandler.pitch[PositionX - xTiles, PositionY - yTiles].ballOnTile = null; } catch (IndexOutOfRangeException) { }
            checkIfPickUp(reason);
        }
예제 #7
0
        public bool Catch(Ball ball, string type)
        {
            int modifier = 0;

            if (type == "scatter")
            {
                modifier = -1;
            }
            else if (type == "quick pass")
            {
                modifier = +1;
            }
            else if (type == "handover")
            {
                modifier = +1;
            }
            else if (type == "long pass")
            {
                modifier = -1;
            }
            else if (type == "long bomb")
            {
                modifier = -1;
            }

            if (RollHandler.AgRoll(+1 + modifier, this))
            {
                HoldingBall = ball;
                PitchHandler.pitch[posX, posY].ballOnTile = null;
                return(true);
            }
            else
            {
                RollHandler.ScatterBall(1, false, ball, false);
                TurnHandler.turnOver = true;
                return(false);
            }
        }