* Added rough Vintage Masters bonus card booster generation.

This commit is contained in:
LevelX2 2014-06-25 12:29:32 +02:00
parent 6c6d12f40f
commit abc441a4ba
3 changed files with 69 additions and 4 deletions

View file

@ -84,7 +84,7 @@ public class DragonsMaze extends ExpansionSet {
@Override
public List<CardInfo> getSpecialRare() {
List<CardInfo> specialRare = new ArrayList<CardInfo>();
List<CardInfo> specialRare = new ArrayList<>();
CardCriteria criteria = new CardCriteria();
criteria.setCodes("GTC").name("Breeding Pool");
specialRare.addAll(CardRepository.instance.findCards(criteria));

View file

@ -28,8 +28,15 @@
package mage.sets;
import java.util.ArrayList;
import java.util.GregorianCalendar;
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;
@ -50,11 +57,47 @@ public class VintageMasters extends ExpansionSet {
super("Vintage Masters", "VMA", "mage.sets.vintagemasters", new GregorianCalendar(2014, 6, 16).getTime(), SetType.REPRINT);
this.hasBasicLands = false;
this.hasBoosters = true;
this.numBoosterSpecial = 1;
this.numBoosterLands = 0;
this.numBoosterCommon = 11;
this.numBoosterCommon = 10;
this.numBoosterUncommon = 3;
this.numBoosterRare = 1;
this.ratioBoosterMythic = 8;
}
@Override
public List<CardInfo> getSpecialCommon() {
CardCriteria criteria = new CardCriteria();
criteria.rarities(Rarity.COMMON).setCodes(this.code);
return CardRepository.instance.findCards(criteria);
}
@Override
public List<CardInfo> getSpecialUncommon() {
CardCriteria criteria = new CardCriteria();
criteria.rarities(Rarity.UNCOMMON).setCodes(this.code);
return CardRepository.instance.findCards(criteria);
}
@Override
public List<CardInfo> getSpecialRare() {
CardCriteria criteria = new CardCriteria();
criteria.rarities(Rarity.RARE).setCodes(this.code);
return CardRepository.instance.findCards(criteria);
}
@Override
public List<CardInfo> getSpecialMythic() {
CardCriteria criteria = new CardCriteria();
criteria.rarities(Rarity.MYTHIC).setCodes(this.code);
return CardRepository.instance.findCards(criteria);
}
@Override
public List<CardInfo> getSpecialBonus() {
CardCriteria criteria = new CardCriteria();
criteria.rarities(Rarity.BONUS).setCodes(this.code);
return CardRepository.instance.findCards(criteria);
}
}

View file

@ -155,6 +155,10 @@ public abstract class ExpansionSet implements Serializable {
if (numBoosterSpecial > 0) {
int specialCards = 0;
List<CardInfo> specialBonus = getSpecialBonus();
if (specialBonus != null) {
specialCards += specialBonus.size();
}
List<CardInfo> specialMythic = getSpecialMythic();
if (specialMythic != null) {
specialCards += specialMythic.size();
@ -181,7 +185,7 @@ public abstract class ExpansionSet implements Serializable {
}
continue;
}
if (rnd.nextInt(5) < 4) {
if (rnd.nextInt(4) < 3) {
if (specialUncommon != null) {
addToBooster(booster, specialUncommon);
} else {
@ -198,10 +202,21 @@ public abstract class ExpansionSet implements Serializable {
continue;
}
if (specialMythic != null) {
addToBooster(booster, specialMythic);
if (specialBonus != null) {
if (rnd.nextInt(3) < 2) {
addToBooster(booster, specialMythic);
continue;
}
} else {
addToBooster(booster, specialMythic);
continue;
}
} else {
i--;
}
if (specialBonus != null) {
addToBooster(booster, specialBonus);
}
}
}
}
@ -259,13 +274,20 @@ public abstract class ExpansionSet implements Serializable {
public List<CardInfo> getSpecialCommon() {
return null;
}
public List<CardInfo> getSpecialUncommon() {
return null;
}
public List<CardInfo> getSpecialRare() {
return null;
}
public List<CardInfo> getSpecialMythic() {
return null;
}
public List<CardInfo> getSpecialBonus() {
return null;
}
}