This commit is contained in:
tool4EvEr
2021-07-04 20:07:44 +02:00
parent af04a994bb
commit db3accfa50
3 changed files with 18 additions and 25 deletions

View File

@@ -2569,7 +2569,6 @@ public class AbilityUtils {
// Count$ThisTurnCast <Valid>
// Count$LastTurnCast <Valid>
if (sq[0].startsWith("ThisTurnCast") || sq[0].startsWith("LastTurnCast")) {
final String[] workingCopy = l[0].split("_");
final String validFilter = workingCopy[1];

View File

@@ -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<StaticAbility> 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<Card, ManaCostShard> 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
}

View File

@@ -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.")