Package mage.game.permanent

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


    if (targets.choose(Outcome.Sacrifice, controllerId, game)) {
      for (UUID targetId: targets.get(0).getTargets()) {
        Permanent permanent = game.getPermanent(targetId);
        if (permanent == null)
          return false;
        permanents.add(permanent.copy());
        paid |= permanent.sacrifice(sourceId, game);
      }
    }
    return paid;
  }
View Full Code Here


                    MageObject object = ((CopyEffect) effect).getTarget();
                    if (object instanceof Permanent) {
                        // so we will use original card instead of target
                        Permanent original = (Permanent)object;
                        // copy it and apply changes we need
                        original = original.copy();
                        applier.apply(this, original);
                        newEffect.setTarget(object);
                    }
                }
            }
View Full Code Here

            for (UUID targetId: targets.get(0).getTargets()) {
                Permanent permanent = game.getPermanent(targetId);
                if (permanent == null) {
                    return false;
                }
                permanents.add(permanent.copy());
                paid |= permanent.sacrifice(sourceId, game);
            }
            if (!paid && targets.get(0).getNumberOfTargets() == 0) {
                paid = true; // e.g. for Devouring Rage
            }
View Full Code Here

            for (UUID targetId: targets.get(0).getTargets()) {
                Permanent permanent = game.getPermanent(targetId);
                if (permanent == null) {
                    return false;
                }
                permanents.add(permanent.copy());
                paid |= game.getPlayer(ability.getControllerId()).moveCardToExileWithInfo(permanent, null, null, sourceId, game, Zone.BATTLEFIELD);
            }
            if (!paid && targets.get(0).getNumberOfTargets() == 0) {
                paid = true;
            }
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent perm = game.getPermanent(source.getSourceId());
        if (perm != null) {
            perm = perm.copy();
            perm.reset(game);
            perm.assignNewId();
            game.addEffect(new EssenceOfTheWildCopyEffect(perm, event.getTargetId()), source);
        }
        return false;
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.