[CMB1] Implement Slivdrazi Monstrosity (#9651)

This commit is contained in:
Grath 2022-10-26 19:39:20 -04:00 committed by GitHub
parent 93e4d0944b
commit 70bd0e4d9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 172 additions and 2 deletions

View file

@ -447,7 +447,7 @@ public class ScryfallImageSupportCards {
add("PELD"); // Throne of Eldraine Promos
add("ELD"); // Throne of Eldraine
//add("PTG"); // Ponies: The Galloping
//add("CMB1"); // Mystery Booster Playtest Cards
add("CMB1"); // Mystery Booster Playtest Cards
add("MB1"); // Mystery Booster
add("GN2"); // Game Night 2019
add("HA1"); // Historic Anthology 1

View file

@ -0,0 +1,109 @@
package mage.cards.s;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.BecomesSubtypeAllEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.AnnihilatorAbility;
import mage.abilities.keyword.DevoidAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.EldraziSliverToken;
import java.util.Arrays;
import java.util.UUID;
/**
* @author Grath
*/
public final class SlivdraziMonstrosity extends CardImpl {
private static final FilterCreaturePermanent eldrazi_you_control = new FilterCreaturePermanent("Eldrazi you control");
static {
eldrazi_you_control.add(SubType.ELDRAZI.getPredicate());
}
public SlivdraziMonstrosity(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{C}{W}{U}{B}{R}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.SLIVER);
this.subtype.add(SubType.ELDRAZI);
this.power = new MageInt(8);
this.toughness = new MageInt(8);
// Eldrazi you control are Slivers in addition to their other types.
this.addAbility(new SimpleStaticAbility(new BecomesSubtypeAllEffect(
Duration.WhileOnBattlefield, Arrays.asList(SubType.SLIVER), eldrazi_you_control, false
).setText("Eldrazi you control are Slivers in addition to their other types.")));
// Slivers you control have devoid and annihilator 1.
Ability ability = new SimpleStaticAbility(new SlivdraziMonstrosityEffect());
ability.addEffect(
new GainAbilityControlledEffect(
new AnnihilatorAbility(1), Duration.WhileOnBattlefield,
StaticFilters.FILTER_PERMANENT_SLIVERS
).setText("and annihilator 1"));
this.addAbility(ability);
// {3}: Create a 1/1 colorless Eldrazi Sliver creature token. It has Sacrifice this creature: Add {C}.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new EldraziSliverToken()), new ManaCostsImpl<>("{3}")));
}
private SlivdraziMonstrosity(final SlivdraziMonstrosity card) {
super(card);
}
@Override
public SlivdraziMonstrosity copy() {
return new SlivdraziMonstrosity(this);
}
}
class SlivdraziMonstrosityEffect extends ContinuousEffectImpl {
private static final FilterPermanent filter = new FilterPermanent(SubType.SLIVER, "Slivers");
public SlivdraziMonstrosityEffect() {
super(Duration.WhileOnBattlefield, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Benefit);
staticText = "Slivers you control have devoid";
}
@Override
public boolean apply(Game game, Ability source) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source, game)) {
if (perm.isControlledBy(source.getControllerId())) {
// Due to the carefully calibrated system of layers that Magic uses to determine the interaction of continuous
// effects, gaining an ability that changes the color of an object has no effect on the color of that object.
// Despite this, Slivdrazi Monstrosity causes Slivers to become colorless as they gain devoid. Rather than try
// to figure out how this could work, this card should just be played as though it read Slivers you control
// have devoid and annihilator 1 and are colorless.
// (2019-11-12)
// This ruling implemented here by adding this ability in the color-changing effect layer.
perm.addAbility(new DevoidAbility(perm.getColor(game)), source.getSourceId(), game);
}
}
return true;
}
@Override
public SlivdraziMonstrosityEffect copy() {
return new SlivdraziMonstrosityEffect(this);
}
private SlivdraziMonstrosityEffect(final SlivdraziMonstrosityEffect effect) {
super(effect);
}
}

View file

@ -0,0 +1,29 @@
package mage.sets;
import mage.cards.ExpansionSet;
import mage.constants.Rarity;
import mage.constants.SetType;
/**
* https://mtg.fandom.com/wiki/Mystery_Booster/Test_cards
* https://magic.wizards.com/en/articles/archive/feature/unraveling-mystery-booster-2019-11-14
* https://scryfall.com/sets/cmb1
*
*/
public class MysteryBoosterPlaytest extends ExpansionSet {
private static final MysteryBoosterPlaytest instance = new MysteryBoosterPlaytest();
public static MysteryBoosterPlaytest getInstance() {
return instance;
}
private MysteryBoosterPlaytest() {
super("Mystery Booster Playtest", "CMB1", ExpansionSet.buildDate(2019, 11, 7), SetType.JOKESET);
this.hasBoosters = false;
this.hasBasicLands = false;
cards.add(new SetCardInfo("Slivdrazi Monstrosity", 102, Rarity.RARE, mage.cards.s.SlivdraziMonstrosity.class));
}
}

View file

@ -33,7 +33,7 @@ public final class EldraziScionToken extends TokenImpl {
subtype.add(SubType.SCION);
power = new MageInt(1);
toughness = new MageInt(1);
addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.GenericMana(1), new SacrificeSourceCost()));
addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(1), new SacrificeSourceCost()));
availableImageSetCodes = tokenImageSets;
}

View file

@ -0,0 +1,32 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.Mana;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.mana.SimpleManaAbility;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
public final class EldraziSliverToken extends TokenImpl {
public EldraziSliverToken() {
super("Eldrazi Sliver Token", "1/1 colorless Eldrazi Sliver creature token with \"Sacrifice this creature: Add {C}.\"");
cardType.add(CardType.CREATURE);
subtype.add(SubType.ELDRAZI);
subtype.add(SubType.SLIVER);
power = new MageInt(1);
toughness = new MageInt(1);
addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(1), new SacrificeSourceCost()));
}
public EldraziSliverToken(final EldraziSliverToken token) {
super(token);
}
@Override
public EldraziSliverToken copy() {
return new EldraziSliverToken(this); //To change body of generated methods, choose Tools | Templates.
}
}