From 676e60cfa7aec3c571d3effcb0e8dd716aeb406d Mon Sep 17 00:00:00 2001 From: Hellfish Date: Wed, 21 Sep 2011 07:49:37 +0000 Subject: [PATCH] *Separated targeted cards to pump from untargeted cards to pump. Fixes the example where a black creature with Prot White doesn't get pumped when Wojek Siren targets another black creature. I will attempt to insert this basic structure into the other AFs that Radiance cards can use. --- .../abilityFactory/AbilityFactory_Pump.java | 87 +++++++++++-------- 1 file changed, 50 insertions(+), 37 deletions(-) diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java index 35ffaecb430..6f0d019411b 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Pump.java @@ -696,8 +696,8 @@ public class AbilityFactory_Pump { * @param sa a {@link forge.card.spellability.SpellAbility} object. */ private void pumpResolve(SpellAbility sa) { - Player activator = sa.getActivatingPlayer(); ArrayList tgtCards; + ArrayList untargetedCards = new ArrayList(); Target tgt = AF.getAbTgt(); if (tgt != null) tgtCards = tgt.getTargetCards(); @@ -706,7 +706,7 @@ public class AbilityFactory_Pump { if(params.containsKey("Radiance")) { for(Card c : CardUtil.getRadiance(hostCard, tgtCards.get(0), params.get("ValidTgts").split(","))) { - tgtCards.add(c); + untargetedCards.add(c); } } @@ -722,43 +722,56 @@ public class AbilityFactory_Pump { if (tgt != null && !CardFactoryUtil.canTarget(AF.getHostCard(), tgtC)) continue; - final int a = getNumAttack(sa); - final int d = getNumDefense(sa); - - tgtC.addTempAttackBoost(a); - tgtC.addTempDefenseBoost(d); - - for (int i = 0; i < Keywords.size(); i++) { - if (!Keywords.get(i).equals("none")) - tgtC.addExtrinsicKeyword(Keywords.get(i)); - } - - if (!params.containsKey("Permanent")) { - // If not Permanent, remove Pumped at EOT - final Command untilEOT = new Command() { - private static final long serialVersionUID = -42244224L; - - public void execute() { - if (AllZoneUtil.isCardInPlay(tgtC)) { - tgtC.addTempAttackBoost(-1 * a); - tgtC.addTempDefenseBoost(-1 * d); - - if (Keywords.size() > 0) { - for (int i = 0; i < Keywords.size(); i++) { - if (!Keywords.get(i).equals("none")) - tgtC.removeExtrinsicKeyword(Keywords.get(i)); - } - } - - } - } - }; - if (params.containsKey("UntilEndOfCombat")) AllZone.getEndOfCombat().addUntil(untilEOT); - else if(params.containsKey("UntilYourNextUpkeep")) AllZone.getUpkeep().addUntil(activator, untilEOT); - else AllZone.getEndOfTurn().addUntil(untilEOT); - } + + applyPump(sa,tgtC); + } + + for(int i=0;i 0) { + for (int i = 0; i < Keywords.size(); i++) { + if (!Keywords.get(i).equals("none")) + applyTo.removeExtrinsicKeyword(Keywords.get(i)); + } + } + + } + } + }; + if (params.containsKey("UntilEndOfCombat")) AllZone.getEndOfCombat().addUntil(untilEOT); + else if(params.containsKey("UntilYourNextUpkeep")) AllZone.getUpkeep().addUntil(sa.getActivatingPlayer(), untilEOT); + else AllZone.getEndOfTurn().addUntil(untilEOT); + } + } /////////////////////////////////////