mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixed that no Zendikar Expeditions lands were added to Battle for Zendikar boosters. I replaced every 20th basic land now by one random land of Zendikar Expeditions.
This commit is contained in:
parent
ed15f0b86b
commit
e94163a4c3
2 changed files with 35 additions and 3 deletions
|
@ -25,18 +25,21 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.sets;
|
package mage.sets;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.List;
|
||||||
import mage.cards.ExpansionSet;
|
import mage.cards.ExpansionSet;
|
||||||
|
import mage.cards.repository.CardCriteria;
|
||||||
|
import mage.cards.repository.CardInfo;
|
||||||
|
import mage.cards.repository.CardRepository;
|
||||||
import mage.constants.SetType;
|
import mage.constants.SetType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author fireshoes
|
* @author fireshoes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class BattleForZendikar extends ExpansionSet {
|
public class BattleForZendikar extends ExpansionSet {
|
||||||
|
|
||||||
private static final BattleForZendikar fINSTANCE = new BattleForZendikar();
|
private static final BattleForZendikar fINSTANCE = new BattleForZendikar();
|
||||||
|
@ -45,16 +48,33 @@ public class BattleForZendikar extends ExpansionSet {
|
||||||
return fINSTANCE;
|
return fINSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<CardInfo> savedSpecialLand = new ArrayList<>();
|
||||||
|
|
||||||
private BattleForZendikar() {
|
private BattleForZendikar() {
|
||||||
super("Battle for Zendikar", "BFZ", "mage.sets.battleforzendikar", new GregorianCalendar(2015, 10, 2).getTime(), SetType.EXPANSION);
|
super("Battle for Zendikar", "BFZ", "mage.sets.battleforzendikar", new GregorianCalendar(2015, 10, 2).getTime(), SetType.EXPANSION);
|
||||||
this.blockName = "Battle for Zendikar";
|
this.blockName = "Battle for Zendikar";
|
||||||
this.hasBoosters = true;
|
this.hasBoosters = true;
|
||||||
this.hasBasicLands = true;
|
this.hasBasicLands = true;
|
||||||
this.numBoosterLands = 1;
|
this.numBoosterLands = 1;
|
||||||
|
this.ratioBoosterSpecialLand = 20; // Approximately as rare as opening a foil mythic = 8 * 6 = ~every 48th booster includes one
|
||||||
|
// I set it to 20 to get it more often
|
||||||
this.numBoosterCommon = 10;
|
this.numBoosterCommon = 10;
|
||||||
this.numBoosterUncommon = 3;
|
this.numBoosterUncommon = 3;
|
||||||
this.numBoosterRare = 1;
|
this.numBoosterRare = 1;
|
||||||
this.ratioBoosterMythic = 8;
|
this.ratioBoosterMythic = 8;
|
||||||
|
this.numBoosterSpecial = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CardInfo> getSpecialLand() {
|
||||||
|
List<CardInfo> specialLand = new ArrayList<>();
|
||||||
|
if (savedSpecialLand.isEmpty()) {
|
||||||
|
CardCriteria criteria = new CardCriteria();
|
||||||
|
criteria.setCodes("EXP");
|
||||||
|
specialLand.addAll(CardRepository.instance.findCards(criteria));
|
||||||
|
}
|
||||||
|
|
||||||
|
specialLand.addAll(savedSpecialLand);
|
||||||
|
return specialLand;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,10 @@ public abstract class ExpansionSet implements Serializable {
|
||||||
protected String blockName;
|
protected String blockName;
|
||||||
protected boolean hasBoosters = false;
|
protected boolean hasBoosters = false;
|
||||||
protected int numBoosterSpecial;
|
protected int numBoosterSpecial;
|
||||||
|
|
||||||
protected int numBoosterLands;
|
protected int numBoosterLands;
|
||||||
|
protected int ratioBoosterSpecialLand = 0; // if > 0 basic lands are replaced with speical land in the ratio every X land is replaced by special land
|
||||||
|
|
||||||
protected int numBoosterCommon;
|
protected int numBoosterCommon;
|
||||||
protected int numBoosterUncommon;
|
protected int numBoosterUncommon;
|
||||||
protected int numBoosterRare;
|
protected int numBoosterRare;
|
||||||
|
@ -150,9 +153,14 @@ public abstract class ExpansionSet implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numBoosterLands > 0) {
|
if (numBoosterLands > 0) {
|
||||||
|
List<CardInfo> specialLands = getSpecialLand();
|
||||||
List<CardInfo> basicLands = getCardsByRarity(Rarity.LAND);
|
List<CardInfo> basicLands = getCardsByRarity(Rarity.LAND);
|
||||||
for (int i = 0; i < numBoosterLands; i++) {
|
for (int i = 0; i < numBoosterLands; i++) {
|
||||||
addToBooster(booster, basicLands);
|
if (ratioBoosterSpecialLand > 0 && rnd.nextInt(ratioBoosterSpecialLand) == 1 && specialLands != null) {
|
||||||
|
addToBooster(booster, specialLands);
|
||||||
|
} else {
|
||||||
|
addToBooster(booster, basicLands);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<CardInfo> commons = getCardsByRarity(Rarity.COMMON);
|
List<CardInfo> commons = getCardsByRarity(Rarity.COMMON);
|
||||||
|
@ -320,6 +328,10 @@ public abstract class ExpansionSet implements Serializable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<CardInfo> getSpecialLand() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public void removeSavedCards() {
|
public void removeSavedCards() {
|
||||||
savedCards.clear();
|
savedCards.clear();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue