diff --git a/Mage.Sets/src/mage/cards/c/CacophonyUnleashed.java b/Mage.Sets/src/mage/cards/c/CacophonyUnleashed.java new file mode 100644 index 00000000000..f36290047fa --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CacophonyUnleashed.java @@ -0,0 +1,91 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldThisOrAnotherTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.CastFromEverywhereSourceCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.DestroyAllEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.game.permanent.token.TokenImpl; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class CacophonyUnleashed extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("nonenchantment creatures"); + + static { + filter.add(Predicates.not(CardType.ENCHANTMENT.getPredicate())); + } + + public CacophonyUnleashed(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{B}{B}"); + + + // When Cacophony Unleashed enters the battlefield, if you cast it, destroy all nonenchantment creatures. + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new DestroyAllEffect(filter)), + CastFromEverywhereSourceCondition.instance, + "When {this} enters the battlefield, if you cast it, destroy all nonenchantment creatures." + )); + + // Whenever Cacophony Unleashed or another enchantment enters the battlefield under your control, until end of turn, Cacophony Unleashed becomes a legendary 6/6 Nightmare God creature with menace and deathtouch. It's still an enchantment. + this.addAbility( + new EntersBattlefieldThisOrAnotherTriggeredAbility( + new BecomesCreatureSourceEffect(new CacophonyUnleashedToken(), CardType.ENCHANTMENT, Duration.EndOfTurn) + .setText("until end of turn, Cacophony Unleashed becomes a legendary 6/6 Nightmare God " + + "creature with menace and deathtouch. It's still an enchantment."), + StaticFilters.FILTER_PERMANENT_ENCHANTMENT, + false, true + ) + ); + } + + private CacophonyUnleashed(final CacophonyUnleashed card) { + super(card); + } + + @Override + public CacophonyUnleashed copy() { + return new CacophonyUnleashed(this); + } +} + +class CacophonyUnleashedToken extends TokenImpl { + + CacophonyUnleashedToken() { + super("", "legendary 6/6 Nightmare God creature with menace and deathtouch"); + supertype.add(SuperType.LEGENDARY); + cardType.add(CardType.CREATURE); + subtype.add(SubType.NIGHTMARE); + subtype.add(SubType.GOD); + power = new MageInt(6); + toughness = new MageInt(6); + addAbility(new MenaceAbility(false)); + addAbility(DeathtouchAbility.getInstance()); + } + + private CacophonyUnleashedToken(final CacophonyUnleashedToken token) { + super(token); + } + + public CacophonyUnleashedToken copy() { + return new CacophonyUnleashedToken(this); + } +} diff --git a/Mage.Sets/src/mage/cards/e/ExtinguishAllHope.java b/Mage.Sets/src/mage/cards/e/ExtinguishAllHope.java index a2e414722fc..a516e0f0007 100644 --- a/Mage.Sets/src/mage/cards/e/ExtinguishAllHope.java +++ b/Mage.Sets/src/mage/cards/e/ExtinguishAllHope.java @@ -1,24 +1,25 @@ package mage.cards.e; -import java.util.UUID; import mage.abilities.effects.common.DestroyAllEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; +import java.util.UUID; + /** * * @author LevelX2 */ public final class ExtinguishAllHope extends CardImpl { - private static final FilterPermanent filter = new FilterPermanent("nonenchantment creatures"); + private static final FilterPermanent filter = new FilterCreaturePermanent("nonenchantment creatures"); static { - filter.add(CardType.CREATURE.getPredicate()); filter.add(Predicates.not(CardType.ENCHANTMENT.getPredicate())); } diff --git a/Mage.Sets/src/mage/sets/CommanderMasters.java b/Mage.Sets/src/mage/sets/CommanderMasters.java index 932785bde0b..c11528c2d4d 100644 --- a/Mage.Sets/src/mage/sets/CommanderMasters.java +++ b/Mage.Sets/src/mage/sets/CommanderMasters.java @@ -91,6 +91,7 @@ public final class CommanderMasters extends ExpansionSet { cards.add(new SetCardInfo("Brood Sliver", 887, Rarity.RARE, mage.cards.b.BroodSliver.class)); cards.add(new SetCardInfo("Burnished Hart", 373, Rarity.UNCOMMON, mage.cards.b.BurnishedHart.class)); cards.add(new SetCardInfo("Cabal Patriarch", 140, Rarity.UNCOMMON, mage.cards.c.CabalPatriarch.class)); + cards.add(new SetCardInfo("Cacophony Unleashed", 730, Rarity.RARE, mage.cards.c.CacophonyUnleashed.class)); cards.add(new SetCardInfo("Cadaver Imp", 141, Rarity.COMMON, mage.cards.c.CadaverImp.class)); cards.add(new SetCardInfo("Calamity of the Titans", 713, Rarity.RARE, mage.cards.c.CalamityOfTheTitans.class)); cards.add(new SetCardInfo("Calix, Destiny's Hand", 918, Rarity.MYTHIC, mage.cards.c.CalixDestinysHand.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java index bb0147304d4..d0df9045bd0 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java @@ -105,6 +105,9 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl { permanent.removeAllCardTypes(game); permanent.removeAllSubTypes(game); } + for (SuperType superType : token.getSuperType(game)) { + permanent.addSuperType(game, superType); + } for (CardType cardType : token.getCardType(game)) { permanent.addCardType(game, cardType); }