[VOW] Implemented Gutter Skulker / Gutter Shortcut

This commit is contained in:
Evan Kranzler 2021-11-06 19:30:49 -04:00
parent 79592acfd9
commit 1f2fa8d8dc
4 changed files with 128 additions and 1 deletions

View file

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

View file

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

View file

@ -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("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("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("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("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("Hallowed Haunting", 17, Rarity.MYTHIC, mage.cards.h.HallowedHaunting.class));
cards.add(new SetCardInfo("Hamlet Vanguard", 201, Rarity.RARE, mage.cards.h.HamletVanguard.class)); cards.add(new SetCardInfo("Hamlet Vanguard", 201, Rarity.RARE, mage.cards.h.HamletVanguard.class));

View file

@ -14,7 +14,7 @@ public enum SourceAttackingAloneCondition implements Condition {
@Override @Override
public boolean apply(Game game, Ability source) { 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 @Override