mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Fix the draft order for sets before Mirrodin Besieged in Quest draft tournaments.
This commit is contained in:
@@ -863,6 +863,21 @@ public class QuestEventDraft {
|
|||||||
List<String> setCombos = new ArrayList<>();
|
List<String> setCombos = new ArrayList<>();
|
||||||
CardEdition[] sets = block.getSets();
|
CardEdition[] sets = block.getSets();
|
||||||
|
|
||||||
|
boolean isBeforeMBS = false; // before Mirrodin Besieged, sets were drafted in the opposite order (old->new instead of new->old)
|
||||||
|
for (CardEdition set : sets) {
|
||||||
|
Calendar cal = Calendar.getInstance();
|
||||||
|
// This is set to Scars of Mirrodin date to account for the fact that MBS is drafted as a part of the Scars of Mirrodin block.
|
||||||
|
// Setting it to the date of Mirrodin Besieged makes it treat all drafts that feature Scars of Mirrodin incorrectly.
|
||||||
|
cal.set(Calendar.YEAR, 2010);
|
||||||
|
cal.set(Calendar.MONTH, Calendar.OCTOBER);
|
||||||
|
cal.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
Date MBSDate = cal.getTime();
|
||||||
|
|
||||||
|
if (set.getDate().before(MBSDate)) {
|
||||||
|
isBeforeMBS = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Arrays.sort(sets, new Comparator<CardEdition>() {
|
Arrays.sort(sets, new Comparator<CardEdition>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(CardEdition set1, CardEdition set2) {
|
public int compare(CardEdition set1, CardEdition set2) {
|
||||||
@@ -878,19 +893,36 @@ public class QuestEventDraft {
|
|||||||
if (sets.length == 2) {
|
if (sets.length == 2) {
|
||||||
|
|
||||||
if (sets[0].getCards().length < 200) {
|
if (sets[0].getCards().length < 200) {
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[1].getCode(), sets[1].getCode()));
|
if (!isBeforeMBS) {
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[1].getCode(), sets[1].getCode()));
|
||||||
|
} else {
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[1].getCode(), sets[1].getCode(), sets[0].getCode()));
|
||||||
|
}
|
||||||
} else if (sets[1].getCards().length < 200) {
|
} else if (sets[1].getCards().length < 200) {
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[1].getCode(), sets[0].getCode(), sets[0].getCode()));
|
if (!isBeforeMBS) {
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[1].getCode(), sets[0].getCode(), sets[0].getCode()));
|
||||||
|
} else {
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[0].getCode(), sets[1].getCode()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[1].getCode(), sets[1].getCode(), sets[1].getCode()));
|
setCombos.add(String.format("%s/%s/%s", sets[1].getCode(), sets[1].getCode(), sets[1].getCode()));
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[1].getCode(), sets[1].getCode()));
|
if (!isBeforeMBS) {
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[0].getCode(), sets[1].getCode()));
|
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[1].getCode(), sets[1].getCode()));
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[0].getCode(), sets[1].getCode()));
|
||||||
|
} else {
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[1].getCode(), sets[1].getCode(), sets[0].getCode()));
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[1].getCode(), sets[0].getCode(), sets[0].getCode()));
|
||||||
|
}
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[0].getCode(), sets[0].getCode()));
|
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[0].getCode(), sets[0].getCode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (sets.length >= 3) {
|
} else if (sets.length >= 3) {
|
||||||
|
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[1].getCode(), sets[2].getCode()));
|
if (!isBeforeMBS) {
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[0].getCode(), sets[1].getCode(), sets[2].getCode()));
|
||||||
|
} else {
|
||||||
|
setCombos.add(String.format("%s/%s/%s", sets[2].getCode(), sets[1].getCode(), sets[0].getCode()));
|
||||||
|
}
|
||||||
setCombos.add(String.format("%s/%s/%s", sets[2].getCode(), sets[2].getCode(), sets[2].getCode()));
|
setCombos.add(String.format("%s/%s/%s", sets[2].getCode(), sets[2].getCode(), sets[2].getCode()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user