New feature: "Chaos Remixed" booster draft (#10328)

* Fix error in draft pick logger that was failing on chaos drafts with fewer than 3 sets

* Implement Remixed Booster Draft

* Add debug test

* minor cleanup

* Cleanup unnecessary checks

* Fix elimination tournament type

* Add note for future improvement
This commit is contained in:
xenohedron 2023-05-12 10:12:23 -04:00 committed by GitHub
parent 6d4e353867
commit 4cc9329b15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 437 additions and 47 deletions

View file

@ -305,7 +305,7 @@ public abstract class ExpansionSet implements Serializable {
return true;
}
private static ObjectColor getColorForValidate(Card card) {
public static ObjectColor getColorForValidate(Card card) {
ObjectColor color = card.getColor();
// treat colorless nonland cards with exactly one ID color as cards of that color
// (e.g. devoid, emerge, spellbombs... but not mana fixing artifacts)
@ -364,8 +364,6 @@ public abstract class ExpansionSet implements Serializable {
return (RandomUtil.nextDouble() > Math.pow(0.8, colorlessCountPlusOne));
}
private static final ObjectColor COLORLESS = new ObjectColor();
protected boolean validateUncommonColors(List<Card> booster) {
List<ObjectColor> uncommonColors = booster.stream()
.filter(card -> card.getRarity() == Rarity.UNCOMMON)
@ -375,7 +373,7 @@ public abstract class ExpansionSet implements Serializable {
// if there are only two uncommons, they can be the same color
if (uncommonColors.size() < 3) return true;
// boosters of artifact sets can have all colorless uncommons
if (uncommonColors.contains(COLORLESS)) return true;
if (uncommonColors.contains(ObjectColor.COLORLESS)) return true;
// otherwise, reject if all uncommons are the same color combination
return (new HashSet<>(uncommonColors).size() > 1);
}