From d4ef2ec414db5385c374755ff2f8caa13361d2ad Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 18 Jul 2021 10:46:05 -0400 Subject: [PATCH] [AFC] Implemented Midnight Pathlighter --- .../src/mage/cards/m/MidnightPathlighter.java | 58 +++++++++++++++++++ .../mage/sets/ForgottenRealmsCommander.java | 1 + .../CantBeBlockedByCreaturesAllEffect.java | 6 +- 3 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/m/MidnightPathlighter.java diff --git a/Mage.Sets/src/mage/cards/m/MidnightPathlighter.java b/Mage.Sets/src/mage/cards/m/MidnightPathlighter.java new file mode 100644 index 00000000000..a4d2c8773ad --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MidnightPathlighter.java @@ -0,0 +1,58 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.abilities.common.ControlledCreaturesDealCombatDamagePlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesAllEffect; +import mage.abilities.effects.keyword.VentureIntoTheDungeonEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.SuperType; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MidnightPathlighter extends CardImpl { + + private static final FilterCreaturePermanent filter + = new FilterCreaturePermanent("except by legendary creatures"); + + static { + filter.add(Predicates.not(SuperType.LEGENDARY.getPredicate())); + } + + public MidnightPathlighter(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{U}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Creatures you control can't be blocked except by legendary creatures. + this.addAbility(new SimpleStaticAbility(new CantBeBlockedByCreaturesAllEffect( + StaticFilters.FILTER_PERMANENT_CREATURES_CONTROLLED, + filter, Duration.WhileOnBattlefield + ))); + + // Whenever one or more creatures you control deal combat damage to a player, venture into the dungeon. + this.addAbility(new ControlledCreaturesDealCombatDamagePlayerTriggeredAbility(new VentureIntoTheDungeonEffect())); + } + + private MidnightPathlighter(final MidnightPathlighter card) { + super(card); + } + + @Override + public MidnightPathlighter copy() { + return new MidnightPathlighter(this); + } +} diff --git a/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java b/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java index 9e72b29c288..e1a656faf86 100644 --- a/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java +++ b/Mage.Sets/src/mage/sets/ForgottenRealmsCommander.java @@ -138,6 +138,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet { cards.add(new SetCardInfo("Masterwork of Ingenuity", 209, Rarity.RARE, mage.cards.m.MasterworkOfIngenuity.class)); cards.add(new SetCardInfo("Merfolk Looter", 86, Rarity.UNCOMMON, mage.cards.m.MerfolkLooter.class)); cards.add(new SetCardInfo("Meteor Golem", 210, Rarity.UNCOMMON, mage.cards.m.MeteorGolem.class)); + cards.add(new SetCardInfo("Midnight Pathlighter", 52, Rarity.RARE, mage.cards.m.MidnightPathlighter.class)); cards.add(new SetCardInfo("Mind Stone", 211, Rarity.UNCOMMON, mage.cards.m.MindStone.class)); cards.add(new SetCardInfo("Mishra's Factory", 248, Rarity.UNCOMMON, mage.cards.m.MishrasFactory.class)); cards.add(new SetCardInfo("Moonsilver Spear", 212, Rarity.RARE, mage.cards.m.MoonsilverSpear.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByCreaturesAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByCreaturesAllEffect.java index bb0bbc9ffbb..51a6dc95308 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByCreaturesAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByCreaturesAllEffect.java @@ -10,7 +10,6 @@ import mage.game.permanent.Permanent; /** * @author LevelX2 */ - public class CantBeBlockedByCreaturesAllEffect extends RestrictionEffect { private final FilterCreaturePermanent filterBlockedBy; @@ -20,8 +19,9 @@ public class CantBeBlockedByCreaturesAllEffect extends RestrictionEffect { super(duration); this.filterCreatures = filterCreatures; this.filterBlockedBy = filterBlockedBy; - staticText = new StringBuilder(filterCreatures.getMessage()).append(" can't be blocked ") - .append(filterBlockedBy.getMessage().startsWith("except by") ? "" : "by ").append(filterBlockedBy.getMessage()).toString(); + staticText = filterCreatures.getMessage() + " can't be blocked " + + (filterBlockedBy.getMessage().startsWith("except by") ? "" : "by ") + + filterBlockedBy.getMessage(); } public CantBeBlockedByCreaturesAllEffect(final CantBeBlockedByCreaturesAllEffect effect) {