Merge pull request #206 from tool4ever/ascendant

Fix Ascendant Acolyte
This commit is contained in:
Anthony Calosa
2022-05-03 12:05:31 +08:00
committed by GitHub
45 changed files with 65 additions and 64 deletions

View File

@@ -1851,9 +1851,6 @@ public class AbilityUtils {
}
}
list = CardLists.getValidCards(list, k[1], sa.getActivatingPlayer(), c, sa);
if (k[0].contains("TotalToughness")) {
return doXMath(Aggregates.sum(list, CardPredicates.Accessors.fnGetNetToughness), expr, c, ctb);
}
return doXMath(list.size(), expr, c, ctb);
}
@@ -2416,16 +2413,6 @@ public class AbilityUtils {
return doXMath(cmc, expr, c, ctb);
}
if (sq[0].startsWith("ColorsCtrl")) {
final String restriction = l[0].substring(11);
final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb);
byte n = 0;
for (final Card card : list) {
n |= card.getColor().getColor();
}
return doXMath(ColorSet.fromMask(n).countColors(), expr, c, ctb);
}
// Count$AttackersDeclared
if (sq[0].startsWith("AttackersDeclared")) {
List<Card> attackers = player.getCreaturesAttackedThisTurn();
@@ -2742,13 +2729,27 @@ public class AbilityUtils {
String[] paidparts = l[0].split("\\$", 2);
String[] lparts = paidparts[0].split(" ", 2);
final CardCollectionView cardsInZones;
CardCollectionView cardsInZones = null;
if (lparts[0].contains("All")) {
cardsInZones = game.getCardsInGame();
} else {
cardsInZones = lparts[0].length() > 5
? game.getCardsIn(ZoneType.listValueOf(lparts[0].substring(5)))
: game.getCardsIn(ZoneType.Battlefield);
final List<ZoneType> zones = ZoneType.listValueOf(lparts[0].length() > 5 ? lparts[0].substring(5) : "Battlefield");
boolean usedLastState = false;
if (ctb instanceof SpellAbility && zones.size() == 1) {
SpellAbility sa = (SpellAbility) ctb;
if (sa.isReplacementAbility()) {
if (zones.get(0).equals(ZoneType.Battlefield)) {
cardsInZones = sa.getLastStateBattlefield();
usedLastState = true;
} else if (zones.get(0).equals(ZoneType.Graveyard)) {
cardsInZones = sa.getLastStateGraveyard();
usedLastState = true;
}
}
}
if (!usedLastState) {
cardsInZones = game.getCardsIn(zones);
}
}
int cnt;
@@ -2761,7 +2762,7 @@ public class AbilityUtils {
}
if (sq[0].startsWith("MostCardName")) {
String[] lparts = l[0].split(" ", 2);
String[] lparts = l[0].split(" ", 2);
final String[] rest = lparts[1].split(",");
final CardCollectionView cardsInZones = lparts[0].length() > 12