[ONE] Implement Mirrex

This commit is contained in:
theelk801 2023-01-14 13:16:29 -05:00
parent 4acd7d6604
commit 7ca7ed52d4
4 changed files with 121 additions and 2 deletions

View file

@ -0,0 +1,78 @@
package mage.cards.m;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.Condition;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.mana.AddManaOfAnyColorEffect;
import mage.abilities.mana.ActivateIfConditionManaAbility;
import mage.abilities.mana.ColorlessManaAbility;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.PhyrexianMiteToken;
/**
* @author TheElk801
*/
public final class Mirrex extends CardImpl {
public Mirrex(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
this.subtype.add(SubType.SPHERE);
// {T}: Add {C}.
this.addAbility(new ColorlessManaAbility());
// {T}: Add one mana of any color. Activate only if Mirrex entered the battlefield this turn.
this.addAbility(new ActivateIfConditionManaAbility(
Zone.BATTLEFIELD, new AddManaOfAnyColorEffect(),
new TapSourceCost(), MirrexCondition.instance
));
// {3}, {T}: Create a 1/1 colorless Phyrexian Mite artifact creature token with toxic 1 and "This creature can't block."
Ability ability = new SimpleActivatedAbility(
new CreateTokenEffect(new PhyrexianMiteToken()), new GenericManaCost(3)
);
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
private Mirrex(final Mirrex card) {
super(card);
}
@Override
public Mirrex copy() {
return new Mirrex(this);
}
}
enum MirrexCondition implements Condition {
instance;
@Override
public boolean apply(Game game, Ability source) {
return Optional
.ofNullable(source.getSourcePermanentIfItStillExists(game))
.filter(Objects::nonNull)
.map(Permanent::getTurnsOnBattlefield)
.equals(0);
}
@Override
public String toString() {
return "if {this} entered the battlefield this turn";
}
}

View file

@ -27,8 +27,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Dragonwing Glider", 126, Rarity.RARE, mage.cards.d.DragonwingGlider.class)); cards.add(new SetCardInfo("Dragonwing Glider", 126, Rarity.RARE, mage.cards.d.DragonwingGlider.class));
cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Forest", 276, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Island", 273, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Koth, Fire of Resistance", 138, Rarity.RARE, mage.cards.k.KothFireOfResistance.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mirrex", 254, Rarity.RARE, mage.cards.m.Mirrex.class));
cards.add(new SetCardInfo("Koth, Fire of Resistance", 446, Rarity.RARE, mage.cards.k.KothFireOfResistance.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Phyrexian Arena", 104, Rarity.RARE, mage.cards.p.PhyrexianArena.class)); cards.add(new SetCardInfo("Phyrexian Arena", 104, Rarity.RARE, mage.cards.p.PhyrexianArena.class));
cards.add(new SetCardInfo("Phyrexian Obliterator", 105, Rarity.MYTHIC, mage.cards.p.PhyrexianObliterator.class)); cards.add(new SetCardInfo("Phyrexian Obliterator", 105, Rarity.MYTHIC, mage.cards.p.PhyrexianObliterator.class));

View file

@ -247,6 +247,7 @@ public enum SubType {
MINION("Minion", SubTypeSet.CreatureType), MINION("Minion", SubTypeSet.CreatureType),
MINOTAUR("Minotaur", SubTypeSet.CreatureType), MINOTAUR("Minotaur", SubTypeSet.CreatureType),
MIRIALAN("Mirialan", SubTypeSet.CreatureType, true), // Star Wars MIRIALAN("Mirialan", SubTypeSet.CreatureType, true), // Star Wars
MITE("Mite", SubTypeSet.CreatureType),
MOLE("Mole", SubTypeSet.CreatureType), MOLE("Mole", SubTypeSet.CreatureType),
MONGER("Monger", SubTypeSet.CreatureType), MONGER("Monger", SubTypeSet.CreatureType),
MONGOOSE("Mongoose", SubTypeSet.CreatureType), MONGOOSE("Mongoose", SubTypeSet.CreatureType),

View file

@ -0,0 +1,41 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.combat.CantBlockSourceEffect;
import mage.abilities.keyword.ToxicAbility;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import java.util.Arrays;
/**
* @author TheElk801
*/
public final class PhyrexianMiteToken extends TokenImpl {
public PhyrexianMiteToken() {
super("Phyrexian Mite Token", "1/1 colorless Phyrexian Mite artifact creature token with toxic 1 and \"This creature can't block.\"");
cardType.add(CardType.ARTIFACT);
cardType.add(CardType.CREATURE);
subtype.add(SubType.PHYREXIAN);
subtype.add(SubType.MITE);
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(new ToxicAbility(1));
this.addAbility(new SimpleStaticAbility(new CantBlockSourceEffect(Duration.WhileOnBattlefield).setText("this creature can't block")));
availableImageSetCodes = Arrays.asList("ONE");
}
public PhyrexianMiteToken(final PhyrexianMiteToken token) {
super(token);
}
@Override
public PhyrexianMiteToken copy() {
return new PhyrexianMiteToken(this);
}
}