Examples of canBeTargetedBy()


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

  public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
    Permanent permanent = game.getPermanent(id);
    if (permanent != null) {
      if (source != null)
        //TODO: check for replacement effects
        return permanent.canBeTargetedBy(game.getObject(source.getSourceId())) && filter.match(permanent, controllerId, game);
      else
        return filter.match(permanent, controllerId, game);
    }
    return false;
  }
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);
    MageObject targetSource = game.getObject(source.getSourceId());
    if (permanent != null) {
      if (source != null)
        return permanent.canBeTargetedBy(targetSource) && filter.match(permanent, source.getControllerId(), game);
      else
        return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
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);
    MageObject targetSource = game.getObject(source.getSourceId());
    if (permanent != null) {
      if (source != null)
        return permanent.canBeTargetedBy(targetSource) && filter.match(permanent, source.getControllerId(), game);
      else
        return filter.match(permanent);
    }
    Player player = game.getPlayer(id);
    if (player != null)
View Full Code Here

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

    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);
    }
    return false;
  }

  @Override
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);
            }
        }
        Spell spell = game.getStack().getSpell(id);
View Full Code Here

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

            //Could be targeting due to combat decision to attack a player or planeswalker.
            UUID controllerId = null;
            if ( source != null ) {
                controllerId = source.getControllerId();
            }
            return permanent.canBeTargetedBy(targetSource, controllerId, game) && filter.match(permanent, game);
        }
        return false;
    }

    @Override
View Full Code Here

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()

        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()

                //1. TODO: check for replacement effects
                //2. We need to check both source.getId() and source.getSourceId()
                // first for protection from spells or abilities (e.g. protection from colored spells, r1753)
                // second for protection from sources (e.g. protection from artifacts + equip ability)
                if (!isNotTarget()) {
                    if (!permanent.canBeTargetedBy(game.getObject(source.getId()), controllerId, game) ||
                            !permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game)) {
                        return false;
                    }
                }
                return filter.match(permanent, source.getSourceId(), controllerId, game);
View Full Code Here

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

                //2. We need to check both source.getId() and source.getSourceId()
                // first for protection from spells or abilities (e.g. protection from colored spells, r1753)
                // second for protection from sources (e.g. protection from artifacts + equip ability)
                if (!isNotTarget()) {
                    if (!permanent.canBeTargetedBy(game.getObject(source.getId()), controllerId, game) ||
                            !permanent.canBeTargetedBy(game.getObject(source.getSourceId()), controllerId, game)) {
                        return false;
                    }
                }
                return filter.match(permanent, source.getSourceId(), controllerId, game);
            } else {
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.