rework shop
This commit is contained in:
@@ -86,7 +86,6 @@ class DropResult(BaseModel):
|
||||
penalty: int
|
||||
total_points: int
|
||||
new_drop_count: int
|
||||
shield_used: bool = False # Whether shield consumable was used to prevent penalty
|
||||
|
||||
|
||||
class EventAssignmentResponse(BaseModel):
|
||||
|
||||
@@ -43,10 +43,10 @@ class ParticipantInfo(BaseModel):
|
||||
# Shop: coins and consumables status
|
||||
coins_earned: int = 0
|
||||
skips_used: int = 0
|
||||
has_shield: bool = False
|
||||
has_active_boost: bool = False
|
||||
boost_multiplier: float | None = None
|
||||
boost_expires_at: datetime | None = None
|
||||
has_lucky_dice: bool = False
|
||||
lucky_dice_multiplier: float | None = None
|
||||
can_undo: bool = False
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
@@ -94,9 +94,11 @@ class PurchaseResponse(BaseModel):
|
||||
|
||||
class UseConsumableRequest(BaseModel):
|
||||
"""Schema for using a consumable"""
|
||||
item_code: str # 'skip', 'shield', 'boost', 'reroll'
|
||||
item_code: str # 'skip', 'boost', 'wild_card', 'lucky_dice', 'copycat', 'undo'
|
||||
marathon_id: int
|
||||
assignment_id: int | None = None # Required for skip and reroll
|
||||
assignment_id: int | None = None # Required for skip, wild_card, copycat
|
||||
game_id: int | None = None # Required for wild_card
|
||||
target_participant_id: int | None = None # Required for copycat
|
||||
|
||||
|
||||
class UseConsumableResponse(BaseModel):
|
||||
@@ -192,9 +194,13 @@ class ConsumablesStatusResponse(BaseModel):
|
||||
skips_available: int # From inventory
|
||||
skips_used: int # In this marathon
|
||||
skips_remaining: int | None # Based on marathon limit
|
||||
shields_available: int # From inventory
|
||||
has_shield: bool # Currently activated
|
||||
boosts_available: int # From inventory
|
||||
has_active_boost: bool # Currently activated (one-time for next complete)
|
||||
has_active_boost: bool # Currently activated (one-time for current assignment)
|
||||
boost_multiplier: float | None # 1.5 if boost active
|
||||
rerolls_available: int # From inventory
|
||||
wild_cards_available: int # From inventory
|
||||
lucky_dice_available: int # From inventory
|
||||
has_lucky_dice: bool # Currently activated
|
||||
lucky_dice_multiplier: float | None # Rolled multiplier if active
|
||||
copycats_available: int # From inventory
|
||||
undos_available: int # From inventory
|
||||
can_undo: bool # Has drop data to undo
|
||||
|
||||
Reference in New Issue
Block a user