Fixed adding wastes in colourless decks

This commit is contained in:
austinio7116
2018-02-28 15:14:41 +00:00
committed by maustin
parent d4b09f39ad
commit ed4583ee7a

View File

@@ -59,8 +59,8 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
protected Iterable<PaperCard> onColorNonCreatures; protected Iterable<PaperCard> onColorNonCreatures;
protected Iterable<PaperCard> keyCards; protected Iterable<PaperCard> keyCards;
protected static final boolean logToConsole = false; protected static final boolean logToConsole = true;
protected static final boolean logColorsToConsole = false; protected static final boolean logColorsToConsole = true;
public CardThemedDeckBuilder(IDeckGenPool pool, DeckFormat format){ public CardThemedDeckBuilder(IDeckGenPool pool, DeckFormat format){
@@ -614,9 +614,8 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
* Only adds wastes if present in the card pool but if present adds them all * Only adds wastes if present in the card pool but if present adds them all
*/ */
private void addWastesIfRequired(){ private void addWastesIfRequired(){
Iterable<PaperCard> wastes = Iterables.filter(aiPlayables,PaperCard.Predicates.name("Wastes")); if(colors.isColorless()) {
if(wastes.iterator().hasNext()){ PaperCard waste = FModel.getMagicDb().getCommonCards().getUniqueByName("Wastes");
PaperCard waste = wastes.iterator().next();
while (landsNeeded > 0) { while (landsNeeded > 0) {
deckList.add(waste); deckList.add(waste);
landsNeeded--; landsNeeded--;
@@ -662,7 +661,9 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
Predicates.compose(CardRulesPredicates.Presets.IS_NONBASIC_LAND, PaperCard.FN_GET_RULES)); Predicates.compose(CardRulesPredicates.Presets.IS_NONBASIC_LAND, PaperCard.FN_GET_RULES));
List<PaperCard> landsToAdd = new ArrayList<>(); List<PaperCard> landsToAdd = new ArrayList<>();
int minBasics;//Keep a minimum number of basics to ensure playable decks int minBasics;//Keep a minimum number of basics to ensure playable decks
if(colors.isMonoColor()){ if(colors.isColorless()){
minBasics=0;
}else if(colors.isMonoColor()){
minBasics=Math.round((r.nextInt(15)+9)*((float) targetSize) / 60); minBasics=Math.round((r.nextInt(15)+9)*((float) targetSize) / 60);
}else{ }else{
minBasics=Math.round((r.nextInt(8)+6)*((float) targetSize) / 60); minBasics=Math.round((r.nextInt(8)+6)*((float) targetSize) / 60);