SIG SELECT: Nomad/Schizo locked by default; Note-unlock gate — TDD
- _filter_major_unlocks(cards, user): strips Major 0 (Nomad) and Major 1 (Schizo) unless user has matching 'nomad'/'schizo' Note; unauthenticated users see 0 majors - levity_sig_cards(room, user) / gravity_sig_cards(room, user): accept user param; default 16 court cards, up to 18 with both Note unlocks - View wires user into both calls; _sig_unique_cards / sig_deck_cards unchanged (game-table deck still includes all 18 unique) - _full_sig_setUp: seats now carry deck_variant=earthman - SigCardHelperTest: 4 new ITs (default 16, nomad +1, schizo +1); empty-deck test updated to clear seats + owner - SigSelectRenderingTest: 18-card test updated to 16-default + 3 Note-unlock ITs Pending: superusers auto-granted nomad + schizo Notes on creation (ask user) Code architected by Disco DeDisco <discodedisco@outlook.com> Git commit message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -491,14 +491,27 @@ def _sig_unique_cards(room):
|
||||
return wands_crowns + swords_cups + major
|
||||
|
||||
|
||||
def levity_sig_cards(room):
|
||||
"""The 18 cards available to the levity group (PC/NC/SC)."""
|
||||
return _sig_unique_cards(room)
|
||||
def _filter_major_unlocks(cards, user):
|
||||
"""Remove Nomad (0) and Schizo (1) unless the user has the matching Note unlock."""
|
||||
if user is None or not user.is_authenticated:
|
||||
return [c for c in cards if c.arcana != TarotCard.MAJOR]
|
||||
earned = set(user.notes.values_list("slug", flat=True))
|
||||
return [
|
||||
c for c in cards
|
||||
if c.arcana != TarotCard.MAJOR
|
||||
or (c.number == 0 and "nomad" in earned)
|
||||
or (c.number == 1 and "schizo" in earned)
|
||||
]
|
||||
|
||||
|
||||
def gravity_sig_cards(room):
|
||||
"""The 18 cards available to the gravity group (BC/EC/AC)."""
|
||||
return _sig_unique_cards(room)
|
||||
def levity_sig_cards(room, user=None):
|
||||
"""Cards available to the levity group (PC/NC/SC), filtered by user's Note unlocks."""
|
||||
return _filter_major_unlocks(_sig_unique_cards(room), user)
|
||||
|
||||
|
||||
def gravity_sig_cards(room, user=None):
|
||||
"""Cards available to the gravity group (BC/EC/AC), filtered by user's Note unlocks."""
|
||||
return _filter_major_unlocks(_sig_unique_cards(room), user)
|
||||
|
||||
|
||||
def sig_seat_order(room):
|
||||
|
||||
Reference in New Issue
Block a user