Examples of apply()


Examples of mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect.apply()

        if (player != null) {
            if (player.getHand().isEmpty()) {
                // he or she puts the top card of his or her library into his or her graveyard
                Effect effect = new PutTopCardOfLibraryIntoGraveTargetEffect(1);
                effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
                effect.apply(game, source);
                return true;
            } else  {
                // discards a card instead. If the player discards a card this way, he or she draws a card.
                player.discard(1, source, game);
                return false; // because player draws a card, the draw event is kept
View Full Code Here

Examples of mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect.apply()

    public boolean apply(Game game, Ability source) {
        Card cardInGraveyard = game.getCard(getTargetPointer().getFirst(game, source));
        if (cardInGraveyard != null) {
            Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
            effect.setTargetPointer(getTargetPointer());
            effect.apply(game, source);

            game.getState().setValue(source.getSourceId().toString() + "returnedCreature", new MageObjectReference(cardInGraveyard.getId(), game));

            return true;
        }
View Full Code Here

Examples of mage.abilities.effects.common.TransformSourceEffect.apply()

        Permanent p = game.getPermanent(source.getSourceId());
        if (p != null) {
            if (p.getCounters().getCount(CounterType.HATCHLING) >= 5) {
                p.getCounters().removeCounter(CounterType.HATCHLING, p.getCounters().getCount(CounterType.HATCHLING));
                TransformSourceEffect effect = new TransformSourceEffect(true);
                return effect.apply(game, source);
            }
        }
        return false;
    }
View Full Code Here

Examples of mage.abilities.effects.common.counter.AddCountersTargetEffect.apply()

        if (card != null) {
            int count = card.getPower().getValue();
            if (count > 0) {
                Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(count));
                effect.setTargetPointer(getTargetPointer());
                return effect.apply(game, source);
            }
        }

        return false;
    }
View Full Code Here

Examples of mage.abilities.effects.common.discard.DiscardTargetEffect.apply()

        Player you = game.getPlayer(source.getControllerId());
        Player targetedPlayer = game.getPlayer(source.getFirstTarget());
        if (you != null) {
            Effect discardEffect = new DiscardTargetEffect(1, true, true);
            discardEffect.setTargetPointer(new FixedTarget(you.getId()));
            if (discardEffect.apply(game, source)) {
                Card discardedCard = game.getCard(this.getTargetPointer().getFirst(game, source));
                if (discardedCard != null
                        && discardedCard.getCardType().contains(CardType.CREATURE)) {
                    int damage = discardedCard.getPower().getValue();
                    if (targetedPlayer != null) {
View Full Code Here

Examples of me.taylorkelly.bigbrother.fixes.Fix.apply()

            getDataFolder().mkdirs();
        }

        // Apply fixes to DB for old BB
        Fix fix = new Fix1(getDataFolder());
        fix.apply();
        Fix fix2 = new Fix2(getDataFolder());
        fix2.apply();
        Fix fix3 = new Fix3(getDataFolder()); // 26 Feb
        fix3.apply();
        Fix fix4 = new Fix4(getDataFolder()); // 5 March, 2011 - N3X
View Full Code Here

Examples of me.taylorkelly.bigbrother.fixes.Fix1.apply()

            getDataFolder().mkdirs();
        }

        // Apply fixes to DB for old BB
        Fix fix = new Fix1(getDataFolder());
        fix.apply();
        Fix fix2 = new Fix2(getDataFolder());
        fix2.apply();
        Fix fix3 = new Fix3(getDataFolder()); // 26 Feb
        fix3.apply();
        Fix fix4 = new Fix4(getDataFolder()); // 5 March, 2011 - N3X
View Full Code Here

Examples of me.taylorkelly.bigbrother.fixes.Fix2.apply()

        // Apply fixes to DB for old BB
        Fix fix = new Fix1(getDataFolder());
        fix.apply();
        Fix fix2 = new Fix2(getDataFolder());
        fix2.apply();
        Fix fix3 = new Fix3(getDataFolder()); // 26 Feb
        fix3.apply();
        Fix fix4 = new Fix4(getDataFolder()); // 5 March, 2011 - N3X
        fix4.apply();
        Fix fix5 = new Fix5(getDataFolder()); // 24 March, 2011 - N3X
View Full Code Here

Examples of me.taylorkelly.bigbrother.fixes.Fix3.apply()

        Fix fix = new Fix1(getDataFolder());
        fix.apply();
        Fix fix2 = new Fix2(getDataFolder());
        fix2.apply();
        Fix fix3 = new Fix3(getDataFolder()); // 26 Feb
        fix3.apply();
        Fix fix4 = new Fix4(getDataFolder()); // 5 March, 2011 - N3X
        fix4.apply();
        Fix fix5 = new Fix5(getDataFolder()); // 24 March, 2011 - N3X
        fix5.apply();
View Full Code Here

Examples of me.taylorkelly.bigbrother.fixes.Fix4.apply()

        Fix fix2 = new Fix2(getDataFolder());
        fix2.apply();
        Fix fix3 = new Fix3(getDataFolder()); // 26 Feb
        fix3.apply();
        Fix fix4 = new Fix4(getDataFolder()); // 5 March, 2011 - N3X
        fix4.apply();
        Fix fix5 = new Fix5(getDataFolder()); // 24 March, 2011 - N3X
        fix5.apply();

        // Initialize Permissions, Help
        BBPermissions.initialize(getServer());
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.