a
    il                     @   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rtdd	d
ddtddddtddddtddg}t||| ||S |dkrd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description2   Zvegetable_gardenZ	Gardeningz
twice-weekmorninghome
   locationdurationzFirst HarvestzYour 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rd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 MilestonezYou'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 SightingzYou 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rt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	communityK   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rd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 TherezYou'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
 

 $