Examples of canBeTargetedBy()


Examples of mage.players.Player.canBeTargetedBy()

  public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
    Set<UUID> possibleTargets = new HashSet<UUID>();
    MageObject targetSource = game.getObject(sourceId);
    for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
      Player player = game.getPlayer(playerId);
      if (player != null && player.canBeTargetedBy(targetSource) && filter.match(player)) {
        possibleTargets.add(playerId);
      }
    }
    for (Permanent permanent: game.getBattlefield().getActivePermanents(FilterCreaturePermanent.getDefault(), sourceControllerId, game)) {
      if (permanent.canBeTargetedBy(targetSource) && filter.match(permanent, sourceControllerId, game)) {
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

  public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
    int count = 0;
    MageObject targetSource = game.getObject(sourceId);
    for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
      Player player = game.getPlayer(playerId);
      if (player != null && player.canBeTargetedBy(targetSource) && filter.match(player)) {
        count++;
        if (count >= this.minNumberOfTargets)
          return true;
      }
    }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

  public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
    Set<UUID> possibleTargets = new HashSet<UUID>();
    MageObject targetSource = game.getObject(sourceId);
    for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
      Player player = game.getPlayer(playerId);
      if (player != null && player.canBeTargetedBy(targetSource) && filter.match(player)) {
        possibleTargets.add(playerId);
      }
    }
    for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
      if (permanent.canBeTargetedBy(targetSource) && filter.match(permanent)) {
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

  @Override
  public boolean canTarget(UUID id, Ability source, Game game) {
    Player player = game.getPlayer(id);
    MageObject targetSource = game.getObject(attackerId);
    if (player != null) {
      return player.canBeTargetedBy(targetSource) && filter.match(player);
    }
    Permanent permanent = game.getPermanent(id);
    if (permanent != null) {
      return permanent.canBeTargetedBy(targetSource) && filter.match(permanent);
    }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            // removed canBeTargeted because it's not correct to check it for attacking target
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                possibleTargets.add(playerId);
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPlaneswalkerPermanent(), sourceControllerId, game)) {
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, game)) {
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    @Override
    public boolean canTarget(UUID id, Ability source, Game game) {
        Player player = game.getPlayer(id);
        MageObject targetSource = game.getObject(attackerId);
        if (player != null) {
            return notTarget || (player.canBeTargetedBy(targetSource, game) && filter.match(player, game));
        }
        Permanent permanent = game.getPermanent(id);
        if (permanent != null) {
            //Could be targeting due to combat decision to attack a player or planeswalker.
            UUID controllerId = null;
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

            MageObject targetSource = game.getObject(source.getSourceId());
            if (permanent != null) {
                return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
            }
            if (player != null) {
                return player.canBeTargetedBy(targetSource, game) && filter.match(player, game);
            }
        }

        if (permanent != null) {
            return filter.match(permanent, game);
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                possibleTargets.add(playerId);
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) {
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.