public void Prone() { proned = true; if (HoldingBall != null) { HoldingBall.PositionX = posX; HoldingBall.PositionY = posY; RollHandler.ScatterBall(1, false, HoldingBall, false); } }
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(); }
public bool Dodge() { if (RollHandler.AgRoll(+1, this)) { return(true); } else { Console.WriteLine("dodge failed"); Prone(); TurnHandler.turnOver = true; return(false); } }
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); } }
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); } }
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); }
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); } }