mirror of
https://github.com/correl/mage.git
synced 2025-04-05 01:09:06 -09:00
[AFC] Implemented Hurl Through Hell
This commit is contained in:
parent
75eddb0a54
commit
4c4168ac1f
14 changed files with 94 additions and 15 deletions
Mage.Sets/src/mage
cards
f
g
h
i
k
m
o
r
u
sets
Mage/src/main/java/mage/abilities/effects/common/asthought
|
@ -71,6 +71,6 @@ class FallenShinobiEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, player.getLibrary().getTopCards(game, 2),
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false);
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ class GolosTirelessPilgrimEffect extends OneShotEffect {
|
|||
}
|
||||
Set<Card> cards = player.getLibrary().getTopCards(game, 3);
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, cards,
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false);
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
71
Mage.Sets/src/mage/cards/h/HurlThroughHell.java
Normal file
71
Mage.Sets/src/mage/cards/h/HurlThroughHell.java
Normal file
|
@ -0,0 +1,71 @@
|
|||
package mage.cards.h;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class HurlThroughHell extends CardImpl {
|
||||
|
||||
public HurlThroughHell(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{B}{R}");
|
||||
|
||||
// Exile target creature. Until the end of your next turn, you may cast that card and you may spend mana as though it were mana of any color to cast that spell.
|
||||
this.getSpellAbility().addEffect(new HurlThroughHellEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
private HurlThroughHell(final HurlThroughHell card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HurlThroughHell copy() {
|
||||
return new HurlThroughHell(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HurlThroughHellEffect extends OneShotEffect {
|
||||
|
||||
HurlThroughHellEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "exile target creature. Until the end of your next turn, you may cast that card " +
|
||||
"and you may spend mana as though it were mana of any color to cast that spell";
|
||||
}
|
||||
|
||||
private HurlThroughHellEffect(final HurlThroughHellEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HurlThroughHellEffect copy() {
|
||||
return new HurlThroughHellEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent == null) {
|
||||
return false;
|
||||
}
|
||||
PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(
|
||||
game, source, permanent.getMainCard(), TargetController.YOU,
|
||||
Duration.UntilEndOfYourNextTurn,
|
||||
false, true, true
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -69,6 +69,6 @@ class IgniteTheFutureEffect extends OneShotEffect {
|
|||
}
|
||||
Set<Card> cards = controller.getLibrary().getTopCards(game, 3);
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, cards,
|
||||
TargetController.YOU, Duration.UntilEndOfYourNextTurn, Zone.GRAVEYARD.equals(spell.getFromZone()), false);
|
||||
TargetController.YOU, Duration.UntilEndOfYourNextTurn, Zone.GRAVEYARD.equals(spell.getFromZone()), false, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ class KheruSpellsnatcherEffect extends OneShotEffect {
|
|||
MageObject card = game.getObject(stackObject.getSourceId());
|
||||
if (card instanceof Card) {
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, (Card) card,
|
||||
TargetController.YOU, Duration.Custom, true, true);
|
||||
TargetController.YOU, Duration.Custom, true, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class MagusOfTheMindEffect extends OneShotEffect {
|
|||
if (controller.getLibrary().hasCards()) {
|
||||
Set<Card> cards = controller.getLibrary().getTopCards(game, stormCount);
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, cards,
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false);
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false, false);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class MindsDesireEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
controller.shuffleLibrary(source, game);
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, controller.getLibrary().getFromTop(game),
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false);
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ class OraclesVaultEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, controller.getLibrary().getFromTop(game),
|
||||
TargetController.YOU, Duration.EndOfTurn, false, false);
|
||||
TargetController.YOU, Duration.EndOfTurn, false, false, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ class OraclesVaultFreeEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, controller.getLibrary().getFromTop(game),
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false);
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ class RadiantScrollwielderEffect extends OneShotEffect {
|
|||
}
|
||||
PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(
|
||||
game, source, card, TargetController.YOU,
|
||||
Duration.EndOfTurn, false, true
|
||||
Duration.EndOfTurn, false, false, true
|
||||
);
|
||||
game.addEffect(new RadiantScrollwielderReplacementEffect(card, game), source);
|
||||
return true;
|
||||
|
|
|
@ -80,7 +80,7 @@ class RagavanNimblePilfererEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(
|
||||
game, source, card, TargetController.YOU, Duration.EndOfTurn, false, true
|
||||
game, source, card, TargetController.YOU, Duration.EndOfTurn, false, false, true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ class ReleaseToTheWindEffect extends OneShotEffect {
|
|||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
if (targetPermanent != null) {
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, targetPermanent,
|
||||
TargetController.OWNER, Duration.Custom, true, true);
|
||||
TargetController.OWNER, Duration.Custom, true, false, true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -99,7 +99,7 @@ class UrzaLordHighArtificerEffect extends OneShotEffect {
|
|||
controller.shuffleLibrary(source, game);
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
return PlayFromNotOwnHandZoneTargetEffect.exileAndPlayFromExile(game, source, card,
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false);
|
||||
TargetController.YOU, Duration.EndOfTurn, true, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -129,6 +129,7 @@ public final class ForgottenRealmsCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("High Market", 246, Rarity.RARE, mage.cards.h.HighMarket.class));
|
||||
cards.add(new SetCardInfo("Hoard-Smelter Dragon", 128, Rarity.RARE, mage.cards.h.HoardSmelterDragon.class));
|
||||
cards.add(new SetCardInfo("Hostage Taker", 186, Rarity.RARE, mage.cards.h.HostageTaker.class));
|
||||
cards.add(new SetCardInfo("Hurl Through Hell", 48, Rarity.RARE, mage.cards.h.HurlThroughHell.class));
|
||||
cards.add(new SetCardInfo("Ignite the Future", 129, Rarity.RARE, mage.cards.i.IgniteTheFuture.class));
|
||||
cards.add(new SetCardInfo("Imprisoned in the Moon", 85, Rarity.RARE, mage.cards.i.ImprisonedInTheMoon.class));
|
||||
cards.add(new SetCardInfo("Indomitable Might", 40, Rarity.RARE, mage.cards.i.IndomitableMight.class));
|
||||
|
|
|
@ -9,6 +9,7 @@ import mage.cards.Card;
|
|||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
@ -140,13 +141,13 @@ public class PlayFromNotOwnHandZoneTargetEffect extends AsThoughEffectImpl {
|
|||
}
|
||||
|
||||
public static boolean exileAndPlayFromExile(Game game, Ability source, Card card, TargetController allowedCaster,
|
||||
Duration duration, boolean withoutMana, boolean onlyCastAllowed) {
|
||||
Duration duration, boolean withoutMana, boolean anyColor, boolean onlyCastAllowed) {
|
||||
if (card == null) {
|
||||
return true;
|
||||
}
|
||||
Set<Card> cards = new HashSet<>();
|
||||
cards.add(card);
|
||||
return exileAndPlayFromExile(game, source, cards, allowedCaster, duration, withoutMana, onlyCastAllowed);
|
||||
return exileAndPlayFromExile(game, source, cards, allowedCaster, duration, withoutMana, anyColor, onlyCastAllowed);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -158,11 +159,12 @@ public class PlayFromNotOwnHandZoneTargetEffect extends AsThoughEffectImpl {
|
|||
* @param allowedCaster
|
||||
* @param duration
|
||||
* @param withoutMana
|
||||
* @param anyColor
|
||||
* @param onlyCastAllowed true for rule "cast that card" and false for rule "play that card"
|
||||
* @return
|
||||
*/
|
||||
public static boolean exileAndPlayFromExile(Game game, Ability source, Set<Card> cards, TargetController allowedCaster,
|
||||
Duration duration, boolean withoutMana, boolean onlyCastAllowed) {
|
||||
Duration duration, boolean withoutMana, boolean anyColor, boolean onlyCastAllowed) {
|
||||
if (cards == null || cards.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -196,6 +198,11 @@ public class PlayFromNotOwnHandZoneTargetEffect extends AsThoughEffectImpl {
|
|||
ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, allowedCaster, duration, withoutMana, onlyCastAllowed);
|
||||
effect.setTargetPointer(new FixedTargets(cardsToPlay, game));
|
||||
game.addEffect(effect, source);
|
||||
if (anyColor) {
|
||||
for (Card card : cardsToPlay) {
|
||||
game.addEffect(new YouMaySpendManaAsAnyColorToCastTargetEffect(duration).setTargetPointer(new FixedTarget(card, game)), source);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue