Implemented All That Glitters

This commit is contained in:
Evan Kranzler 2019-09-05 17:10:56 -04:00
parent fdafebd937
commit fe1c597af6
2 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,61 @@
package mage.cards.a;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class AllThatGlitters extends CardImpl {
private static final FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent();
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
private static final DynamicValue xValue = new PermanentsOnBattlefieldCount(filter);
public AllThatGlitters(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +1/+1 for each artifact and/or enchantment you control.
this.addAbility(new SimpleStaticAbility(new BoostEnchantedEffect(
xValue, xValue, Duration.WhileOnBattlefield
).setText("enchanted creature gets +1/+1 for each artifact and/or enchantment you control")));
}
private AllThatGlitters(final AllThatGlitters card) {
super(card);
}
@Override
public AllThatGlitters copy() {
return new AllThatGlitters(this);
}
}
// someBODY

View file

@ -27,6 +27,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
this.ratioBoosterMythic = 8;
this.maxCardNumberInBooster = 269; // unconfirmed for now
cards.add(new SetCardInfo("All That Glitters", 2, Rarity.UNCOMMON, mage.cards.a.AllThatGlitters.class));
cards.add(new SetCardInfo("Arcane Signet", 331, Rarity.COMMON, mage.cards.a.ArcaneSignet.class));
cards.add(new SetCardInfo("Bake into a Pie", 76, Rarity.COMMON, mage.cards.b.BakeIntoAPie.class));
cards.add(new SetCardInfo("Chittering Witch", 319, Rarity.RARE, mage.cards.c.ChitteringWitch.class));