mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Merge branch 'QuestDraftSetFix' into 'master'
Quest draft set fix See merge request core-developers/forge!174
This commit is contained in:
@@ -789,29 +789,13 @@ public class QuestEventDraft implements IQuestEvent {
|
|||||||
if (!allowedQuestSets.isEmpty()) {
|
if (!allowedQuestSets.isEmpty()) {
|
||||||
for (final CardBlock block : blocks) {
|
for (final CardBlock block : blocks) {
|
||||||
|
|
||||||
boolean blockAllowed = false;
|
// New code : all sets must be unlocked
|
||||||
boolean largeSetUnlocked = false;
|
boolean blockAllowed = true;
|
||||||
int unlockedSets = 0;
|
|
||||||
final boolean allBlocksSanctioned = quest.getFormat().getAllowedSetCodes().isEmpty();
|
|
||||||
|
|
||||||
for (final CardEdition set : block.getSets()) {
|
for (CardEdition set : block.getSets()) {
|
||||||
if (!allowedQuestSets.contains(set) && !allBlocksSanctioned) {
|
if (!allowedQuestSets.contains(set)) {
|
||||||
continue;
|
blockAllowed = false;
|
||||||
}
|
}
|
||||||
unlockedSets++;
|
|
||||||
if (set.isLargeSet()) {
|
|
||||||
largeSetUnlocked = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Allow partially unlocked blocks if they contain at least one large and one small unlocked set.
|
|
||||||
if (largeSetUnlocked && unlockedSets > 1) {
|
|
||||||
blockAllowed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (largeSetUnlocked && block.getSets().size() == 1) {
|
|
||||||
blockAllowed = true;
|
|
||||||
singleSets.add(block.getSets().get(0).getCode());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (blockAllowed) {
|
if (blockAllowed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user