Package mage.game.permanent

Examples of mage.game.permanent.PermanentToken


  public Token copy() {
    return new Token(this);
  }

  public boolean putOntoBattlefield(Game game, UUID sourceId, UUID controllerId) {
    PermanentToken permanent = new PermanentToken(this, controllerId);
    game.getBattlefield().addPermanent(permanent);
    permanent.entersBattlefield(sourceId, game);
    game.applyEffects();
    game.fireEvent(new ZoneChangeEvent(permanent, controllerId, Zone.OUTSIDE, Zone.BATTLEFIELD));
    return true;
  }
View Full Code Here


        }
        GameEvent event = GameEvent.getEvent(EventType.CREATE_TOKEN, null, sourceId, controllerId, amount);
        if (!game.replaceEvent(event)) {
            amount = event.getAmount();
            for (int i = 0; i < amount; i++) {
                PermanentToken newToken = new PermanentToken(this, controllerId, setCode, game);
                game.getState().addCard(newToken);
                game.addPermanent(newToken);
                if (tapped) {
                    newToken.setTapped(true);
                }
                this.lastAddedTokenIds.add(newToken.getId());
                this.lastAddedTokenId = newToken.getId();
                game.setScopeRelevant(true);
                game.applyEffects();
                newToken.entersBattlefield(sourceId, game, Zone.OUTSIDE, true);
                game.setScopeRelevant(false);
                game.applyEffects();
                game.fireEvent(new ZoneChangeEvent(newToken, controllerId, Zone.OUTSIDE, Zone.BATTLEFIELD));
                if (attacking && game.getCombat() != null) {
                    game.getCombat().addAttackingCreature(newToken.getId(), game);
                }
            }
            game.informPlayers(new StringBuilder(controller.getName()).append(" puts ")
                    .append(CardUtil.numberToText(amount, "a")).append(" ").append(this.getName()).append(" token").append(amount==1?"":"s")
                    .append(" onto the battlefield").toString());
View Full Code Here

        this.color = object.getColor();
        this.manaCost = object.getManaCost().getSymbols();
        this.convertedManaCost = object.getManaCost().convertedManaCost();
        if (object instanceof PermanentToken) {
            this.mageObjectType = MageObjectType.TOKEN;
            PermanentToken permanentToken = (PermanentToken) object;
            this.rarity = Rarity.COMMON;
            this.expansionSetCode = permanentToken.getExpansionSetCode();
            this.rules = permanentToken.getRules();
            this.type = permanentToken.getToken().getTokenType();
        } else if (object instanceof Emblem) {
            this.mageObjectType = MageObjectType.EMBLEM;
            Emblem emblem = (Emblem) object;
            this.rarity = Rarity.SPECIAL;
            this.rules = emblem.getAbilities().getRules(emblem.getName());
View Full Code Here

                        updateLatestCardView(game, card, stackObject.getId());
                    }
                    checkPaid(stackObject.getId(), (StackAbility)stackObject);
                } else if (object != null) {
                    if (object instanceof PermanentToken) {
                        PermanentToken token = (PermanentToken)object;
                        stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility)stackObject, token.getName(), new CardView(token)));
                        checkPaid(stackObject.getId(), (StackAbility)stackObject);
                    } else if (object instanceof Emblem) {
                        Card sourceCard = game.getCard(((Emblem)object).getSourceId());
                        if (sourceCard != null) {
                            ((StackAbility)stackObject).setName("Emblem " + sourceCard.getName());
View Full Code Here

TOP

Related Classes of mage.game.permanent.PermanentToken

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.