Package mage.game.permanent

Examples of mage.game.permanent.Permanent


  }

  @Override
  public boolean apply(Game game, Ability source) {
    Card card = game.getCard(source.getFirstTarget());
    Permanent permanent = game.getPermanent(source.getSourceId());
    permanent.setName(card.getName());
    permanent.getColor().setColor(card.getColor());
    permanent.getManaCost().clear();
    permanent.getManaCost().add(card.getManaCost());
    permanent.getCardType().clear();
    for (CardType type: card.getCardType()) {
      permanent.getCardType().add(type);
    }
    permanent.getSubtype().clear();
    for (String type: card.getSubtype()) {
      permanent.getSubtype().add(type);
    }
    permanent.getSupertype().clear();
    for (String type: card.getSupertype()) {
      permanent.getSupertype().add(type);
    }
    permanent.setExpansionSetCode(card.getExpansionSetCode());
    permanent.getAbilities().clear();
    for (Ability ability: card.getAbilities()) {
      permanent.addAbility(ability);
    }
    permanent.getPower().setValue(card.getPower().getValue());
    permanent.getToughness().setValue(card.getToughness().getValue());
    permanent.getLoyalty().setValue(card.getLoyalty().getValue());
    permanent.setArt(card.getArt());
   
    return true;

  }
View Full Code Here


    super(cost);
  }

  @Override
  public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
    Permanent permanent = game.getPermanent(sourceId);
    if (permanent != null) {
      paid = permanent.tap(game);
    }
    return paid;
  }
View Full Code Here

    return paid;
  }

  @Override
  public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
    Permanent permanent = game.getPermanent(sourceId);
    if (permanent != null) {
      return !permanent.isTapped() && permanent.canTap();
    }
    return false;
  }
View Full Code Here

    this.amount = cost.amount;
  }

  @Override
  public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
    Permanent planeswalker = game.getPermanent(sourceId);
    if (planeswalker.getLoyalty().getValue() + amount >= 0 && !planeswalker.isLoyaltyUsed())
      return true;
    return false;
  }
View Full Code Here

    return false;
  }

  @Override
  public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
    Permanent planeswalker = game.getPermanent(sourceId);
    if (planeswalker.getLoyalty().getValue() + amount >= 0 && !planeswalker.isLoyaltyUsed()) {
      planeswalker.getLoyalty().boostValue(amount);
      planeswalker.setLoyaltyUsed(true);
      this.paid = true;
    }
    return paid;
  }
View Full Code Here

    return new BoostTargetEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent target = (Permanent) game.getPermanent(source.getFirstTarget());
    if (target != null) {
      target.addPower(power);
      target.addToughness(toughness);
      return true;
    }
    return false;
  }
View Full Code Here

    super(cost);
  }

  @Override
  public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
    Permanent permanent = game.getPermanent(sourceId);
    if (permanent != null) {
      paid = permanent.sacrifice(sourceId, game);
    }
    return paid;
  }
View Full Code Here

    return paid;
  }

  @Override
  public boolean canPay(UUID sourceId, UUID controllerId, Game game) {
    Permanent permanent = game.getPermanent(sourceId);
    if (permanent != null) {
      return true;
    }
    return false;
  }
View Full Code Here

    return new DestroySourceEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
      permanent.destroy(source.getId(), game, noRegen);
      return true;
    }
    return false;
  }
View Full Code Here

  @Override
  public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
    if (target.choose(Outcome.Tap, controllerId, game)) {
      for (UUID targetId: (List<UUID>)target.getTargets()) {
        Permanent permanent = game.getPermanent(targetId);
        if (permanent == null)
          return false;
        paid |= permanent.tap(game);
      }
    }
    return paid;
  }
View Full Code Here

TOP

Related Classes of mage.game.permanent.Permanent

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.