mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Moved input_targetValid code into CardFactoryUtil
This commit is contained in:
@@ -172,7 +172,6 @@ public class CardFactory implements NewConstants {
|
|||||||
ArrayList<String> a = c.getIntrinsicKeyword();
|
ArrayList<String> a = c.getIntrinsicKeyword();
|
||||||
for(int i = 0; i < a.size(); i++)
|
for(int i = 0; i < a.size(); i++)
|
||||||
if(a.get(i).toString().contains(": add ")) return i;
|
if(a.get(i).toString().contains(": add ")) return i;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2434,7 +2433,8 @@ public class CardFactory implements NewConstants {
|
|||||||
}
|
}
|
||||||
}; //SpDstryTgt
|
}; //SpDstryTgt
|
||||||
|
|
||||||
Input InGetTarget = new Input() {
|
Input InGetTarget = CardFactoryUtil.input_targetValid(spDstryTgt, Tgts, Selec);
|
||||||
|
/*new Input() {
|
||||||
private static final long serialVersionUID = -142142142142L;
|
private static final long serialVersionUID = -142142142142L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -2442,18 +2442,18 @@ public class CardFactory implements NewConstants {
|
|||||||
CardList allCards = new CardList();
|
CardList allCards = new CardList();
|
||||||
allCards.addAll(AllZone.Human_Play.getCards());
|
allCards.addAll(AllZone.Human_Play.getCards());
|
||||||
allCards.addAll(AllZone.Computer_Play.getCards());
|
allCards.addAll(AllZone.Computer_Play.getCards());
|
||||||
allCards.filter(new CardListFilter() {
|
/ *allCards.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return (CardFactoryUtil.canTarget(card, c));
|
return (CardFactoryUtil.canTarget(card, c));
|
||||||
}
|
}
|
||||||
});
|
});* ///Input_targetSpecific already checks for this
|
||||||
|
|
||||||
CardList choices = allCards.getValidCards(Tgts);
|
CardList choices = allCards.getValidCards(Tgts);
|
||||||
boolean free = false;
|
boolean free = false;
|
||||||
if(this.isFree()) free = true;
|
if(this.isFree()) free = true;
|
||||||
stopSetNext(CardFactoryUtil.input_targetSpecific(spDstryTgt, choices, Selec, true, free));
|
stopSetNext(CardFactoryUtil.input_targetSpecific(spDstryTgt, choices, Selec, true, free));
|
||||||
}
|
}
|
||||||
};//InGetTarget
|
};*///InGetTarget
|
||||||
|
|
||||||
//card.clearSpellAbility();
|
//card.clearSpellAbility();
|
||||||
spDstryTgt.setBeforePayMana(InGetTarget);
|
spDstryTgt.setBeforePayMana(InGetTarget);
|
||||||
|
|||||||
@@ -1471,6 +1471,24 @@ public class CardFactoryUtil {
|
|||||||
return desc;
|
return desc;
|
||||||
}//soul_desc()
|
}//soul_desc()
|
||||||
|
|
||||||
|
public static Input input_targetValid(final SpellAbility sa, final String[] Tgts, final String message)
|
||||||
|
{
|
||||||
|
return new Input() {
|
||||||
|
private static final long serialVersionUID = -142142142142L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showMessage() {
|
||||||
|
CardList allCards = new CardList();
|
||||||
|
allCards.addAll(AllZone.Human_Play.getCards());
|
||||||
|
allCards.addAll(AllZone.Computer_Play.getCards());
|
||||||
|
|
||||||
|
CardList choices = allCards.getValidCards(Tgts);
|
||||||
|
boolean free = false;
|
||||||
|
if(this.isFree()) free = true;
|
||||||
|
stopSetNext(CardFactoryUtil.input_targetSpecific(sa, choices, message, true, free));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}//input_targetValid
|
||||||
//CardList choices are the only cards the user can successful select
|
//CardList choices are the only cards the user can successful select
|
||||||
public static Input input_targetSpecific(final SpellAbility spell, final CardList choices, final String message, final boolean targeted, final boolean free) {
|
public static Input input_targetSpecific(final SpellAbility spell, final CardList choices, final String message, final boolean targeted, final boolean free) {
|
||||||
return input_targetSpecific(spell, choices, message, Command.Blank, targeted, free);
|
return input_targetSpecific(spell, choices, message, Command.Blank, targeted, free);
|
||||||
|
|||||||
Reference in New Issue
Block a user