diff --git a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java index b0b6aaf65ae..eb371f8031f 100644 --- a/forge-game/src/main/java/forge/game/ability/AbilityUtils.java +++ b/forge-game/src/main/java/forge/game/ability/AbilityUtils.java @@ -2569,7 +2569,6 @@ public class AbilityUtils { // Count$ThisTurnCast // Count$LastTurnCast if (sq[0].startsWith("ThisTurnCast") || sq[0].startsWith("LastTurnCast")) { - final String[] workingCopy = l[0].split("_"); final String validFilter = workingCopy[1]; diff --git a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java index 41029d79e66..d83cb74157a 100644 --- a/forge-game/src/main/java/forge/game/cost/CostAdjustment.java +++ b/forge-game/src/main/java/forge/game/cost/CostAdjustment.java @@ -45,7 +45,7 @@ public class CostAdjustment { } Cost result = cost.copy(); - + boolean isStateChangeToFaceDown = false; if (sa.isSpell() && sa.isCastFaceDown()) { // Turn face down to apply cost modifiers correctly @@ -60,7 +60,7 @@ public class CostAdjustment { result.add(new Cost(ManaCost.get(n), false)); } } - + CardCollection cardsOnBattlefield = new CardCollection(game.getCardsIn(ZoneType.Battlefield)); cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Stack)); cardsOnBattlefield.addAll(game.getCardsIn(ZoneType.Command)); @@ -68,7 +68,7 @@ public class CostAdjustment { cardsOnBattlefield.add(host); } final List raiseAbilities = Lists.newArrayList(); - + // Sort abilities to apply them in proper order for (Card c : cardsOnBattlefield) { for (final StaticAbility stAb : c.getStaticAbilities()) { @@ -94,11 +94,10 @@ public class CostAdjustment { } return result; } - + private static void applyRaise(final Cost cost, final SpellAbility sa, final StaticAbility st) { final Card hostCard = st.getHostCard(); - final Card card = sa.getHostCard(); - + if (!checkRequirement(sa, st)) { return; } @@ -138,7 +137,7 @@ public class CostAdjustment { count = Integer.parseInt(amount); } else { if (st.hasParam("AffectedAmount")) { - count = AbilityUtils.calculateAmount(card, st.hasSVar(amount) ? st.getSVar(amount) : amount, sa); + count = AbilityUtils.calculateAmount(hostCard, st.hasSVar(amount) ? st.getSVar(amount) : amount, sa); } else { count = AbilityUtils.calculateAmount(hostCard, amount, st); } @@ -152,13 +151,13 @@ public class CostAdjustment { cost.add(part); } } - + // If cardsToDelveOut is null, will immediately exile the delved cards and remember them on the host card. // Otherwise, will return them in cardsToDelveOut and the caller is responsible for doing the above. public static final void adjust(ManaCostBeingPaid cost, final SpellAbility sa, CardCollection cardsToDelveOut, boolean test) { final Game game = sa.getActivatingPlayer().getGame(); final Card originalCard = sa.getHostCard(); - + if (sa.isTrigger()) { return; } @@ -204,7 +203,7 @@ public class CostAdjustment { } // need to reduce generic extra because of 2 hybrid mana cost.decreaseGenericMana(sumGeneric); - + if (sa.isSpell() && sa.isOffering()) { // cost reduction from offerings adjustCostByOffering(cost, sa); } @@ -263,7 +262,7 @@ public class CostAdjustment { } Map convokedCards = sa.getActivatingPlayer().getController().chooseCardsForConvokeOrImprovise(sa, cost.toManaCost(), untappedCards, improvise); - + // Convoked creats are tapped here, setting up their taps triggers, // Then again when payment is done(In InputPayManaCost.done()) with suppression of Taps triggers. // This is to make sure that triggers go off at the right time @@ -296,15 +295,13 @@ public class CostAdjustment { final CardCollectionView toSacList = sa.getHostCard().getController().getController().choosePermanentsToSacrifice(sa, 0, 1, canOffer, offeringType); - if (!toSacList.isEmpty()) { - toSac = toSacList.getFirst(); - } - else { + if (toSacList.isEmpty()) { return; } - + toSac = toSacList.getFirst(); + cost.subtractManaCost(toSac.getManaCost()); - + sa.setSacrificedAsOffering(toSac); toSac.setUsedToPay(true); //stop it from interfering with mana input } @@ -315,15 +312,13 @@ public class CostAdjustment { final CardCollectionView toSacList = sa.getHostCard().getController().getController().choosePermanentsToSacrifice(sa, 0, 1, canEmerge, "Creature"); - if (!toSacList.isEmpty()) { - toSac = toSacList.getFirst(); - } - else { + if (toSacList.isEmpty()) { return; } - + toSac = toSacList.getFirst(); + cost.decreaseGenericMana(toSac.getCMC()); - + sa.setSacrificedAsEmerge(toSac); toSac.setUsedToPay(true); //stop it from interfering with mana input } diff --git a/forge-game/src/main/java/forge/game/phase/Untap.java b/forge-game/src/main/java/forge/game/phase/Untap.java index 1fec36dc06b..c6894964c1f 100644 --- a/forge-game/src/main/java/forge/game/phase/Untap.java +++ b/forge-game/src/main/java/forge/game/phase/Untap.java @@ -87,7 +87,6 @@ public class Untap extends Phase { * @return a boolean. */ public static boolean canUntap(final Card c) { - if (c.hasKeyword("CARDNAME doesn't untap during your untap step.") || c.hasKeyword("This card doesn't untap during your next untap step.") || c.hasKeyword("This card doesn't untap during your next two untap steps.")