diff --git a/Mage.Sets/src/mage/cards/g/Gloomshrieker.java b/Mage.Sets/src/mage/cards/g/Gloomshrieker.java new file mode 100644 index 00000000000..89d8e8555c7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/Gloomshrieker.java @@ -0,0 +1,90 @@ +package mage.cards.g; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.filter.FilterCard; +import mage.filter.common.FilterPermanentCard; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.target.common.TargetCardInYourGraveyard; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class Gloomshrieker extends CardImpl { + + private static final FilterCard filter = new FilterPermanentCard("permanent card from your graveyard"); + + public Gloomshrieker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{1}{B}{G}"); + + this.subtype.add(SubType.CAT); + this.subtype.add(SubType.BEAST); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Menace + this.addAbility(new MenaceAbility()); + + // When Gloomshrieker enters the battlefield, return target permanent card from your graveyard to your hand. + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToHandTargetEffect()); + ability.addTarget(new TargetCardInYourGraveyard(filter)); + this.addAbility(ability); + + // If Gloomshrieker would die, exile it instead. + this.addAbility(new SimpleStaticAbility(new GloomshriekerEffect())); + } + + private Gloomshrieker(final Gloomshrieker card) { + super(card); + } + + @Override + public Gloomshrieker copy() { + return new Gloomshrieker(this); + } +} + +class GloomshriekerEffect extends ReplacementEffectImpl { + + GloomshriekerEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If {this} would die, exile it instead"; + } + + private GloomshriekerEffect(final GloomshriekerEffect effect) { + super(effect); + } + + @Override + public GloomshriekerEffect copy() { + return new GloomshriekerEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ZONE_CHANGE; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return event.getTargetId().equals(source.getSourceId()) && ((ZoneChangeEvent) event).isDiesEvent(); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + ((ZoneChangeEvent) event).setToZone(Zone.EXILED); + return true; + } +} diff --git a/Mage.Sets/src/mage/cards/n/NissasChosen.java b/Mage.Sets/src/mage/cards/n/NissasChosen.java index 04b22398cc0..4a7568ae43b 100644 --- a/Mage.Sets/src/mage/cards/n/NissasChosen.java +++ b/Mage.Sets/src/mage/cards/n/NissasChosen.java @@ -52,7 +52,7 @@ class NissasChosenEffect extends ReplacementEffectImpl { public NissasChosenEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit); - staticText = "If {this} would be put into a graveyard from the battlefield, put it on the bottom of its owner's library instead"; + staticText = "If {this} would die, put it on the bottom of its owner's library instead"; } public NissasChosenEffect(final NissasChosenEffect effect) { diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index d40c02d7302..d1394894f42 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -51,6 +51,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Forest", 291, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Generous Visitor", 185, Rarity.UNCOMMON, mage.cards.g.GenerousVisitor.class)); cards.add(new SetCardInfo("Geothermal Kami", 186, Rarity.COMMON, mage.cards.g.GeothermalKami.class)); + cards.add(new SetCardInfo("Gloomshrieker", 219, Rarity.UNCOMMON, mage.cards.g.Gloomshrieker.class)); cards.add(new SetCardInfo("Go-Shintai of Ancient Wars", 144, Rarity.UNCOMMON, mage.cards.g.GoShintaiOfAncientWars.class)); cards.add(new SetCardInfo("Go-Shintai of Shared Purpose", 14, Rarity.UNCOMMON, mage.cards.g.GoShintaiOfSharedPurpose.class)); cards.add(new SetCardInfo("Goro-Goro, Disciple of Ryusei", 145, Rarity.RARE, mage.cards.g.GoroGoroDiscipleOfRyusei.class));