From 1f2fa8d8dc1b3e33d071f6b3b4a3d7c94d05f004 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 6 Nov 2021 19:30:49 -0400 Subject: [PATCH] [VOW] Implemented Gutter Skulker / Gutter Shortcut --- .../src/mage/cards/g/GutterShortcut.java | 73 +++++++++++++++++++ Mage.Sets/src/mage/cards/g/GutterSkulker.java | 52 +++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 2 + .../common/SourceAttackingAloneCondition.java | 2 +- 4 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/g/GutterShortcut.java create mode 100644 Mage.Sets/src/mage/cards/g/GutterSkulker.java diff --git a/Mage.Sets/src/mage/cards/g/GutterShortcut.java b/Mage.Sets/src/mage/cards/g/GutterShortcut.java new file mode 100644 index 0000000000..5b2f62cf08 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GutterShortcut.java @@ -0,0 +1,73 @@ +package mage.cards.g; + +import mage.abilities.Ability; +import mage.abilities.common.PutIntoGraveFromAnywhereSourceAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.Condition; +import mage.abilities.decorator.ConditionalRestrictionEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.abilities.effects.common.combat.CantBeBlockedAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GutterShortcut extends CardImpl { + + public GutterShortcut(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, ""); + + this.subtype.add(SubType.AURA); + this.color.setBlue(true); + this.nightCard = true; + + // 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 can't be blocked as long as it's attacking alone. + this.addAbility(new SimpleStaticAbility(new ConditionalRestrictionEffect( + new CantBeBlockedAttachedEffect(AttachmentType.AURA), GutterShortcutCondition.instance, + "enchanted creature can't be blocked as long as it's attacking alone" + ))); + + // If Gutter Shortcut would be put into a graveyard from anywhere, exile it instead. + this.addAbility(new PutIntoGraveFromAnywhereSourceAbility(new ExileSourceEffect().setText("exile it instead"))); + } + + private GutterShortcut(final GutterShortcut card) { + super(card); + } + + @Override + public GutterShortcut copy() { + return new GutterShortcut(this); + } +} + +enum GutterShortcutCondition implements Condition { + instance; + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + return permanent != null && game.getCombat().attacksAlone() + && game.getCombat().getAttackers().contains(permanent.getAttachedTo()); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/g/GutterSkulker.java b/Mage.Sets/src/mage/cards/g/GutterSkulker.java new file mode 100644 index 0000000000..628a453833 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GutterSkulker.java @@ -0,0 +1,52 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceAttackingAloneCondition; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalRestrictionEffect; +import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect; +import mage.abilities.keyword.DisturbAbility; +import mage.abilities.keyword.TransformAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class GutterSkulker extends CardImpl { + + public GutterSkulker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.subtype.add(SubType.SPIRIT); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + this.secondSideCardClazz = mage.cards.g.GutterShortcut.class; + + // Gutter Skulker can't be blocked as long as it's attacking alone. + this.addAbility(new SimpleStaticAbility(new ConditionalRestrictionEffect( + new CantBeBlockedSourceEffect(Duration.WhileOnBattlefield), + SourceAttackingAloneCondition.instance, + "{this} can't be blocked as long as it's attacking alone" + ))); + + // Disturb {3}{U} + this.addAbility(new TransformAbility()); + this.addAbility(new DisturbAbility(new ManaCostsImpl<>("{3}{U}"))); + } + + private GutterSkulker(final GutterSkulker card) { + super(card); + } + + @Override + public GutterSkulker copy() { + return new GutterSkulker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index 4a099c2613..05d7f60aeb 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -137,6 +137,8 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Groom's Finery", 117, Rarity.UNCOMMON, mage.cards.g.GroomsFinery.class)); cards.add(new SetCardInfo("Gryff Rider", 15, Rarity.COMMON, mage.cards.g.GryffRider.class)); cards.add(new SetCardInfo("Gryffwing Cavalry", 16, Rarity.UNCOMMON, mage.cards.g.GryffwingCavalry.class)); + cards.add(new SetCardInfo("Gutter Shortcut", 62, Rarity.UNCOMMON, mage.cards.g.GutterShortcut.class)); + cards.add(new SetCardInfo("Gutter Skulker", 62, Rarity.UNCOMMON, mage.cards.g.GutterSkulker.class)); cards.add(new SetCardInfo("Halana and Alena, Partners", 239, Rarity.RARE, mage.cards.h.HalanaAndAlenaPartners.class)); cards.add(new SetCardInfo("Hallowed Haunting", 17, Rarity.MYTHIC, mage.cards.h.HallowedHaunting.class)); cards.add(new SetCardInfo("Hamlet Vanguard", 201, Rarity.RARE, mage.cards.h.HamletVanguard.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingAloneCondition.java b/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingAloneCondition.java index 5e747aae04..048bb5dfed 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingAloneCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/SourceAttackingAloneCondition.java @@ -14,7 +14,7 @@ public enum SourceAttackingAloneCondition implements Condition { @Override public boolean apply(Game game, Ability source) { - return game.getCombat().attacksAlone() && game.getCombat().getAttackers().get(0).equals(source.getSourceId()); + return game.getCombat().attacksAlone() && game.getCombat().getAttackers().contains(source.getSourceId()); } @Override