[UNF]? Implemented, Embiggen!

This commit is contained in:
Evan Kranzler 2022-10-02 21:48:39 -04:00
parent a7e4fe4f2e
commit d5f67a45c8
2 changed files with 93 additions and 0 deletions

View file

@ -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

View file

@ -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));