Package mage.game.permanent

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


  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
      permanent.addCounters(new PlusOneCounter(amount));
    }
    return true;
  }

  @Override
View Full Code Here


  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
      permanent.addCounters(name, amount);
    }
    return true;
  }

  @Override
View Full Code Here

  public boolean apply(Game game, Ability source) {
    Permanent enchantment = game.getPermanent(source.getSourceId());
    if (enchantment != null && enchantment.getAttachedTo() != null) {
      Permanent creature = game.getPermanent(enchantment.getAttachedTo());
      if (creature != null) {
        creature.addCounters(new PlusOneCounter(amount));
      }
    }
    return true;
  }
View Full Code Here

      if (target.canChoose(null, source.getControllerId(), game)) {
        target.setRequired(true);
        if (player.choose(Outcome.Neutral, target, game)) {
          Permanent permanent = game.getPermanent(target.getFirstTarget());
          if (permanent != null) {
            permanent.addCounters("phylactery", 1);
          }
        }
      }
    }
    return false;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
      Permanent permanent = game.getPermanent(source.getSourceId());
      if (permanent != null) {
        int amount = source.getManaCosts().getVariableCosts().get(0).getAmount();
        permanent.addCounters(new PlusOneCounter(amount));
      }
      return true;
    }

    @Override
View Full Code Here

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      permanent.addCounters(name, amount);
    }
    return true;
  }

  @Override
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent permanent = game.getPermanent(event.getTargetId());
        if (permanent != null) {
            permanent.addCounters(CounterType.M1M1.createInstance(), game);
        }
        used = true;
        return false;
    }
View Full Code Here

            int numberOfCounters = sourcePermanent.getCounters().getCount(CounterType.P1P1);
            if (numberOfCounters > 0) {
                Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source));
                if (targetCreature != null) {
                    sourcePermanent.removeCounters(CounterType.P1P1.getName(), 1, game);
                    targetCreature.addCounters(CounterType.P1P1.createInstance(1), game);
                    StringBuilder sb = new StringBuilder("Moved one +1/+1 counter from ").append(sourcePermanent.getName()).append(" to ").append(targetCreature.getName());
                    game.informPlayers(sb.toString());
                    return true;
                }
            }
View Full Code Here

                Permanent permanent = game.getPermanent(chosen);
                if (permanent != null) {
                    if (permanent.getCounters().size() > 0) {
                        if (permanent.getCounters().size() == 1) {
                            for (Counter counter : permanent.getCounters().values()) {
                                permanent.addCounters(counter.getName(), 1, game);
                            }
                        } else {
                            Choice choice = new ChoiceImpl(true);
                            Set<String> choices = new HashSet<>();
                            for (Counter counter : permanent.getCounters().values()) {
View Full Code Here

                            choice.setChoices(choices);
                            choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")");
                            controller.choose(Outcome.Benefit, choice, game);
                            for (Counter counter : permanent.getCounters().values()) {
                                if (counter.getName().equals(choice.getChoice())) {
                                    permanent.addCounters(counter.getName(), 1, game);
                                    break;
                                }
                            }
                        }
                    }
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.