diff --git a/Mage.Sets/src/mage/cards/e/Embiggen.java b/Mage.Sets/src/mage/cards/e/Embiggen.java new file mode 100644 index 00000000000..87244ec6cc2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/e/Embiggen.java @@ -0,0 +1,92 @@ +package mage.cards.e; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.Arrays; +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Embiggen extends CardImpl { + + private static final FilterPermanent filter = new FilterCreaturePermanent("non-Brushwagg creature"); + + static { + filter.add(Predicates.not(SubType.BRUSHWAGG.getPredicate())); + } + + public Embiggen(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{G}"); + + // Until end of turn, target non-Brushwagg creature gets +1/+1 for each supertype, card type, and subtype it has. + this.getSpellAbility().addEffect(new EmbiggenEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + private Embiggen(final Embiggen card) { + super(card); + } + + @Override + public Embiggen copy() { + return new Embiggen(this); + } +} + +class EmbiggenEffect extends OneShotEffect { + + EmbiggenEffect() { + super(Outcome.Benefit); + staticText = "until end of turn, target non-Brushwagg creature " + + "gets +1/+1 for each supertype, card type, and subtype it has"; + } + + private EmbiggenEffect(final EmbiggenEffect effect) { + super(effect); + } + + @Override + public EmbiggenEffect copy() { + return new EmbiggenEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent == null) { + return false; + } + int count = permanent + .getSuperType() + .size() + + permanent + .getCardType(game) + .size() + + Arrays + .stream(SubType.values()) + .filter(subType -> permanent.hasSubtype(subType, game)) + .mapToInt(x -> 1) + .sum(); + if (count > 0) { + game.addEffect(new BoostTargetEffect(count, count).setTargetPointer(new FixedTarget(permanent, game)), source); + return true; + } + return false; + } +} +// it's a perfectly cromulent card diff --git a/Mage.Sets/src/mage/sets/Unfinity.java b/Mage.Sets/src/mage/sets/Unfinity.java index 91eaded2c71..fff6af331c0 100644 --- a/Mage.Sets/src/mage/sets/Unfinity.java +++ b/Mage.Sets/src/mage/sets/Unfinity.java @@ -27,6 +27,7 @@ public final class Unfinity extends ExpansionSet { cards.add(new SetCardInfo("Circuits Act", 103, Rarity.COMMON, mage.cards.c.CircuitsAct.class)); cards.add(new SetCardInfo("Clown Car", 186, Rarity.RARE, mage.cards.c.ClownCar.class)); cards.add(new SetCardInfo("Dissatisfied Customer", 72, Rarity.COMMON, mage.cards.d.DissatisfiedCustomer.class)); + cards.add(new SetCardInfo("Embiggen", 137, Rarity.COMMON, mage.cards.e.Embiggen.class)); cards.add(new SetCardInfo("Forest", 239, Rarity.LAND, mage.cards.basiclands.Forest.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Godless Shrine", 282, Rarity.RARE, mage.cards.g.GodlessShrine.class)); cards.add(new SetCardInfo("Hallowed Fountain", 277, Rarity.RARE, mage.cards.h.HallowedFountain.class));