From edda235273ca90a2fef555a00ee3f956aeacf3d1 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Tue, 1 Nov 2022 21:33:41 -0400 Subject: [PATCH] [BRO] Implement Disciples of Gix --- Mage.Sets/src/mage/cards/b/BuriedAlive.java | 31 +++---- .../src/mage/cards/d/DisciplesOfGix.java | 82 +++++++++++++++++++ Mage.Sets/src/mage/sets/TheBrothersWar.java | 1 + 3 files changed, 100 insertions(+), 14 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/d/DisciplesOfGix.java diff --git a/Mage.Sets/src/mage/cards/b/BuriedAlive.java b/Mage.Sets/src/mage/cards/b/BuriedAlive.java index d9af2768d07..df5ecafe216 100644 --- a/Mage.Sets/src/mage/cards/b/BuriedAlive.java +++ b/Mage.Sets/src/mage/cards/b/BuriedAlive.java @@ -1,10 +1,10 @@ package mage.cards.b; -import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.effects.SearchEffect; +import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.cards.Cards; import mage.cards.CardsImpl; import mage.constants.CardType; import mage.constants.Outcome; @@ -14,8 +14,9 @@ import mage.game.Game; import mage.players.Player; import mage.target.common.TargetCardInLibrary; +import java.util.UUID; + /** - * * @author cbt33, plopman (Entomb) */ public final class BuriedAlive extends CardImpl { @@ -25,7 +26,6 @@ public final class BuriedAlive extends CardImpl { // Search your library for up to three creature cards and put them into your graveyard. Then shuffle your library. this.getSpellAbility().addEffect(new BuriedAliveEffect()); - } private BuriedAlive(final BuriedAlive card) { @@ -38,10 +38,10 @@ public final class BuriedAlive extends CardImpl { } } -class BuriedAliveEffect extends SearchEffect { +class BuriedAliveEffect extends OneShotEffect { public BuriedAliveEffect() { - super(new TargetCardInLibrary(0, 3, StaticFilters.FILTER_CARD_CREATURE), Outcome.Detriment); + super(Outcome.Detriment); staticText = "search your library for up to three creature cards, put them into your graveyard, then shuffle"; } @@ -57,14 +57,17 @@ class BuriedAliveEffect extends SearchEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - if (controller != null) { - if (controller.searchLibrary(target, source, game)) { - controller.moveCards(new CardsImpl(target.getTargets()), Zone.GRAVEYARD, source, game); - } - controller.shuffleLibrary(source, game); - return true; + if (controller == null) { + return false; } - return false; + TargetCardInLibrary target = new TargetCardInLibrary( + 0, 3, StaticFilters.FILTER_CARD_CREATURE + ); + controller.searchLibrary(target, source, game); + Cards cards = new CardsImpl(target.getTargets()); + cards.retainZone(Zone.LIBRARY, game); + controller.moveCards(cards, Zone.GRAVEYARD, source, game); + controller.shuffleLibrary(source, game); + return true; } - } diff --git a/Mage.Sets/src/mage/cards/d/DisciplesOfGix.java b/Mage.Sets/src/mage/cards/d/DisciplesOfGix.java new file mode 100644 index 00000000000..411ea50aa11 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DisciplesOfGix.java @@ -0,0 +1,82 @@ +package mage.cards.d; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.filter.StaticFilters; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class DisciplesOfGix extends CardImpl { + + public DisciplesOfGix(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); + + this.subtype.add(SubType.PHYREXIAN); + this.subtype.add(SubType.HUMAN); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Disciples of Gix enters the battlefield, search your library for up to three artifact cards, put them into your graveyard, then shuffle. + this.addAbility(new EntersBattlefieldTriggeredAbility(new DisciplesOfGixEffect())); + } + + private DisciplesOfGix(final DisciplesOfGix card) { + super(card); + } + + @Override + public DisciplesOfGix copy() { + return new DisciplesOfGix(this); + } +} + + +class DisciplesOfGixEffect extends OneShotEffect { + + public DisciplesOfGixEffect() { + super(Outcome.Benefit); + staticText = "search your library for up to three artifact cards, put them into your graveyard, then shuffle"; + } + + public DisciplesOfGixEffect(final DisciplesOfGixEffect effect) { + super(effect); + } + + @Override + public DisciplesOfGixEffect copy() { + return new DisciplesOfGixEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { + return false; + } + TargetCardInLibrary target = new TargetCardInLibrary( + 0, 3, StaticFilters.FILTER_CARD_ARTIFACT + ); + controller.searchLibrary(target, source, game); + Cards cards = new CardsImpl(target.getTargets()); + cards.retainZone(Zone.LIBRARY, game); + controller.moveCards(cards, Zone.GRAVEYARD, source, game); + controller.shuffleLibrary(source, game); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index 42554a2e45d..40b076d40fc 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -42,6 +42,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Corrupt", 88, Rarity.UNCOMMON, mage.cards.c.Corrupt.class)); cards.add(new SetCardInfo("Depth Charge Colossus", 78, Rarity.COMMON, mage.cards.d.DepthChargeColossus.class)); cards.add(new SetCardInfo("Diabolic Intent", 89, Rarity.RARE, mage.cards.d.DiabolicIntent.class)); + cards.add(new SetCardInfo("Disciples of Gix", 90, Rarity.UNCOMMON, mage.cards.d.DisciplesOfGix.class)); cards.add(new SetCardInfo("Disenchant", 6, Rarity.COMMON, mage.cards.d.Disenchant.class)); cards.add(new SetCardInfo("Disfigure", 91, Rarity.COMMON, mage.cards.d.Disfigure.class)); cards.add(new SetCardInfo("Drafna, Founder of Lat-Nam", 47, Rarity.RARE, mage.cards.d.DrafnaFounderOfLatNam.class));