Commit c8c43139 authored by imakunee's avatar imakunee

Commander Quest checkstyle and bugfixes

-QuestEventCommanderDuelManager
Removed unused imports

-CEditorQuest
Fixed colorless cards getting filtered out of deck creation.
parent 71eaf70d
......@@ -322,7 +322,7 @@ public final class CEditorQuest extends CDeckEditor<Deck> {
public boolean apply(PaperCard subject) {
CardRules cr = subject.getRules();
ManaCost mc = cr.getManaCost();
return !mc.isPureGeneric() && allowedColor.containsAllColorsFrom(cr.getColorIdentity().getColor());
return allowedColor.containsAllColorsFrom(cr.getColorIdentity().getColor());
}
}
......@@ -336,7 +336,10 @@ public final class CEditorQuest extends CDeckEditor<Deck> {
List<String> colors = new ArrayList<>();
//Return early if there are no current commanders
if(commanders.size() == 0) return ColorSet.fromNames(colors);
if(commanders.size() == 0){
colors.add("c");
return ColorSet.fromNames(colors);
}
//For each commander,add each color of its color identity if not already added
for(PaperCard pc : commanders){
......@@ -347,6 +350,8 @@ public final class CEditorQuest extends CDeckEditor<Deck> {
if(!colors.contains("g") && pc.getRules().getColorIdentity().hasGreen()) colors.add("g");
}
colors.add("c");
return ColorSet.fromNames(colors);
}
......
......@@ -4,10 +4,7 @@ import forge.deck.*;
import forge.item.PaperCard;
import forge.model.FModel;
import forge.quest.data.QuestPreferences;
import forge.util.CollectionSuppliers;
import forge.util.MyRandom;
import forge.util.maps.EnumMapOfLists;
import forge.util.maps.MapOfLists;
import java.util.ArrayList;
import java.util.Collections;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment