[CMM] Implement Cacophony Unleashed (#10689)

This commit is contained in:
Susucre 2023-07-29 01:33:35 +02:00 committed by GitHub
parent 3e406a9975
commit 50989970cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 99 additions and 3 deletions

View file

@ -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);
}
}

View file

@ -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()));
}

View file

@ -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));

View file

@ -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);
}