mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Changed bosster generation to generate special land card that's in dragon's maze booster.
This commit is contained in:
parent
83554081c7
commit
a157849e16
2 changed files with 142 additions and 4 deletions
|
|
@ -28,9 +28,16 @@
|
|||
|
||||
package mage.sets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -50,7 +57,8 @@ public class DragonsMaze extends ExpansionSet {
|
|||
super("Dragon's Maze", "DGM", "seticon_mtggtc", "mage.sets.dragonsmaze", new GregorianCalendar(2013, 5, 03).getTime(), Constants.SetType.EXPANSION);
|
||||
this.blockName = "Return to Ravnica";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterSpecial = 1;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
|
|
@ -58,4 +66,63 @@ public class DragonsMaze extends ExpansionSet {
|
|||
this.parentSet = ReturnToRavnica.getInstance();
|
||||
this.hasBasicLands = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardInfo> getCommon() {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.setCodes(this.code).rarities(Rarity.COMMON).notTypes(CardType.LAND).doubleFaced(false);
|
||||
return CardRepository.instance.findCards(criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardInfo> getSpecialCommon() {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.rarities(Rarity.COMMON).setCodes(this.code).types(CardType.LAND);
|
||||
return CardRepository.instance.findCards(criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardInfo> getSpecialRare() {
|
||||
List<CardInfo> specialRare = new ArrayList<CardInfo>();
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.setCodes("GTC").name("Breeding Pool");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("GTC").name("Godless Shrine");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("GTC").name("Sacred Foundry");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("GTC").name("Stomping Ground");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("GTC").name("Watery Grave");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("RTR").name("Blood Crypt");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("RTR").name("Hallowed Fountain");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("RTR").name("Overgrown Tomb");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("RTR").name("Steam Vents");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes("RTR").name("Temple Garden");
|
||||
specialRare.addAll(CardRepository.instance.findCards(criteria));
|
||||
return specialRare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CardInfo> getSpecialMythic() {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.rarities(Rarity.MYTHIC).setCodes(this.code).types(Constants.CardType.LAND);
|
||||
return CardRepository.instance.findCards(criteria);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ public abstract class ExpansionSet implements Serializable {
|
|||
|
||||
protected String blockName;
|
||||
protected boolean hasBoosters = false;
|
||||
protected int numBoosterSpecial;
|
||||
protected int numBoosterLands;
|
||||
protected int numBoosterCommon;
|
||||
protected int numBoosterUncommon;
|
||||
|
|
@ -120,9 +121,7 @@ public abstract class ExpansionSet implements Serializable {
|
|||
criteria.setCodes(!hasBasicLands && parentSet != null ? parentSet.code : this.code).rarities(Rarity.LAND).doubleFaced(false);
|
||||
List<CardInfo> basicLand = CardRepository.instance.findCards(criteria);
|
||||
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes(this.code).rarities(Rarity.COMMON).doubleFaced(false);
|
||||
List<CardInfo> common = CardRepository.instance.findCards(criteria);
|
||||
List<CardInfo> common = getCommon();
|
||||
|
||||
criteria = new CardCriteria();
|
||||
criteria.setCodes(this.code).rarities(Rarity.UNCOMMON).doubleFaced(false);
|
||||
|
|
@ -160,6 +159,60 @@ public abstract class ExpansionSet implements Serializable {
|
|||
addToBooster(booster, doubleFaced);
|
||||
}
|
||||
|
||||
if (numBoosterSpecial > 0) {
|
||||
int specialCards = 0;
|
||||
Random randomno = new Random();
|
||||
List<CardInfo> specialMythic = getSpecialMythic();
|
||||
if (specialMythic != null) {
|
||||
specialCards += specialMythic.size();
|
||||
}
|
||||
List<CardInfo> specialRare = getSpecialRare();
|
||||
if (specialRare != null) {
|
||||
specialCards += specialRare.size();
|
||||
}
|
||||
List<CardInfo> specialUncommon = getSpecialUncommon();
|
||||
if (specialUncommon != null) {
|
||||
specialCards += specialUncommon.size();
|
||||
}
|
||||
List<CardInfo> specialCommon = getSpecialCommon();
|
||||
if (specialCommon != null) {
|
||||
specialCards += specialCommon.size();
|
||||
}
|
||||
if (specialCards > 0) {
|
||||
for (int i = 0; i < numBoosterSpecial; i++) {
|
||||
if (randomno.nextInt(15) < 10) {
|
||||
if (specialCommon != null) {
|
||||
addToBooster(booster, specialCommon);
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (randomno.nextInt(5) < 4) {
|
||||
if (specialUncommon != null) {
|
||||
addToBooster(booster, specialUncommon);
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (randomno.nextInt(8) < 7) {
|
||||
if (specialRare != null) {
|
||||
addToBooster(booster, specialRare);
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (specialMythic != null) {
|
||||
addToBooster(booster, specialMythic);
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return booster;
|
||||
}
|
||||
|
||||
|
|
@ -183,4 +236,22 @@ public abstract class ExpansionSet implements Serializable {
|
|||
return hasBasicLands;
|
||||
}
|
||||
|
||||
public List<CardInfo> getCommon() {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.setCodes(this.code).rarities(Rarity.COMMON).doubleFaced(false);
|
||||
return CardRepository.instance.findCards(criteria);
|
||||
}
|
||||
|
||||
public List<CardInfo> getSpecialCommon() {
|
||||
return null;
|
||||
}
|
||||
public List<CardInfo> getSpecialUncommon() {
|
||||
return null;
|
||||
}
|
||||
public List<CardInfo> getSpecialRare() {
|
||||
return null;
|
||||
}
|
||||
public List<CardInfo> getSpecialMythic() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue