Implemented Serpent of Yawning Depths

This commit is contained in:
Evan Kranzler 2019-12-17 20:42:33 -05:00
parent 05f1cd8db9
commit 6601d65793
2 changed files with 85 additions and 0 deletions

View file

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

View file

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