a
    Ži÷l  ã                   @   s~   d Z ddlZddlZddlmZmZmZ ddlmZ ddl	m
Z
 ddd	„Zdd
d„Zddd„Zddd„Zddd„Zg d¢ZdS )aV  
Hobbies & Personal Development Activity Events
Personal growth, hobbies, and self-improvement activities

Events:
- gardening: Starting a garden (ages 20-100) - Uses ActivityRecord to track plants grown
- meditation: Beginning a meditation practice (ages 14-100) - Uses Habit system for daily practice
- birdWatching: Taking up birdwatching (ages 30-100) - Uses ActivityRecord to track species spotted
- collectionHobby: Starting a collection hobby (ages 8-100) - Uses ActivityRecord to track collection
- readingChallenge: Challenging yourself to read more books (ages 10-100) - Uses ActivityRecord to track books read

Integration:
- Meditation uses HabitClass for daily practice tracking
- Collections, gardening, reading use ActivityRecord for progress tracking
- Achievement integration for milestones
- Follow-up events for hobby progress updates
é    N)ÚmessageFunctionÚquestionFunctionÚanswerOption)Ú
HabitClass)ÚActivityRecordÚmessageFc                 C   sØ  d}|| j vo4| jjdko4| jjdko4dt ¡ d k}d}|dkr„tdd	d
dd�tdddd�tdddd�tddƒg}t||| ||ƒS |dk�rÔddlm}m} |d d	k�rº| j j	d7  _	| j j
d
8  _
| j jd8  _| j jd
8  _dt ¡ jdd… › �}	|dd|	dddd œƒƒ }
| jj |
¡ t|	d| jƒ}d!|_d"|_g |_| jj |¡ | jj || jd#d$d%gd&| jj t d'd
¡d(�¡ | jj |d)d*| jd+d,dd-�¡ | j d.¡ �n|d dk�rl| j j	d
7  _	| j jd8  _| j jd'8  _d/t ¡ jdd… › �}|dd|dd0d1d œƒƒ }| jj |¡ t|d| jƒ}d,|_d2|_| jj |¡ | j d3¡ nh|d dk�r¸| j j	d'7  _	| j jd8  _| j jd48  _| j d5¡ n| j j	d48  _	| j d6¡ dS )7zCStarting a garden - Creates ActivityRecord to track garden progressÚ	gardeningé   éd   é   éˆ  z"You want to start a garden. Begin?ÚanswerzYes, full vegetable garden!Z	vegetableé   )Ú
energyCostÚ	moneyCostzSmall herb gardenZherbé   ©r   zJust houseplantsZhouseplantsúNot interestedÚnor   ©Ú	schedulerÚoneTimeEventÚdataé   Z
gardening_Né   ÚActivity© ÚhobbyzVegetable GardenzGrowing vegetables at home©ÚidÚtypeÚtitleÚdescriptioné2   Zvegetable_gardenZ	Gardeningz
twice-weekÚmorningÚhomeé
   ©ÚlocationÚdurationzFirst Harvestz™Your vegetable garden is thriving! You harvest your first homegrown tomatoes, lettuce, and herbs. Nothing tastes quite like vegetables you grew yourself!ÚdaysFromNowé<   ©r!   r   ÚdateÚdateTypeÚdateModifierÚcompletionFunczmYou've started a full vegetable garden! It will require regular care, but the fresh produce will be worth it.Zherb_garden_zHerb GardenzGrowing herbs on windowsillZherb_gardenzcYou've planted a small herb garden on your windowsill. Fresh basil and rosemary at your fingertips!é   zZYou've brought home some beautiful houseplants. They brighten up your living space nicely.z-You decide gardening isn't for you right now.)ÚaskedQuestionsÚcÚageYearsÚrandomr   r   Ú	functionsr   r   Ú	happinessÚenergyÚmoneyÚstressÚuuidÚuuid4ÚhexÚ
activitiesÚappendr   r-   ÚperformanceÚfocusÚachievementsÚactivityRecordsÚ	schedulesr   ÚrandintÚoneTimeEventsÚmessageQueue)Úplayerr    r   ÚresponseÚfnameÚcheckÚanswerOptionsr   r   Z	garden_idZgarden_activityZgarden_recordZherb_idZherb_activityZherb_recordr   r   ú:/var/www/lichun.app/lichun/ws/events/activities/hobbies.pyr      s�    2ü
ü



û	úÿü
r   c                 C   s†  d}|| j vo4| jjdko4| jjdko4dt ¡ d k}d}|dkrztdd	ƒtd
dƒtdddd�tddƒg}t||| ||ƒS |dk�r‚ddlm}m} |d d	k�rh| j j	d8  _	| j j
d7  _
| j jd7  _tdddd�}	tdd„ | jjD ƒƒ�s| jj |	¡ | jj || jdd	dgd| jj t dd¡d �¡ | jj |d!d"| jd#dd$d%�¡ | j d&¡ �n|d dk�r¤| j j	d'8  _	| j j
d7  _
| j d(¡ nÞ|d dk�rf| j jd8  _| j j	d)8  _	| j j
d'7  _
| j jd7  _td*d+dd�}
td,d„ | jjD ƒƒ�s&| jj |
¡ | jj || jd-d	dgd| jj t dd'¡d �¡ | j d.¡ n| j j
d8  _
| j d/¡ d$S )0zOBeginning a meditation practice - Uses Habit system for daily practice trackingÚ
meditationé   r
   r   r   z5You want to start meditating daily. Begin a practice?r   zYes, meditate daily!ÚdailyzTry occasionallyÚ
occasionalzUse meditation appÚappr&   r   z
Not for mer   r   r   r   r   r	   r1   z<You meditate daily, bringing peace and clarity to your mind.Úpositive©Únamer"   Ú	habitTypec                 s   s   | ]}|j d kV  qdS )rN   N©rU   ©Ú.0Úhr   r   rM   Ú	<genexpr>™   ó    zmeditation.<locals>.<genexpr>zDaily meditationr$   r%   r'   zMeditation Milestonez²You've been meditating consistently for 30 days! You notice you're calmer, more focused, and better at managing stress. The practice has become an essential part of your routine.r*   Nr,   z]You've committed to daily meditation. The practice brings you peace and clarity each morning.r   zTYou try meditating when you remember. Even occasional practice helps calm your mind.r   Úmeditation_appz-You use a meditation app for guided sessions.c                 s   s   | ]}|j d kV  qdS )r]   NrW   rX   r   r   rM   r[   Å   r\   zGuided meditationzgYou've subscribed to a meditation app. The guided sessions make it easy to build a consistent practice.z'You decide meditation isn't your thing.)r2   r3   r4   r5   r   r   r6   r   r   r:   r7   Úhealthr   ÚanyÚhabitsr?   rD   r   rE   rF   r-   rG   r9   )rH   r    r   rI   rJ   rK   rL   r   r   Zmeditation_habitZ	app_habitr   r   rM   rN   z   s†    2ü
ý


û	úÿý


ûrN   c                 C   sb  d}|| j vo4| jjdko4| jjdko4dt ¡ d k}d}|dkr~tdd	dd
�tddƒtdddd
�tddƒg}t||| ||ƒS |dk�r^ddlm}m} |d d	k�r¤| j j	d8  _	| j j
d7  _
| j jd8  _dt ¡ jdd… › �}	|dd|	ddddœƒƒ }
| jj |
¡ t|	d| jƒ}d |_d!|_g |_| jj |¡ | jj || jdd"d#gd$| jj t dd%¡d&�¡ | jj |d'd(| jd)d*dd+�¡ | j d,¡ �nº|d dk�rH| j j
d7  _
| j jd 8  _dt ¡ jdd… › �}	|dd|	ddd-dœƒƒ }
| jj |
¡ t|	d| jƒ}d.|_d/|_| jj |¡ | j d0¡ �n|d dk�rB| j j	d8  _	| j j
d17  _
| j jd7  _| j jd8  _dt ¡ jdd… › �}	|dd|	dd2d3dœƒƒ }
| jj |
¡ t|	d| jƒ}d|_d4|_g |_| jj |¡ | jj || jd2g d5¢d$| jj t dd6¡d&�¡ | j d7¡ n| j j
d.8  _
| j d8¡ dS )9zETaking up birdwatching - Uses ActivityRecord to track species spottedÚbirdWatchingr   r
   r   r   z)You're interested in birdwatching. Start?r   zYes, buy binoculars!Z
binocularsr   zUse what I haveÚbasiczJoin birdwatching groupÚgroupr#   r   r   r   r   r   r	   r   Zbirdwatching_Nr   r   r   r   ZBirdwatchingz&Observing and identifying bird speciesr   r&   Zserious_birderÚweekendr$   Zparké(   r'   zRare Bird SightingzŒYou spotted a rare bird species through your binoculars! You carefully note it in your bird journal. Your hobby is becoming quite rewarding!r*   é-   r,   z]You've invested in quality binoculars! You can't wait to identify all the birds in your area.zCasual bird observationr1   Zcasual_birderz\You start birdwatching with what you have. It's peaceful watching nature from your backyard.r   zBirdwatching ClubzBirding with a local groupZsocial_birder)Úweeklyr$   rd   r+   zfYou've joined a local birdwatching group! You make new friends who share your appreciation for nature.z&You decide birdwatching isn't for you.)r2   r3   r4   r5   r   r   r6   r   r   r9   r7   r:   r;   r<   r=   r>   r?   r   r-   r@   rA   rB   rC   rD   r   rE   rF   rG   Úsocial)rH   r    r   rI   rJ   rK   rL   r   r   Z
birding_idZbirding_activityZbirding_recordr   r   rM   ra   Ø   s¶    2ü
ü



û	úÿü
ü



ûra   c              
   C   s  d}|| j vo4| jjdko4| jjdko4dt ¡ d k}| jjdk rRt g d¢¡}n*| jjdk rnt g d	¢¡}nt g d
¢¡}d|› d�}|dkrätdddd�tdddd�tdddd�tddƒg}t||| ||ƒ}|rà|rà|| j_|S |dk�rddlm	}	 t
| jddƒ}|d dk�r| j jd8  _| j jd7  _| j jd7  _d t ¡ jd!d… › �}
|d"d#|
d$| ¡ › d%�d&|› �d'œƒƒ }| jj |¡ t|
d$| jƒ}d(|_|› d)�|_g |_| jj |¡ | jj |	d*d+|› d,�| jd-d.d!d/�¡ | j d0|› d1�¡ �nî|d dk�rÊ| j jd8  _| j jd27  _d t ¡ jd!d… › �}
|d"d#|
d$| ¡ › d%�d3|› �d'œƒƒ }| jj |¡ t|
d$| jƒ}d|_|› d4�|_| jj |¡ | j d5|› d6�¡ �n,|d dk�rÚ| j jd8  _| j jd77  _| j jd27  _| j jd(7  _d t ¡ jd!d… › �}
|d"d#|
d$| ¡ › d8�d&|› d9�d'œƒƒ }| jj |¡ t|
d$| jƒ}d2|_|› d:�|_g |_| jj |¡ | jj |	d;d<|› d=�| jd-d>d!d/�¡ | j d?|› d@�¡ n| j jd8  _| j dA¡ t| jdƒ�rt| jdƒ d!S )BzTStarting a collection hobby - Uses ActivityRecord to track collection size and valueÚcollectionHobbyr   r
   r   r   é   )ZrocksZstickersútrading cardsé   )rk   úvinyl recordszvintage posters)ZcoinsZstampszvintage itemsz
art printsrm   zYou want to start collecting z. Begin?r   zYes, start collection!Úseriousr#   r   zCasual collectingÚcasualr	   zJoin collector communityÚ	communityéK   r   r   r   )r   Útemp_collection_typeZcollectiblesr   r1   Zcollection_Nr   r   r   z CollectionzCollecting r   r&   Z_seriouszRare Collection Findz,You found an incredibly rare piece for your zi collection! It's worth significantly more than what you paid. Your collection is really coming together!r*   éZ   r,   zYou've started your z8 collection! You love the thrill of finding rare pieces.r   zCasually collecting Z_casualzYou casually pick up z@ when you find interesting ones. It's a fun, low-pressure hobby.r   z Collector Communityz with a communityZ
_communityzCollection ShowcasezYou showcased your z~ collection at a community event! Fellow collectors were impressed with your curated pieces. You've made valuable connections!éx   zYYou've joined a collector community! You meet fellow enthusiasts and learn so much about Ú.z.You decide collecting isn't for you right now.)r2   r3   r4   r5   Úchoicer   r   rr   r6   r   Úgetattrr9   r7   Úprestiger;   r<   r=   r!   r>   r?   r   r-   r@   rA   rB   rC   rF   rG   rh   ÚhasattrÚdelattr)rH   r    r   rI   rJ   rK   Zcollection_typerL   Zquestion_resultr   Zcollection_idZcollection_activityZcollection_recordr   r   rM   ri   Q  sÄ    2ü
ü

úÿü

ü

úÿri   c                 C   sð  d}|| j vo4| jjdko4| jjdko4dt ¡ d k}d}|dkrvtdd	ƒtd
dƒtddƒtddƒg}t||| ||ƒS |dk�rìddlm}m} |d d	k�rð| j j	d7  _	| j j
d7  _
| j jd8  _dt ¡ jdd… › �}	|dd|	ddddœƒƒ }
| jj |
¡ t|	d| jƒ}d|_d|_g |_| jj |¡ tdd d!d"�}td#d$„ | jjD ƒƒ�sn| jj |¡ | jj || jd%d&d'gd(| jj t dd)¡d*�¡ | jj |d+d,| jd-d.dd/�¡ | jj |d0d1| jd-d2dd/�¡ | j d3¡ �nü|d dk�r.| j j	d7  _	| j j
d47  _
| j jd58  _dt ¡ jdd… › �}	|dd|	dd6d7dœƒƒ }
| jj |
¡ t|	d| jƒ}d|_d8|_g |_| jj |¡ td9d:d!d"�}td;d$„ | jjD ƒƒ�sÎ| jj |¡ | jj || jd%d<d'gd(| jj t dd=¡d*�¡ | jj |d>d?| jd-d@dd/�¡ | j dA¡ n¾|d dk�rÐ| j j	d7  _	| j j
d7  _
dt ¡ jdd… › �}	|dd|	ddBdCdœƒƒ }
| jj |
¡ t|	d| jƒ}d|_dD|_| jj |¡ | j dE¡ n| j j
d58  _
| j dF¡ dS )GzQChallenging yourself to read more books - Uses ActivityRecord to track books readÚreadingChallenger&   r
   r   r   z.Challenge yourself to read 50 books this year?r   zYes, 50 books!ZfiftyzMore realistic: 20 booksZtwentyzJust read for funro   zNot a readerr   r   )r   r   r   r   r	   Zreading_Nr   r   r   r   zReading Challenge: 50 BookszReading 50 books this yearr   Zambitious_readerÚdaily_readingz@You read every day, working towards your ambitious reading goal.rS   rT   c                 s   s   | ]}|j d kV  qdS )r|   NrW   rX   r   r   rM   r[     r\   z#readingChallenge.<locals>.<genexpr>zReading timerP   Úeveningr%   r+   r'   zReading Challenge: Quarter MarkzqYou've been reading consistently for 3 months! You're making great progress toward your 50-book goal. Keep it up!r*   rs   r,   z Reading Challenge: Halfway Therez±You're halfway through the year! Your reading habit has become a cherished part of your daily routine. The books you've read have opened your mind to new ideas and perspectives.é´   z]You've committed to reading 50 books this year! An ambitious goal that will expand your mind.r   r1   zReading Challenge: 20 BookszReading 20 books this yearZmoderate_readerÚregular_readingz9You read regularly, enjoying books at a comfortable pace.c                 s   s   | ]}|j d kV  qdS )r   NrW   rX   r   r   rM   r[   I  r\   zthrice-weekre   zReading Challenge Check-inzpYou've been keeping up with your reading goal! The books you've read have enriched your life in unexpected ways.rt   zbYou've set a goal to read 20 books this year. A realistic target that will still enrich your life.zCasual Readingz%Reading for pleasure without pressureZcasual_readerzpYou decide to read casually without pressure. Sometimes the best reading happens when it's purely for enjoyment.zReading just isn't your thing.)r2   r3   r4   r5   r   r   r6   r   r   Úintelligencer7   r:   r;   r<   r=   r>   r?   r   r-   r@   rA   rB   rC   r   r_   r`   rD   r   rE   rF   rG   )rH   r    r   rI   rJ   rK   rL   r   r   Z
reading_idZreading_activityZreading_recordZreading_habitr   r   rM   r{   Ú  sø    2ü
ü
ý


û	úÿúÿü
ý


û	úÿü
r{   )r   rN   ra   ri   r{   )r   FF)r   FF)r   FF)r   FF)r   FF)Ú__doc__r5   r;   Zevents.baser   r   r   Úhealth.health_managerr   Úcore.modelsr   r   rN   ra   ri   r{   Ú__all__r   r   r   rM   Ú<module>   s   
`
^
y
 

 $