God pack rarity weights are computed from set-wide card counts, not per-pack counts #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
`Generation.calculate_god_pack_probabilities` weights each eligible rarity by `Card.objects.filter(set=pokemon_set, rarity=rarity).count()` over the whole set, but `prob_at_least_one_new_card` then applies those weights to the per-pack card pool. For multi-pack sets the two disagree, e.g. A1/Charizard: crown_rare weight 0.05 (set-based) vs 0.13 (pack-based), illustration_rare 0.40 vs 0.35. A god pack draws from the pack's ☆+ pool, so the per-pack count is the right one.
Impact on the displayed number is small (god packs are weighted 0.05%), but the calculation is internally inconsistent. Fix: pass the pack and count `pack.cards.filter(rarity=...)` (or derive the weights from `cards_by_rarity` already built in utils.py, which also removes the per-rarity queries).