Examples of EmptyToken


Examples of mage.game.permanent.token.EmptyToken

    public boolean apply(Game game, Ability source) {
        Player you = game.getPlayer(source.getControllerId());
        if (you != null) {
            for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, game)) {
                if (permanent.getControllerId().equals(source.getControllerId())) {
                    EmptyToken token = new EmptyToken();
                    CardUtil.copyTo(token).from(permanent);
                    token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                }
            }
            return true;
        }
        return false;
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

        if (permanent == null) return false;

        if (permanent.getImprinted().size() > 0) {
            Card card = game.getCard(permanent.getImprinted().get(0));
            if (card != null) {
                EmptyToken token = new EmptyToken();
                CardUtil.copyTo(token).from(card);

                token.addAbility(HasteAbility.getInstance());
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());

                ExileTargetEffect exileEffect = new ExileTargetEffect();
                exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
                delayedAbility.setSourceId(source.getSourceId());
                delayedAbility.setControllerId(source.getControllerId());
                game.addDelayedTriggeredAbility(delayedAbility);
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

        if (permanent == null) {
            permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        }

        if (permanent != null) {
            EmptyToken token = new EmptyToken();
            CardUtil.copyTo(token).from(permanent);

            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
           
            return true;
        }

        return false;
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

            if (target == null) {
                target = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
            }
            if (target != null) {
                if (target instanceof Permanent) {
                    EmptyToken token = new EmptyToken();
                    CardUtil.copyTo(token).from((Permanent) target);
                    token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(source.getFirstTarget());
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null && card != null) {
            if (controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.GRAVEYARD)) {
                EmptyToken token = new EmptyToken();
                CardUtil.copyTo(token).from(card);

                if (!token.hasSubtype("Spirit")) {
                    token.getSubtype().add("Spirit");
                }               
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());

                ExileTargetEffect exileEffect = new ExileTargetEffect();
                exileEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
                delayedAbility.setSourceId(source.getSourceId());
                delayedAbility.setControllerId(source.getControllerId());
                game.addDelayedTriggeredAbility(delayedAbility);
            }
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

        if (permanent == null) {
            permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
        }

        if (permanent != null) {
            EmptyToken token = new EmptyToken();
            CardUtil.copyTo(token).from(permanent);

            token.addAbility(HasteAbility.getInstance());
            token.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceEffect(), TargetController.ANY, true));
            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
            return true;
        }

        return false;
    }
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

    @Override
    public boolean apply(Game game, Ability source) {
        MageObject thisCard = game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        if (thisCard != null && thisCard instanceof Permanent) {
            EmptyToken token = new EmptyToken();
            CardUtil.copyTo(token).from((Permanent)thisCard);
            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
            return true;
        } else { // maybe it's token
            Permanent permanent = game.getBattlefield().getPermanent(source.getSourceId());
            if (permanent != null) {
                EmptyToken token = new EmptyToken();
                CardUtil.copyTo(token).from(permanent);
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

                Cost cost = new ManaCostsImpl("{2}");
                if (player.chooseUse(outcome, new StringBuilder("Pay ").append(cost.getText()).append(" and put a token copy of ").append(target.getName()).append(" onto the battlefield").toString(), game)) {
                    cost.clearPaid();
                    if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                        if (target instanceof Permanent) {
                            EmptyToken token = new EmptyToken();
                            CardUtil.copyTo(token).from((Permanent)target);
                            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                            return true;
                        }
                    }
                }
            }
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

                    }
                }
            }
        }
        if (copyFromPermanent != null) {
            EmptyToken token = new EmptyToken();
            CardUtil.copyTo(token).from(copyFromPermanent); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer)
            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
            Permanent sourcePermanent = game.getPermanent(token.getLastAddedToken());
            if (sourcePermanent != null) {
                game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ProgenitorMimicApplyToPermanent());
                return true;
            }
        }
View Full Code Here

Examples of mage.game.permanent.token.EmptyToken

        }

        if (permanent.getImprinted().size() > 0) {
            Card card = game.getCard(permanent.getImprinted().get(0));
            if (card != null) {
                EmptyToken token = new EmptyToken();
                CardUtil.copyTo(token).from(card);
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                return true;
            }
        }

        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.