Package mage

Examples of mage.MageObject


  }

  @Override
  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)
View Full Code Here


  }

  @Override
  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);
      }
View Full Code Here

  }

  @Override
  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);
View Full Code Here

  }

  @Override
  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)
View Full Code Here

  }

  @Override
  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);
      }
View Full Code Here

  }

  @Override
  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)
View Full Code Here

  }

  @Override
  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);
      }
View Full Code Here

  }

  @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) {
View Full Code Here

        pass();
        passedTurn = true;
      } else if (response.getString() != null && response.getString().equals("special")) {
        specialAction(game);
      } else if (response.getUUID() != null) {
        MageObject object = game.getObject(response.getUUID());
        if (object != null) {
          Map<UUID, ActivatedAbility> useableAbilities = null;
          switch (game.getZone(object.getId())) {
            case HAND:
              useableAbilities = getUseableAbilities(object.getAbilities().getActivatedAbilities(Zone.HAND), game);
              break;
            case BATTLEFIELD:
              useableAbilities = getUseableAbilities(object.getAbilities().getActivatedAbilities(Zone.BATTLEFIELD), game);
              break;
            case GRAVEYARD:
              useableAbilities = getUseableAbilities(object.getAbilities().getActivatedAbilities(Zone.GRAVEYARD), game);
              break;
          }
          if (useableAbilities != null && useableAbilities.size() > 0) {
            activateAbility(useableAbilities, game);
          }
View Full Code Here

    }
    return true;
  }

  protected void playManaAbilities(Game game) {
    MageObject object = game.getObject(response.getUUID());
    Map<UUID, ActivatedAbility> useableAbilities;
    switch (game.getZone(object.getId())) {
      case HAND:
        useableAbilities = getUseableAbilities(object.getAbilities().getManaAbilities(Zone.HAND), game);
        if (useableAbilities.size() > 0) {
          activateAbility(useableAbilities, game);
        }
        break;
      case BATTLEFIELD:
        useableAbilities = getUseableAbilities(object.getAbilities().getManaAbilities(Zone.BATTLEFIELD), game);
        if (useableAbilities.size() > 0) {
          activateAbility(useableAbilities, game);
        }
        break;
      case GRAVEYARD:
        useableAbilities = getUseableAbilities(object.getAbilities().getManaAbilities(Zone.GRAVEYARD), game);
        if (useableAbilities.size() > 0) {
          activateAbility(useableAbilities, game);
        }
        break;
    }
View Full Code Here

TOP

Related Classes of mage.MageObject

Copyright © 2018 www.massapicom. 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.