From 6b9db5eb17c13064d0914529b539ba7406d97ee3 Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Thu, 4 Jan 2018 05:44:12 +0400 Subject: [PATCH] [RIX] Added Deeproot Elite --- Mage.Sets/src/mage/cards/d/DeeprootElite.java | 86 +++++++++++++++++++ .../mage/cards/f/ForerunnerOfTheHeralds.java | 2 +- Mage.Sets/src/mage/sets/RivalsOfIxalan.java | 1 + .../FilterControlledCreaturePermanent.java | 13 ++- 4 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/d/DeeprootElite.java diff --git a/Mage.Sets/src/mage/cards/d/DeeprootElite.java b/Mage.Sets/src/mage/cards/d/DeeprootElite.java new file mode 100644 index 00000000000..a4d85082ed8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DeeprootElite.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author JayDi85 + */ +public class DeeprootElite extends CardImpl { + + private static final FilterPermanent filterYourAnotherMerfolk = new FilterPermanent(SubType.MERFOLK, "another " + SubType.MERFOLK.toString()); + static { + filterYourAnotherMerfolk.add(new AnotherPredicate()); + filterYourAnotherMerfolk.add(new ControllerPredicate(TargetController.YOU)); + } + + private static final FilterControlledCreaturePermanent filterYourAnyMerfolk = new FilterControlledCreaturePermanent(SubType.MERFOLK); + static { + filterYourAnyMerfolk.add(new ControllerPredicate(TargetController.YOU)); + } + + public DeeprootElite(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}"); + + this.subtype.add(SubType.MERFOLK); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever another Merfolk enters the battlefield under your control, put a +1/+1 counter on target Merfolk you control. + Ability ability = new EntersBattlefieldControlledTriggeredAbility(new AddCountersTargetEffect(CounterType.P1P1.createInstance()), filterYourAnotherMerfolk); + ability.addTarget(new TargetControlledCreaturePermanent(filterYourAnyMerfolk)); + this.addAbility(ability); + } + + public DeeprootElite(final DeeprootElite card) { + super(card); + } + + @Override + public DeeprootElite copy() { + return new DeeprootElite(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/f/ForerunnerOfTheHeralds.java b/Mage.Sets/src/mage/cards/f/ForerunnerOfTheHeralds.java index c6445274c21..2f3531e377f 100644 --- a/Mage.Sets/src/mage/cards/f/ForerunnerOfTheHeralds.java +++ b/Mage.Sets/src/mage/cards/f/ForerunnerOfTheHeralds.java @@ -52,7 +52,7 @@ import mage.target.common.TargetCardInLibrary; */ public class ForerunnerOfTheHeralds extends CardImpl { - private static final FilterPermanent filterAnotherMerfolk = new FilterPermanent(SubType.MERFOLK, SubType.MERFOLK.toString()); + private static final FilterPermanent filterAnotherMerfolk = new FilterPermanent(SubType.MERFOLK, "another " + SubType.MERFOLK.toString()); static { filterAnotherMerfolk.add(new AnotherPredicate()); filterAnotherMerfolk.add(new ControllerPredicate(TargetController.YOU)); diff --git a/Mage.Sets/src/mage/sets/RivalsOfIxalan.java b/Mage.Sets/src/mage/sets/RivalsOfIxalan.java index 72919af296a..a2308076088 100644 --- a/Mage.Sets/src/mage/sets/RivalsOfIxalan.java +++ b/Mage.Sets/src/mage/sets/RivalsOfIxalan.java @@ -63,6 +63,7 @@ public class RivalsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Buffling End", 1, Rarity.UNCOMMON, mage.cards.m.BafflingEnd.class)); cards.add(new SetCardInfo("Captain's Hook", 177, Rarity.RARE, mage.cards.c.CaptainsHook.class)); cards.add(new SetCardInfo("Cinder Barrens", 205, Rarity.RARE, mage.cards.c.CinderBarrens.class)); + cards.add(new SetCardInfo("Deeproot Elite", 127, Rarity.RARE, mage.cards.d.DeeprootElite.class)); cards.add(new SetCardInfo("Dusk Charger", 69, Rarity.COMMON, mage.cards.d.DuskCharger.class)); cards.add(new SetCardInfo("Elenda, the Dusk Rose", 157, Rarity.MYTHIC, mage.cards.e.ElendaTheDuskRose.class)); cards.add(new SetCardInfo("Evolving Wilds", 186, Rarity.RARE, mage.cards.e.EvolvingWilds.class)); diff --git a/Mage/src/main/java/mage/filter/common/FilterControlledCreaturePermanent.java b/Mage/src/main/java/mage/filter/common/FilterControlledCreaturePermanent.java index 34e81d3e432..e438f4d091e 100644 --- a/Mage/src/main/java/mage/filter/common/FilterControlledCreaturePermanent.java +++ b/Mage/src/main/java/mage/filter/common/FilterControlledCreaturePermanent.java @@ -43,15 +43,20 @@ public class FilterControlledCreaturePermanent extends FilterControlledPermanent } public FilterControlledCreaturePermanent(String name) { - super(name); - this.add(new CardTypePredicate(CardType.CREATURE)); - // this.add(new ControllerPredicate(TargetController.YOU)); + this(null, name); + } + + public FilterControlledCreaturePermanent(SubType subtype) { + this(subtype, subtype.toString() + " you control"); } public FilterControlledCreaturePermanent(SubType subtype, String name) { super(name); + this.add(new CardTypePredicate(CardType.CREATURE)); - this.add(new SubtypePredicate(subtype)); + if(subtype != null) { + this.add(new SubtypePredicate(subtype)); + } } public FilterControlledCreaturePermanent(final FilterControlledCreaturePermanent filter) {