diff --git a/res/cardsfolder/r/reap_intellect.txt b/res/cardsfolder/r/reap_intellect.txt index 72f47bdd404..499db9753c9 100644 --- a/res/cardsfolder/r/reap_intellect.txt +++ b/res/cardsfolder/r/reap_intellect.txt @@ -5,7 +5,6 @@ A:SP$ ChangeZone | Cost$ X 2 U B | Origin$ Hand | Destination$ Exile | ValidTgts SVar:DBExile:DB$ ChangeZoneAll | Origin$ Hand,Library,Graveyard | Destination$ Exile | Defined$ Targeted | Search$ True | ChangeType$ Card.sharesNameWith Remembered | Shuffle$ True | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:X:Count$xPaid -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/reap_intellect.jpg Oracle:Target opponent reveals his or her hand. You choose up to X nonland cards from it and exile them. For each card exiled this way, search that player's graveyard, hand, and library for any number of cards with the same name as that card and exile them. Then that player shuffles his or her library. SetInfo:DGM Mythic \ No newline at end of file diff --git a/src/main/java/forge/card/ability/ai/ChangeZoneAi.java b/src/main/java/forge/card/ability/ai/ChangeZoneAi.java index 96bcd99be4a..37a8a668d70 100644 --- a/src/main/java/forge/card/ability/ai/ChangeZoneAi.java +++ b/src/main/java/forge/card/ability/ai/ChangeZoneAi.java @@ -260,7 +260,7 @@ public class ChangeZoneAi extends SpellAbilityAi { for (final Player p : pDefined) { List list = p.getCardsIn(origin); - if ((type != null) && p == ai) { + if (type != null && p == ai) { // AI only "knows" about his information list = CardLists.getValidCards(list, type, source.getController(), source); list = CardLists.filter(list, new Predicate() { @@ -276,6 +276,16 @@ public class ChangeZoneAi extends SpellAbilityAi { }); } + String num = sa.getParam("ChangeNum"); + if (num != null) { + if (num.contains("X") && source.getSVar("X").equals("Count$xPaid")) { + // Set PayX here to maximum value. + int xPay = ComputerUtilMana.determineLeftoverMana(sa, ai); + xPay = Math.min(xPay, list.size()); + source.setSVar("PayX", Integer.toString(xPay)); + } + } + if (list.isEmpty()) { return false; } @@ -356,7 +366,7 @@ public class ChangeZoneAi extends SpellAbilityAi { // this works for hidden because the mana is paid first. final String type = sa.getParam("ChangeType"); - if ((type != null) && type.contains("X") && source.getSVar("X").equals("Count$xPaid")) { + if (type != null && type.contains("X") && source.getSVar("X").equals("Count$xPaid")) { // Set PayX here to maximum value. final int xPay = ComputerUtilMana.determineLeftoverMana(sa, ai); source.setSVar("PayX", Integer.toString(xPay));