* Erratic Portal - Fixed that the mana costs had not to be paid if the players said he wants to pay.

This commit is contained in:
LevelX2 2015-06-10 13:26:49 +02:00
parent 4a4a949f3f
commit 199ff16c0c
7 changed files with 38 additions and 32 deletions

View file

@ -103,7 +103,7 @@ class VectisDominatorEffect extends OneShotEffect {
Player player = game.getPlayer(targetCreature.getControllerId()); Player player = game.getPlayer(targetCreature.getControllerId());
if (player != null) { if (player != null) {
cost.clearPaid(); cost.clearPaid();
final StringBuilder sb = new StringBuilder("Pay 2 life otherwise ").append(targetCreature.getName()).append(" will be tapped)"); final StringBuilder sb = new StringBuilder("Pay 2 life? (Otherwise ").append(targetCreature.getName()).append(" will be tapped)");
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) { if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true); cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
} }

View file

@ -54,7 +54,6 @@ public class Victimize extends CardImpl {
super(ownerId, 133, "Victimize", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}"); super(ownerId, 133, "Victimize", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}");
this.expansionSetCode = "CNS"; this.expansionSetCode = "CNS";
// Choose two target creature cards in your graveyard. Sacrifice a creature. If you do, return the chosen cards to the battlefield tapped. // Choose two target creature cards in your graveyard. Sacrifice a creature. If you do, return the chosen cards to the battlefield tapped.
this.getSpellAbility().addEffect(new VictimizeEffect()); this.getSpellAbility().addEffect(new VictimizeEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(2, new FilterCreatureCard("creature cards in your graveyard"))); this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(2, new FilterCreatureCard("creature cards in your graveyard")));
@ -88,14 +87,14 @@ class VictimizeEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (player != null) { if (controller != null) {
SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature"))); SacrificeTargetCost cost = new SacrificeTargetCost(new TargetControlledCreaturePermanent(new FilterControlledCreaturePermanent("a creature")));
if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), true)) { if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
for (UUID targetId: getTargetPointer().getTargets(game, source)) { for (UUID targetId: getTargetPointer().getTargets(game, source)) {
Card card = game.getCard(targetId); Card card = game.getCard(targetId);
if (card != null) { if (card != null) {
player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), true); controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), true);
} }
} }
} }

View file

@ -95,19 +95,22 @@ class ErraticPortalEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId());
if (targetCreature != null) { if (controller != null) {
Player player = game.getPlayer(targetCreature.getControllerId()); Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (player != null) { if (targetCreature != null) {
cost.clearPaid(); Player player = game.getPlayer(targetCreature.getControllerId());
final StringBuilder sb = new StringBuilder("Pay {1} otherwise ").append(targetCreature.getName()).append(" will be returned to its owner's hand)"); if (player != null) {
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) { cost.clearPaid();
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true); if (player.chooseUse(Outcome.Benefit, "Pay {1}? (Otherwise " + targetCreature.getLogName() +" will be returned to its owner's hand)", game)) {
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), false);
}
if (!cost.isPaid()) {
controller.moveCards(targetCreature, Zone.BATTLEFIELD, Zone.HAND, source, game);
}
} }
if (!cost.isPaid()) { }
return targetCreature.moveToZone(Zone.HAND, source.getSourceId(), game, true); return true;
}
}
} }
return false; return false;
} }

View file

@ -105,7 +105,7 @@ class ExaltedDragonReplacementEffect extends ReplacementEffectImpl {
if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) && if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
player.chooseUse(Outcome.Neutral, "Sacrifice a land?", game) ) player.chooseUse(Outcome.Neutral, "Sacrifice a land?", game) )
{ {
if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), true) ) { if (attackCost.pay(source, game, source.getSourceId(), event.getPlayerId(), false) ) {
return false; return false;
} }
} }

View file

@ -148,7 +148,7 @@ class PlungeIntoDarknessSearchEffect extends OneShotEffect {
if (player != null) { if (player != null) {
VariableCost cost = new PayVariableLifeCost(); VariableCost cost = new PayVariableLifeCost();
int xValue = cost.announceXValue(source, game); int xValue = cost.announceXValue(source, game);
cost.getFixedCostsFromAnnouncedValue(xValue).pay(source, game, source.getSourceId(), source.getControllerId(), true); cost.getFixedCostsFromAnnouncedValue(xValue).pay(source, game, source.getSourceId(), source.getControllerId(), false);
Cards cards = new CardsImpl(Zone.PICK); Cards cards = new CardsImpl(Zone.PICK);
int count = Math.min(player.getLibrary().size(), xValue); int count = Math.min(player.getLibrary().size(), xValue);

View file

@ -98,19 +98,23 @@ class CrystalShardEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(source.getFirstTarget()); Player controller = game.getPlayer(source.getControllerId());
if (targetCreature != null) { if (controller != null) {
Player player = game.getPlayer(targetCreature.getControllerId()); Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (player != null) { if (targetCreature != null) {
cost.clearPaid(); Player player = game.getPlayer(targetCreature.getControllerId());
final StringBuilder sb = new StringBuilder("Pay {1} otherwise ").append(targetCreature.getName()).append(" will be returned to its owner's hand)"); if (player != null) {
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) { cost.clearPaid();
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), false); final StringBuilder sb = new StringBuilder("Pay {1}? (Otherwise ").append(targetCreature.getName()).append(" will be returned to its owner's hand)");
} if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
if (!cost.isPaid()) { cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), false);
return targetCreature.moveToZone(Zone.HAND, source.getSourceId(), game, true); }
if (!cost.isPaid()) {
controller.moveCards(targetCreature, Zone.BATTLEFIELD, Zone.HAND, source, game);
}
} }
} }
return true;
} }
return false; return false;
} }

View file

@ -92,7 +92,7 @@ class TyrannizeEffect extends OneShotEffect {
Cost cost = new PayLifeCost(7); Cost cost = new PayLifeCost(7);
if (!cost.canPay(source, source.getSourceId(), player.getId(), game) if (!cost.canPay(source, source.getSourceId(), player.getId(), game)
|| !player.chooseUse(Outcome.LoseLife, "Pay 7 life?", game) || !player.chooseUse(Outcome.LoseLife, "Pay 7 life?", game)
|| !cost.pay(source, game, source.getSourceId(), player.getId(), true)) { || !cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
for (Card card : player.getHand().getCards(game)) { for (Card card : player.getHand().getCards(game)) {
player.discard(card, source, game); player.discard(card, source, game);
} }