diff --git a/Mage.Sets/src/mage/cards/s/SerpentOfYawningDepths.java b/Mage.Sets/src/mage/cards/s/SerpentOfYawningDepths.java new file mode 100644 index 0000000000..70dd0f83b9 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SerpentOfYawningDepths.java @@ -0,0 +1,84 @@ +package mage.cards.s; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class SerpentOfYawningDepths extends CardImpl { + + public SerpentOfYawningDepths(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{4}{U}{U}"); + + this.subtype.add(SubType.SERPENT); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Krakens, Leviathans, Octopuses, and Serpents you control can't be blocked except by Krakens, Leviathans, Octopuses, and Serpents. + this.addAbility(new SimpleStaticAbility(new SerpentOfYawningDepthsEffect())); + } + + private SerpentOfYawningDepths(final SerpentOfYawningDepths card) { + super(card); + } + + @Override + public SerpentOfYawningDepths copy() { + return new SerpentOfYawningDepths(this); + } +} + +class SerpentOfYawningDepthsEffect extends RestrictionEffect { + + private static final FilterPermanent filter = new FilterCreaturePermanent(); + + static { + filter.add(Predicates.or( + new SubtypePredicate(SubType.KRAKEN), + new SubtypePredicate(SubType.LEVIATHAN), + new SubtypePredicate(SubType.OCTOPUS), + new SubtypePredicate(SubType.SERPENT) + )); + } + + SerpentOfYawningDepthsEffect() { + super(Duration.WhileOnBattlefield); + this.staticText = "Krakens, Leviathans, Octopuses, and Serpents you control " + + "can't be blocked except by Krakens, Leviathans, Octopuses, and Serpents."; + } + + private SerpentOfYawningDepthsEffect(SerpentOfYawningDepthsEffect effect) { + super(effect); + } + + @Override + public SerpentOfYawningDepthsEffect copy() { + return new SerpentOfYawningDepthsEffect(this); + } + + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) { + return filter.match(blocker, game); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + return permanent.isControlledBy(source.getControllerId()) && filter.match(permanent, game); + } +} diff --git a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java index c0c9fce670..ae9371a443 100644 --- a/Mage.Sets/src/mage/sets/TherosBeyondDeath.java +++ b/Mage.Sets/src/mage/sets/TherosBeyondDeath.java @@ -48,6 +48,7 @@ public final class TherosBeyondDeath extends ExpansionSet { cards.add(new SetCardInfo("Nyxborn Courser", 29, Rarity.COMMON, mage.cards.n.NyxbornCourser.class)); cards.add(new SetCardInfo("Plains", 250, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS)); cards.add(new SetCardInfo("Revoke Existence", 34, Rarity.COMMON, mage.cards.r.RevokeExistence.class)); + cards.add(new SetCardInfo("Serpent of Yawning Depths", 291, Rarity.RARE, mage.cards.s.SerpentOfYawningDepths.class)); cards.add(new SetCardInfo("Setessan Champion", 198, Rarity.RARE, mage.cards.s.SetessanChampion.class)); cards.add(new SetCardInfo("Sphinx Mindbreaker", 290, Rarity.RARE, mage.cards.s.SphinxMindbreaker.class)); cards.add(new SetCardInfo("Staggering Insight", 228, Rarity.UNCOMMON, mage.cards.s.StaggeringInsight.class));