a
    iVD                     @   s^   d Z ddlZddlmZmZ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 )a  
Family Activity Events
Family bonding and interaction activities (ages 5-100)

These events focus on relationship building with family members rather than
tracked activities. They check for family member existence, modify affinity,
and create appropriate schedules or one-time events.

Integration Approach:
- All events check for family members (get_allFamily) before triggering
- Events modify family member affinity appropriately based on player choices
- Recurring activities (game night) create schedules via scheduler()
- Planned events (vacation, photos) create oneTimeEvents with future dates
- Events that reference specific family members store IDs between question/answer phases
- Probabilities adjusted for reasonable trigger rates (1/500 to 1/800)
- Energy costs and social stat changes reflect the nature of the interaction

Events:
- familyGameNight: Weekly/monthly family game night tradition (ages 8+)
- familyVacation: Planning a family vacation with oneTimeEvent (ages 8-65)
- teachSiblingSkill: Teaching a younger sibling (ages 10-30, requires younger siblings)
- helpParentProject: Helping parent with home projects (ages 10-45, requires parents)
- familyPhoto: Professional family photo session with oneTimeEvent (ages 5+)
    N)messageFunctionquestionFunctionanswerOptionmessageFc                 C   s  d}ddl m} || }|| jvoT| jjdkoT| jjdkoTt|dkoTdt d k}d}|d	krzg d
}t||| ||S |d	krddl m}	m	}
 |d dkr| jj
|	| jdg dd| jj dd | j jd7  _| j jd7  _|D ]}| jd7  _q| jd n|d dkr| jj|
dd| jdddd| jj d | j jd7  _| j jd7  _|D ]}| jd7  _qn| jd n6| j jd8  _|D ]}| jd8  _q| jd  d!S )"z*Start a weekly family game night traditionfamilyGameNightr   get_allFamily   d        zHYour family suggests starting a regular game night tradition. How often?answer)Yes, every week!Once a monthToo busy)	scheduleroneTimeEventoptionr   zFamily Game Night)weeklyeveningweekendhome   )locationduration   
      zvYou've started a weekly family game night tradition! Every Friday evening, the family gathers for board games and fun.r   zRIt's time for your monthly family game night! Everyone's excited to play together.daysFromNow      titler   datedateTypedateModifierhourr         zMYou've decided to have family game night once a month. It's a nice tradition!zFYou're too busy for family game night. Your family seems disappointed.N)	functionsr   askedQuestionscageYearslenrandomr   r   r   	schedulesappendid	happinesssocialaffinitymessageQueueoneTimeEventsr#   )playertyper   responsefnamer   familycheckanswerOptionsr   r   member r?   9/var/www/lichun.app/lichun/ws/events/activities/family.pyr      s\    




*
r   c                 C   sJ  d}ddl m} || }|| jvo`| jjdko`| jjdko`t|dko`| jjdko`dt d k}d	}|d
krtdddtdddddg}t	||| ||S |d
krFddl m
}	 |d dkr2| jj|	dd| jdtddddd | j jd8  _| j jd7  _|D ]}
|
 jd7  _q| jd n|d dkr| jj|	dd| jdtddddd | j jd8  _| j jd7  _|D ]}
|
 jd 7  _q| jd! n|d dkr*| jj|	d"d#| jdtdd$dd%| jj d | j jd 7  _|D ]}
|
 jd&7  _q| jd' n| j jd 8  _| jd( d)S )*z Plan a family vacation this yearfamilyVacationr   r   r	   A   r   r   i   z@Your family wants to plan a vacation together. What sounds good?r   zYes, big trip!i  	moneyCostzWeekend getawayzStaycation at homezCan't afford itr   r   zFamily VacationzXYour big family vacation has arrived! Everyone's excited for this amazing trip together.r      Z   vacationr!   r   zlYou've planned an amazing family vacation! Everyone is excited about the trip. You'll leave in a few months.zFamily Weekend GetawayzDTime for your family weekend getaway! A nice break from the routine.r      r'   z\A weekend getaway with the family sounds perfect! You've booked it for a few weeks from now.zFamily StaycationzXYour family staycation week begins! Time to relax at home and enjoy quality family time.   r   r   zgYou've planned a staycation at home. It'll be relaxing and the family will enjoy quality time together.z7You can't afford a vacation right now. Maybe next year.N)r)   r   r*   r+   r,   r-   moneyr.   r   r   r   r6   r0   r#   randintr2   r4   r5   r1   r7   r8   r   r9   r:   r   r;   r<   r=   r   r>   r?   r?   r@   rA   a   s    











rA   c                 C   s(  d}g }| j D ]&}d|jv r|j| jjk r|| q|| jvo~| jjdko~| jjdko~t|dko~| jjdko~dt d k}|sdS t	|}|d	kr|j
| _d
|j d}|d	krtdddddg}	t||| ||	|gdS |d	kr$ddlm}
 |
| t| dd}|s|rt	|}|r|d dkr| j jd8  _| j jd7  _| j jd7  _| jd7  _| jd|j d n|d dkr| j jd7  _| j jd7  _| jd7  _| jd|j d n2| j jd8  _| jd8  _| j|j d t| dr$t| d dS )z6Your younger sibling wants you to teach them somethingteachSiblingSkillsiblingr   rF   r   r   X  Nr   zYour younger sibling z) wants you to teach them something. Help?zYes, spend time teaching!
energyCostzQuick lesson onlyr   
characters
get_person_temp_sibling_idr   r   r   z You spent quality time teaching z/. They really appreciated it and learned a lot!r(   z	You gave z, a quick lesson. They learned something new!r'   z6 seems disappointed that you're too busy to help them.)rrelationshipsr,   r+   r0   r*   r-   energyr.   choicer1   rW   	firstnamer   r   r)   rV   getattrr2   r3   r4   r5   hasattrdelattr)r7   r8   r   r9   r:   Zyounger_siblingspersonr<   rO   r=   rV   r?   r?   r@   rN      sd    









rN   c                 C   s  d}ddl m} || dp"|| d}|| jvoh| jjdkoh| jjdkoh|duoh| jjdkohd	t d
 k}|srdS |dkr|j| _d}d|j	v rd}nd|j	v rd}g d}	t
|	}
d| d|
 d}|dkrtdddtddddg}t||| |||gdS |dkr~ddl m} || t| dd}|sF|| dpD|| d}|rhd}d|j	v rbd}nd|j	v rrd}|d dkr| j jd8  _| j jd7  _| j jd7  _| jd7  _| jd| d n|d dkr6| j jd8  _| j jd7  _| j jd7  _| jd7  _| jd| d n2| j jd8  _| jd8  _| jd| d  t| dr~t| d dS )!z*Your parent needs help with a home projecthelpParentProjectr   )get_relationshipmotherfatherr   -   Nr   rP   r   parent)	gardeningzpainting the housezfixing the fencezorganizing the garagezremodeling the kitchenzYour z needs help with z. Want to assist?zYes, help all day!r   rQ   zHelp for a bitr   rS   rU   _temp_parent_idr   r'   r   zYou helped your zF all day with the project. They're grateful and you feel accomplished!r(   z- for a while. They appreciate the assistance!z) is disappointed you're too busy to help.)r)   rb   r*   r+   r,   rZ   r.   r1   rh   rY   r[   r   r   rV   r]   r2   r3   r4   r5   r0   r^   r_   )r7   r8   r   r9   r:   rb   rf   r<   Zparent_titleZprojectsprojectr=   rV   r?   r?   r@   ra     sx    










ra   c                 C   s  d}ddl m} || }|| jvo`| jjdko`| jjdko`t|dko`| jjdko`dt d k}d	}|d
krtdddtddddg}t	||| ||S |d
krddl m
}	 |d dkr>| jj|	dd| jdtddddd | j jd8  _| j jd7  _| j jd7  _|D ]}
|
 jd7  _q| jd n|d dkr| jj|	dd| jdtddddd | j jd8  _| j jd7  _|D ]}
|
 jd7  _q| jd n6| j jd8  _|D ]}
|
 jd8  _q| jd d S )!z(Family wants to take professional photosfamilyPhotor   r   r(   r
   2   r   i  zPYour family wants to schedule a professional photo session together. Are you in?r   zYes, sounds fun!rC   zOkay, if I have toZRefuserE   r   zFamily Photo Sessionz\Today is the family photo session! Time to smile for the camera and create lasting memories.r   r   rI   rJ   Zphotography_studior!   r'   zdYou're excited for the family photo session! It's scheduled for a few weeks from now. Should be fun!zIToday is the family photo session. Time to put on a smile for the camera.zXYou agreed to participate in the family photos. It's scheduled for a few weeks from now.r   r   zPYou refused to participate in family photos. Your family is really disappointed.N)r)   r   r*   r+   r,   r-   rK   r.   r   r   r   r6   r0   r#   rL   r2   r3   r4   r5   rM   r?   r?   r@   rj   R  s|    









rj   )r   rA   rN   ra   rj   )r   FF)r   FF)r   FF)r   FF)r   FF)__doc__r.   Zevents.baser   r   r   r   rA   rN   ra   rj   __all__r?   r?   r?   r@   <module>   s   
C
^
C
P
O