mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
[ONE] Implement Monument to Perfection
This commit is contained in:
parent
d2d8effb85
commit
220fd75ef8
2 changed files with 140 additions and 0 deletions
139
Mage.Sets/src/mage/cards/m/MonumentToPerfection.java
Normal file
139
Mage.Sets/src/mage/cards/m/MonumentToPerfection.java
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateIfConditionActivatedAbility;
|
||||
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.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
|
||||
import mage.abilities.hint.Hint;
|
||||
import mage.abilities.hint.ValueHint;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.keyword.ToxicAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledLandPermanent;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.custom.CreatureToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MonumentToPerfection extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterLandCard("a basic, Sphere, or Locus land card");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
SuperType.BASIC.getPredicate(),
|
||||
SubType.SPHERE.getPredicate(),
|
||||
SubType.LOCUS.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
public MonumentToPerfection(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
|
||||
// {3}, {T}: Search your library for a basic, Sphere, or Locus land card, reveal it, put it into your hand, then shuffle.
|
||||
Ability ability = new SimpleActivatedAbility(new SearchLibraryPutInHandEffect(
|
||||
new TargetCardInLibrary(filter), true
|
||||
), new GenericManaCost(3));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
||||
// {3}: Monument to Perfection becomes a 9/9 Phyrexian Construct artifact creature, loses all abilities, and gains indestructible and toxic 9. Activate only if there are nine or more lands with different names among the basic, Sphere, and Locus lands you control.
|
||||
this.addAbility(new ActivateIfConditionActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new BecomesCreatureSourceEffect(new CreatureToken(
|
||||
9, 9, "9/9 Phyrexian Construct artifact creature, " +
|
||||
"loses all abilities, and gains indestructible and toxic 9", SubType.PHYREXIAN, SubType.CONSTRUCT
|
||||
).withType(CardType.ARTIFACT)
|
||||
.withAbility(IndestructibleAbility.getInstance())
|
||||
.withAbility(new ToxicAbility(9)),
|
||||
null, Duration.Custom, true,
|
||||
false, null, null, true
|
||||
), new GenericManaCost(3), MonumentToPerfectionCondition.instance
|
||||
).addHint(MonumentToPerfectionValue.getHint()));
|
||||
}
|
||||
|
||||
private MonumentToPerfection(final MonumentToPerfection card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MonumentToPerfection copy() {
|
||||
return new MonumentToPerfection(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum MonumentToPerfectionValue implements DynamicValue {
|
||||
instance;
|
||||
private static final FilterPermanent filter = new FilterControlledLandPermanent();
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
SuperType.BASIC.getPredicate(),
|
||||
SubType.SPHERE.getPredicate(),
|
||||
SubType.LOCUS.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
private static final Hint hint = new ValueHint(
|
||||
"Different names among basics, Spheres, and Locuses you control", instance
|
||||
);
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
return game
|
||||
.getBattlefield()
|
||||
.getActivePermanents(filter, sourceAbility.getControllerId(), game)
|
||||
.stream()
|
||||
.map(permanent -> permanent.getName())
|
||||
.filter(s -> s.length() > 0)
|
||||
.distinct()
|
||||
.mapToInt(x -> 1)
|
||||
.sum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MonumentToPerfectionValue copy() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Hint getHint() {
|
||||
return hint;
|
||||
}
|
||||
}
|
||||
|
||||
enum MonumentToPerfectionCondition implements Condition {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return MonumentToPerfectionValue.instance.calculate(game, source, null) >= 9;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "there are nine or more lands with different names among the basic, Sphere, and Locus lands you control";
|
||||
}
|
||||
}
|
||||
|
|
@ -39,6 +39,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Migloz, Maze Crusher", 210, Rarity.RARE, mage.cards.m.MiglozMazeCrusher.class));
|
||||
cards.add(new SetCardInfo("Mindsplice Apparatus", 63, Rarity.RARE, mage.cards.m.MindspliceApparatus.class));
|
||||
cards.add(new SetCardInfo("Mirrex", 254, Rarity.RARE, mage.cards.m.Mirrex.class));
|
||||
cards.add(new SetCardInfo("Monument to Perfection", 233, Rarity.RARE, mage.cards.m.MonumentToPerfection.class));
|
||||
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Norn's Wellspring", 24, Rarity.RARE, mage.cards.n.NornsWellspring.class));
|
||||
cards.add(new SetCardInfo("Ovika, Enigma Goliath", 213, Rarity.RARE, mage.cards.o.OvikaEnigmaGoliath.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue