From f181166e7476636b63f9bd0a923c739e797aa478 Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Fri, 24 Feb 2023 19:19:08 +0300 Subject: [PATCH 1/2] - Improve PumpAi for cards like Pearlspear Courier. --- forge-ai/src/main/java/forge/ai/ability/PumpAi.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java index 61ebcd32291..4c976ed46ef 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java @@ -438,6 +438,10 @@ public class PumpAi extends PumpAiBase { list = CardLists.getTargetableCards(list, sa); CardLists.sortByPowerDesc(list); + if (source.hasKeyword("You may choose not to untap CARDNAME during your untap step.") && sa.getPayCosts().hasTapCost()) { + list.remove(source); // don't tap a card that will be tapped as a part of the cost and won't untap normally. + } + // Try not to kill own creatures with this pump CardCollection canDieToPump = new CardCollection(); for (Card c : list) { From 0a15ed42601a6ace0467bdc989ed5e57d07d6a2a Mon Sep 17 00:00:00 2001 From: Michael Kamensky Date: Fri, 24 Feb 2023 19:21:18 +0300 Subject: [PATCH 2/2] - Make the check sturdier. --- forge-ai/src/main/java/forge/ai/ability/PumpAi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java index 4c976ed46ef..6d733072875 100644 --- a/forge-ai/src/main/java/forge/ai/ability/PumpAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/PumpAi.java @@ -438,7 +438,7 @@ public class PumpAi extends PumpAiBase { list = CardLists.getTargetableCards(list, sa); CardLists.sortByPowerDesc(list); - if (source.hasKeyword("You may choose not to untap CARDNAME during your untap step.") && sa.getPayCosts().hasTapCost()) { + if (list.contains(source) && source.hasKeyword("You may choose not to untap CARDNAME during your untap step.") && sa.getPayCosts().hasTapCost()) { list.remove(source); // don't tap a card that will be tapped as a part of the cost and won't untap normally. }