* Delve - Fixed that if automatically mana payment is deactivated cards could be delved without using it for mana payment of the delve spell. While automatically mana payment is deactivated only one card at a time can be used for delve now fixes #929.

This commit is contained in:
LevelX2 2015-04-26 22:16:09 +02:00
parent 0adeb0770f
commit a496e614d3
4 changed files with 8 additions and 14 deletions

View file

@ -106,17 +106,6 @@ public class TriggeredAbilities extends ConcurrentHashMap<String, TriggeredAbili
}
}
// private MageObject getMageObject(GameEvent event, Game game, TriggeredAbility ability) {
// MageObject object = game.getPermanent(ability.getSourceId());
// if (object == null) {
// object = game.getLastKnownInformation(ability.getSourceId(), event.getZone());
// if (object == null) {
// object = game.getObject(ability.getSourceId());
// }
// }
// return object;
// }
/**
* Adds a by sourceId gained triggered ability
*

View file

@ -218,6 +218,7 @@ public abstract class ManaCostImpl extends CostImpl implements ManaCost {
}
Player player = game.getPlayer(controllerId);
assignPayment(game, ability, player.getManaPool());
game.getState().getSpecialActions().removeManaActions();
while (!isPaid()) {
ManaCost unpaid = this.getUnpaid();
String promptText = ManaUtil.addSpecialManaPayAbilities(ability, game, unpaid);

View file

@ -119,7 +119,8 @@ public class ManaCostsImpl<T extends ManaCost> extends ArrayList<T> implements M
}
Player player = game.getPlayer(controllerId);
assignPayment(game, ability, player.getManaPool());
assignPayment(game, ability, player.getManaPool());
game.getState().getSpecialActions().removeManaActions();
while (!isPaid()) {
ManaCost unpaid = this.getUnpaid();
String promptText = ManaUtil.addSpecialManaPayAbilities(ability, game, unpaid);

View file

@ -27,7 +27,6 @@
*/
package mage.abilities.keyword;
import java.util.ArrayList;
import java.util.List;
import mage.Mana;
import mage.abilities.Ability;
@ -106,8 +105,12 @@ import mage.util.CardUtil;
SpecialAction specialAction = new DelveSpecialAction();
specialAction.setControllerId(source.getControllerId());
specialAction.setSourceId(source.getSourceId());
int unpaidAmount = unpaid.getMana().getColorless();
if (!controller.getManaPool().isAutoPayment() && unpaidAmount > 1) {
unpaidAmount = 1;
}
specialAction.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(
0, Math.min(controller.getGraveyard().size(), unpaid.getMana().getColorless()), new FilterCard())));
0, Math.min(controller.getGraveyard().size(), unpaidAmount), new FilterCard())));
if (specialAction.canActivate(source.getControllerId(), game)) {
game.getState().getSpecialActions().add(specialAction);
}