diff --git a/Mage.Sets/src/mage/cards/t/TheMotherlodeExcavator.java b/Mage.Sets/src/mage/cards/t/TheMotherlodeExcavator.java new file mode 100644 index 00000000000..22bc65a93f6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TheMotherlodeExcavator.java @@ -0,0 +1,119 @@ +package mage.cards.t; + +import java.util.UUID; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.ReflexiveTriggeredAbility; +import mage.abilities.costs.common.PayEnergyCost; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.abilities.effects.common.DoWhenCostPaid; +import mage.abilities.effects.common.combat.CantBlockAllEffect; +import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.constants.*; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.permanent.ControllerIdPredicate; +import mage.filter.predicate.permanent.DefendingPlayerControlsSourceAttackingPredicate; +import mage.game.Game; +import mage.target.TargetPermanent; +import mage.target.common.TargetOpponent; + +/** + * @author Cguy7777 + */ +public final class TheMotherlodeExcavator extends CardImpl { + + private static final FilterLandPermanent filterLand + = new FilterLandPermanent("nonbasic land defending player controls"); + private static final FilterCreaturePermanent filterCreatures + = new FilterCreaturePermanent("creatures that player controls without flying"); + + static { + filterLand.add(DefendingPlayerControlsSourceAttackingPredicate.instance); + filterLand.add(Predicates.not(SuperType.BASIC.getPredicate())); + filterCreatures.add(DefendingPlayerControlsSourceAttackingPredicate.instance); + filterCreatures.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public TheMotherlodeExcavator(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{R}{R}"); + + this.supertype.add(SuperType.LEGENDARY); + this.subtype.add(SubType.ROBOT); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // When The Motherlode, Excavator enters the battlefield, choose target opponent. + // You get an amount of {E} equal to the number of nonbasic lands that player controls. + Ability ability = new EntersBattlefieldTriggeredAbility( + new GetEnergyCountersControllerEffect(TheMotherlodeExcavatorCount.instance) + .setText("choose target opponent. You get an amount of {E} (energy counters) " + + "equal to the number of nonbasic lands that player controls")); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); + + // Whenever The Motherlode attacks, you may pay {E}{E}{E}{E}. + // When you do, destroy target nonbasic land defending player controls, + // and creatures that player controls without flying can't block this turn. + ReflexiveTriggeredAbility reflexiveAbility + = new ReflexiveTriggeredAbility(new DestroyTargetEffect(), false); + reflexiveAbility.addEffect(new CantBlockAllEffect(filterCreatures, Duration.EndOfTurn) + .concatBy(", and")); + reflexiveAbility.addTarget(new TargetPermanent(filterLand)); + + this.addAbility(new AttacksTriggeredAbility( + new DoWhenCostPaid(reflexiveAbility, new PayEnergyCost(4), "Pay {E}{E}{E}{E}?"))); + } + + private TheMotherlodeExcavator(final TheMotherlodeExcavator card) { + super(card); + } + + @Override + public TheMotherlodeExcavator copy() { + return new TheMotherlodeExcavator(this); + } +} + +enum TheMotherlodeExcavatorCount implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + if (sourceAbility.getFirstTarget() == null) { + return 0; + } + FilterLandPermanent filter = FilterLandPermanent.nonbasicLands(); + filter.add(new ControllerIdPredicate(sourceAbility.getFirstTarget())); + return game.getBattlefield().count( + filter, + sourceAbility.getControllerId(), + sourceAbility, + game); + } + + @Override + public TheMotherlodeExcavatorCount copy() { + return this; + } + + @Override + public String toString() { + return ""; + } + + @Override + public String getMessage() { + return "nonbasic lands that player controls"; + } +} diff --git a/Mage.Sets/src/mage/sets/Fallout.java b/Mage.Sets/src/mage/sets/Fallout.java index 794c091f0d6..dad3bf0c8c3 100644 --- a/Mage.Sets/src/mage/sets/Fallout.java +++ b/Mage.Sets/src/mage/sets/Fallout.java @@ -322,6 +322,10 @@ public final class Fallout extends ExpansionSet { cards.add(new SetCardInfo("Temple of Triumph", 312, Rarity.RARE, mage.cards.t.TempleOfTriumph.class)); cards.add(new SetCardInfo("Temple of the False God", 311, Rarity.UNCOMMON, mage.cards.t.TempleOfTheFalseGod.class)); cards.add(new SetCardInfo("Terramorphic Expanse", 313, Rarity.COMMON, mage.cards.t.TerramorphicExpanse.class)); + cards.add(new SetCardInfo("The Motherlode, Excavator", 62, Rarity.RARE, mage.cards.t.TheMotherlodeExcavator.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Motherlode, Excavator", 389, Rarity.RARE, mage.cards.t.TheMotherlodeExcavator.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Motherlode, Excavator", 590, Rarity.RARE, mage.cards.t.TheMotherlodeExcavator.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("The Motherlode, Excavator", 917, Rarity.RARE, mage.cards.t.TheMotherlodeExcavator.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("The Wise Mothman", 4, Rarity.MYTHIC, mage.cards.t.TheWiseMothman.class)); cards.add(new SetCardInfo("Thirst for Knowledge", 180, Rarity.UNCOMMON, mage.cards.t.ThirstForKnowledge.class)); cards.add(new SetCardInfo("Thought Vessel", 251, Rarity.COMMON, mage.cards.t.ThoughtVessel.class));