diff --git a/Mage.Sets/src/mage/sets/ModernMasters.java b/Mage.Sets/src/mage/sets/ModernMasters.java index 5ffbcb44d1..72fe20786a 100644 --- a/Mage.Sets/src/mage/sets/ModernMasters.java +++ b/Mage.Sets/src/mage/sets/ModernMasters.java @@ -46,6 +46,7 @@ public class ModernMasters extends ExpansionSet { private ModernMasters() { super("Modern Masters", "MMA", "", "mage.sets.modernmasters", new GregorianCalendar(2016, 6, 7).getTime(), SetType.REPRINT); + this.hasBasicLands = false; this.hasBoosters = true; this.numBoosterLands = 0; this.numBoosterCommon = 11; diff --git a/Mage/src/mage/cards/Sets.java b/Mage/src/mage/cards/Sets.java index aea33d0be3..9566f233da 100644 --- a/Mage/src/mage/cards/Sets.java +++ b/Mage/src/mage/cards/Sets.java @@ -215,6 +215,27 @@ public class Sets extends HashMap { } } } + if (landSets.isEmpty()) { + // if set has no lands and also it has no parent or parent has no lands get last set with lands + // select a set with basic lands by random + Random generator = new Random(); + int maxRndValue = 0; + String selectedSetCode = null; + for (ExpansionSet set :Sets.getInstance().getSortedByReleaseDate()) { + if (set.hasBasicLands) { + int rndValue = generator.nextInt(100); + if (rndValue >= maxRndValue) { + maxRndValue = rndValue; + selectedSetCode = set.getCode(); + } + } + } + if (selectedSetCode != null) { + landSets.add(selectedSetCode); + } else { + throw new IllegalArgumentException("No set with basic land was found"); + } + } return landSets; }