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 d€d-d�dƒt d‚d9dƒdƒt d„dd…d;ƒt d†dd‡dƒt dˆdd‰d
ƒt dŠd-d‹dƒt dŒdd�dƒt dŽdGd�dƒt d�dtd‘dƒt d’d)d“dƒ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 Drinkséd   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 Laptopi¨a  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 VillaiðI 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 )NúDhttps://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 1g®Gáz®ï?zGet 100 diamonds!r   r5   Zitem2zDiamond Pack 2g×£p=
×ÿ?zGet 210 diamonds!éÒ   Zitem3zDiamond Pack 3gìQ¸…ë@zGet 330 diamonds!iJ  Zitem4zDiamond Pack 4gìQ¸…ë@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!