mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
[KHM] Implemented Tuskeri Firewalker (#7400)
* Refactored ExileTop3 -> ExileTopXMayPlayUntilEndOfTurnEffect * [KHM] Implemented Tuskeri Firewalker
This commit is contained in:
parent
faf49af0ea
commit
4e66d4877c
6 changed files with 70 additions and 14 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
39
Mage.Sets/src/mage/cards/t/TuskeriFirewalker.java
Normal file
39
Mage.Sets/src/mage/cards/t/TuskeriFirewalker.java
Normal file
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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<Card> cards = new HashSet<>(controller.getLibrary().getTopCards(game, 3));
|
||||
Set<Card> 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";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue