a
    Æié  ã                   @   sF   d Z ddlZddlmZmZ ddd„Zddd	„Zdd
d„Zg d¢ZdS )z¶
Family and Parenthood Events
Having children and family life (ages 18-50)

Events:
- haveChild: Deciding to have a child
- pregnant: Pregnancy announcement
- childBorn: Child birth
é    N)ÚmessageFunctionÚquestionFunctionÚmessageFc                 C   sØ   d}|| j vo4| jjdko4| jjdk o4dt ¡ d k}|dkr–|r–| jjrÔddlm} || | jjƒ}|jd	krÔd
|j d |j	 d }t
||| |ƒS n>|dkrÔ|d dkrÀd| j_| j d¡ nd| j_| j d¡ dS )zDeciding to have a childÚ	haveChildé   é2   é   éè  Úanswerr   ©Ú
get_personéP   z$Would you like to have a child with ú ú?ÚoptionÚYesTz#You are now trying to have a child!Fz)You decide not to have a child right now.N)ÚaskedQuestionsÚcÚageYearsÚrandomÚpartnerÚ	functionsr   ÚaffinityÚ	firstnameÚlastnamer   ÚtryingForChildÚmessageQueueÚappend)ÚplayerÚtyper   ÚresponseÚfnameÚcheckr   r   © r#   ú8/var/www/lichun.app/lichun/ws/events/adulthood/family.pyr      s    2
r   c           	   	   C   sö   d}|| j vo@| jjdko@| jjdko@| jjdk o@dt ¡ d k}|dkrŽ|rŽ| jjròdd	lm} || | jjƒ}|jd
kròd}t	||| |ƒS nd|dkrò|d dkròd| j_
d| j_ddlm} | jj || jddgd| jj dd�¡ | j d¡ dS )zPregnancy announcementÚpregnantTr   r   r   r	   r
   r   r   r   zYou are pregnant!r   r   F)Ú	schedulerÚ	PregnancyÚdailyÚhomei  )ÚlocationÚdurationzYou are now pregnant!N)r   r   r   r   r   r   r   r   r   r   r%   r&   Ú	schedulesr   Úidr   )	r   r   r   r    r!   r"   r   r   r&   r#   r#   r$   r%   #   s     >
(r%   c           	      C   s�   d}ddl m} t| jddƒo(|| jdƒ}|dkrŒ|rŒddl m} || ƒ}d| j_d| j_d	| j_| j 	d
|j
 d |j ¡ t||| |ƒS dS )zChild birthÚ	childBornr   )ÚscheduleCompleter%   Fr'   r
   )Ú	add_childTz You have a child! Their name is r   N)r   r/   Úgetattrr   r0   r%   r   Úchildrenr   r   r   r   r   )	r   r   r   r    r!   r/   r"   r0   Úchildr#   r#   r$   r.   8   s    r.   )r   r%   r.   )r   FF)r   FF)r   FF)	Ú__doc__r   Zevents.baser   r   r   r%   r.   Ú__all__r#   r#   r#   r$   Ú<module>   s   



