Fix Autopay test selecting same mana multiple times

This commit is contained in:
tool4EvEr
2023-04-13 23:41:18 +02:00
parent 3e736104a1
commit 6a27f7ea70
2 changed files with 22 additions and 0 deletions

View File

@@ -61,6 +61,24 @@ public class Mana {
return false; return false;
} }
if (!sourceCard.equals(m2.sourceCard)) {
if (addsKeywords(null) != m2.addsKeywords(null)) {
return false;
}
if (addsCounters(null) != m2.addsCounters(null)) {
return false;
}
if (mp.isCannotCounterPaidWith() != mp2.isCannotCounterPaidWith()) {
return false;
}
if (mp.getTriggersWhenSpent() != mp2.getTriggersWhenSpent()) {
return false;
}
if (mp.isPersistentMana() != mp2.isPersistentMana()) {
return false;
}
}
return mp == mp2 || (mp.getManaRestrictions().equals(mp2.getManaRestrictions()) && mp.getExtraManaRestriction().equals(mp2.getExtraManaRestriction())); return mp == mp2 || (mp.getManaRestrictions().equals(mp2.getManaRestrictions()) && mp.getExtraManaRestriction().equals(mp2.getExtraManaRestriction()));
} }

View File

@@ -226,6 +226,10 @@ public class AbilityManaPart implements java.io.Serializable {
return source.isValid(cannotCounterSpell, sourceCard.getController(), sourceCard, null); return source.isValid(cannotCounterSpell, sourceCard.getController(), sourceCard, null);
} }
public boolean isCannotCounterPaidWith() {
return null != cannotCounterSpell;
}
public void addNoCounterEffect(SpellAbility saBeingPaid) { public void addNoCounterEffect(SpellAbility saBeingPaid) {
final Game game = sourceCard.getGame(); final Game game = sourceCard.getGame();
final Card eff = new Card(game.nextCardId(), game); final Card eff = new Card(game.nextCardId(), game);