mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
nonLandNames support. updated Conundrum Sphinx
This commit is contained in:
parent
6238e2dfa1
commit
41546cf7d3
2 changed files with 7 additions and 1 deletions
|
@ -54,6 +54,7 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
private final static Logger logger = Logger.getLogger(Sets.class);
|
||||
private static final Sets fINSTANCE = new Sets();
|
||||
private static Set<String> names;
|
||||
private static Set<String> nonLandNames;
|
||||
private static List<Card> cards;
|
||||
protected static Random rnd = new Random();
|
||||
|
||||
|
@ -63,6 +64,7 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
|
||||
private Sets() {
|
||||
names = new TreeSet<String>();
|
||||
nonLandNames = new TreeSet<String>();
|
||||
cards = new ArrayList<Card>();
|
||||
this.addSet(AlaraReborn.getInstance());
|
||||
this.addSet(Apocalypse.getInstance());
|
||||
|
@ -95,6 +97,7 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
for (Card card: set.getCards()) {
|
||||
cards.add(card);
|
||||
names.add(card.getName());
|
||||
if (!card.getCardType().contains(CardType.LAND)) nonLandNames.add(card.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,6 +105,10 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
return names;
|
||||
}
|
||||
|
||||
public static Set<String> getNonLandCardNames() {
|
||||
return nonLandNames;
|
||||
}
|
||||
|
||||
public static Card getRandomCard() {
|
||||
return cards.get(rnd.nextInt(cards.size()));
|
||||
}
|
||||
|
|
|
@ -90,7 +90,6 @@ class ConundrumSphinxEffect extends OneShotEffect<ConundrumSphinxEffect> {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Set<String> cardNames = Sets.getCardNames();
|
||||
Choice cardChoice = new ChoiceImpl();
|
||||
cardChoice.setChoices(Sets.getCardNames());
|
||||
for (Player player: game.getPlayers().values()) {
|
||||
|
|
Loading…
Reference in a new issue