a
    ?i	M                     @   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
d.ddZd/ddZd0ddZd1ddZd2ddZd3ddZd4ddZd5ddZd6d d!Zd7d"d#Zd8d$d%Zd9d&d'Zg d(ZdS ):a9  
School Year Transition Events
School progression and grade transitions (from dayEvents.py)

Events:
- school: School year transitions and grade progression
- graduate5th: 5th grade graduation
- graduate8th: 8th grade graduation
- graduate12th: 12th grade graduation (high school)
- college: College year transitions
- collegeParty: College party
- collegeGreekLife: Joining Greek life
- collegeMissHome: Missing home in college
- collegeMinor: Choosing a college minor
- adultMissFriends: Missing friends as adult
- driversLessons: Driver's education
- driversTest: Taking driver's test
- positiveInteraction: Positive social interaction
- lowEnergyEvents: Low energy coping mechanisms
- extendedFamily: Extended family relationship events
- murderAttempt: Extreme negative relationship event
- funeral: Attending a funeral
    N)messageFunctionquestionFunctionanswerOptionmessagec           
      C   sp  d}d}d}d}d}| j jdkr6d| j jvr6| jdksR| j jdkr| j jdkr| j j}d}| j jd	kr| j jd
krd}d}n| j jdkrt| j| j _| j j	
| j j d}d}ddlm} ||| j j| jd| j _| j j
| j j n| j jdkrd}d}nx| j jdkr&d}d}n^| j jdkr@d}d}nD| j jdkrZd}d}n*| j jdkrtd}d}n| j jdkrd}d}n| j jdkrd}d}n| j jdkr>| j j	D ] }|| jv r| j j	| qt| j| j _| j j	
| j j ddlm} ||| j j| jd| j _| j j
| j j d }d!}nF| j jd!krVd"}d#}n.| j jd#krnd$}d%}n| j jd%krd&}d'}d| j _|| j _td(|  | j jdkr0d| j jvr0| jd)kr0d}| j jd*kr&| j jdkr&d+| j j d, }| j jdkrt|  | j jdkr0t|  n
d-}d.| _t||| |}|rl| j jd	krfdd/lm}	 |	|  d| _|S )0z-School year transitions and grade progressionschoolFstudentcollege09-01Z	preschool   TNone   zYou have started kindergartenZkindergartenzYou have started 1st gradeZ1str   EducationRecordZeducationLevellocationdatezYou have started 2nd gradeZ2ndzYou have started 3rd gradeZ3rdzYou have started 4th gradeZ4thzYou have started 5th grade5thzYou have started 6th gradeZ6thzYou have started 7th gradeZ7thzYou have started 8th grade8thzYou have started highschoolZ9thzYou have started 10th gradeZ10thzYou have started 11th gradeZ11thzYou have started 12th grade12thzeducation updated to 06-01Z
highschoolzYou have finished z gradez%You have finished school for the yearZyearlyGraduation)create_classmates)c
occupation	educationr   ageYearsrandomchoiceZelementary_schoolsZelementary_school
activitiesappend	functionsr   current_educationactivityRecordsremovehigh_schoolsZhigh_schoolprintgraduate8thgraduate5thdayEventr   r   updateClient)
playertypefnamecheckresultr   r   r   ar    r/   ?/var/www/lichun.app/lichun/ws/events/school_year/transitions.pyr      s    >(
r   Fc                 C   sV   d}d}d}| j jdkr6| j jdkr6| jdkr6d}d}t||| |dg}|rRd| _|S )	Nr&   Fr   r   r   TzYou have finished 5th grade! Take this opportunity to reflect on your life so far, and say goodbye to your elementary school friends.zOnward to middle school!r   r   r   r   r   r(   r)   r*   r   responser,   r+   r-   r/   r/   r0   r&   v   s    "r&   c                 C   sV   d}d}d}| j jdkr6| j jdkr6| jdkr6d}d}t||| |dg}|rRd| _|S )	Nr%   Fr   r   r   TzYou have finished 8th grade! Take this opportunity to reflect on your life so far, and say goodbye to your middle school friends.zOnward to highschool!r1   r2   r/   r/   r0   r%      s    "r%   c                 C   s|   d}d}d}| j jdkr\| j jdkr\| jdkr\d}d}| j jD ]}|| jv r>| j j| q>t||| |dg}|rxd| _|S )	Ngraduate12thFr   r   r   TzYou have finished 12th grade! Take this opportunity to reflect on your life so far, and say goodbye to your high school friends.zOnward to college!)	r   r   r   r   r   r#   r"   r   r(   )r)   r*   r   r3   r,   r+   r-   r.   r/   r/   r0   r4      s    "
r4   c           
      C   s  d}d}d}d}d}| j jdkr`| j jr`| j jdksFd| j jv r`| jdkr`| j j}d}td| j j  | j jdkr
d| j jj d	 }d| j _| j jD ]}|j	d
kr| j j
| qd}ddlm} ||| j j| jd| j _| j j| j j | j j| j j nF| j jdkr"d}d}n.| j jdkr:d}d}n| j jdkrPd}d}d| j _|| j _| j jdkr| j jdkr| jdkrd}d}d| j _ddlm}	 |	| | j | _ t||| |}|rd| _|S )Nr   Fr   r   r	   Tzstarting college yearzYou have started college at z! You are a freshman.jobcollege yr 1r   r   r   z0You have started your sophomore year of college.zcollege yr 2z-You have started your junior year of college.zcollege yr 3z-You have started your senior year of college.zcollege yr 4r   zLYou have graduated college! Congratulations, it's time to start your career.work)	randomJob)r   r   r   r   r   r$   titler5   r   r*   r"   r   r   r    r!   r   r8   r   r(   )
r)   r*   r+   r,   r-   r   r   r.   r   r8   r/   r/   r0   r      sR    >
(r   c                 C   s   d}| j o | jjdko t dk }|rR|dkrRd}tdtdg}t||| d|S |dkr| j|d	  |d
 dkr| j jd7  _| j j	d7  _	|d
 dkr| j j	d8  _	d S )NcollegePartyr6   皙?answerz'Hey! There's a party tonight, wanna go?zI'll be there!No thanks, I should study.Tdataoptionr   )
weekendr   r   r   r   r   askedQuestionsadd	happinesssocialr)   r*   r   r3   r+   r,   answerOptionsr/   r/   r0   r:      s    r:   c                 C   s   d}| j o | jjdko t dk }|rR|dkrRd}tdtdg}t||| d|S |dkr|d	 dkr| j jd
7  _| j jd7  _d| j_|d	 dkr| j jd
8  _d S )NcollegeGreekLifer6   r;   r<   z-Would you like to join a fraternity/sorority?zYes!r=   Tr?   r      )	r@   r   r   r   r   r   rC   rD   Z	greekLiferE   r/   r/   r0   rG      s    rG   c                 C   sN   d}| j jdko&| j jdk o&t dk }|rJd}| j| t||| |S d S )NcollegeMissHomer6   2   {Gz?z@You miss home, and your family misses you. You should call them.)r   r   rD   r   eventsrB   r   )r)   r*   r+   r,   r   r/   r/   r0   rI      s    $rI   c                 C   s@   d}| j jdkot dk }ddlm} t|| jddi}d S )NadultMissFriendsr7   rK   r   find_where_testaffinity__gtrJ   )r   r   r   r   rO   listr)r)   r*   r+   r,   rO   Zfriendsr/   r/   r0   rM      s    rM   c                 C   s   d}| j jdko*t dk o*t| j dd }|rT|dkrTd}g d}t||| d	|S |dkr~|d
 | j _| j  jd8  _d	| _d S )NcollegeMinorr6   r;   minorFr<   z!Would you like to choose a minor?)ZArtZBiologyZBusinessZ	ChemistryzComputer ScienceZ	EconomicsZEnglishZHistoryZMathematicsZMusicZ
PhilosophyZPhysicszPolitical ScienceZ
PsychologyZ	SociologyZTheaterTr?   r   )r   r   r   getattrr   rT   energyr(   rE   r/   r/   r0   rS     s    (rS   c                 C   s   ddl m} d}| jjdko@| jjdk o@|| jvo@dt d k}d}|r|| jj|| jd	g d
d| jj t	ddd t
||| |S )Nr   	schedulerdriversLessonsrH         d   z4Your parents have signed you up for drivers lessons!Drivers Education)dailyweekdayZafterSchoolr      r   duration)r   rX   r   r   rL   r   	schedulesr   idrandintr   )r)   r*   rX   r+   r,   r   r/   r/   r0   rY     s    22rY   c                 C   s  d}ddl m}m} || jvo>| jj o>|| jdo>t dk }ddg}	|dkr|rt| jd	shd| j_| j jd
7  _| jj}
d||
 d }t	||| ||	S |dkrt| jd	sd
| j_t
dd| jjd
 d  }t |k rd}d| j_| j| nd}| j| d S )NdriversTestr   )scheduleCompleteordinal_suffixr]   r;   ZNervousZ	Confidentr<   driversTestAttemptsr[   zToday is your z3 attempt at the driver's test! How are you feeling?g?g      ?zYou passed your drivers test!TzYou failed your drivers test!)r   rg   rh   rA   r   ZcanDriver   hasattrri   r   minrB   messageQueuer   )r)   r*   r   r3   dilemmar+   rg   rh   r,   rF   numZ	pass_rater/   r/   r0   rf     s*    ,
rf   c           	      C   s   d}ddl m} ddl m} tt|| jddidk}|r|dkrdt d	 krtd
 |t|| jddi}|jd }t	||| dS |dkrd| _
d S )NpositiveInteractionr   rN   	randArrayrP   rJ   r<   r[     zpositive interactionz6 is starting to really like you and wants to hang out!TZactive)r   rO   rq   lenrQ   rR   r   r$   	firstnamer   Z
controller)	r)   r*   r   r3   r+   rO   rq   r,   pr/   r/   r0   ro   8  s    
ro   c           	      C   s   d}| j jdk r|dkr| j jt d krdddd}| j jd	krLd
|d< | j jdkr`d|d< | j jdkrtd|d< tt| }|| }ddddddd}t|| |g}t	||| d|S d S )NlowEnergyEventsr`   r<   rr   zoYou notice a sharpness creeping into your tone. Fatigue is making you irritable and you're pushing people away.zpYour tiredness is making you reach for comfort foods. You're overeating and it's not making you feel any better.zqYou're withdrawing from friends and family, opting to be alone. Isolation seems easier when you're this worn out.)rudeness
overeating	isolationr7   z<You wake up feeling exhausted and decide to skip work today.	skip_workr   z>You wake up feeling exhausted and decide to skip school today.skip_school   zTExhaustion sets in and you find yourself reaching for a drink more often than usual.alcoholzI've run out of patience.zI just need some comfort food.zI just need some alone time.zI need a personal day.zI can't face school today.z)Just one more drink to take the edge off.)rw   rx   ry   rz   r{   r}   T)
r   rV   r   r   r   r   rQ   keysr   r   )	r)   r*   r   r3   r+   ZmessageOptionsZcoping_mechanismZ
answerDictrF   r/   r/   r0   rv   F  s.    (rv   c                 C   s   d}|dkrg }| j D ]"}|jdkr|jdk r|| qt|dkrdt d krt|}|jd }td	|j	td
|j	g}t
||| d|S n`|dkr|rddlm}	 |	| |d }
|d d	kr|
 jd7  _| j jd8  _n|
 jd8  _d S )NextendedFamilyr<      ir   r[   r   zF is upset you've been ignoring them, you should have a chat with them!z(I'll set some time aside to talk to themzI'm ignoring them for a reason!T)
get_personr>   r?   r`   
   )rR   familyLevelaffinityr   rs   r   r   rt   r   rd   r   r   r   r   rV   )r)   r*   r   r3   r+   foundrR   r   rF   r   ru   r/   r/   r0   r   d  s&    




r   c           	      C   s   d}ddl m} ddl m} tt|| jddidk}|rdt d kr|d	kr|t|| jddi}|d
 d }t||| dS d S )NmurderAttemptr   )findrp   r   ir[   i r<   rt   zI hates you so much they break into your house and stab you in your sleep.T)r   r   rq   rs   rQ   rR   r   r   )	r)   r*   r   r3   r+   r   rq   r,   ru   r/   r/   r0   r   {  s    r   c              
   C   s  | j D  ]}d}d|j |j }|dkrf|jdkrf|| jvrfd}|jd |j d }t||| |  S |dkr||j|j kr| j| |d d	kr| j jd
8  _| j j	d
8  _	ddl
m} | jj|| jdg dd| jj dd q|d dkr| jd qd S )NFz
funeral---r<   aliveT z9 has passed away, would you like to attend their funeral?r?   YesrH   r   rW   ZFuneral)onceZ	afternoonr@   Zcemeteryr[   ra   NozYou did not attend the funeral.)rR   rt   lastnamestatusrL   r   rB   r   rC   rD   r   rX   rc   r   rd   rl   )r)   r*   r   r3   Zpersonr,   r+   rX   r/   r/   r0   funeral  s     ,r   )r   r&   r%   r4   r   r:   rG   rI   rM   rS   rY   rf   ro   rv   r   r   r   )r   )r   FFF)r   FFF)r   FFF)r   )r   FF)r   FF)r   )r   )r   FF)r   )r   FFF)r   FF)r   FF)r   FF)r   FF)r   FF)__doc__r   Zevents.baser   r   r   r   r&   r%   r4   r   r:   rG   rI   rM   rS   rY   rf   ro   rv   r   r   r   __all__r/   r/   r/   r0   <module>   s(   
W



.


	









