Fix Scavenge for CDA

This commit is contained in:
tool4EvEr
2021-07-11 09:45:14 +02:00
parent c491f6dfb6
commit 4b785fd75b
9 changed files with 12 additions and 15 deletions

View File

@@ -1482,7 +1482,7 @@ public class ComputerUtilMana {
String restriction = null;
if (payCosts != null && payCosts.getCostMana() != null) {
restriction = payCosts.getCostMana().getRestiction();
restriction = payCosts.getCostMana().getRestriction();
}
ManaCostBeingPaid cost = new ManaCostBeingPaid(mana, restriction);

View File

@@ -374,7 +374,7 @@ public class UntapAi extends SpellAbilityAi {
if (!ComputerUtilMana.hasEnoughManaSourcesToCast(ab, ai)) {
// TODO: Currently limited to predicting something that can be paid with any color,
// can ideally be improved to work by color.
ManaCostBeingPaid reduced = new ManaCostBeingPaid(ab.getPayCosts().getCostMana().getManaCostFor(ab), ab.getPayCosts().getCostMana().getRestiction());
ManaCostBeingPaid reduced = new ManaCostBeingPaid(ab.getPayCosts().getCostMana().getManaCostFor(ab), ab.getPayCosts().getCostMana().getRestriction());
reduced.decreaseShard(ManaCostShard.GENERIC, untappingCards.size());
if (ComputerUtilMana.canPayManaCost(reduced, ab, ai)) {
CardCollection manaLandsTapped = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield),

View File

@@ -220,5 +220,3 @@ public class CopyPermanentEffect extends TokenEffectBase {
return copy;
}
}

View File

@@ -322,7 +322,7 @@ public class PlayEffect extends SpellAbilityEffect {
if (controlledByPlayer != null) {
tgtSA.setControlledByPlayer(controlledByTimeStamp, controlledByPlayer);
activator.pushPaidForSA(tgtSA);
tgtSA.setManaCostBeingPaid(new ManaCostBeingPaid(tgtSA.getPayCosts().getCostMana().getManaCostFor(tgtSA), tgtSA.getPayCosts().getCostMana().getRestiction()));
tgtSA.setManaCostBeingPaid(new ManaCostBeingPaid(tgtSA.getPayCosts().getCostMana().getManaCostFor(tgtSA), tgtSA.getPayCosts().getCostMana().getRestriction()));
}
if (controller.getController().playSaFromPlayEffect(tgtSA)) {

View File

@@ -3000,7 +3000,7 @@ public class CardFactoryUtil {
"| SpellDescription$ (" + inst.getReminderText() + ")";
final SpellAbility sa = AbilityFactory.getAbility(effect, card);
sa.setSVar("ScavengeX", "Count$CardPower");
sa.setSVar("ScavengeX", "Exiled$CardPower");
sa.setIntrinsic(intrinsic);
inst.addSpellAbility(sa);

View File

@@ -864,8 +864,8 @@ public class Cost implements Serializable {
CostPartMana mPart = (CostPartMana) part;
ManaCostBeingPaid oldManaCost = new ManaCostBeingPaid(mPart.getMana());
oldManaCost.addManaCost(costPart2.getMana());
String r2 = costPart2.getRestiction();
String r1 = mPart.getRestiction();
String r2 = costPart2.getRestriction();
String r1 = mPart.getRestriction();
String r = r1 == null ? r2 : ( r2 == null ? r1 : r1 + "." + r2);
costParts.remove(costPart2);
boolean XCantBe0 = !mPart.canXbe0() || !costPart2.canXbe0();

View File

@@ -59,7 +59,6 @@ public class CostExile extends CostPartWithList {
this.sameZone = sameZone;
}
@Override
public Integer getMaxAmountX(SpellAbility ability, Player payer) {
final Card source = ability.getHostCard();

View File

@@ -124,7 +124,7 @@ public class CostPartMana extends CostPart {
return true;
}
public String getRestiction() {
public String getRestriction() {
return restriction;
}
@@ -136,11 +136,11 @@ public class CostPartMana extends CostPart {
if (isExiledCreatureCost() && sa.getPaidList(CostExile.HashLKIListKey)!= null && !sa.getPaidList(CostExile.HashLKIListKey).isEmpty()) {
// back from the brink
return sa.getPaidList(CostExile.HashLKIListKey).get(0).getManaCost();
} if (isEnchantedCreatureCost() && sa.getHostCard().getEnchantingCard() != null) {
return sa.getHostCard().getEnchantingCard().getManaCost();
} else {
return getManaToPay();
}
if (isEnchantedCreatureCost() && sa.getHostCard().getEnchantingCard() != null) {
return sa.getHostCard().getEnchantingCard().getManaCost();
}
return getManaToPay();
}
@Override

View File

@@ -702,7 +702,7 @@ public class HumanPlay {
public static boolean payManaCost(final PlayerControllerHuman controller, final ManaCost realCost, final CostPartMana mc, final SpellAbility ability, final Player activator, String prompt, ManaConversionMatrix matrix, boolean isActivatedSa) {
final Card source = ability.getHostCard();
ManaCostBeingPaid toPay = new ManaCostBeingPaid(realCost, mc.getRestiction());
ManaCostBeingPaid toPay = new ManaCostBeingPaid(realCost, mc.getRestriction());
String xInCard = source.getSVar("X");
String xColor = ability.getParam("XColor");