mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
[LTC] Implement Travel Through Caradhras
This commit is contained in:
parent
0258e3977b
commit
b95b7a8738
2 changed files with 97 additions and 0 deletions
96
Mage.Sets/src/mage/cards/t/TravelThroughCaradhras.java
Normal file
96
Mage.Sets/src/mage/cards/t/TravelThroughCaradhras.java
Normal file
|
@ -0,0 +1,96 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ExileSpellEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.choices.TwoChoiceVote;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class TravelThroughCaradhras extends CardImpl {
|
||||
|
||||
public TravelThroughCaradhras(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}{G}");
|
||||
|
||||
// Council's dilemma -- Starting with you, each player votes for Redhorn Pass or Mines of Moria. For each Redhorn Pass vote, search your library for a basic land card and put it onto the battlefield tapped. If you search your library this way, shuffle. For each Mines of Moria vote, return a card from your graveyard to your hand.
|
||||
this.getSpellAbility().addEffect(new TravelThroughCaradhrasEffect());
|
||||
this.getSpellAbility().setAbilityWord(AbilityWord.COUNCILS_DILEMMA);
|
||||
|
||||
// Exile Travel Through Caradhras.
|
||||
this.getSpellAbility().addEffect(new ExileSpellEffect().concatBy("<br>"));
|
||||
}
|
||||
|
||||
private TravelThroughCaradhras(final TravelThroughCaradhras card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TravelThroughCaradhras copy() {
|
||||
return new TravelThroughCaradhras(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TravelThroughCaradhrasEffect extends OneShotEffect {
|
||||
|
||||
TravelThroughCaradhrasEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "starting with you, each player votes for Redhorn Pass or Mines of Moria. " +
|
||||
"For each Redhorn Pass vote, search your library for a basic land card and " +
|
||||
"put it onto the battlefield tapped. If you search your library this way, " +
|
||||
"shuffle. For each Mines of Moria vote, return a card from your graveyard to your hand";
|
||||
}
|
||||
|
||||
private TravelThroughCaradhrasEffect(final TravelThroughCaradhrasEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TravelThroughCaradhrasEffect copy() {
|
||||
return new TravelThroughCaradhrasEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
TwoChoiceVote voteHandler = new TwoChoiceVote(
|
||||
"Redhorn Pass (search for land)",
|
||||
"Mines of Moria (return from graveyard)",
|
||||
Outcome.Detriment
|
||||
);
|
||||
voteHandler.doVotes(source, game);
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int redhornPass = voteHandler.getVoteCount(true);
|
||||
int minesOfMoria = voteHandler.getVoteCount(false);
|
||||
if (redhornPass > 0) {
|
||||
new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(
|
||||
redhornPass, StaticFilters.FILTER_CARD_BASIC_LAND
|
||||
), true).apply(game, source);
|
||||
}
|
||||
if (minesOfMoria > 0) {
|
||||
TargetCard target = new TargetCardInYourGraveyard(Math.min(minesOfMoria, player.getGraveyard().size()));
|
||||
target.setNotTarget(true);
|
||||
player.choose(outcome, player.getGraveyard(), target, source, game);
|
||||
player.moveCards(new CardsImpl(target.getTargets()), Zone.HAND, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -234,6 +234,7 @@ public final class TalesOfMiddleEarthCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Trading Post", 288, Rarity.RARE, mage.cards.t.TradingPost.class));
|
||||
cards.add(new SetCardInfo("Tranquil Cove", 340, Rarity.COMMON, mage.cards.t.TranquilCove.class));
|
||||
cards.add(new SetCardInfo("Tranquil Thicket", 341, Rarity.UNCOMMON, mage.cards.t.TranquilThicket.class));
|
||||
cards.add(new SetCardInfo("Travel Through Caradhras", 44, Rarity.RARE, mage.cards.t.TravelThroughCaradhras.class));
|
||||
cards.add(new SetCardInfo("Treasure Nabber", 230, Rarity.RARE, mage.cards.t.TreasureNabber.class));
|
||||
cards.add(new SetCardInfo("Unbreakable Formation", 179, Rarity.RARE, mage.cards.u.UnbreakableFormation.class));
|
||||
cards.add(new SetCardInfo("Underground River", 342, Rarity.RARE, mage.cards.u.UndergroundRiver.class));
|
||||
|
|
Loading…
Reference in a new issue