Package mage.game.permanent

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


  @Override
  public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
    Permanent permanent = game.getPermanent(sourceId);
    if (permanent != null && permanent.getCounters().getCount(name) >= amount) {
      permanent.removeCounters(name, amount, game);
      this.paid = true;
    }
    return paid;
  }
View Full Code Here


        game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getId(), source.getControllerId(), damage));
        retValue = true;
      }
      Permanent permanent = game.getPermanent(source.getSourceId());
      if (permanent != null) {
        permanent.removeCounters("+1/+1", damage, game);
      }
      return retValue;
    }

    @Override
View Full Code Here

    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(ability.getSourceId());
        if (permanent != null) {
            this.removedCounters = permanent.getCounters().getCount(CounterType.ELIXIR);
            if (this.removedCounters > 0) {
                permanent.removeCounters(CounterType.ELIXIR.createInstance(this.removedCounters), game);
            }
        }
        this.paid = true;
        return true;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(source.getSourceId());
        if (p != null && p.getCounters().getCount(counter.getName()) >= counter.getCount()) {
            p.removeCounters(counter.getName(), counter.getCount(), game);
            game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName())
                    .append(" counter from ").append(p.getName()).toString());
            return true;
        }
        Card c = game.getCard(source.getSourceId());
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(source.getSourceId());
        if (p != null) {
            int amount = p.getCounters().getCount(CounterType.FADE);
            if (amount > 0) {
                p.removeCounters(CounterType.FADE.createInstance(), game);
            }
            else
            {
                p.sacrifice(source.getSourceId(), game);
            }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(source.getSourceId());
        if (p != null) {
            int amount = p.getCounters().getCount(CounterType.TIME);
            if (amount > 0) {
                p.removeCounters(CounterType.TIME.createInstance(), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent permanent = game.getPermanent(sourceId);
        if (permanent != null && permanent.getCounters().getCount(name) >= amount) {
            permanent.removeCounters(name, amount, game);
            this.paid = true;
        }
        return paid;
    }
View Full Code Here

        Permanent permanent = game.getPermanent(target.getFirstTarget());

        if (permanent != null) {
            for(Counter counter : permanent.getCounters().values()){
                permanent.removeCounters(counter, game);
            }

            return true;
        }
View Full Code Here

                                int numberOfCountersSelected = 1;
                                if (countersLeft > 1 && countersOnPermanent > 1) {
                                    numberOfCountersSelected = controller.getAmount(1, Math.min(countersLeft, countersOnPermanent),
                                            new StringBuilder("Remove how many counters from ").append(permanent.getLogName()).toString(),  game);
                                }
                                permanent.removeCounters(counterName, numberOfCountersSelected, game);
                                if (permanent.getCounters().getCount(counterName) == 0 ){
                                    permanent.getCounters().removeCounter(counterName);
                                }
                                countersRemoved += numberOfCountersSelected;
                                game.informPlayers(new StringBuilder(controller.getName())
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(targetPointer.getFirst(game, source));
        if (p != null && p.getCounters().getCount(counter.getName()) >= counter.getCount()) {
            p.removeCounters(counter.getName(), counter.getCount(), game);
            game.informPlayers(new StringBuilder("Removed ").append(counter.getCount()).append(" ").append(counter.getName())
                    .append(" counter from ").append(p.getName()).toString());
            return true;
        }
        Card c = game.getCard(targetPointer.getFirst(game, source));
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.