mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Removed the function isValidCard in favor of isValid in GameEntity.
This commit is contained in:
@@ -4862,29 +4862,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|| ((isCreature() || isTribal())
|
|| ((isCreature() || isTribal())
|
||||||
&& CardUtil.isACreatureType(cardType) && typeContains("AllCreatureTypes"))) return true;
|
&& CardUtil.isACreatureType(cardType) && typeContains("AllCreatureTypes"))) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}//isType
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>isValidCard.</p>
|
|
||||||
* Takes an array of arguments like Permanent.Blue+withFlying, only one of them has to be true
|
|
||||||
*
|
|
||||||
* @param Restrictions an array of {@link java.lang.String} objects.
|
|
||||||
* @param sourceController a {@link forge.Player} object.
|
|
||||||
* @param source a {@link forge.Card} object.
|
|
||||||
* @return a boolean.
|
|
||||||
*/
|
|
||||||
public boolean isValidCard(final String Restrictions[], final Player sourceController, final Card source) {
|
|
||||||
|
|
||||||
if (getName().equals("Mana Pool") || isImmutable()) return false;
|
|
||||||
|
|
||||||
for (int i = 0; i < Restrictions.length; i++) {
|
|
||||||
if (isValid(Restrictions[i], sourceController, source)) return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}//isValidCard
|
|
||||||
|
|
||||||
|
|
||||||
// Takes one argument like Permanent.Blue+withFlying
|
// Takes one argument like Permanent.Blue+withFlying
|
||||||
/**
|
/**
|
||||||
@@ -4920,7 +4898,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
if (hasProperty(exR[j], sourceController, source) == false) return false;
|
if (hasProperty(exR[j], sourceController, source) == false) return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}//isValidCard(String Restriction)
|
}//isValid(String Restriction)
|
||||||
|
|
||||||
// Takes arguments like Blue or withFlying
|
// Takes arguments like Blue or withFlying
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -675,7 +675,7 @@ public class CardList implements Iterable<Card> {
|
|||||||
public final CardList getValidCards(final String[] restrictions, final Player sourceController, final Card source) {
|
public final CardList getValidCards(final String[] restrictions, final Player sourceController, final Card source) {
|
||||||
return this.filter(new CardListFilter() {
|
return this.filter(new CardListFilter() {
|
||||||
public boolean addCard(final Card c) {
|
public boolean addCard(final Card c) {
|
||||||
return c != null && c.isValidCard(restrictions, sourceController, source);
|
return c != null && c.isValid(restrictions, sourceController, source);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -707,7 +707,7 @@ public final class CardUtil {
|
|||||||
}
|
}
|
||||||
for(Card c : AllZoneUtil.getColorInPlay(strCol))
|
for(Card c : AllZoneUtil.getColorInPlay(strCol))
|
||||||
{
|
{
|
||||||
if(!res.contains(c) && c.isValidCard(valid, source.getController(), source) && !c.equals(origin)) {
|
if(!res.contains(c) && c.isValid(valid, source.getController(), source) && !c.equals(origin)) {
|
||||||
res.add(c);
|
res.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ public class CombatUtil {
|
|||||||
String parse = attacker.getKeyword().get(KeywordPosition).toString();
|
String parse = attacker.getKeyword().get(KeywordPosition).toString();
|
||||||
String k[] = parse.split(" ", 2);
|
String k[] = parse.split(" ", 2);
|
||||||
final String restrictions[] = k[1].split(",");
|
final String restrictions[] = k[1].split(",");
|
||||||
if (blocker.isValidCard(restrictions, attacker.getController(), attacker))
|
if (blocker.isValid(restrictions, attacker.getController(), attacker))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -381,7 +381,7 @@ public class CombatUtil {
|
|||||||
String parse = blocker.getKeyword().get(KeywordPosition).toString();
|
String parse = blocker.getKeyword().get(KeywordPosition).toString();
|
||||||
String k[] = parse.split(" ", 2);
|
String k[] = parse.split(" ", 2);
|
||||||
final String restrictions[] = k[1].split(",");
|
final String restrictions[] = k[1].split(",");
|
||||||
if (attacker.isValidCard(restrictions, blocker.getController(), blocker))
|
if (attacker.isValid(restrictions, blocker.getController(), blocker))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1187,8 +1187,8 @@ public class CombatUtil {
|
|||||||
if (abilityParams.containsKey("Defined") && abilityParams.get("Defined").equals("TriggeredAttacker"))
|
if (abilityParams.containsKey("Defined") && abilityParams.get("Defined").equals("TriggeredAttacker"))
|
||||||
list.add(attacker);
|
list.add(attacker);
|
||||||
if (abilityParams.containsKey("ValidCards"))
|
if (abilityParams.containsKey("ValidCards"))
|
||||||
if (attacker.isValidCard(abilityParams.get("ValidCards").split(","), source.getController(), source)
|
if (attacker.isValid(abilityParams.get("ValidCards").split(","), source.getController(), source)
|
||||||
|| attacker.isValidCard(abilityParams.get("ValidCards").replace("attacking+", "").split(",")
|
|| attacker.isValid(abilityParams.get("ValidCards").replace("attacking+", "").split(",")
|
||||||
, source.getController(), source))
|
, source.getController(), source))
|
||||||
list.add(attacker);
|
list.add(attacker);
|
||||||
if (list.isEmpty()) continue;
|
if (list.isEmpty()) continue;
|
||||||
@@ -1265,8 +1265,8 @@ public class CombatUtil {
|
|||||||
if (abilityParams.containsKey("Defined") && abilityParams.get("Defined").equals("TriggeredAttacker"))
|
if (abilityParams.containsKey("Defined") && abilityParams.get("Defined").equals("TriggeredAttacker"))
|
||||||
list.add(attacker);
|
list.add(attacker);
|
||||||
if (abilityParams.containsKey("ValidCards"))
|
if (abilityParams.containsKey("ValidCards"))
|
||||||
if (attacker.isValidCard(abilityParams.get("ValidCards").split(","), source.getController(), source)
|
if (attacker.isValid(abilityParams.get("ValidCards").split(","), source.getController(), source)
|
||||||
|| attacker.isValidCard(abilityParams.get("ValidCards").replace("attacking+", "").split(",")
|
|| attacker.isValid(abilityParams.get("ValidCards").replace("attacking+", "").split(",")
|
||||||
, source.getController(), source))
|
, source.getController(), source))
|
||||||
list.add(attacker);
|
list.add(attacker);
|
||||||
if (list.isEmpty()) continue;
|
if (list.isEmpty()) continue;
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class ComputerAI_General implements Computer {
|
|||||||
if (buffedcard.getSVar("BuffedBy").length() > 0) {
|
if (buffedcard.getSVar("BuffedBy").length() > 0) {
|
||||||
String buffedby = buffedcard.getSVar("BuffedBy");
|
String buffedby = buffedcard.getSVar("BuffedBy");
|
||||||
String[] bffdby = buffedby.split(",");
|
String[] bffdby = buffedby.split(",");
|
||||||
if (c.isValidCard(bffdby, c.getController(), c)) {
|
if (c.isValid(bffdby, c.getController(), c)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ public class ComputerAI_General implements Computer {
|
|||||||
if (buffedcard.getSVar("AntiBuffedBy").length() > 0) {
|
if (buffedcard.getSVar("AntiBuffedBy").length() > 0) {
|
||||||
String buffedby = buffedcard.getSVar("AntiBuffedBy");
|
String buffedby = buffedcard.getSVar("AntiBuffedBy");
|
||||||
String[] bffdby = buffedby.split(",");
|
String[] bffdby = buffedby.split(",");
|
||||||
if (c.isValidCard(bffdby, c.getController(), c)) {
|
if (c.isValid(bffdby, c.getController(), c)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -745,13 +745,13 @@ public class GameAction {
|
|||||||
|
|
||||||
if (entity instanceof Card){
|
if (entity instanceof Card){
|
||||||
Card perm = (Card)entity;
|
Card perm = (Card)entity;
|
||||||
// I think the Keyword checks might be superfluous with the isValidCard check
|
// I think the Keyword checks might be superfluous with the isValid check
|
||||||
if (!AllZoneUtil.isCardInPlay(perm)
|
if (!AllZoneUtil.isCardInPlay(perm)
|
||||||
|| CardFactoryUtil.hasProtectionFrom(c, perm)
|
|| CardFactoryUtil.hasProtectionFrom(c, perm)
|
||||||
|| ((c.hasKeyword("Enchant creature") || c.hasKeyword("Enchant tapped creature"))
|
|| ((c.hasKeyword("Enchant creature") || c.hasKeyword("Enchant tapped creature"))
|
||||||
&& !perm.isCreature())
|
&& !perm.isCreature())
|
||||||
|| (c.hasKeyword("Enchant tapped creature") && perm.isUntapped())
|
|| (c.hasKeyword("Enchant tapped creature") && perm.isUntapped())
|
||||||
|| (tgt != null && !perm.isValidCard(tgt.getValidTgts(), c.getController(), c))){
|
|| (tgt != null && !perm.isValid(tgt.getValidTgts(), c.getController(), c))){
|
||||||
c.unEnchantEntity(perm);
|
c.unEnchantEntity(perm);
|
||||||
moveToGraveyard(c);
|
moveToGraveyard(c);
|
||||||
checkAgain = true;
|
checkAgain = true;
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ public abstract class GameEntity extends MyObservable {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}//isValidCard
|
}//isValid
|
||||||
|
|
||||||
public boolean isValid(final String Restriction, final Player sourceController, final Card source) {
|
public boolean isValid(final String Restriction, final Player sourceController, final Card source) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ public class PhaseUtil {
|
|||||||
String k[] = parse.split(":");
|
String k[] = parse.split(":");
|
||||||
final String restrictions[] = k[1].split(",");
|
final String restrictions[] = k[1].split(",");
|
||||||
final Card card = ca;
|
final Card card = ca;
|
||||||
if (c.isValidCard(restrictions, card.getController(), card)) return false;
|
if (c.isValid(restrictions, card.getController(), card)) return false;
|
||||||
}
|
}
|
||||||
} // end of Permanents don't untap during their controllers' untap steps
|
} // end of Permanents don't untap during their controllers' untap steps
|
||||||
|
|
||||||
|
|||||||
@@ -900,7 +900,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -980,7 +980,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1075,7 +1075,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1169,7 +1169,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1260,7 +1260,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1347,7 +1347,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1433,7 +1433,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1518,7 +1518,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1597,7 +1597,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1675,7 +1675,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1773,7 +1773,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
@@ -1851,7 +1851,7 @@ public class Upkeep implements java.io.Serializable {
|
|||||||
// We do not want to slow down the pace of the game by asking too many questions.
|
// We do not want to slow down the pace of the game by asking too many questions.
|
||||||
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
// Dialogs outside of the Ability appear at the previous end of turn phase !!!
|
||||||
|
|
||||||
if (peek[0].isValidCard(shareTypes, k.getController(), k)) {
|
if (peek[0].isValid(shareTypes, k.getController(), k)) {
|
||||||
if (player.isHuman()) {
|
if (player.isHuman()) {
|
||||||
StringBuilder question = new StringBuilder();
|
StringBuilder question = new StringBuilder();
|
||||||
question.append("Your top card is ").append(peek[0].getName());
|
question.append("Your top card is ").append(peek[0].getName());
|
||||||
|
|||||||
@@ -2326,7 +2326,7 @@ public class CardFactoryUtil {
|
|||||||
// Reconfirm the Validity of a TgtValid, or if the Creature is still
|
// Reconfirm the Validity of a TgtValid, or if the Creature is still
|
||||||
// a Creature
|
// a Creature
|
||||||
if (tgt.doesTarget()
|
if (tgt.doesTarget()
|
||||||
&& !target.isValidCard(tgt.getValidTgts(), ability.getActivatingPlayer(), ability.getSourceCard()))
|
&& !target.isValid(tgt.getValidTgts(), ability.getActivatingPlayer(), ability.getSourceCard()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -2551,10 +2551,10 @@ public class CardFactoryUtil {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kw.startsWith("Protection:")) { // uses isValidCard
|
if (kw.startsWith("Protection:")) { // uses isValid
|
||||||
String characteristic = kw.split(":")[1];
|
String characteristic = kw.split(":")[1];
|
||||||
String[] characteristics = characteristic.split(",");
|
String[] characteristics = characteristic.split(",");
|
||||||
if (card.isValidCard(characteristics, card.getController(), card)) {
|
if (card.isValid(characteristics, card.getController(), card)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3102,7 +3102,7 @@ public class CardFactoryUtil {
|
|||||||
|
|
||||||
cl = cl.filter(new CardListFilter() {
|
cl = cl.filter(new CardListFilter() {
|
||||||
public boolean addCard(final Card cdev) {
|
public boolean addCard(final Card cdev) {
|
||||||
return cdev.isValidCard(validDevoured.split(","), csource.getController(), csource);
|
return cdev.isValid(validDevoured.split(","), csource.getController(), csource);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -3750,7 +3750,7 @@ public class CardFactoryUtil {
|
|||||||
String[] k = parse.split(":");
|
String[] k = parse.split(":");
|
||||||
|
|
||||||
String[] restrictions = k[1].split(",");
|
String[] restrictions = k[1].split(",");
|
||||||
if (!c.isValidCard(restrictions, card.getController(), card)) {
|
if (!c.isValid(restrictions, card.getController(), card)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ public class Target {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Card c : AllZoneUtil.getCardsIn(tgtZone)){
|
for (Card c : AllZoneUtil.getCardsIn(tgtZone)){
|
||||||
if (c.isValidCard(ValidTgts, srcCard.getController(), srcCard) && (!isTargeted || CardFactoryUtil.canTarget(srcCard, c))) {
|
if (c.isValid(ValidTgts, srcCard.getController(), srcCard) && (!isTargeted || CardFactoryUtil.canTarget(srcCard, c))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -465,7 +465,7 @@ public class Target_Selection {
|
|||||||
Player activatingPlayer = sa.getActivatingPlayer();
|
Player activatingPlayer = sa.getActivatingPlayer();
|
||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
Card c = (Card) o;
|
Card c = (Card) o;
|
||||||
return c.isValidCard(valids, activatingPlayer, srcCard);
|
return c.isValid(valids, activatingPlayer, srcCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o instanceof Player) {
|
if (o instanceof Player) {
|
||||||
@@ -485,7 +485,7 @@ public class Target_Selection {
|
|||||||
|
|
||||||
if (o instanceof SpellAbility) {
|
if (o instanceof SpellAbility) {
|
||||||
Card c = ((SpellAbility) o).getSourceCard();
|
Card c = ((SpellAbility) o).getSourceCard();
|
||||||
return c.isValidCard(valids, activatingPlayer, srcCard);
|
return c.isValid(valids, activatingPlayer, srcCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ public class StaticAbility {
|
|||||||
|
|
||||||
if (mapParams.containsKey("TopCardOfLibraryIs")) {
|
if (mapParams.containsKey("TopCardOfLibraryIs")) {
|
||||||
Card topCard = controller.getCardsIn(Zone.Library).get(0);
|
Card topCard = controller.getCardsIn(Zone.Library).get(0);
|
||||||
if (!topCard.isValidCard(mapParams.get("TopCardOfLibraryIs").split(","), controller, hostCard))
|
if (!topCard.isValid(mapParams.get("TopCardOfLibraryIs").split(","), controller, hostCard))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ public abstract class Trigger {
|
|||||||
public boolean matchesValid(Object o, String[] valids, Card srcCard) {
|
public boolean matchesValid(Object o, String[] valids, Card srcCard) {
|
||||||
if (o instanceof Card) {
|
if (o instanceof Card) {
|
||||||
Card c = (Card) o;
|
Card c = (Card) o;
|
||||||
return c.isValidCard(valids, srcCard.getController(), srcCard);
|
return c.isValid(valids, srcCard.getController(), srcCard);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o instanceof Player) {
|
if (o instanceof Player) {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class Trigger_Championed extends Trigger {
|
|||||||
Card championed = (Card) runParams2.get("Championed");
|
Card championed = (Card) runParams2.get("Championed");
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!championed.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!championed.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class Trigger_ChangesZone extends Trigger {
|
|||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
Card moved = (Card) runParams2.get("Card");
|
Card moved = (Card) runParams2.get("Card");
|
||||||
if (!moved.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!moved.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class Trigger_CounterAdded extends Trigger {
|
|||||||
Counters addedType = (Counters) runParams2.get("CounterType");
|
Counters addedType = (Counters) runParams2.get("CounterType");
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!addedTo.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!addedTo.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class Trigger_DamageDone extends Trigger {
|
|||||||
Object tgt = runParams2.get("DamageTarget");
|
Object tgt = runParams2.get("DamageTarget");
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidSource")) {
|
if (mapParams.containsKey("ValidSource")) {
|
||||||
if (!src.isValidCard(mapParams.get("ValidSource").split(","), hostCard.getController(), hostCard)) {
|
if (!src.isValid(mapParams.get("ValidSource").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class Trigger_Drawn extends Trigger {
|
|||||||
Card draw = ((Card) runParams2.get("Card"));
|
Card draw = ((Card) runParams2.get("Card"));
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!draw.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!draw.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class Trigger_Sacrificed extends Trigger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!sac.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!sac.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class Trigger_SpellAbilityCast extends Trigger {
|
|||||||
if (sa.getTarget().doesTarget()) {
|
if (sa.getTarget().doesTarget()) {
|
||||||
boolean validTgtFound = false;
|
boolean validTgtFound = false;
|
||||||
for (Card tgt : sa.getTarget().getTargetCards()) {
|
for (Card tgt : sa.getTarget().getTargetCards()) {
|
||||||
if (tgt.isValidCard(mapParams.get("TargetsValid").split(","), hostCard.getController(), hostCard)) {
|
if (tgt.isValid(mapParams.get("TargetsValid").split(","), hostCard.getController(), hostCard)) {
|
||||||
validTgtFound = true;
|
validTgtFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class Trigger_Taps extends Trigger {
|
|||||||
Card tapper = (Card) runParams2.get("Card");
|
Card tapper = (Card) runParams2.get("Card");
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!tapper.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!tapper.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class Trigger_TapsForMana extends Trigger {
|
|||||||
Card tapper = (Card) runParams2.get("Card");
|
Card tapper = (Card) runParams2.get("Card");
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!tapper.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!tapper.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ public class Trigger_Unequip extends Trigger {
|
|||||||
Card equipment = (Card) runParams2.get("Equipment");
|
Card equipment = (Card) runParams2.get("Equipment");
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!equipped.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!equipped.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidEquipment")) {
|
if (mapParams.containsKey("ValidEquipment")) {
|
||||||
if (!equipment.isValidCard(mapParams.get("ValidEquipment").split(","), hostCard.getController(), hostCard)) {
|
if (!equipment.isValid(mapParams.get("ValidEquipment").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class Trigger_Untaps extends Trigger {
|
|||||||
Card untapper = (Card) runParams2.get("Card");
|
Card untapper = (Card) runParams2.get("Card");
|
||||||
|
|
||||||
if (mapParams.containsKey("ValidCard")) {
|
if (mapParams.containsKey("ValidCard")) {
|
||||||
if (!untapper.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
if (!untapper.isValid(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user