mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
updated M19 to use taplands in addition to basics in the land slot (closes #5072)
This commit is contained in:
parent
c597546718
commit
a3fb80d45c
1 changed files with 45 additions and 1 deletions
|
@ -1,6 +1,12 @@
|
|||
package mage.sets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SetType;
|
||||
|
||||
|
@ -15,12 +21,14 @@ public final class CoreSet2019 extends ExpansionSet {
|
|||
public static CoreSet2019 getInstance() {
|
||||
return instance;
|
||||
}
|
||||
List<CardInfo> savedSpecialCommon = new ArrayList<>();
|
||||
|
||||
private CoreSet2019() {
|
||||
super("Core Set 2019", "M19", ExpansionSet.buildDate(2018, 7, 13), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.hasBasicLands = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterSpecial = 1;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
|
@ -343,4 +351,40 @@ public final class CoreSet2019 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Windreader Sphinx", 84, Rarity.RARE, mage.cards.w.WindreaderSphinx.class));
|
||||
cards.add(new SetCardInfo("Woodland Stream", 260, Rarity.COMMON, mage.cards.w.WoodlandStream.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardInfo> getCardsByRarity(Rarity rarity) {
|
||||
// Common cards retrievement of Fate Reforged boosters - prevent the retrievement of the common lands (e.g. Blossoming Sands)
|
||||
if (rarity == Rarity.COMMON) {
|
||||
List<CardInfo> savedCardsInfos = savedCards.get(rarity);
|
||||
if (savedCardsInfos == null) {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.rarities(Rarity.COMMON);
|
||||
criteria.setCodes(this.code).notTypes(CardType.LAND);
|
||||
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
|
||||
criteria.maxCardNumber(maxCardNumberInBooster);
|
||||
}
|
||||
savedCardsInfos = CardRepository.instance.findCards(criteria);
|
||||
savedCards.put(rarity, savedCardsInfos);
|
||||
}
|
||||
// Return a copy of the saved cards information, as not to let modify the original.
|
||||
return new ArrayList<>(savedCardsInfos);
|
||||
} else {
|
||||
return super.getCardsByRarity(rarity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardInfo> getSpecialCommon() {
|
||||
List<CardInfo> specialCommons = new ArrayList<>();
|
||||
if (savedSpecialCommon.isEmpty()) {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.rarities(Rarity.COMMON).setCodes(this.code).types(CardType.LAND);
|
||||
savedSpecialCommon = CardRepository.instance.findCards(criteria);
|
||||
criteria.rarities(Rarity.LAND).setCodes(this.code);
|
||||
savedSpecialCommon.addAll(CardRepository.instance.findCards(criteria));
|
||||
}
|
||||
specialCommons.addAll(savedSpecialCommon);
|
||||
return specialCommons;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue