diff --git a/Mage.Sets/src/mage/cards/l/LootTheKeyToEverything.java b/Mage.Sets/src/mage/cards/l/LootTheKeyToEverything.java new file mode 100644 index 00000000000..68cc299c670 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LootTheKeyToEverything.java @@ -0,0 +1,94 @@ +package mage.cards.l; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.ExileTopXMayPlayUntilEffect; +import mage.abilities.keyword.WardAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterNonlandPermanent; +import mage.filter.predicate.mageobject.AnotherPredicate; +import mage.game.Game; + +import java.util.Collection; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class LootTheKeyToEverything extends CardImpl { + + public LootTheKeyToEverything(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}{U}{R}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.BEAST); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // Ward {1} + this.addAbility(new WardAbility(new ManaCostsImpl<>("{1}"))); + + // At the beginning of your upkeep, exile the top X cards of your library, where X is the number of card types among other nonland permanents you control. You may play those cards this turn. + this.addAbility(new BeginningOfUpkeepTriggeredAbility( + new ExileTopXMayPlayUntilEffect(LootTheKeyToEverythingValue.instance, Duration.EndOfTurn) + .setText("exile the top X cards of your library, where X is the number of card types " + + "among other nonland permanents you control. You may play those cards this turn"), + TargetController.YOU, false + )); + } + + private LootTheKeyToEverything(final LootTheKeyToEverything card) { + super(card); + } + + @Override + public LootTheKeyToEverything copy() { + return new LootTheKeyToEverything(this); + } +} + +enum LootTheKeyToEverythingValue implements DynamicValue { + instance; + private static final FilterPermanent filter = new FilterNonlandPermanent(); + + static { + filter.add(AnotherPredicate.instance); + filter.add(TargetController.YOU.getControllerPredicate()); + } + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return game + .getBattlefield() + .getActivePermanents(filter, sourceAbility.getControllerId(), sourceAbility, game) + .stream() + .map(permanent -> permanent.getCardType(game)) + .flatMap(Collection::stream) + .distinct() + .mapToInt(x -> 1) + .sum(); + } + + @Override + public LootTheKeyToEverythingValue copy() { + return this; + } + + @Override + public String getMessage() { + return ""; + } + + @Override + public String toString() { + return "X"; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBigScore.java b/Mage.Sets/src/mage/sets/TheBigScore.java index ea88c000875..cca223a44c1 100644 --- a/Mage.Sets/src/mage/sets/TheBigScore.java +++ b/Mage.Sets/src/mage/sets/TheBigScore.java @@ -21,6 +21,7 @@ public final class TheBigScore extends ExpansionSet { this.hasBasicLands = false; this.hasBoosters = false; + cards.add(new SetCardInfo("Loot, the Key to Everything", 21, Rarity.MYTHIC, mage.cards.l.LootTheKeyToEverything.class)); cards.add(new SetCardInfo("Oltec Matterweaver", 3, Rarity.MYTHIC, mage.cards.o.OltecMatterweaver.class)); cards.add(new SetCardInfo("Torpor Orb", 27, Rarity.MYTHIC, mage.cards.t.TorporOrb.class)); cards.add(new SetCardInfo("Vaultborn Tyrant", 20, Rarity.MYTHIC, mage.cards.v.VaultbornTyrant.class)); diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index 910396aaa16..d98c9efcb35 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -52690,6 +52690,7 @@ Forest|Modern Horizons 3|308|C||Basic Land - Forest|||({T}: Add {G}.)| Snow-Covered Wastes|Modern Horizons 3|309|U||Basic Snow Land|||{T}: Add {C}.| Oltec Matterweaver|The Big Score|3|M|{2}{W}|Creature - Human Artificer|2|4|Whenever you cast a creature spell, choose one --$* Create a 1/1 colorless Gnome artifact creature token.$* Create a token that's a copy of target artifact token you control.| Vaultborn Tyrant|The Big Score|20|M|{5}{G}{G}|Creature - Dinosaur|6|6|Trample$Whenever Vaultborn Tyrant or another creature with power 4 or greater enters the battlefield under your control, you gain 3 life and draw a card.$When Vaultborn Tyrant dies, if it's not a token, create a token that's a copy of it, except it's an artifact in addition to its other types.| +Loot, the Key to Everything|The Big Score|21|M|{G}{U}{R}|Legendary Creature - Beast Noble|1|2|Ward {1}$At the beginning of your upkeep, exile the top X cards of your library, where X is the number of card types among other nonland permanents you control. You may play those cards this turn.| Nexus of Becoming|The Big Score|25|M|{6}|Artifact|||At the beginning of combat on your turn, draw a card. Then you may exile an artifact or creature card from your hand. If you do, create a token that's a copy of the exiled card, except it's a 3/3 Golem artifact creature in addition to its other types.| Sword of Wealth and Power|The Big Score|26|M|{3}|Artifact - Equipment|||Equipped creature gets +2/+2 and has protection from instants and from sorceries.$Whenever equipped creature deals combat damage to a player, create a Treasure token. When you next cast an instant or sorcery spell this turn, copy that spell. You may choose new targets for the copy.$Equip {2}| Torpor Orb|The Big Score|27|M|{2}|Artifact|||Creatures entering the battlefield don't cause abilities to trigger.|