feat: rarity ladder utility for safe next-rarity lookups #59
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/paper-dynasty-card-creation#59
Loading…
Reference in New Issue
Block a user
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?
Problem
rarity_thresholds.pydefines rarity IDs (5, 4, 3, 2, 1, 99) but has no "next rarity" function. The Phase 2 Validation Spec (T4-4) warns that naiverarity_id + 1produces invalid values —100for HoF,0for Diamond.When T4 rarity upgrade is implemented (card-creation#57), a proper ordered ladder lookup is needed to safely resolve the next rarity tier.
Fix
Add a
RARITY_LADDERordered mapping and anext_rarity(current_id)helper that returns the next tier orNoneif already at max. Handle edge cases for HoF and Diamond.Relationship
Subtask/prerequisite of card-creation#57 (T4 rarity collision guard). Could be implemented as part of that issue.
PR opened: #64
Added
RARITY_LADDER(ordered[5, 4, 3, 2, 1, 99]),next_rarity()(returns next tier orNoneat HoF/unknown), andrarity_is_downgrade()(position-based comparison) torarity_thresholds.py. All three uselist.index()lookups against the ladder, avoiding any arithmetic on the non-contiguous IDs.