feat(suitbuilder): apply CD-tier filter in loadItems (before domination)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-25 20:35:20 +02:00
parent 7155055072
commit 75a735d589

View file

@ -25,6 +25,7 @@ type Solver struct {
bestSuitItemCount int
highestArmorCount int
armorBucketsItems int
allowedCD map[int]bool // nil == no CD filter (default / all tiers)
lockedSetCounts map[int]int
lockedSpells map[string]bool
@ -53,6 +54,7 @@ func newSolver(s *Server, c SearchConstraints, emit func(string, map[string]any)
}
// Required spells register first, so they always get the low bits.
sv.neededSpellBitmap = sv.spellIndex.getBitmap(c.RequiredSpells)
sv.allowedCD = allowedCritSet(c.AllowedCritDamage)
return sv
}
@ -259,6 +261,10 @@ func (sv *Solver) loadItems(ctx context.Context) ([]*SuitItem, error) {
}
}
// Drop armor whose CD tier is disallowed BEFORE domination, so a CD2 piece
// can't surpass-and-remove an allowed CD1 piece we'd then exclude.
items = filterArmorByCD(items, sv.allowedCD)
filtered := removeSurpassedItems(items)
jewelryFallback := map[string]bool{"Ring": true, "Bracelet": true, "Jewelry": true, "Necklace": true, "Amulet": true}