mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
Hinata & X spells fix
This commit is contained in:
committed by
Michael Kamensky
parent
e44c53bc68
commit
60cd9ab369
@@ -1343,7 +1343,7 @@ public class ComputerUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final CardCollection typeList =
|
final CardCollection typeList =
|
||||||
CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), type.split(","), source.getController(), source, sa);
|
CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), type, source.getController(), source, sa);
|
||||||
for (Card c : typeList) {
|
for (Card c : typeList) {
|
||||||
if (c.getSVar("SacMe").equals("6")) {
|
if (c.getSVar("SacMe").equals("6")) {
|
||||||
return true;
|
return true;
|
||||||
@@ -1620,7 +1620,7 @@ public class ComputerUtil {
|
|||||||
objects = AbilityUtils.getDefinedObjects(source, topStack.getParam("Defined"), topStack);
|
objects = AbilityUtils.getDefinedObjects(source, topStack.getParam("Defined"), topStack);
|
||||||
} else if (topStack.hasParam("ValidCards")) {
|
} else if (topStack.hasParam("ValidCards")) {
|
||||||
CardCollectionView battleField = aiPlayer.getCardsIn(ZoneType.Battlefield);
|
CardCollectionView battleField = aiPlayer.getCardsIn(ZoneType.Battlefield);
|
||||||
objects = CardLists.getValidCards(battleField, topStack.getParam("ValidCards").split(","), source.getController(), source, topStack);
|
objects = CardLists.getValidCards(battleField, topStack.getParam("ValidCards"), source.getController(), source, topStack);
|
||||||
} else {
|
} else {
|
||||||
return threatened;
|
return threatened;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class ComputerUtilAbility {
|
|||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
if (!c.getSVar("NeedsToPlay").isEmpty()) {
|
if (!c.getSVar("NeedsToPlay").isEmpty()) {
|
||||||
final String needsToPlay = c.getSVar("NeedsToPlay");
|
final String needsToPlay = c.getSVar("NeedsToPlay");
|
||||||
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), needsToPlay.split(","), c.getController(), c, null);
|
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), needsToPlay, c.getController(), c, null);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1951,7 +1951,7 @@ public class ComputerUtilCard {
|
|||||||
|
|
||||||
CardCollectionView list = game.getCardsIn(ZoneType.Battlefield);
|
CardCollectionView list = game.getCardsIn(ZoneType.Battlefield);
|
||||||
|
|
||||||
list = CardLists.getValidCards(list, needsToPlay.split(","), card.getController(), card, sa);
|
list = CardLists.getValidCards(list, needsToPlay, card.getController(), card, sa);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return AiPlayDecision.MissingNeededCards;
|
return AiPlayDecision.MissingNeededCards;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ public class ComputerUtilCost {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final CardCollection typeList = CardLists.getValidCards(hand, type.split(","), source.getController(), source, sa);
|
final CardCollection typeList = CardLists.getValidCards(hand, type, source.getController(), source, sa);
|
||||||
if (typeList.size() > ai.getMaxHandSize()) {
|
if (typeList.size() > ai.getMaxHandSize()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,14 +69,14 @@ public class AnimateAi extends SpellAbilityAi {
|
|||||||
final String valid = topStack.getParamOrDefault("SacValid", "Card.Self");
|
final String valid = topStack.getParamOrDefault("SacValid", "Card.Self");
|
||||||
String num = topStack.getParamOrDefault("Amount", "1");
|
String num = topStack.getParamOrDefault("Amount", "1");
|
||||||
final int nToSac = AbilityUtils.calculateAmount(topStack.getHostCard(), num, topStack);
|
final int nToSac = AbilityUtils.calculateAmount(topStack.getHostCard(), num, topStack);
|
||||||
CardCollection list = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid.split(","),
|
CardCollection list = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid,
|
||||||
ai.getWeakestOpponent(), topStack.getHostCard(), topStack);
|
ai.getWeakestOpponent(), topStack.getHostCard(), topStack);
|
||||||
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
||||||
ComputerUtilCard.sortByEvaluateCreature(list);
|
ComputerUtilCard.sortByEvaluateCreature(list);
|
||||||
if (!list.isEmpty() && list.size() == nToSac && ComputerUtilCost.canPayCost(sa, ai, sa.isTrigger())) {
|
if (!list.isEmpty() && list.size() == nToSac && ComputerUtilCost.canPayCost(sa, ai, sa.isTrigger())) {
|
||||||
Card animatedCopy = becomeAnimated(source, sa);
|
Card animatedCopy = becomeAnimated(source, sa);
|
||||||
list.add(animatedCopy);
|
list.add(animatedCopy);
|
||||||
list = CardLists.getValidCards(list, valid.split(","), ai.getWeakestOpponent(), topStack.getHostCard(),
|
list = CardLists.getValidCards(list, valid, ai.getWeakestOpponent(), topStack.getHostCard(),
|
||||||
topStack);
|
topStack);
|
||||||
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
||||||
if (ComputerUtilCard.evaluateCreature(animatedCopy) < ComputerUtilCard.evaluateCreature(list.get(0))
|
if (ComputerUtilCard.evaluateCreature(animatedCopy) < ComputerUtilCard.evaluateCreature(list.get(0))
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class ChooseCardAi extends SpellAbilityAi {
|
|||||||
choice = ComputerUtilCard.getBestCreatureAI(options);
|
choice = ComputerUtilCard.getBestCreatureAI(options);
|
||||||
} else if (logic.equals("Clone")) {
|
} else if (logic.equals("Clone")) {
|
||||||
final String filter = "Permanent.YouDontCtrl,Permanent.nonLegendary";
|
final String filter = "Permanent.YouDontCtrl,Permanent.nonLegendary";
|
||||||
CardCollection newOptions = CardLists.getValidCards(options, filter.split(","), ctrl, host, sa);
|
CardCollection newOptions = CardLists.getValidCards(options, filter, ctrl, host, sa);
|
||||||
if (!newOptions.isEmpty()) {
|
if (!newOptions.isEmpty()) {
|
||||||
options = newOptions;
|
options = newOptions;
|
||||||
}
|
}
|
||||||
@@ -194,7 +194,7 @@ public class ChooseCardAi extends SpellAbilityAi {
|
|||||||
choice = Aggregates.random(options);
|
choice = Aggregates.random(options);
|
||||||
} else if (logic.equals("Untap")) {
|
} else if (logic.equals("Untap")) {
|
||||||
final String filter = "Permanent.YouCtrl,Permanent.tapped";
|
final String filter = "Permanent.YouCtrl,Permanent.tapped";
|
||||||
CardCollection newOptions = CardLists.getValidCards(options, filter.split(","), ctrl, host, sa);
|
CardCollection newOptions = CardLists.getValidCards(options, filter, ctrl, host, sa);
|
||||||
if (!newOptions.isEmpty()) {
|
if (!newOptions.isEmpty()) {
|
||||||
options = newOptions;
|
options = newOptions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ public class CloneAi extends SpellAbilityAi {
|
|||||||
filter = filter.replace(".nonLegendary+", ".").replace(".nonLegendary", "");
|
filter = filter.replace(".nonLegendary+", ".").replace(".nonLegendary", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
CardCollection newOptions = CardLists.getValidCards(options, filter.split(","), ctrl, host, sa);
|
CardCollection newOptions = CardLists.getValidCards(options, filter, ctrl, host, sa);
|
||||||
if (!newOptions.isEmpty()) {
|
if (!newOptions.isEmpty()) {
|
||||||
options = newOptions;
|
options = newOptions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public class CopyPermanentAi extends SpellAbilityAi {
|
|||||||
final boolean canCopyLegendary = sa.hasParam("NonLegendary");
|
final boolean canCopyLegendary = sa.hasParam("NonLegendary");
|
||||||
final String filter = canCopyLegendary ? "Permanent" : "Permanent.YouDontCtrl,Permanent.nonLegendary";
|
final String filter = canCopyLegendary ? "Permanent" : "Permanent.YouDontCtrl,Permanent.nonLegendary";
|
||||||
// TODO add filter to not select Legendary from Other Player when ai already have a Legendary with that name
|
// TODO add filter to not select Legendary from Other Player when ai already have a Legendary with that name
|
||||||
return CardLists.getValidCards(options, filter.split(","), ctrl, host, sa);
|
return CardLists.getValidCards(options, filter, ctrl, host, sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ public class DamageAllAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
// TODO: X may be something different than X paid
|
// TODO: X may be something different than X paid
|
||||||
CardCollection list =
|
CardCollection list =
|
||||||
CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), validC.split(","), source.getController(), source, sa);
|
CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), validC, source.getController(), source, sa);
|
||||||
|
|
||||||
final Predicate<Card> filterKillable = new Predicate<Card>() {
|
final Predicate<Card> filterKillable = new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ public class DestroyAllAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
// TODO should probably sort results when targeted to use on biggest threat instead of first match
|
// TODO should probably sort results when targeted to use on biggest threat instead of first match
|
||||||
for (Player opponent: ai.getOpponents()) {
|
for (Player opponent: ai.getOpponents()) {
|
||||||
CardCollection opplist = CardLists.getValidCards(opponent.getCardsIn(ZoneType.Battlefield), valid.split(","), source.getController(), source, sa);
|
CardCollection opplist = CardLists.getValidCards(opponent.getCardsIn(ZoneType.Battlefield), valid, source.getController(), source, sa);
|
||||||
CardCollection ailist = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid.split(","), source.getController(), source, sa);
|
CardCollection ailist = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid, source.getController(), source, sa);
|
||||||
|
|
||||||
opplist = CardLists.filter(opplist, predicate);
|
opplist = CardLists.filter(opplist, predicate);
|
||||||
ailist = CardLists.filter(ailist, predicate);
|
ailist = CardLists.filter(ailist, predicate);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class DigUntilAi extends SpellAbilityAi {
|
|||||||
} else {
|
} else {
|
||||||
if (sa.hasParam("Valid")) {
|
if (sa.hasParam("Valid")) {
|
||||||
final String valid = sa.getParam("Valid");
|
final String valid = sa.getParam("Valid");
|
||||||
if (CardLists.getValidCards(ai.getCardsIn(ZoneType.Library), valid.split(","), source.getController(), source, sa).isEmpty()) {
|
if (CardLists.getValidCards(ai.getCardsIn(ZoneType.Library), valid, source.getController(), source, sa).isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class RegenerateAllAi extends SpellAbilityAi {
|
|||||||
final String valid = sa.getParamOrDefault("ValidCards", "");
|
final String valid = sa.getParamOrDefault("ValidCards", "");
|
||||||
|
|
||||||
CardCollectionView list = game.getCardsIn(ZoneType.Battlefield);
|
CardCollectionView list = game.getCardsIn(ZoneType.Battlefield);
|
||||||
list = CardLists.getValidCards(list, valid.split(","), hostCard.getController(), hostCard, sa);
|
list = CardLists.getValidCards(list, valid, hostCard.getController(), hostCard, sa);
|
||||||
list = CardLists.filter(list, CardPredicates.isController(ai));
|
list = CardLists.filter(list, CardPredicates.isController(ai));
|
||||||
|
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class SacrificeAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
List<Card> list = null;
|
List<Card> list = null;
|
||||||
try {
|
try {
|
||||||
list = CardLists.getValidCards(opp.getCardsIn(ZoneType.Battlefield), valid.split(","), sa.getActivatingPlayer(), source, sa);
|
list = CardLists.getValidCards(opp.getCardsIn(ZoneType.Battlefield), valid, sa.getActivatingPlayer(), source, sa);
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@@ -141,7 +141,7 @@ public class SacrificeAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
List<Card> humanList = null;
|
List<Card> humanList = null;
|
||||||
try {
|
try {
|
||||||
humanList = CardLists.getValidCards(ai.getStrongestOpponent().getCardsIn(ZoneType.Battlefield), valid.split(","), sa.getActivatingPlayer(), source, sa);
|
humanList = CardLists.getValidCards(ai.getStrongestOpponent().getCardsIn(ZoneType.Battlefield), valid, sa.getActivatingPlayer(), source, sa);
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
@@ -155,7 +155,7 @@ public class SacrificeAi extends SpellAbilityAi {
|
|||||||
} else if (defined.equals("You")) {
|
} else if (defined.equals("You")) {
|
||||||
List<Card> computerList = null;
|
List<Card> computerList = null;
|
||||||
try {
|
try {
|
||||||
computerList = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid.split(","), sa.getActivatingPlayer(), source, sa);
|
computerList = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid, sa.getActivatingPlayer(), source, sa);
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -241,14 +241,14 @@ public class TokenAi extends SpellAbilityAi {
|
|||||||
final String valid = topStack.getParamOrDefault("SacValid", "Card.Self");
|
final String valid = topStack.getParamOrDefault("SacValid", "Card.Self");
|
||||||
String num = sa.getParamOrDefault("Amount", "1");
|
String num = sa.getParamOrDefault("Amount", "1");
|
||||||
final int nToSac = AbilityUtils.calculateAmount(topStack.getHostCard(), num, topStack);
|
final int nToSac = AbilityUtils.calculateAmount(topStack.getHostCard(), num, topStack);
|
||||||
CardCollection list = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid.split(","),
|
CardCollection list = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), valid,
|
||||||
ai.getWeakestOpponent(), topStack.getHostCard(), sa);
|
ai.getWeakestOpponent(), topStack.getHostCard(), sa);
|
||||||
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
||||||
// only care about saving single creature for now
|
// only care about saving single creature for now
|
||||||
if (!list.isEmpty() && nTokens > 0 && list.size() == nToSac) {
|
if (!list.isEmpty() && nTokens > 0 && list.size() == nToSac) {
|
||||||
ComputerUtilCard.sortByEvaluateCreature(list);
|
ComputerUtilCard.sortByEvaluateCreature(list);
|
||||||
list.add(token);
|
list.add(token);
|
||||||
list = CardLists.getValidCards(list, valid.split(","), ai.getWeakestOpponent(), topStack.getHostCard(), sa);
|
list = CardLists.getValidCards(list, valid, ai.getWeakestOpponent(), topStack.getHostCard(), sa);
|
||||||
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
list = CardLists.filter(list, CardPredicates.canBeSacrificedBy(topStack, true));
|
||||||
return ComputerUtilCard.evaluateCreature(token) < ComputerUtilCard.evaluateCreature(list.get(0))
|
return ComputerUtilCard.evaluateCreature(token) < ComputerUtilCard.evaluateCreature(list.get(0))
|
||||||
&& list.contains(token);
|
&& list.contains(token);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class UntapAllAi extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
CardCollectionView list = CardLists.filter(aiPlayer.getGame().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.TAPPED);
|
CardCollectionView list = CardLists.filter(aiPlayer.getGame().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.TAPPED);
|
||||||
final String valid = sa.getParamOrDefault("ValidCards", "");
|
final String valid = sa.getParamOrDefault("ValidCards", "");
|
||||||
list = CardLists.getValidCards(list, valid.split(","), source.getController(), source, sa);
|
list = CardLists.getValidCards(list, valid, source.getController(), source, sa);
|
||||||
// don't untap if only opponent benefits
|
// don't untap if only opponent benefits
|
||||||
PlayerCollection goodControllers = aiPlayer.getAllies();
|
PlayerCollection goodControllers = aiPlayer.getAllies();
|
||||||
goodControllers.add(aiPlayer);
|
goodControllers.add(aiPlayer);
|
||||||
@@ -43,7 +43,7 @@ public class UntapAllAi extends SpellAbilityAi {
|
|||||||
if (sa.hasParam("ValidCards")) {
|
if (sa.hasParam("ValidCards")) {
|
||||||
String valid = sa.getParam("ValidCards");
|
String valid = sa.getParam("ValidCards");
|
||||||
CardCollectionView list = CardLists.filter(aiPlayer.getGame().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.TAPPED);
|
CardCollectionView list = CardLists.filter(aiPlayer.getGame().getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.TAPPED);
|
||||||
list = CardLists.getValidCards(list, valid.split(","), source.getController(), source, sa);
|
list = CardLists.getValidCards(list, valid, source.getController(), source, sa);
|
||||||
return mandatory || !list.isEmpty();
|
return mandatory || !list.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView,
|
|||||||
list.addAll(p.getCardsIn(presentZone));
|
list.addAll(p.getCardsIn(presentZone));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list = CardLists.getValidCards(list, sIsPresent.split(","), this.getHostCard().getController(), this.getHostCard(), this);
|
list = CardLists.getValidCards(list, sIsPresent, this.getHostCard().getController(), this.getHostCard(), this);
|
||||||
|
|
||||||
final String rightString = presentCompare.substring(2);
|
final String rightString = presentCompare.substring(2);
|
||||||
int right = AbilityUtils.calculateAmount(getHostCard(), rightString, this);
|
int right = AbilityUtils.calculateAmount(getHostCard(), rightString, this);
|
||||||
@@ -397,7 +397,7 @@ public abstract class CardTraitBase extends GameObject implements IHasCardView,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list = CardLists.getValidCards(list, sIsPresent.split(","), this.getHostCard().getController(), this.getHostCard(), this);
|
list = CardLists.getValidCards(list, sIsPresent, this.getHostCard().getController(), this.getHostCard(), this);
|
||||||
|
|
||||||
final String rightString = presentCompare.substring(2);
|
final String rightString = presentCompare.substring(2);
|
||||||
int right = AbilityUtils.calculateAmount(getHostCard(), rightString, this);
|
int right = AbilityUtils.calculateAmount(getHostCard(), rightString, this);
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ public class AbilityUtils {
|
|||||||
candidates = game.getCardsIn(ZoneType.smartValueOf(zone));
|
candidates = game.getCardsIn(ZoneType.smartValueOf(zone));
|
||||||
validDefined = s[1];
|
validDefined = s[1];
|
||||||
}
|
}
|
||||||
cards.addAll(CardLists.getValidCards(candidates, validDefined.split(","), hostCard.getController(), hostCard, sa));
|
cards.addAll(CardLists.getValidCards(candidates, validDefined, hostCard.getController(), hostCard, sa));
|
||||||
return cards;
|
return cards;
|
||||||
} else {
|
} else {
|
||||||
CardCollection list = null;
|
CardCollection list = null;
|
||||||
@@ -977,7 +977,7 @@ public class AbilityUtils {
|
|||||||
String var = sa.getParam("AbilityCount");
|
String var = sa.getParam("AbilityCount");
|
||||||
valid = TextUtil.fastReplace(valid, var, Integer.toString(calculateAmount(source, var, sa)));
|
valid = TextUtil.fastReplace(valid, var, Integer.toString(calculateAmount(source, var, sa)));
|
||||||
}
|
}
|
||||||
return CardLists.getValidCards(list, valid.split(","), sa.getActivatingPlayer(), source, sa);
|
return CardLists.getValidCards(list, valid, sa.getActivatingPlayer(), source, sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1884,7 +1884,7 @@ public class AbilityUtils {
|
|||||||
return doXMath(0, expr, c, ctb);
|
return doXMath(0, expr, c, ctb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list = CardLists.getValidCards(list, k[1].split(","), sa.getActivatingPlayer(), c, sa);
|
list = CardLists.getValidCards(list, k[1], sa.getActivatingPlayer(), c, sa);
|
||||||
if (k[0].contains("TotalToughness")) {
|
if (k[0].contains("TotalToughness")) {
|
||||||
return doXMath(Aggregates.sum(list, CardPredicates.Accessors.fnGetNetToughness), expr, c, ctb);
|
return doXMath(Aggregates.sum(list, CardPredicates.Accessors.fnGetNetToughness), expr, c, ctb);
|
||||||
}
|
}
|
||||||
@@ -1911,7 +1911,7 @@ public class AbilityUtils {
|
|||||||
return doXMath(0, expr, c, ctb);
|
return doXMath(0, expr, c, ctb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
list = CardLists.getValidCards(list, k[1].split(","), sa.getActivatingPlayer(), c, sa);
|
list = CardLists.getValidCards(list, k[1], sa.getActivatingPlayer(), c, sa);
|
||||||
return doXMath(list.size(), expr, c, ctb);
|
return doXMath(list.size(), expr, c, ctb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1940,14 +1940,14 @@ public class AbilityUtils {
|
|||||||
if (sq[0].startsWith("LastStateBattlefield")) {
|
if (sq[0].startsWith("LastStateBattlefield")) {
|
||||||
final String[] k = l[0].split(" ");
|
final String[] k = l[0].split(" ");
|
||||||
CardCollection list = new CardCollection(game.getLastStateBattlefield());
|
CardCollection list = new CardCollection(game.getLastStateBattlefield());
|
||||||
list = CardLists.getValidCards(list, k[1].split(","), player, c, ctb);
|
list = CardLists.getValidCards(list, k[1], player, c, ctb);
|
||||||
return doXMath(list.size(), expr, c, ctb);
|
return doXMath(list.size(), expr, c, ctb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sq[0].startsWith("LastStateGraveyard")) {
|
if (sq[0].startsWith("LastStateGraveyard")) {
|
||||||
final String[] k = l[0].split(" ");
|
final String[] k = l[0].split(" ");
|
||||||
CardCollection list = new CardCollection(game.getLastStateGraveyard());
|
CardCollection list = new CardCollection(game.getLastStateGraveyard());
|
||||||
list = CardLists.getValidCards(list, k[1].split(","), player, c, ctb);
|
list = CardLists.getValidCards(list, k[1], player, c, ctb);
|
||||||
return doXMath(list.size(), expr, c, ctb);
|
return doXMath(list.size(), expr, c, ctb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2176,7 +2176,7 @@ public class AbilityUtils {
|
|||||||
|
|
||||||
if (sq[0].startsWith("Devoured")) {
|
if (sq[0].startsWith("Devoured")) {
|
||||||
final String validDevoured = sq[0].split(" ")[1];
|
final String validDevoured = sq[0].split(" ")[1];
|
||||||
CardCollection cl = CardLists.getValidCards(c.getDevouredCards(), validDevoured.split(","), player, c, ctb);
|
CardCollection cl = CardLists.getValidCards(c.getDevouredCards(), validDevoured, player, c, ctb);
|
||||||
return doXMath(cl.size(), expr, c, ctb);
|
return doXMath(cl.size(), expr, c, ctb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2451,8 +2451,7 @@ public class AbilityUtils {
|
|||||||
|
|
||||||
if (sq[0].startsWith("ColorsCtrl")) {
|
if (sq[0].startsWith("ColorsCtrl")) {
|
||||||
final String restriction = l[0].substring(11);
|
final String restriction = l[0].substring(11);
|
||||||
final String[] rest = restriction.split(",");
|
final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb);
|
||||||
final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), rest, player, c, ctb);
|
|
||||||
byte n = 0;
|
byte n = 0;
|
||||||
for (final Card card : list) {
|
for (final Card card : list) {
|
||||||
n |= card.getColor().getColor();
|
n |= card.getColor().getColor();
|
||||||
@@ -2711,8 +2710,7 @@ public class AbilityUtils {
|
|||||||
// Count$SumPower_valid
|
// Count$SumPower_valid
|
||||||
if (sq[0].startsWith("SumPower")) {
|
if (sq[0].startsWith("SumPower")) {
|
||||||
final String[] restrictions = l[0].split("_");
|
final String[] restrictions = l[0].split("_");
|
||||||
final String[] rest = restrictions[1].split(",");
|
CardCollection filteredCards = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), restrictions[1], player, c, ctb);
|
||||||
CardCollection filteredCards = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), rest, player, c, ctb);
|
|
||||||
return doXMath(Aggregates.sum(filteredCards, CardPredicates.Accessors.fnGetNetPower), expr, c, ctb);
|
return doXMath(Aggregates.sum(filteredCards, CardPredicates.Accessors.fnGetNetPower), expr, c, ctb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2723,9 +2721,8 @@ public class AbilityUtils {
|
|||||||
if (sq[0].contains("Graveyard"))
|
if (sq[0].contains("Graveyard"))
|
||||||
zone = ZoneType.Graveyard;
|
zone = ZoneType.Graveyard;
|
||||||
final String[] restrictions = l[0].split("_");
|
final String[] restrictions = l[0].split("_");
|
||||||
final String[] rest = restrictions[1].split(",");
|
|
||||||
CardCollectionView cardsonbattlefield = game.getCardsIn(zone);
|
CardCollectionView cardsonbattlefield = game.getCardsIn(zone);
|
||||||
CardCollection filteredCards = CardLists.getValidCards(cardsonbattlefield, rest, player, c, ctb);
|
CardCollection filteredCards = CardLists.getValidCards(cardsonbattlefield, restrictions[1], player, c, ctb);
|
||||||
return Aggregates.sum(filteredCards, CardPredicates.Accessors.fnGetCmc);
|
return Aggregates.sum(filteredCards, CardPredicates.Accessors.fnGetCmc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2821,8 +2818,7 @@ public class AbilityUtils {
|
|||||||
|
|
||||||
if (sq[0].startsWith("GreatestToughness_")) {
|
if (sq[0].startsWith("GreatestToughness_")) {
|
||||||
final String restriction = l[0].substring(18);
|
final String restriction = l[0].substring(18);
|
||||||
final String[] rest = restriction.split(",");
|
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb);
|
||||||
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), rest, player, c, ctb);
|
|
||||||
int highest = 0;
|
int highest = 0;
|
||||||
for (final Card crd : list) {
|
for (final Card crd : list) {
|
||||||
if (crd.getNetToughness() > highest) {
|
if (crd.getNetToughness() > highest) {
|
||||||
@@ -2834,8 +2830,7 @@ public class AbilityUtils {
|
|||||||
|
|
||||||
if (sq[0].startsWith("HighestCMC_")) {
|
if (sq[0].startsWith("HighestCMC_")) {
|
||||||
final String restriction = l[0].substring(11);
|
final String restriction = l[0].substring(11);
|
||||||
final String[] rest = restriction.split(",");
|
CardCollection list = CardLists.getValidCards(game.getCardsInGame(), restriction, player, c, ctb);
|
||||||
CardCollection list = CardLists.getValidCards(game.getCardsInGame(), rest, player, c, ctb);
|
|
||||||
int highest = 0;
|
int highest = 0;
|
||||||
for (final Card crd : list) {
|
for (final Card crd : list) {
|
||||||
// dont check for Split card anymore
|
// dont check for Split card anymore
|
||||||
@@ -2874,8 +2869,7 @@ public class AbilityUtils {
|
|||||||
if (sq[0].startsWith("DifferentCardNames_")) {
|
if (sq[0].startsWith("DifferentCardNames_")) {
|
||||||
final List<String> crdname = Lists.newArrayList();
|
final List<String> crdname = Lists.newArrayList();
|
||||||
final String restriction = l[0].substring(19);
|
final String restriction = l[0].substring(19);
|
||||||
final String[] rest = restriction.split(",");
|
CardCollection list = CardLists.getValidCards(game.getCardsInGame(), restriction, player, c, ctb);
|
||||||
CardCollection list = CardLists.getValidCards(game.getCardsInGame(), rest, player, c, ctb);
|
|
||||||
for (final Card card : list) {
|
for (final Card card : list) {
|
||||||
String name = card.getName();
|
String name = card.getName();
|
||||||
// CR 201.2b Those objects have different names only if each of them has at least one name and no two objects in that group have a name in common
|
// CR 201.2b Those objects have different names only if each of them has at least one name and no two objects in that group have a name in common
|
||||||
@@ -2889,8 +2883,7 @@ public class AbilityUtils {
|
|||||||
if (sq[0].startsWith("DifferentPower_")) {
|
if (sq[0].startsWith("DifferentPower_")) {
|
||||||
final List<Integer> powers = Lists.newArrayList();
|
final List<Integer> powers = Lists.newArrayList();
|
||||||
final String restriction = l[0].substring(15);
|
final String restriction = l[0].substring(15);
|
||||||
final String[] rest = restriction.split(",");
|
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb);
|
||||||
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), rest, player, c, ctb);
|
|
||||||
for (final Card card : list) {
|
for (final Card card : list) {
|
||||||
Integer pow = card.getNetPower();
|
Integer pow = card.getNetPower();
|
||||||
if (!powers.contains(pow)) {
|
if (!powers.contains(pow)) {
|
||||||
@@ -2915,8 +2908,7 @@ public class AbilityUtils {
|
|||||||
|
|
||||||
if (sq[0].startsWith("ColorsCtrl")) {
|
if (sq[0].startsWith("ColorsCtrl")) {
|
||||||
final String restriction = l[0].substring(11);
|
final String restriction = l[0].substring(11);
|
||||||
final String[] rest = restriction.split(",");
|
final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb);
|
||||||
final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), rest, player, c, ctb);
|
|
||||||
byte n = 0;
|
byte n = 0;
|
||||||
for (final Card card : list) {
|
for (final Card card : list) {
|
||||||
n |= card.getColor().getColor();
|
n |= card.getColor().getColor();
|
||||||
@@ -3417,16 +3409,14 @@ public class AbilityUtils {
|
|||||||
String[] lparts = l[0].split(" ", 2);
|
String[] lparts = l[0].split(" ", 2);
|
||||||
final List<ZoneType> vZone = ZoneType.listValueOf(lparts[0].split("Valid")[1]);
|
final List<ZoneType> vZone = ZoneType.listValueOf(lparts[0].split("Valid")[1]);
|
||||||
String restrictions = TextUtil.fastReplace(l[0], TextUtil.addSuffix(lparts[0]," "), "");
|
String restrictions = TextUtil.fastReplace(l[0], TextUtil.addSuffix(lparts[0]," "), "");
|
||||||
final String[] rest = restrictions.split(",");
|
CardCollection cards = CardLists.getValidCards(game.getCardsIn(vZone), restrictions, player, source, ctb);
|
||||||
CardCollection cards = CardLists.getValidCards(game.getCardsIn(vZone), rest, player, source, ctb);
|
|
||||||
return doXMath(cards.size(), m, source, ctb);
|
return doXMath(cards.size(), m, source, ctb);
|
||||||
}
|
}
|
||||||
|
|
||||||
// count valid cards on the battlefield
|
// count valid cards on the battlefield
|
||||||
if (l[0].startsWith("Valid ")) {
|
if (l[0].startsWith("Valid ")) {
|
||||||
final String restrictions = l[0].substring(6);
|
final String restrictions = l[0].substring(6);
|
||||||
final String[] rest = restrictions.split(",");
|
CardCollection cardsonbattlefield = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), restrictions, player, source, ctb);
|
||||||
CardCollection cardsonbattlefield = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), rest, player, source, ctb);
|
|
||||||
return doXMath(cardsonbattlefield.size(), m, source, ctb);
|
return doXMath(cardsonbattlefield.size(), m, source, ctb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ public class AnimateAllEffect extends AnimateEffectBase {
|
|||||||
list = getTargetPlayers(sa).getCardsIn(ZoneType.Battlefield);
|
list = getTargetPlayers(sa).getCardsIn(ZoneType.Battlefield);
|
||||||
}
|
}
|
||||||
|
|
||||||
list = CardLists.getValidCards(list, valid.split(","), host.getController(), host, sa);
|
list = CardLists.getValidCards(list, valid, host.getController(), host, sa);
|
||||||
|
|
||||||
for (final Card c : list) {
|
for (final Card c : list) {
|
||||||
doAnimate(c, sa, power, toughness, types, removeTypes, finalColors,
|
doAnimate(c, sa, power, toughness, types, removeTypes, finalColors,
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public class CharmEffect extends SpellAbilityEffect {
|
|||||||
} else {
|
} else {
|
||||||
num = Math.min(AbilityUtils.calculateAmount(source, sa.getParamOrDefault("CharmNum", "1"), sa), list.size());
|
num = Math.min(AbilityUtils.calculateAmount(source, sa.getParamOrDefault("CharmNum", "1"), sa), list.size());
|
||||||
}
|
}
|
||||||
final int min = sa.hasParam("MinCharmNum") ? AbilityUtils.calculateAmount(source, sa.getParamOrDefault("MinCharmNum", "1"), sa) : num;
|
final int min = sa.hasParam("MinCharmNum") ? AbilityUtils.calculateAmount(source, sa.getParam("MinCharmNum"), sa) : num;
|
||||||
|
|
||||||
boolean repeat = sa.hasParam("CanRepeatModes");
|
boolean repeat = sa.hasParam("CanRepeatModes");
|
||||||
boolean random = sa.hasParam("Random");
|
boolean random = sa.hasParam("Random");
|
||||||
@@ -120,7 +120,7 @@ public class CharmEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (additionalDesc) {
|
if (additionalDesc) {
|
||||||
String addDescS = (sa.getParam("AdditionalDescription"));
|
String addDescS = sa.getParam("AdditionalDescription");
|
||||||
if (optional) {
|
if (optional) {
|
||||||
sb.append(". ").append(addDescS.trim());
|
sb.append(". ").append(addDescS.trim());
|
||||||
} else if (addDescS.startsWith(("."))) {
|
} else if (addDescS.startsWith(("."))) {
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class CopySpellAbilityEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
valid = CardLists.getValidCards(valid, type.split(","), chosenSA.getActivatingPlayer(), chosenSA.getHostCard(), sa);
|
valid = CardLists.getValidCards(valid, type, chosenSA.getActivatingPlayer(), chosenSA.getHostCard(), sa);
|
||||||
Card originalTarget = Iterables.getFirst(getTargetCards(chosenSA), null);
|
Card originalTarget = Iterables.getFirst(getTargetCards(chosenSA), null);
|
||||||
valid.remove(originalTarget);
|
valid.remove(originalTarget);
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ public class DigEffect extends SpellAbilityEffect {
|
|||||||
if (changeValid.contains("ChosenType")) {
|
if (changeValid.contains("ChosenType")) {
|
||||||
changeValid = changeValid.replace("ChosenType", host.getChosenType());
|
changeValid = changeValid.replace("ChosenType", host.getChosenType());
|
||||||
}
|
}
|
||||||
valid = CardLists.getValidCards(top, changeValid.split(","), cont, host, sa);
|
valid = CardLists.getValidCards(top, changeValid, cont, host, sa);
|
||||||
if (totalCMC) {
|
if (totalCMC) {
|
||||||
valid = CardLists.getValidCards(valid, "Card.cmcLE" + totcmc, cont, host, sa);
|
valid = CardLists.getValidCards(valid, "Card.cmcLE" + totcmc, cont, host, sa);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ public class DiscardEffect extends SpellAbilityEffect {
|
|||||||
"X", Integer.toString(AbilityUtils.calculateAmount(source, "X", sa)));
|
"X", Integer.toString(AbilityUtils.calculateAmount(source, "X", sa)));
|
||||||
}
|
}
|
||||||
|
|
||||||
toBeDiscarded = CardLists.getValidCards(dPHand, valid.split(","), source.getController(), source, sa);
|
toBeDiscarded = CardLists.getValidCards(dPHand, valid, source.getController(), source, sa);
|
||||||
toBeDiscarded = CardLists.filter(toBeDiscarded, Presets.NON_TOKEN);
|
toBeDiscarded = CardLists.filter(toBeDiscarded, Presets.NON_TOKEN);
|
||||||
if (toBeDiscarded.size() > 1) {
|
if (toBeDiscarded.size() > 1) {
|
||||||
toBeDiscarded = GameActionUtil.orderCardsByTheirOwners(game, toBeDiscarded, ZoneType.Graveyard, sa);
|
toBeDiscarded = GameActionUtil.orderCardsByTheirOwners(game, toBeDiscarded, ZoneType.Graveyard, sa);
|
||||||
@@ -250,8 +250,7 @@ public class DiscardEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String valid = sa.getParamOrDefault("DiscardValid", "Card");
|
final String valid = sa.getParamOrDefault("DiscardValid", "Card");
|
||||||
String[] dValid = valid.split(",");
|
CardCollection validCards = CardLists.getValidCards(dPHand, valid, source.getController(), source, sa);
|
||||||
CardCollection validCards = CardLists.getValidCards(dPHand, dValid, source.getController(), source, sa);
|
|
||||||
|
|
||||||
Player chooser = p;
|
Player chooser = p;
|
||||||
if (mode.equals("RevealYouChoose")) {
|
if (mode.equals("RevealYouChoose")) {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class RegenerateAllEffect extends RegenerateBaseEffect {
|
|||||||
final String valid = sa.getParamOrDefault("ValidCards", "");
|
final String valid = sa.getParamOrDefault("ValidCards", "");
|
||||||
|
|
||||||
CardCollectionView list = game.getCardsIn(ZoneType.Battlefield);
|
CardCollectionView list = game.getCardsIn(ZoneType.Battlefield);
|
||||||
list = CardLists.getValidCards(list, valid.split(","), hostCard.getController(), hostCard, sa);
|
list = CardLists.getValidCards(list, valid, hostCard.getController(), hostCard, sa);
|
||||||
|
|
||||||
// create Effect for Regeneration
|
// create Effect for Regeneration
|
||||||
createRegenerationEffect(sa, list);
|
createRegenerationEffect(sa, list);
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class RepeatEffect extends SpellAbilityEffect {
|
|||||||
} else {
|
} else {
|
||||||
list = game.getCardsIn(ZoneType.Battlefield);
|
list = game.getCardsIn(ZoneType.Battlefield);
|
||||||
}
|
}
|
||||||
list = CardLists.getValidCards(list, repeatPresent.split(","), sa.getActivatingPlayer(), sa.getHostCard(), sa);
|
list = CardLists.getValidCards(list, repeatPresent, sa.getActivatingPlayer(), sa.getHostCard(), sa);
|
||||||
|
|
||||||
final String rightString = repeatCompare.substring(2);
|
final String rightString = repeatCompare.substring(2);
|
||||||
int right = AbilityUtils.calculateAmount(sa.getHostCard(), rightString, sa);
|
int right = AbilityUtils.calculateAmount(sa.getHostCard(), rightString, sa);
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class UnattachAllEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
String valid = sa.getParam("UnattachValid");
|
String valid = sa.getParam("UnattachValid");
|
||||||
CardCollectionView unattachList = game.getCardsIn(ZoneType.Battlefield);
|
CardCollectionView unattachList = game.getCardsIn(ZoneType.Battlefield);
|
||||||
unattachList = CardLists.getValidCards(unattachList, valid.split(","), source.getController(), source, sa);
|
unattachList = CardLists.getValidCards(unattachList, valid, source.getController(), source, sa);
|
||||||
for (final Card c : unattachList) {
|
for (final Card c : unattachList) {
|
||||||
handleUnattachment((GameEntity) o, c);
|
handleUnattachment((GameEntity) o, c);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class UntapAllEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
list = list2;
|
list = list2;
|
||||||
}
|
}
|
||||||
list = CardLists.getValidCards(list, valid.split(","), card.getController(), card, sa);
|
list = CardLists.getValidCards(list, valid, card.getController(), card, sa);
|
||||||
|
|
||||||
boolean remember = sa.hasParam("RememberUntapped");
|
boolean remember = sa.hasParam("RememberUntapped");
|
||||||
for (Card c : list) {
|
for (Card c : list) {
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class CardZoneTable extends ForwardingTable<ZoneType, ZoneType, CardColle
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (valid != null) {
|
if (valid != null) {
|
||||||
allCards = CardLists.getValidCards(allCards, valid.split(","), host.getController(), host, sa);
|
allCards = CardLists.getValidCards(allCards, valid, host.getController(), host, sa);
|
||||||
}
|
}
|
||||||
return allCards;
|
return allCards;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ public class CostAdjustment {
|
|||||||
count = Integer.parseInt(amount);
|
count = Integer.parseInt(amount);
|
||||||
} else {
|
} else {
|
||||||
if (st.hasParam("Relative")) {
|
if (st.hasParam("Relative")) {
|
||||||
|
// grab SVar here already to avoid potential collision when SA has one with same name
|
||||||
count = AbilityUtils.calculateAmount(hostCard, st.hasSVar(amount) ? st.getSVar(amount) : amount, sa);
|
count = AbilityUtils.calculateAmount(hostCard, st.hasSVar(amount) ? st.getSVar(amount) : amount, sa);
|
||||||
} else {
|
} else {
|
||||||
count = AbilityUtils.calculateAmount(hostCard, amount, st);
|
count = AbilityUtils.calculateAmount(hostCard, amount, st);
|
||||||
@@ -379,7 +380,7 @@ public class CostAdjustment {
|
|||||||
// TODO: update cards with "This spell costs X less to cast...if you..."
|
// TODO: update cards with "This spell costs X less to cast...if you..."
|
||||||
// The caster is sa.getActivatingPlayer()
|
// The caster is sa.getActivatingPlayer()
|
||||||
// cards like Hostage Taker can cast spells from other players.
|
// cards like Hostage Taker can cast spells from other players.
|
||||||
value = AbilityUtils.calculateAmount(hostCard, amount, sa);
|
value = AbilityUtils.calculateAmount(hostCard, staticAbility.hasSVar(amount) ? staticAbility.getSVar(amount) : amount, sa);
|
||||||
} else {
|
} else {
|
||||||
value = AbilityUtils.calculateAmount(hostCard, amount, staticAbility);
|
value = AbilityUtils.calculateAmount(hostCard, amount, staticAbility);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
runParams.put(AbilityKey.Activator, root == null ? null : root.getActivatingPlayer());
|
runParams.put(AbilityKey.Activator, root == null ? null : root.getActivatingPlayer());
|
||||||
|
|
||||||
player.getGame().getTriggerHandler().runTrigger(TriggerType.TapsForMana, runParams, false);
|
player.getGame().getTriggerHandler().runTrigger(TriggerType.TapsForMana, runParams, false);
|
||||||
if (source.isLand() && sa.getPayCosts() != null && sa.getPayCosts().hasTapCost() ) {
|
if (source.isLand() && sa.getPayCosts() != null && sa.getPayCosts().hasTapCost()) {
|
||||||
player.setTappedLandForManaThisTurn(true);
|
player.setTappedLandForManaThisTurn(true);
|
||||||
}
|
}
|
||||||
} // end produceMana(String)
|
} // end produceMana(String)
|
||||||
|
|||||||
@@ -467,7 +467,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
|||||||
CardCollectionView list = game.getCardsIn(zone);
|
CardCollectionView list = game.getCardsIn(zone);
|
||||||
final String present = getParam("IsPresent");
|
final String present = getParam("IsPresent");
|
||||||
|
|
||||||
list = CardLists.getValidCards(list, present.split(","), controller, hostCard, this);
|
list = CardLists.getValidCards(list, present, controller, hostCard, this);
|
||||||
|
|
||||||
int right = 1;
|
int right = 1;
|
||||||
final String rightString = compare.substring(2);
|
final String rightString = compare.substring(2);
|
||||||
|
|||||||
@@ -1070,7 +1070,7 @@ public final class StaticAbilityContinuous {
|
|||||||
affectedCardsOriginal = new CardCollection(affectedCards);
|
affectedCardsOriginal = new CardCollection(affectedCards);
|
||||||
}
|
}
|
||||||
|
|
||||||
affectedCards = CardLists.getValidCards(affectedCards, stAb.getParam("Affected").split(","), controller, hostCard, stAb);
|
affectedCards = CardLists.getValidCards(affectedCards, stAb.getParam("Affected"), controller, hostCard, stAb);
|
||||||
|
|
||||||
// Add back all cards that are in other player's graveyard, and meet the restrictions without YouOwn/YouCtrl (treat it as in your graveyard)
|
// Add back all cards that are in other player's graveyard, and meet the restrictions without YouOwn/YouCtrl (treat it as in your graveyard)
|
||||||
if (affectedCardsOriginal != null) {
|
if (affectedCardsOriginal != null) {
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class TriggerAttackersDeclared extends Trigger {
|
|||||||
|
|
||||||
CardCollection attackers = (CardCollection) runParams.get(AbilityKey.Attackers);
|
CardCollection attackers = (CardCollection) runParams.get(AbilityKey.Attackers);
|
||||||
if (hasParam("ValidAttackers")) {
|
if (hasParam("ValidAttackers")) {
|
||||||
attackers = CardLists.getValidCards(attackers, getParam("ValidAttackers").split(","), getHostCard().getController(), getHostCard(), this);
|
attackers = CardLists.getValidCards(attackers, getParam("ValidAttackers"), getHostCard().getController(), getHostCard(), this);
|
||||||
FCollection<GameEntity> defenders = new FCollection<>();
|
FCollection<GameEntity> defenders = new FCollection<>();
|
||||||
for (Card attacker : attackers) {
|
for (Card attacker : attackers) {
|
||||||
defenders.add(attacker.getGame().getCombat().getDefenderByAttacker(attacker));
|
defenders.add(attacker.getGame().getCombat().getDefenderByAttacker(attacker));
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class TriggerDrawn extends Trigger {
|
|||||||
final String sIsPresent = this.getParam("ValidPlayerControls");
|
final String sIsPresent = this.getParam("ValidPlayerControls");
|
||||||
final Player p = ((Player)runParams.get(AbilityKey.Player));
|
final Player p = ((Player)runParams.get(AbilityKey.Player));
|
||||||
CardCollection list = (CardCollection) p.getCardsIn(ZoneType.Battlefield);
|
CardCollection list = (CardCollection) p.getCardsIn(ZoneType.Battlefield);
|
||||||
list = CardLists.getValidCards(list, sIsPresent.split(","), this.getHostCard().getController(),
|
list = CardLists.getValidCards(list, sIsPresent, this.getHostCard().getController(),
|
||||||
this.getHostCard(), this);
|
this.getHostCard(), this);
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class TriggerLifeGained extends Trigger {
|
|||||||
final String sIsPresent = this.getParam("ValidPlayerControls");
|
final String sIsPresent = this.getParam("ValidPlayerControls");
|
||||||
final Player p = ((Player)runParams.get(AbilityKey.Player));
|
final Player p = ((Player)runParams.get(AbilityKey.Player));
|
||||||
CardCollection list = (CardCollection) p.getCardsIn(ZoneType.Battlefield);
|
CardCollection list = (CardCollection) p.getCardsIn(ZoneType.Battlefield);
|
||||||
list = CardLists.getValidCards(list, sIsPresent.split(","), this.getHostCard().getController(),
|
list = CardLists.getValidCards(list, sIsPresent, this.getHostCard().getController(),
|
||||||
this.getHostCard(), this);
|
this.getHostCard(), this);
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user