From b73529fbc4cfa0e9e2065fe1fdce173b227d760e Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Mon, 7 Jan 2019 20:00:46 -0500 Subject: [PATCH] Implemented Rhythm of the Wild --- .../src/mage/cards/r/RhythmOfTheWild.java | 57 +++++++++++++++++++ .../src/mage/sets/RavnicaAllegiance.java | 1 + 2 files changed, 58 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java diff --git a/Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java b/Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java new file mode 100644 index 0000000000..610dc43e09 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RhythmOfTheWild.java @@ -0,0 +1,57 @@ +package mage.cards.r; + +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.CantBeCounteredControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.RiotAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.filter.FilterPermanent; +import mage.filter.FilterSpell; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.permanent.TokenPredicate; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class RhythmOfTheWild extends CardImpl { + + private static final FilterSpell filter + = new FilterSpell("Creature spells you control"); + private static final FilterPermanent filter2 + = new FilterControlledCreaturePermanent("Nontoken creatures you control"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + filter2.add(Predicates.not(new TokenPredicate())); + } + + public RhythmOfTheWild(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{G}"); + + // Creature spells you control can't be countered. + this.addAbility(new SimpleStaticAbility(new CantBeCounteredControlledEffect( + filter, null, Duration.WhileOnBattlefield + ))); + + // Nontoken creatures you control have riot. + this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( + new RiotAbility(), Duration.WhileOnBattlefield, filter2 + ))); + } + + private RhythmOfTheWild(final RhythmOfTheWild card) { + super(card); + } + + @Override + public RhythmOfTheWild copy() { + return new RhythmOfTheWild(this); + } +} diff --git a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java index db60a75e3a..10eabc8225 100644 --- a/Mage.Sets/src/mage/sets/RavnicaAllegiance.java +++ b/Mage.Sets/src/mage/sets/RavnicaAllegiance.java @@ -107,6 +107,7 @@ public final class RavnicaAllegiance extends ExpansionSet { cards.add(new SetCardInfo("Rakdos, the Showstopper", 199, Rarity.MYTHIC, mage.cards.r.RakdosTheShowstopper.class)); cards.add(new SetCardInfo("Rampage of the Clans", 134, Rarity.RARE, mage.cards.r.RampageOfTheClans.class)); cards.add(new SetCardInfo("Ravager Wurm", 200, Rarity.MYTHIC, mage.cards.r.RavagerWurm.class)); + cards.add(new SetCardInfo("Rhythm of the Wild", 201, Rarity.UNCOMMON, mage.cards.r.RhythmOfTheWild.class)); cards.add(new SetCardInfo("Rix Maadi Reveler", 109, Rarity.RARE, mage.cards.r.RixMaadiReveler.class)); cards.add(new SetCardInfo("Sauroform Hybrid", 140, Rarity.COMMON, mage.cards.s.SauroformHybrid.class)); cards.add(new SetCardInfo("Savage Smash", 203, Rarity.COMMON, mage.cards.s.SavageSmash.class));