mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
- T, V, U cards: A player now moves the card/permanent to a zone.
This commit is contained in:
parent
ae3ff96e11
commit
47dc1d8d61
4 changed files with 36 additions and 30 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
@ -17,13 +16,13 @@ import mage.players.Player;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author cbt33, Ad Nauseum (North), Izzet Staticaster (LevelX2), Bane Alley Broker (LevelX2)
|
||||
* @author cbt33, Ad Nauseum (North), Izzet Staticaster (LevelX2), Bane Alley
|
||||
* Broker (LevelX2)
|
||||
*/
|
||||
public final class TaintedPact extends CardImpl {
|
||||
|
||||
public TaintedPact(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{B}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}");
|
||||
|
||||
// Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first.
|
||||
this.getSpellAbility().addEffect(new TaintedPactEffect());
|
||||
|
@ -39,9 +38,9 @@ public final class TaintedPact extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class TaintedPactEffect extends OneShotEffect{
|
||||
|
||||
public TaintedPactEffect() {
|
||||
class TaintedPactEffect extends OneShotEffect {
|
||||
|
||||
public TaintedPactEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
this.staticText = "Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first";
|
||||
}
|
||||
|
@ -54,28 +53,29 @@ class TaintedPactEffect extends OneShotEffect{
|
|||
public TaintedPactEffect copy() {
|
||||
return new TaintedPactEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || sourceCard == null) {
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card sourceCard = game.getCard(source.getSourceId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null
|
||||
|| sourceCard == null) {
|
||||
return false;
|
||||
}
|
||||
Set<String> names = new HashSet<>();
|
||||
while (player.canRespond() && player.getLibrary().hasCards()) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
while (controller.canRespond()
|
||||
&& controller.getLibrary().hasCards()) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
|
||||
card.moveToExile(null, null, source, game);
|
||||
controller.moveCards(card, Zone.EXILED, source, game);
|
||||
// Checks if there was already exiled a card with the same name
|
||||
if (names.contains(card.getName())) {
|
||||
break;
|
||||
}
|
||||
names.add(card.getName());
|
||||
if (player.chooseUse(outcome, "Put " + card.getName() + " into your hand?", source, game)) {
|
||||
//Adds the current card to hand if it is chosen.
|
||||
card.moveToZone(Zone.HAND, source, game, true);
|
||||
if (controller.chooseUse(outcome, "Put " + card.getName() + " into your hand?", source, game)) {
|
||||
//Adds the current card to hand if it is chosen.
|
||||
controller.moveCards(card, Zone.HAND, source, game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.u;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -24,7 +23,7 @@ import mage.target.common.TargetControlledPermanent;
|
|||
public final class Umbilicus extends CardImpl {
|
||||
|
||||
public Umbilicus(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
|
||||
|
||||
// At the beginning of each player's upkeep, that player returns a permanent they control to its owner's hand unless they pay 2 life.
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new BloodClockEffect(), TargetController.ANY, false, true);
|
||||
|
@ -63,7 +62,8 @@ class BloodClockEffect extends OneShotEffect {
|
|||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
if (player.getLife() > 2 && player.chooseUse(Outcome.Neutral, "Pay 2 life? If you don't, return a permanent you control to its owner's hand.", source, game)) {
|
||||
if (player.getLife() > 2
|
||||
&& player.chooseUse(Outcome.Neutral, "Pay 2 life? If you don't, return a permanent you control to its owner's hand.", source, game)) {
|
||||
player.loseLife(2, game, source, false);
|
||||
game.informPlayers(player.getLogName() + " pays 2 life. They will not return a permanent they control.");
|
||||
return true;
|
||||
|
@ -73,10 +73,10 @@ class BloodClockEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
game.informPlayers(player.getLogName() + " returns " + permanent.getName() + " to hand.");
|
||||
return permanent.moveToZone(Zone.HAND, source, game, false);
|
||||
return player.moveCards(permanent, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import mage.target.TargetCard;
|
|||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
@ -84,6 +85,8 @@ class UneshCriosphinxSovereignEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Set<Card> cardsToGraveyard = new LinkedHashSet<>();
|
||||
Set<Card> cardsToHand = new LinkedHashSet<>();
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (controller == null || sourceObject == null) {
|
||||
return false;
|
||||
|
@ -134,8 +137,9 @@ class UneshCriosphinxSovereignEffect extends OneShotEffect {
|
|||
if (i < pile1.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
card.moveToZone(pile1Zone, source, game, false);
|
||||
cardsToGraveyard.add(card);
|
||||
}
|
||||
controller.moveCards(cardsToGraveyard, pile1Zone, source, game);
|
||||
game.informPlayers(sb.toString());
|
||||
|
||||
sb = new StringBuilder("Pile 2, going to ").append(pile2Zone == Zone.HAND ? "Hand" : "Graveyard").append(':');
|
||||
|
@ -146,8 +150,9 @@ class UneshCriosphinxSovereignEffect extends OneShotEffect {
|
|||
if (i < pile2.size()) {
|
||||
sb.append(", ");
|
||||
}
|
||||
card.moveToZone(pile2Zone, source, game, false);
|
||||
cardsToHand.add(card);
|
||||
}
|
||||
controller.moveCards(cardsToHand, pile2Zone, source, game);
|
||||
game.informPlayers(sb.toString());
|
||||
}
|
||||
|
||||
|
|
|
@ -76,16 +76,17 @@ class VaporSnareEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean targetChosen = false;
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
TargetPermanent target = new TargetPermanent(1, 1, filter, false);
|
||||
|
||||
if (player != null && target.canChoose(source.getSourceId(), player.getId(), game)) {
|
||||
player.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
if (controller != null
|
||||
&& target.canChoose(source.getSourceId(), controller.getId(), game)) {
|
||||
controller.choose(Outcome.Sacrifice, target, source.getSourceId(), game);
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
|
||||
if ( permanent != null ) {
|
||||
targetChosen = true;
|
||||
permanent.moveToZone(Zone.HAND, source, game, false);
|
||||
controller.moveCards(permanent, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue