* 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());
if (player != null) {
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)) {
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}");
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.
this.getSpellAbility().addEffect(new VictimizeEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(2, new FilterCreatureCard("creature cards in your graveyard")));
@ -88,14 +87,14 @@ class VictimizeEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
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)) {
Card card = game.getCard(targetId);
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
public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (targetCreature != null) {
Player player = game.getPlayer(targetCreature.getControllerId());
if (player != null) {
cost.clearPaid();
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)) {
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature != null) {
Player player = game.getPlayer(targetCreature.getControllerId());
if (player != null) {
cost.clearPaid();
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;
}

View file

@ -105,7 +105,7 @@ class ExaltedDragonReplacementEffect extends ReplacementEffectImpl {
if ( attackCost.canPay(source, source.getSourceId(), event.getPlayerId(), 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;
}
}

View file

@ -148,7 +148,7 @@ class PlungeIntoDarknessSearchEffect extends OneShotEffect {
if (player != null) {
VariableCost cost = new PayVariableLifeCost();
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);
int count = Math.min(player.getLibrary().size(), xValue);

View file

@ -98,19 +98,23 @@ class CrystalShardEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (targetCreature != null) {
Player player = game.getPlayer(targetCreature.getControllerId());
if (player != null) {
cost.clearPaid();
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)) {
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), false);
}
if (!cost.isPaid()) {
return targetCreature.moveToZone(Zone.HAND, source.getSourceId(), game, true);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
if (targetCreature != null) {
Player player = game.getPlayer(targetCreature.getControllerId());
if (player != null) {
cost.clearPaid();
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)) {
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), false);
}
if (!cost.isPaid()) {
controller.moveCards(targetCreature, Zone.BATTLEFIELD, Zone.HAND, source, game);
}
}
}
return true;
}
return false;
}

View file

@ -92,7 +92,7 @@ class TyrannizeEffect extends OneShotEffect {
Cost cost = new PayLifeCost(7);
if (!cost.canPay(source, source.getSourceId(), player.getId(), 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)) {
player.discard(card, source, game);
}