Package mage.game.permanent.token

Examples of mage.game.permanent.token.Token


    this.token = permanent.token.copy();
  }

  @Override
  public void reset(Game game) {
    Token copy = token.copy();
    copyFromToken(copy);
    super.reset(game);
  }
View Full Code Here


        this.expansionSetCode = permanent.expansionSetCode;
    }

    @Override
    public void reset(Game game) {
        Token tokenCopy = token.copy();
        copyFromToken(tokenCopy, game);
        super.reset(game);
    }
View Full Code Here

    }

    @Override
    public boolean apply(Game game, Ability source) {
        int value = amount.calculate(game, source, this);
        Token tokenCopy = token.copy();
        tokenCopy.getAbilities().newId(); // neccessary if token has ability like DevourAbility()
        tokenCopy.putOntoBattlefield(value, game, source.getSourceId(), source.getControllerId(), tapped, attacking);
        this.lastAddedTokenId = tokenCopy.getLastAddedToken();
        this.lastAddedTokenIds = tokenCopy.getLastAddedTokenIds();
        return true;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Card card = player.getLibrary().getFromTop(game);
        if (card != null) {
            if (card.getCardType().contains(CardType.CREATURE)) {
                Token token = new SaprolingToken();
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
            }
            if (card.getCardType().contains(CardType.LAND)) {
                player.getLibrary().getCard(card.getId(), game);
                card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId());
            }
View Full Code Here

        list.add("Spirit");
        list.add("Warrior");
        ObjectColor objectColor = new ObjectColor();
        objectColor.setBlack(true);
        objectColor.setGreen(true);
        Token token = new Token("Spirit Warrior", "X/X black and green Spirit Warrior creature token onto the battlefield, where X is the greatest toughness among creatures you control",
                objectColor, list, value, value, new AbilitiesImpl());
        token.getAbilities().newId(); // neccessary if token has ability like DevourAbility()
        token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
        return true;
    }
View Full Code Here

        return new AjanisChosenEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        Token token = new CatToken();
        if(token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())){
            Player player = game.getPlayer(source.getControllerId());
            Permanent enchantement = game.getPermanent(this.getTargetPointer().getFirst(game, source));
            Permanent tokenPermanent = game.getPermanent(token.getLastAddedToken());
            if(player != null && enchantement != null && tokenPermanent != null && enchantement.getSubtype().contains("Aura"))
            {
                Permanent oldCreature = game.getPermanent(enchantement.getAttachedTo());

                if(oldCreature != null && enchantement.getSpellAbility().getTargets().get(0).canTarget(tokenPermanent.getId(), game) && player.chooseUse(Outcome.Neutral, "Attach " + enchantement.getName() + " to the token ?", game))
View Full Code Here

        return new NahiriTheLithomancerFirstAbilityEffect(this);
    }
   
    @Override
    public boolean apply(Game game, Ability source) {
        Token token = new NahiriTheLithomancerKorSoldierToken();
        if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
            Permanent tokenPermanent = game.getPermanent(token.getLastAddedToken());
            if (tokenPermanent != null) {
                //TODO: Make sure the Equipment can legally enchant the token, preferably on targetting.
                Target target = new TargetControlledPermanent(0, 1, filter, true);
                if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) {
                    Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget());
View Full Code Here

        if (controller != null) {
            for(UUID creatureId: getTargetPointer().getTargets(game, source)) {
                Permanent creature = game.getPermanent(creatureId);
                if (creature != null) {
                    controller.moveCardToExileWithInfo(creature, null, null, source.getSourceId(), game, Zone.BATTLEFIELD);
                    Token token = new HourOfNeedSphinxToken();
                    token.putOntoBattlefield(1, game, source.getSourceId(), creature.getControllerId());
                }
            }
            return true;
        }
        return false;
View Full Code Here

    }

    @Override
    public boolean apply(Game game, Ability source) {
        game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game);
        Token token = new SpiritBlueToken();
        token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
        return true;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
       
        if (controller != null) {
            Token token = new CatSoldierCreatureToken();
            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
            Permanent catToken = game.getPermanent(token.getLastAddedToken());
            Permanent attackingCreature = game.getPermanent(getTargetPointer().getFirst(game, source));           
            if (catToken != null && attackingCreature != null && game.getState().getCombat() != null) {
                // Possible ruling (see Ætherplasm)
                // The token you put onto the battlefield is blocking the attacking creature,
                // even if the block couldn't legally be declared (for example, if that creature
View Full Code Here

TOP

Related Classes of mage.game.permanent.token.Token

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.