Examples of canBeTargetedBy()


Examples of mage.game.permanent.Permanent.canBeTargetedBy()

        Player player = game.getPlayer(id);

        if (source != null) {
            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);
            }
        }
View Full Code Here

Examples of mage.game.permanent.Permanent.canBeTargetedBy()

    public boolean canTarget(UUID id, Ability source, Game game) {
        Permanent permanent = game.getPermanent(id);
        if (permanent != null) {
            if (source != null) {
                MageObject targetSource = game.getObject(source.getSourceId());
                return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
            } else {
                return filter.match(permanent, game);
            }
        }
        return false;
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);
      if (player != null && !player.hasLeft() && filter.match(player)) {
        if (player.canBeTargetedBy(targetSource)) {
          count++;
          if (count >= this.minNumberOfTargets)
            return true;
        }
      }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    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.hasLeft() && filter.match(player)) {
        if (player.canBeTargetedBy(targetSource))
          possibleTargets.add(playerId);
      }
    }
    return possibleTargets;
  }
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);
    if (player != null) {
      if (source != null)
        return player.canBeTargetedBy(game.getObject(source.getSourceId())) && filter.match(player);
      else
        return filter.match(player);
    }
    return false;
  }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

        return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
      if (source != null)
        return player.canBeTargetedBy(targetSource) && filter.match(player);
      else
        return filter.match(player);
    return false;
  }
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(FilterCreaturePermanent.getDefault(), sourceControllerId, game)) {
      if (permanent.canBeTargetedBy(targetSource) && filter.match(permanent, sourceControllerId, game)) {
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

        return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
      if (source != null)
        return player.canBeTargetedBy(targetSource) && filter.match(player);
      else
        return filter.match(player);
    return false;
  }
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
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.