a
    S+i+                     @   sL   d Z ddlZG dd dZdd Zdd ZG d	d
 d
Zdd Zdd ZdS )a  
Shop Manager Module

This module contains all shop and store-related functionality for BaoLife.
It manages in-game store items and in-app purchase items.

Classes:
    - StoreItem: Represents items available for purchase with in-game currency
    - InAppPurchaseItem: Represents items available for real money purchase

Functions:
    - getStoreItems(): Returns list of all available store items
    - purchaseItem(player, itemID): Handles purchase of store items with in-game money
    - getInAppPurchaseItems(): Returns list of all in-app purchase items
    - purchaseInAppItem(player, itemID): Handles in-app purchase transactions

Extracted from: ws/functions.py
Original line numbers: 2756-2861
    Nc                   @   s   e Zd ZdZdddZdS )	StoreItema  
    Represents an item available for purchase in the in-game store.

    Attributes:
        id (str): Unique identifier (UUID hex)
        name (str): Display name of the item
        image (str): URL to item image
        price (int): Cost in in-game currency
        description (str): Item description text
        prestigeBoost (int): Amount of prestige gained when purchased
        energyBoost (int): Amount of energy gained when purchased (0 if permanent item)
    Nr   c                 C   s4   t  j| _|| _|| _|| _|| _|| _|| _	d S )N)
uuiduuid4hexidnameimagepricedescriptionprestigeBoostenergyBoost)selfr   r	   r
   r   r   r    r   2/var/www/lichun.app/lichun/ws/shop/shop_manager.py__init__'   s    zStoreItem.__init__)Nr   __name__
__module____qualname____doc__r   r   r   r   r   r      s   r   c               6   C   sv  t ddddddt ddd	d
dt ddddt dddddt ddddt ddddt ddddd t d!d"d#dt d$d%d&d't d(d)d*dd+t d,d-d.dd/t d0d1d2d3t d4d5d6d7t d8d9d:d;t d<d=d>dt d?d@dAdBt dCd)dDddEt dFdGdHdIdJt dKdLdMdNt dOdPdQdIt dRddSdt dTd-dUdt dVdWdXdYdZt d[dd\dt d]dGd^dt d_d9d`dt daddbd;t dcddddt dedfdgdt dhd)diddjt dkdGdldNt dmddndt doddpdt dqddrdt dsdtdud7t dvd=dwdt dxddyd;t dzd)d{dt d|dd}dt d~dfddt dd-ddt dd9ddt dddd;t ddddt dddd
t dd-ddt ddddt ddGddt ddtddt dd)ddg2} | S )a  
    Returns a list of all available store items.

    Items include luxury goods, experiences, and energy boosts that can be
    purchased with in-game currency to increase prestige or energy.

    Returns:
        list[StoreItem]: List of all available store items
    zCase of Energy Drinksd   zGives you a +20 energy boostr   aH  https://media.discordapp.net/attachments/1106614533402931284/1187548155630329937/craig_vg_cozy_cartoon-style_image_of_a_pack_of_energy_drinks._T_bee4a32e-9d74-422c-813a-a20c1a198c5f.png?ex=66060767&is=65f39267&hm=afa75cf6bc2477fed66536b28371988a1e29dd9d835d0fc31a9834bc83980319&=&format=png&quality=lossless&width=526&height=526   z
Sports CariP  z#A shiny new sports car to show off.2   zDhttps://v3b.fal.media/files/b/zebra/qZXW3UgLfqPzkOKvkJeOt_output.pngzLuxury Phonei N  z9A state-of-the-art smartphone with the latest technology.zDesigner SuitiX  z+A designer suit to make a great impression.   zFhttps://v3b.fal.media/files/b/penguin/rt2iZVcC_9kSe8B29V3ak_output.pngzLuxury Watchi'  z'A timeless piece of fine craftsmanship.   zHigh-End Laptopia  z1A high-performance laptop for both work and play.#   zArtisan Coffee Machinei  zMake perfect coffee every time.
   zEhttps://v3b.fal.media/files/b/monkey/G9qa80OkcyEnDjWjKm8q4_output.pngzLuxury Yachti@ z-A personal luxury yacht for parties and more.zPrivate Jeti z/Travel in style and comfort with a private jet.   zDesigner Handbagi  z!A handbag from a famous designer.zDhttps://v3b.fal.media/files/b/panda/i4G7JcMyYH8sP1qCaSmaZ_output.pngzDiamond Ringi@  z%A dazzling ring with a large diamond.zDhttps://v3b.fal.media/files/b/tiger/XjFTzmkaa0ILumrKOcTK3_output.pngzPersonal Islandi  zYour very own island paradise.   zLuxury VillaiI z&A luxurious villa in a prime location.K   z
Exotic Peti:  z'A unique pet to accompany your journey.   zGourmet Chefi.  z'Hire a gourmet chef to cook your meals.zFamous Paintingi@  z*An original painting from a famous artist.(   z	Rare Winez"A bottle of rare and vintage wine.zDhttps://v3b.fal.media/files/b/koala/OePvHz6E3K8XTRtrjzQt7_output.pngzLimited Edition Sneakersi  z/Limited edition sneakers from a high-end brand.   zDhttps://v3b.fal.media/files/b/panda/_SWcVFQ-SqyLHSQuU_Uq__output.pngzLuxury Skincare Seti  z-A luxury skincare set for ultimate pampering.   zConcert Ticketsi	  z)Tickets to see your favorite artist live.zCustom-Made Dressz-A custom-made dress from a renowned designer.zHigh-End Stereo Systemz7A high-end stereo system for the best audio experience.zDesigner Sunglassesi  z'Stylish sunglasses from a famous brand.   zChttps://v3b.fal.media/files/b/lion/vcw1faj-Iwe3KsBtkKi09_output.pngzFive Star Vacationz0An all-inclusive vacation at a five-star resort.zFitness Membershipz&Membership to a high-end fitness club.zGourmet Kitchen Setz&A set of top-notch kitchen appliances.zHome Theatre Systemz&Turn your home into a personal cinema.zVintage Guitarz,A beautiful vintage guitar for music lovers.zDesigner Furniture Seti0u  z/Furnish your home with a unique designer touch.zLuxury Fragrancez(A signature scent from a high-end brand.zEhttps://v3b.fal.media/files/b/rabbit/KLB-SKDI3SEWLV6vnRpT-_output.pngzAntique Chess Setz2An antique chess set for intellectual stimulation.zRare Book Collectionz(A collection of rare and valuable books.zUpscale Pet HousezA deluxe house for your pet.zOrchard Gardenz%Grow your own fruit in your backyard.zPrivate Helicopteri z=Get to your destination in no time with a private helicopter.zGold-Plated Pool Tablez!A pool table with a golden touch.zSmart Home Systemz<Turn your home into a smart home with the latest technology.zRare Comic Collectionz-A collection of rare and vintage comic books.zCollector's Edition Board Gamesz4Collector's edition versions of popular board games.zHome Recording Studioz3Create your own music with a home recording studio.zAdvanced Dronez5An advanced drone for capturing high-quality footage.zLuxury Hot Tubz%Relax in style with a luxury hot tub.zDesigner Watchz(A designer watch that makes a statement.zPlatinum Credit Cardz2A platinum credit card with a high spending limit.zPersonal Robotz,A personal robot to assist with daily tasks.zCrystal Chandelierz?Add a touch of elegance to your home with a crystal chandelier.zItalian Leather Sofaz6A luxurious Italian leather sofa for your living room.zSkydiving Experiencez#Experience the thrill of skydiving.zSpace Travel Ticketz0Travel to space for an unforgettable experience.zVirtual Reality Systemz>Experience the future of gaming with a virtual reality system.)r   itemsr   r   r   getStoreItems2   sh    4r'   c                 C   s   ddl m} | jD ]}|j|kr| jj|jkr| j j|j8  _| j j|j7  _|j	dkrz| j j
|j	7  _
|| j n| jj|  dS  dS qdS )a  
    Processes the purchase of a store item.

    Checks if player has sufficient funds, deducts the price, and applies
    item benefits (prestige boost, energy boost, or adds to inventory).

    Args:
        player: The player object containing character and store data
        itemID (str): The unique identifier of the item to purchase

    Returns:
        bool: True if purchase successful, False if insufficient funds or item not found
    r   )getPeakEnergyTF)stats.stats_managerr(   
storeItemsr   cmoneyr	   prestiger   r   energyr&   append)playeritemIDr(   itemr   r   r   purchaseItems   s    


r3   c                   @   s   e Zd ZdZdddZdS )InAppPurchaseItema_  
    Represents an item available for purchase with real money.

    Attributes:
        id (str): Unique identifier
        name (str): Display name of the item
        price (float): Real money price (USD)
        description (str): Item description text
        diamonds (int): Number of diamonds awarded
        image (str): URL to item image
    Nc                 C   s(   || _ || _|| _|| _|| _d| _d S )NDhttps://v3b.fal.media/files/b/tiger/Jxcl60OfljvE7E8kmrsF1_output.png)r   r   r	   r
   diamondsr   )r   r   r   r	   r
   r6   r   r   r   r   r      s    zInAppPurchaseItem.__init__)Nr   r   r   r   r   r4      s   r4   c               
   C   sR   t ddddddt ddd	d
ddt dddddt dddddt dddddg} | S )a  
    Returns a list of all available in-app purchase items.

    These items represent diamond packs that can be purchased with real money
    to obtain premium in-game currency.

    Returns:
        list[InAppPurchaseItem]: List of all available in-app purchase items
    Zitem1zDiamond Pack 1gGz?zGet 100 diamonds!r   r5   Zitem2zDiamond Pack 2gףp=
?zGet 210 diamonds!   Zitem3zDiamond Pack 3gQ@zGet 330 diamonds!iJ  Zitem4zDiamond Pack 4gQ@zGet 460 diamonds!i  Zitem5zDiamond Pack 5g(\@zGet 600 diamonds!iX  )r4   r%   r   r   r   getInAppPurchaseItems   s    r8   c                 C   s,   t  D ] }|j|kr| j j|j7  _qdS )a  
    Processes an in-app purchase transaction.

    Awards diamonds to the player's character based on the purchased item.
    Note: Actual payment processing happens elsewhere; this only awards the diamonds.

    Args:
        player: The player object containing character data
        itemID (str): The unique identifier of the in-app purchase item

    Returns:
        bool: Always returns False (legacy behavior)
    F)r8   r   r+   r6   )r0   r1   r2   r   r   r   purchaseInAppItem   s    

r9   )r   r   r   r'   r3   r4   r8   r9   r   r   r   r   <module>   s   A!