Implemented Inspire Awe

This commit is contained in:
Evan Kranzler 2020-01-02 16:20:39 -05:00
parent 0ccd01de7a
commit be32db8a80
3 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,44 @@
package mage.cards.i;
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.EnchantmentOrEnchantedPredicate;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class InspireAwe extends CardImpl {
private static final FilterCreaturePermanent filter
= new FilterCreaturePermanent("enchanted creatures and enchantment creatures");
static {
filter.add(EnchantmentOrEnchantedPredicate.instance);
}
public InspireAwe(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}");
// Prevent all combat damage that would be dealt this turn except by enchanted creatures and enchantment creatures. Scry 2.
this.getSpellAbility().addEffect(new PreventAllDamageByAllPermanentsEffect(
filter, Duration.EndOfTurn, true
));
this.getSpellAbility().addEffect(new ScryEffect(2));
}
private InspireAwe(final InspireAwe card) {
super(card);
}
@Override
public InspireAwe copy() {
return new InspireAwe(this);
}
}

View file

@ -60,6 +60,7 @@ public final class TherosBeyondDeath extends ExpansionSet {
cards.add(new SetCardInfo("Idyllic Tutor", 24, Rarity.RARE, mage.cards.i.IdyllicTutor.class));
cards.add(new SetCardInfo("Indomitable Will", 25, Rarity.COMMON, mage.cards.i.IndomitableWill.class));
cards.add(new SetCardInfo("Inevitable End", 102, Rarity.UNCOMMON, mage.cards.i.InevitableEnd.class));
cards.add(new SetCardInfo("Inspire Awe", 175, Rarity.COMMON, mage.cards.i.InspireAwe.class));
cards.add(new SetCardInfo("Ironscale Hydra", 296, Rarity.RARE, mage.cards.i.IronscaleHydra.class));
cards.add(new SetCardInfo("Island", 251, Rarity.LAND, mage.cards.basiclands.Island.class, FULL_ART_BFZ_VARIOUS));
cards.add(new SetCardInfo("Klothys's Design", 176, Rarity.UNCOMMON, mage.cards.k.KlothyssDesign.class));

View file

@ -0,0 +1,36 @@
package mage.filter.predicate.mageobject;
import mage.constants.SubType;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.Objects;
/**
* @author TheElk801
*/
public enum EnchantmentOrEnchantedPredicate implements Predicate<Permanent> {
instance;
@Override
public boolean apply(Permanent input, Game game) {
if (!input.isCreature()) {
return false;
}
if (input.isEnchantment()) {
return true;
}
return input
.getAttachments()
.stream()
.map(game::getPermanent)
.filter(Objects::nonNull)
.anyMatch(permanent -> permanent.hasSubtype(SubType.AURA, game));
}
@Override
public String toString() {
return "enchanted creature or enchantment creature";
}
}