int PossibleDamage(Tile position, HumanPiece humanPiece) { int res = 0; Vector2Int myPos = new Vector2Int(x, y); Vector2Int enemyPosition = new Vector2Int(humanPiece.x, humanPiece.y); Move(position.x, position.y, false); List <Tile> possibleMoves = humanPiece.GetPosibleMoves(); foreach (Tile move in possibleMoves) { humanPiece.Move(move.x, move.y, false); bool requireChoice; List <Piece> attacksPossibilities = humanPiece.GetAttackPossibilities(out requireChoice); if (attacksPossibilities.Contains(this)) { res += humanPiece.damage; break; } } Move(myPos.x, myPos.y, false); humanPiece.Move(enemyPosition.x, enemyPosition.y, false); return(res); }
public MoveAnimation(HumanPiece piece, Vector2Int position) { this.piece = piece; piece.Move(position.x, position.y); }