- Fixed Replicate.

This commit is contained in:
Sloth
2013-06-16 18:00:14 +00:00
parent f089ef0c60
commit 15b3599a05
4 changed files with 12 additions and 10 deletions

View File

@@ -1111,7 +1111,7 @@ public class AbilityUtils {
}
} else {
// if it's paid by the AI already the human can pay, but it won't change anything
paid |= HumanPlay.payCostDuringAbilityResolve(payer, source, cost, sa);
paid |= HumanPlay.payCostDuringAbilityResolve(payer, source, cost, sa, null);
}
}

View File

@@ -283,7 +283,8 @@ public class HumanPlay {
* a {@link forge.Command} object.
* @param sourceAbility TODO
*/
public static boolean payCostDuringAbilityResolve(final Player p, final Card source, final Cost cost, SpellAbility sourceAbility) {
public static boolean payCostDuringAbilityResolve(final Player p, final Card source, final Cost cost, SpellAbility sourceAbility
, String prompt) {
// Only human player pays this way
Card current = null; // Used in spells with RepeatEach effect to distinguish cards, Cut the Tethers
@@ -296,8 +297,6 @@ public class HumanPlay {
current = source.getImprinted().get(0);
}
String promptCurrent = current == null ? "" : "Current Card: " + current + "\r\n";
final List<CostPart> parts = cost.getCostParts();
ArrayList<CostPart> remainingParts = new ArrayList<CostPart>(cost.getCostParts());
CostPart costPart = null;
@@ -451,8 +450,8 @@ public class HumanPlay {
}
}
if (typeChoices.size() > 1) {
String prompt = "Select type counters to remove";
counterType = GuiChoose.one(prompt, typeChoices);
String cprompt = "Select type counters to remove";
counterType = GuiChoose.one(cprompt, typeChoices);
} else {
counterType = typeChoices.get(0);
}
@@ -603,7 +602,10 @@ public class HumanPlay {
if (!(costPart instanceof CostPartMana ))
throw new RuntimeException("GameActionUtil.payCostDuringAbilityResolve - The remaining payment type is not Mana.");
String prompt = source + "\r\n" + promptCurrent;
if (prompt == null) {
String promptCurrent = current == null ? "" : "Current Card: " + current + "\r\n";
prompt = source + "\r\n" + promptCurrent;
}
InputPayMana toSet = new InputPayManaExecuteCommands(p, prompt, cost.getCostMana().getManaToPay());
Singletons.getControl().getInputQueue().setInputAndWait(toSet);
return toSet.isPaid();

View File

@@ -585,8 +585,8 @@ public class PlayerControllerHuman extends PlayerController {
* @see forge.game.player.PlayerController#payManaOptional(forge.Card, forge.card.cost.Cost)
*/
@Override
public boolean payManaOptional(Card c, Cost attackCost, String prompt, ManaPaymentPurpose purpose) {
return HumanPlay.payCostDuringAbilityResolve(player, c, attackCost, null);
public boolean payManaOptional(Card c, Cost cost, String prompt, ManaPaymentPurpose purpose) {
return HumanPlay.payCostDuringAbilityResolve(player, c, cost, null, prompt);
}

View File

@@ -353,7 +353,7 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
hasPaid = activating.getController().payManaOptional(sp.getSourceCard(), costMultikicker, prompt, ManaPaymentPurpose.Replicate);
if( hasPaid )
sp.getSourceCard().addReplicateMagnitude(1);
} while( !hasPaid );
} while( hasPaid );
}
for (int i = 0; i < sp.getSourceCard().getReplicateMagnitude(); i++) {