diff --git a/Mage.Sets/src/mage/cards/a/ActOnImpulse.java b/Mage.Sets/src/mage/cards/a/ActOnImpulse.java index 0f7dfa3ff87..65891fdaf11 100644 --- a/Mage.Sets/src/mage/cards/a/ActOnImpulse.java +++ b/Mage.Sets/src/mage/cards/a/ActOnImpulse.java @@ -1,6 +1,6 @@ package mage.cards.a; -import mage.abilities.effects.common.ExileTop3MayPlayUntilEndOfTurnEffect; +import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -17,7 +17,7 @@ public final class ActOnImpulse extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{R}"); // Exile the top three cards of your library. Until end of turn, you may play cards exiled this way. - this.getSpellAbility().addEffect(new ExileTop3MayPlayUntilEndOfTurnEffect()); + this.getSpellAbility().addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(3)); } public ActOnImpulse(final ActOnImpulse card) { diff --git a/Mage.Sets/src/mage/cards/c/ChandraHeartOfFire.java b/Mage.Sets/src/mage/cards/c/ChandraHeartOfFire.java index 0ae6aba9dda..767111168a6 100644 --- a/Mage.Sets/src/mage/cards/c/ChandraHeartOfFire.java +++ b/Mage.Sets/src/mage/cards/c/ChandraHeartOfFire.java @@ -8,7 +8,7 @@ import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; -import mage.abilities.effects.common.ExileTop3MayPlayUntilEndOfTurnEffect; +import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect; import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect; import mage.abilities.effects.common.discard.DiscardHandControllerEffect; import mage.abilities.effects.mana.BasicManaEffect; @@ -46,7 +46,7 @@ public final class ChandraHeartOfFire extends CardImpl { // +1: Discard your hand, then exile the top three cards of your library. Until end of turn, you may play cards exiled this way. Ability ability = new LoyaltyAbility(new DiscardHandControllerEffect(), 1); - ability.addEffect(new ExileTop3MayPlayUntilEndOfTurnEffect().concatBy(", then")); + ability.addEffect(new ExileTopXMayPlayUntilEndOfTurnEffect(3).concatBy(", then")); this.addAbility(ability); // +1: Chandra, Heart of Fire deals 2 damage to any target. diff --git a/Mage.Sets/src/mage/cards/j/JeskasWill.java b/Mage.Sets/src/mage/cards/j/JeskasWill.java index c2b91257161..2810aac7438 100644 --- a/Mage.Sets/src/mage/cards/j/JeskasWill.java +++ b/Mage.Sets/src/mage/cards/j/JeskasWill.java @@ -5,7 +5,7 @@ import mage.abilities.Ability; import mage.abilities.Mode; import mage.abilities.condition.common.ControlACommanderCondition; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.ExileTop3MayPlayUntilEndOfTurnEffect; +import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -35,7 +35,7 @@ public final class JeskasWill extends CardImpl { this.getSpellAbility().addTarget(new TargetOpponent()); // • Exile the top three cards of your library. You may play them this turn. - this.getSpellAbility().addMode(new Mode(new ExileTop3MayPlayUntilEndOfTurnEffect())); + this.getSpellAbility().addMode(new Mode(new ExileTopXMayPlayUntilEndOfTurnEffect(3))); } private JeskasWill(final JeskasWill card) { diff --git a/Mage.Sets/src/mage/cards/t/TuskeriFirewalker.java b/Mage.Sets/src/mage/cards/t/TuskeriFirewalker.java new file mode 100644 index 00000000000..39cb803ce75 --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TuskeriFirewalker.java @@ -0,0 +1,39 @@ +package mage.cards.t; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.ExileTopXMayPlayUntilEndOfTurnEffect; +import mage.abilities.keyword.BoastAbility; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +/** + * + * @author weirddan455 + */ +public final class TuskeriFirewalker extends CardImpl { + + public TuskeriFirewalker(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}"); + + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.BERSERKER); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // Boast — {1}: Exile the top card of your library. You may play that card this turn. + this.addAbility(new BoastAbility(new ExileTopXMayPlayUntilEndOfTurnEffect(1), new GenericManaCost(1))); + } + + private TuskeriFirewalker(final TuskeriFirewalker card) { + super(card); + } + + @Override + public TuskeriFirewalker copy() { + return new TuskeriFirewalker(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Kaldheim.java b/Mage.Sets/src/mage/sets/Kaldheim.java index e4a4987bcd4..f94748c4e76 100644 --- a/Mage.Sets/src/mage/sets/Kaldheim.java +++ b/Mage.Sets/src/mage/sets/Kaldheim.java @@ -241,6 +241,7 @@ public final class Kaldheim extends ExpansionSet { cards.add(new SetCardInfo("Toralf, God of Fury", 154, Rarity.MYTHIC, mage.cards.t.ToralfGodOfFury.class)); cards.add(new SetCardInfo("Tormentor's Helm", 155, Rarity.COMMON, mage.cards.t.TormentorsHelm.class)); cards.add(new SetCardInfo("Toski, Bearer of Secrets", 197, Rarity.RARE, mage.cards.t.ToskiBearerOfSecrets.class)); + cards.add(new SetCardInfo("Tuskeri Firewalker", 157, Rarity.COMMON, mage.cards.t.TuskeriFirewalker.class)); cards.add(new SetCardInfo("Tyvar Kell", 198, Rarity.MYTHIC, mage.cards.t.TyvarKell.class)); cards.add(new SetCardInfo("Undersea Invader", 78, Rarity.COMMON, mage.cards.u.UnderseaInvader.class)); cards.add(new SetCardInfo("Usher of the Fallen", 35, Rarity.UNCOMMON, mage.cards.u.UsherOfTheFallen.class)); diff --git a/Mage/src/main/java/mage/abilities/effects/common/ExileTop3MayPlayUntilEndOfTurnEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ExileTopXMayPlayUntilEndOfTurnEffect.java similarity index 60% rename from Mage/src/main/java/mage/abilities/effects/common/ExileTop3MayPlayUntilEndOfTurnEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/ExileTopXMayPlayUntilEndOfTurnEffect.java index 3ad21482f61..eeb8cbffcc6 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ExileTop3MayPlayUntilEndOfTurnEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ExileTopXMayPlayUntilEndOfTurnEffect.java @@ -2,6 +2,7 @@ package mage.abilities.effects.common; import mage.MageObject; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect; @@ -12,24 +13,27 @@ import mage.constants.Zone; import mage.game.Game; import mage.players.Player; import mage.target.targetpointer.FixedTargets; +import mage.util.CardUtil; -import java.util.HashSet; import java.util.Set; -public class ExileTop3MayPlayUntilEndOfTurnEffect extends OneShotEffect { +public class ExileTopXMayPlayUntilEndOfTurnEffect extends OneShotEffect { - public ExileTop3MayPlayUntilEndOfTurnEffect() { + private final int amount; + + public ExileTopXMayPlayUntilEndOfTurnEffect(int amount) { super(Outcome.Benefit); - this.staticText = "exile the top three cards of your library. Until end of turn, you may play cards exiled this way"; + this.amount = amount; } - public ExileTop3MayPlayUntilEndOfTurnEffect(final ExileTop3MayPlayUntilEndOfTurnEffect effect) { + private ExileTopXMayPlayUntilEndOfTurnEffect(final ExileTopXMayPlayUntilEndOfTurnEffect effect) { super(effect); + this.amount = effect.amount; } @Override - public ExileTop3MayPlayUntilEndOfTurnEffect copy() { - return new ExileTop3MayPlayUntilEndOfTurnEffect(this); + public ExileTopXMayPlayUntilEndOfTurnEffect copy() { + return new ExileTopXMayPlayUntilEndOfTurnEffect(this); } @Override @@ -37,7 +41,7 @@ public class ExileTop3MayPlayUntilEndOfTurnEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { - Set cards = new HashSet<>(controller.getLibrary().getTopCards(game, 3)); + Set cards = controller.getLibrary().getTopCards(game, amount); if (!cards.isEmpty()) { controller.moveCardsToExile(cards, source, game, true, source.getSourceId(), sourceObject.getIdName()); // remove cards that could not be moved to exile @@ -53,4 +57,16 @@ public class ExileTop3MayPlayUntilEndOfTurnEffect extends OneShotEffect { return false; } + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + if (amount == 1) { + return "exile the top card of your library. You may play that card this turn"; + } + return "exile the top " + + CardUtil.numberToText(amount) + + " cards of your library. Until end of turn, you may play cards exiled this way"; + } }