예제 #1
0
    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);
    }
예제 #2
0
 public MoveAnimation(HumanPiece piece, Vector2Int position)
 {
     this.piece = piece;
     piece.Move(position.x, position.y);
 }