Package mage.abilities

Examples of mage.abilities.Mode


        // Choose one - Exile all cards from target player's graveyard;
        this.getSpellAbility().addEffect(new ExileGraveyardAllTargetPlayerEffect());
        this.getSpellAbility().addTarget(new TargetPlayer());
        // or Jund Charm deals 2 damage to each creature;
        Mode mode = new Mode();
        mode.getEffects().add(new DamageAllEffect(2, new FilterCreaturePermanent()));
        this.getSpellAbility().addMode(mode);
        // or put two +1/+1 counters on target creature.
        mode = new Mode();
        mode.getEffects().add(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2), Outcome.BoostCreature));
        mode.getTargets().add(new TargetCreaturePermanent());
        this.getSpellAbility().addMode(mode);
    }
View Full Code Here


        // Choose one - Return target permanent to its owner's hand;
        this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
        this.getSpellAbility().addTarget(new TargetPermanent());
        // or target creature gets -4/-4 until end of turn;
        Mode mode = new Mode();
        mode.getEffects().add(new BoostTargetEffect(-4, -4, Duration.EndOfTurn));
        mode.getTargets().add(new TargetCreaturePermanent());
        this.getSpellAbility().addMode(mode);
        // or creatures you control get +2/+0 until end of turn.
        mode = new Mode();
        mode.getEffects().add(new BoostControlledEffect(2, 0, Duration.EndOfTurn, new FilterCreaturePermanent(), false));
        this.getSpellAbility().addMode(mode);
    }
View Full Code Here

        // <strong>*</strong> Destroy target monocolored creature.
        this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
        this.getSpellAbility().addEffect(new DestroyTargetEffect());
       
        // <strong>*</strong> Destroy target artifact or enchantment.
        Mode mode = new Mode();
        mode.getEffects().add(new DestroyTargetEffect());
        mode.getTargets().add(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent()));
        this.getSpellAbility().addMode(mode);
       
        // <strong>*</strong> Draw two cards, then discard a card.
        mode = new Mode();
        mode.getEffects().add(new DrawDiscardControllerEffect(2,1));
        this.getSpellAbility().addMode(mode);

    }
View Full Code Here

        this.getSpellAbility().getModes().setMaxModes(1);
        //Destroy target land;
        this.getSpellAbility().addEffect(new DestroyTargetEffect());
        this.getSpellAbility().addTarget(new TargetLandPermanent());
        //or search your library for a land card, put that card onto the battlefield, then shuffle your library.
        Mode mode = new Mode();
        mode.getEffects().add(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(new FilterLandCard())));
        this.getSpellAbility().getModes().addMode(mode);

        // Entwine {1}{G}
        this.addAbility(new EntwineAbility("{1}{G}"));
    }
View Full Code Here

        this.getSpellAbility().getModes().setMaxModes(2);
        // *Tap target creature
        this.getSpellAbility().addEffect(new TapTargetEffect());
        this.getSpellAbility().addTarget(new TargetCreaturePermanent());
        // *Winterflame deals 2 damage to target creature
        Mode mode = new Mode();
        mode.getEffects().add(new DamageTargetEffect(2));
        mode.getTargets().add(new TargetCreaturePermanent());
        this.getSpellAbility().addMode(mode);

    }
View Full Code Here

        // <strong>*</strong> Mardu Charm deals 4 damage to target creature.
        this.getSpellAbility().addEffect(new DamageTargetEffect(4));
        this.getSpellAbility().addTarget(new TargetCreaturePermanent());
       
        // <strong>*</strong> Put two 1/1 white Warrior creature tokens onto the battlefield. They gain first strike until end of turn.
        Mode mode = new Mode();
        mode.getEffects().add(new MarduCharmCreateTokenEffect());
        this.getSpellAbility().addMode(mode);
       
        // <strong>*</strong> Target opponent reveals his or her hand. You choose a noncreature, nonland card from it.  That player discards that card.
        mode = new Mode();
        mode.getEffects().add(new DiscardCardYouChooseTargetEffect(filter));
        mode.getTargets().add(new TargetOpponent());
        this.getSpellAbility().addMode(mode);
       
    }
View Full Code Here

        // Choose one - Target player gains 3 life; or prevent the next 3 damage that would be dealt to target creature or player this turn.
        this.getSpellAbility().addEffect(new GainLifeTargetEffect(3));
        this.getSpellAbility().addTarget(new TargetPlayer());
       
        Mode mode = new Mode();
        mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn, 3));
        mode.getTargets().add(new TargetCreatureOrPlayer());
       
        this.getSpellAbility().addMode(mode);
    }
View Full Code Here

        // * Target player loses X life.
        this.getSpellAbility().addEffect(new LoseLifeTargetEffect(xValue));
        this.getSpellAbility().addTarget(new TargetPlayer());

        // * Return target creature card with converted mana cost X or less from your graveyard to the battlefield.
        Mode mode = new Mode();
        mode.getEffects().add(new ReturnFromGraveyardToBattlefieldTargetEffect());
        mode.getTargets().add(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
        this.getSpellAbility().addMode(mode);

        // * Target creature gets -X/-X until end of turn.
        mode = new Mode();
        mode.getEffects().add(new BoostTargetEffect(xValue, xValue, Duration.EndOfTurn));
        mode.getTargets().add(new TargetCreaturePermanent());
        this.getSpellAbility().addMode(mode);

        // * Up to X target creatures gain fear until end of turn.
        mode = new Mode();
        Effect effect = new GainAbilityTargetEffect(FearAbility.getInstance(), Duration.EndOfTurn);
        effect.setText("Up to X target creatures gain fear until end of turn");
        mode.getEffects().add(effect);
        mode.getTargets().add(new TargetCreaturePermanent(0,1));
        this.getSpellAbility().addMode(mode);       
    }
View Full Code Here

    }

    @Override
    public void adjustTargets(Ability ability, Game game) {
        for (UUID modeId :ability.getModes().getSelectedModes()) {
            Mode mode = ability.getModes().get(modeId);
            for (Effect effect :mode.getEffects()) {
                if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
                    mode.getTargets().clear();
                    int xValue = ability.getManaCostsToPay().getX();
                    FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue +  " or less from your graveyard");
                    filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, xValue + 1));
                    mode.getTargets().add(new TargetCardInYourGraveyard(filter));
                }
                if (effect instanceof GainAbilityTargetEffect) {
                    mode.getTargets().clear();
                    int xValue = ability.getManaCostsToPay().getX();
                    FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures gain fear until end of turn");
                    mode.getTargets().add(new TargetCreaturePermanent(0, xValue, filter, false));
                }
            }
        }
    }
View Full Code Here

       
        // Choose one - Creatures you control gain double strike until end of turn;
        this.getSpellAbility().addEffect(new GainAbilityControlledEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent(), false));
       
        // or untap all creatures you control and after this phase, there is an additional combat phase.
        Mode mode = new Mode();
        mode.getEffects().add(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "untap all creatures you control"));
        mode.getEffects().add(new AdditionalCombatPhaseEffect());
        this.getSpellAbility().getModes().addMode(mode);
       
        // Entwine {1}{R}
        this.addAbility(new EntwineAbility("{1}{R}"));
    }
View Full Code Here

TOP

Related Classes of mage.abilities.Mode

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.