mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
AbilityUtils: add Valid to xCount to fix Mana Echoes
This commit is contained in:
@@ -1834,6 +1834,19 @@ public class AbilityUtils {
|
||||
|
||||
return CardFactoryUtil.doXMath(game.getCounterAddedThisTurn(cType, parts[2], parts[3], c, player, ctb), expr, c);
|
||||
}
|
||||
|
||||
// count valid cards in any specified zone/s
|
||||
if (l[0].startsWith("Valid")) {
|
||||
String[] lparts = l[0].split(" ", 2);
|
||||
final String[] rest = lparts[1].split(",");
|
||||
|
||||
final CardCollectionView cardsInZones = lparts[0].length() > 5
|
||||
? game.getCardsIn(ZoneType.listValueOf(lparts[0].substring(5)))
|
||||
: game.getCardsIn(ZoneType.Battlefield);
|
||||
|
||||
CardCollection cards = CardLists.getValidCards(cardsInZones, rest, player, c, ctb);
|
||||
return CardFactoryUtil.doXMath(cards.size(), expr, c);
|
||||
}
|
||||
}
|
||||
return CardFactoryUtil.xCount(c, s2);
|
||||
}
|
||||
|
||||
@@ -1156,24 +1156,6 @@ public class Player extends GameEntity implements Comparable<Player> {
|
||||
addChangedKeywords(ImmutableList.of(keyword), ImmutableList.of(), getGame().getNextTimestamp());
|
||||
}
|
||||
|
||||
/**
|
||||
* Replace all instances of added keywords.
|
||||
* @param oldKeyword the keyword to replace.
|
||||
* @param newKeyword the keyword with which to replace.
|
||||
*/
|
||||
private final void replaceAllKeywordInstances(final String oldKeyword, final String newKeyword) {
|
||||
boolean keywordReplaced = false;
|
||||
for (final KeywordsChange ck : changedKeywords.values()) {
|
||||
if (ck.removeKeywordfromAdd(oldKeyword)) {
|
||||
ck.addKeyword(newKeyword);
|
||||
keywordReplaced = true;
|
||||
}
|
||||
}
|
||||
if (keywordReplaced) {
|
||||
updateKeywords();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all keyword changes which grant this {@link Player} the specified
|
||||
* keyword.
|
||||
|
||||
@@ -55,7 +55,6 @@ public class TriggerCounterRemoved extends Trigger {
|
||||
* @param runParams*/
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
final Card addedTo = (Card) runParams.get(AbilityKey.Card);
|
||||
final CounterType addedType = (CounterType) runParams.get(AbilityKey.CounterType);
|
||||
final Integer addedNewCounterAmount = (Integer) runParams.get(AbilityKey.NewCounterAmount);
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ public class TriggerCounterRemovedOnce extends Trigger {
|
||||
* @param runParams*/
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
final Card removedFrom = (Card) runParams.get(AbilityKey.Card);
|
||||
final CounterType removedType = (CounterType) runParams.get(AbilityKey.CounterType);
|
||||
|
||||
if (!matchesValidParam("ValidCard", runParams.get(AbilityKey.Card))) {
|
||||
|
||||
Reference in New Issue
Block a user