a
    i|                     @   s   d Z ddlZddlmZ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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 )+z
Moral Dilemma Events
Complex ethical decisions with lasting consequences

Events:
- braceletDilemma: Stolen bracelet dilemma
- bullyDilemma: Bullying intervention dilemma
    N)messageFunctionquestionFunctionanswerOptiondilemmaClassmessageFc                    sd  d}|| j vo@d| jjv o@| jjdko@| jjdk o@dt d k}tddd	td
dd	tddd	g}|r&|dkr&ddlm}m}	 || }
|
r&|	| }|	| }|j	d |j
 }|j	d |j
 }t||}|
j|_|j|jg|_| j| d|
j	 d |
j
 d | d | d }t||| ||S |dkrjt fdd|D d| jd _| j j| jd jj8  _|r`t|dr`|jdkr`ddlm} || |j}
|| |jd }|| |jd }|j	d |j
 }|j	d |j
 }d}|j|d krd|
j	 d |
j
 d }nR|j|d kr8d|
j	 d |
j
 d }n(|j|d kr`d |
j	 d |
j
 d }dS )!zBullying intervention dilemmabullyDilemmaschool
           zStand up for your friend   
energyCostDon't do anythingr   zJoin in on the bullyinganswer)get_random_friendget_random_classmate Your friend z$  is being bullied by popular kids, z and z What do you do?c                 3   s    | ]}|j  d  kr|V  qdS optionNr   .0r   response >/var/www/lichun.app/lichun/ws/events/dilemmas/moral_choices.py	<genexpr>#       zbullyDilemma.<locals>.<genexpr>Nstep   
get_person zYou stand up for your friend zE and tell the bullies to stop. They stop and leave your friend alone.z9You don't do anything about the bullying and your friend z continues to be bullied.z,You join in on the bullying and your friend )askedQuestionsclocationageYearsrandomr   	functionsr   r   	firstnamelastnamer   idfriendZbulliesactiveDilemmasappendr   nextr   energyr   hasattrr"   r%   )playertyper   r   dilemmafnamecheckanswerOptionsr   r   r0   
classmate1Z
classmate2classmate1NameZclassmate2Namer%   r   r   r   r      sD    >"
(
 r   c                    s  d}|| j vo@d| jjv o@| jjdko@| jjdk o@dt d k}tdddtd	d
dtdddg}|r|dkrddlm} || }	|	jd |	j	 }
d|
 d }t
||}|	j|_| j| t||| ||S |dkrt fdd|D d| jd _| j j| jd jj8  _n|rt|drt|dr|jdkrddlm} || |j}|jd |j	 }
d}|j|d krd|
 d }n:|j|d krd|
 d }n|j|d krd|
 d }| j| | j| dS ) zStolen bracelet dilemmabraceletDilemmar   r   r
   r   r   zConfront her directly about itr   zTell the teacher about it   r   r   r   )r   r   zuYou received a bracelet from your grandmother and wear it to school, but one day it went missing. Today you saw that z   is wearing it. What do you do?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r   F   r    z"braceletDilemma.<locals>.<genexpr>Nr!   r"   r#   r$   r&   You confront z about the bracelet and she says that she found it on the ground and thought it was pretty. She apologizes and gives it back to you.z>You tell the teacher about the bracelet and she takes it from z and returns it to you.z5You decide not to do anything about the bracelet and z continues to wear it.)r'   r(   r)   r*   r+   r   r,   r   r-   r.   r   r/   	classmater1   r2   r   r3   r   r4   r   r5   r"   r%   messageQueueremove)r6   r7   r   r   r8   r9   r:   r;   r   r<   r=   r%   rA   r   r   r   r>   5   s8    >"

 *r>   c                    s  d}|| j vo(| jjdko(dt d k}tdddtdtd	td
g}|r|dkrd}t||}| j| t||| ||S |dkrt	 fdd|D d| jd _
| j j| jd j
j8  _n|rt|drt|dr|jdkrd}|j
|d kr*d}| j jd7  _| j jd7  _n|j
|d kr`d}| j jd7  _| j jd7  _nZ|j
|d krd}| j jd7  _| j jd8  _n$|j
|d krd}| j jd8  _| j| | j| dS )z"Finding someone's lost pet dilemmafoundLostPet   r   r   zTake it to vet to scan chip   r   zPost on social mediazKeep the dogzLeave it, not your problemr   zEYou found a lost dog with a collar but no one around. What do you do?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r   l   r    zfoundLostPet.<locals>.<genexpr>Nr!   r"   r#   r&   r   zYou take the dog to the vet. They scan the chip and contact the owner. The family is overjoyed to be reunited with their pet and thanks you profusely!   zYou post photos of the dog on social media. Within hours, the owners see your post and come to pick up their beloved pet. They're so grateful!r	   zYou decide to keep the dog. It's adorable and friendly, but you can't shake the feeling that somewhere, a family is heartbroken looking for their pet.   r?   zmYou leave the dog and walk away. You hope it finds its way home, but you wonder if you should have done more.)r'   r(   r*   r+   r   r   r1   r2   r   r3   r   r4   r   r5   r"   	happinesssocialrB   rC   r6   r7   r   r   r8   r9   r:   r;   r   r   r   rD   Z   sD    &

 *rD   c                    sD  d}|| j vo(| jjdko(dt d k}tdddtdd	dtd
tdg}|r|dkrddlm} || }	|	rt||}|	j|_	| j
| d|	j d|	j d}t||| ||S n|dkrt fdd|D d| j
d _| j j| j
d jj8  _n>|r@t|dr@t|dr@|jdkr@ddlm}
 |
| |j	}	d}|j|d krd|	j d|	j d}|	 jd8  _| j jd8  _n|j|d krd|	j d}|	 jd8  _nl|j|d krd |	j d!}| j jd8  _n<|j|d" kr(d#|	j d$}|	 jd7  _| j jd	8  _| j| | j
| dS )%z"Friend cheating on partner dilemmafriendCheating   r   r   zTell the partnerr	   r   zConfront your friendrF   zStay out of itzSupport your friend regardlessr   r   r   zYou discover that your friend r   z. is cheating on their partner. What do you do?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r      r    z!friendCheating.<locals>.<genexpr>Nr!   r"   r#   r$   r&   	You tell zN's partner about the cheating. They're devastated but grateful you told them. z= is furious with you and your friendship is severely damaged.rH   r@   zt about the cheating. They're defensive but eventually admit they need to make a choice. Your friendship is strained.zjYou decide to stay out of it. It's not your place to get involved. But you feel guilty every time you see z and their partner together.r?   zYou support zc no matter what. They appreciate your loyalty, but you feel uncomfortable condoning their behavior.)r'   r(   r*   r+   r   r,   r   r   r/   r0   r1   r2   r-   r.   r   r3   r   r4   r   r5   r"   r%   affinityrJ   rI   rB   rC   )r6   r7   r   r   r8   r9   r:   r;   r   r0   r%   r   r   r   rL      sN    &



 *rL   c                    s  d}|| j vo(| jjdko(dt d k}tdtdddtd	td
g}|r|dkrd}t||}| j| t||| ||S |dkrt	 fdd|D d| jd _
| j j| jd j
j8  _n|rt|drt|dr|jdkrd}|j
|d krJd}| j jd7  _| j jd7  _| j jd7  _| j jd7  _n|j
|d krpd}| j jd7  _nZ|j
|d krd}| j jd8  _| j jd7  _n$|j
|d krd}| j jd8  _| j| | j| dS ) z'Finding expensive item in store dilemmafoundExpensiveItemr	   r   r   zTurn it in to storezLook for owner yourselfrG   r   zKeep itzLeave it where it isr   z7You find an expensive phone in a store. What do you do?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r      r    z%foundExpensiveItem.<locals>.<genexpr>Nr!   r"   r#   r&   r   zYou turn the phone in to the store's lost and found. A week later, the owner contacts you to thank you and gives you a $50 reward for your honesty!rF   2   zYou look through the phone to find the owner's contact info and call them. They're incredibly grateful and meet you to get it back. It feels good to help someone.   ziYou keep the phone. It's nice, but you feel guilty every time you use it, wondering who you took it from.rH      r?   zWYou leave it where it is. Maybe the owner will come back for it. You hope they find it.r   )r'   r(   r*   r+   r   r   r1   r2   r   r3   r   r4   r   r5   r"   rI   rJ   moneydiamondsrB   rC   rK   r   r   r   rQ      sF    &

 *rQ   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}tdtdd	d
tdtdg}|r|dkrd}t||}| j| t	||| ||S |dkrt
 fdd|D d| jd _| j j| jd jj8  _n|rt|drt|dr|jdkrd}|j|d krBd}| j jd	7  _| j jd8  _n|j|d krxd}| j jd7  _| j jd	7  _nj|j|d krd}| j jd	8  _| j jd7  _n4|j|d krd}| j jd8  _| j jd8  _| j| | j| dS )z,Coworker taking credit for your work dilemmacolleagueStealingCredit   A   workr   r   zCall them out publiclyzTalk to them privatelyr	   r   zTell your bossz	Let it gor   zMA coworker presented your idea as their own in a meeting. How do you respond?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r      r    z*colleagueStealingCredit.<locals>.<genexpr>Nr!   r"   r#   r&   r   zYou call out your coworker in front of everyone. The room gets awkward. Your boss looks uncomfortable. You're right, but you've made an enemy.rG   zYou pull your coworker aside and tell them you know what happened. They apologize and agree to set the record straight. Your boss later acknowledges your contribution.r   zYou tell your boss privately that it was your idea. They investigate and confirm it. Your coworker is reprimanded, and your boss knows they can trust you.rF   r?   zwYou let it go. It eats at you, but you decide it's not worth the conflict. Your coworker gets praised for 'their' work.)r'   r(   r*   
occupationr+   r   r   r1   r2   r   r3   r   r4   r   r5   r"   rI   rJ   rB   rC   rK   r   r   r   rW      sF    >

 *rW   c           	         s  d}|| j vo(| jjdko(dt d k}tddddtd	dd
tdddtdg}|r|dkrtddg}d| d}t||}||_| j	| t
||| ||S |dkrt fdd|D d| jd _| j j| jd jj8  _| j j| jd jj8  _n|rt|drt|dr|jdkrt|drD|jnd}d}|j|d krzd| d}| j jd7  _n|j|d krd | d!}| j jd7  _nZ|j|d krd"| d#}| j jd7  _n,|j|d$ krd%| d&}| j jd8  _| j	| | j| dS )'zStray animal needs help dilemmastrayAnimalDecisionr	   r   r   zAdopt itrT   rF   	moneyCostr   zTake to shelterr   zFeed it but leave itrR   r^   ZNothingr   catZdogzThere's a skinny stray z? in your neighborhood. It looks hungry and sad. What do you do?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r   !  r    z&strayAnimalDecision.<locals>.<genexpr>Nr!   r"   r#   animalr&   r   zYou adopt the z! It takes some time and money to get them healthy, but they become a loving companion. Your life is enriched by their presence.rH   zYou take the zd to a shelter where they can get proper care and hopefully find a home. It's the responsible choice.zYou start feeding the zY regularly. They're healthier now, but you wonder if they'd be better off in a real home.r?   zYou do nothing. You see the z? around sometimes, still looking thin and sad. You feel guilty.)r'   r(   r*   r+   r   choicer   ra   r1   r2   r   r3   r   r4   r   rU   r^   r5   r"   rI   rB   rC   )	r6   r7   r   r   r8   r9   r:   r;   ra   r   r   r   r\     sF    &



 *r\   c                    s  d}|| j vo(| jjdko(dt d k}tdtdddd	td
tdddg}|r|dkrd}t||}| j| t||| ||S |dkrt	 fdd|D d| jd _
| j j| jd j
j8  _| j j| jd j
j8  _| j j| jd j
j8  _n|rt|drt|dr|jdkrd}|j
|d krfd}| j jd8  _| j jd8  _n|j
|d krd}| j jd7  _| j jd7  _nZ|j
|d krd}| j jd8  _n4|j
|d krd}| j jd7  _| j jd7  _| j| | j| dS )z#Witnessing someone shoplift dilemmawitnessShoplifting   r   r   zTell store employeezOffer to buy them foodrG   r   r^   diamondCostzLook the other wayzTalk to them about itr	   r   r   zWYou see a teen shoplifting food from a grocery store. They look hungry. What do you do?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r   K  r    z%witnessShoplifting.<locals>.<genexpr>Nr!   r"   r#   r&   r   z~You tell a store employee. They confront the teen, who looks scared and embarrassed. You followed the rules, but you feel bad.zYou approach the teen and offer to buy them food. They're surprised but grateful. They explain they're going through a hard time. You help them find resources for assistance.rS   zfYou look away and pretend you didn't see anything. You understand that sometimes people are desperate.r?   zYou talk to them about their situation. They open up about their struggles, and you help direct them to food banks and support services.rF   )r'   r(   r*   r+   r   r   r1   r2   r   r3   r   r4   r   rU   r^   rV   rf   r5   r"   rJ   rI   rB   rC   rK   r   r   r   rc   9  sH    &


 *rc   c                    s  d}|| j vo4| jjdko4| jjdko4dt d k}tdddtddd	d
tdddtdg}|r|dkrddlm} || }	|	rt||}|	j	|_
| j| d|	j d|	j d}t||| ||S n|dkrHt fdd|D d| jd _| j j| jd jj8  _| j j| jd jj8  _| j j| jd jj8  _n|rt|drt|dr|jdkrddlm}
 |
| |j
}	d}t }|j|d kr
|dkr|	j d}| j jd7  _|	 jd7  _n,d|	j d }|	 jd!8  _| j jd!8  _n|j|d krF|	j d"}| j jd7  _|	 jd!7  _nz|j|d krd#|	j d$}|	 jd!7  _| j jd	8  _n<|j|d% krd&|	j d'}|	 jd(8  _| j jd!8  _| j| | j| dS ))z/Friend asks to borrow significant money dilemmafriendBorrowMoneyr
     r   r   zYes, give them moneyr_   zYes, but make contractr   re   zOffer smaller amountd   zSay nor   r   rN   r   r   z> asks to borrow $500. They're in a tough spot. Do you lend it?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r   |  r    z$friendBorrowMoney.<locals>.<genexpr>Nr!   r"   r#   r$   r&         ?zb pays you back a few months later. They're grateful for your help and your friendship is stronger.rG   zMonths pass and z_ hasn't paid you back. You're too uncomfortable to bring it up. Your friendship feels strained.r	   z agrees to sign a simple contract. They pay you back on schedule. Your friendship remains strong and the professionalism helped.z	You give zi $100. It's not what they needed, but they appreciate the help. They seem disappointed but understanding.r?   rO   zV you can't lend them money. They're disappointed and the friendship feels awkward now.rF   )r'   r(   r*   rU   r+   r   r,   r   r   r/   r0   r1   r2   r-   r.   r   r3   r   r4   r   r^   rV   rf   r5   r"   r%   rP   rI   rB   rC   )r6   r7   r   r   r8   r9   r:   r;   r   r0   r%   ZrepayChancer   r   r   rg   f  s`    2



 *
rg   c                    s  d}|| j vo(| jjdko(dt d k}tddddtd	d
dtdtddddg}|r|dkrd}t||}| j| t||| ||S |dkrt	 fdd|D d| jd _
| j j| jd j
j8  _| j j| jd j
j8  _n|rt|drt|dr|jdkrd}|j
|d kr>d}| j jd8  _n|j
|d krdd}| j jd7  _nZ|j
|d krd}| j jd8  _| j jd8  _n$|j
|d  krd!}| j jd7  _| j| | j| dS )"z4Choosing between convenience and environment dilemmaenvironmentalChoicerM   r   r   zCheap flightrT   rH   r]   zEco-friendly optioni  r_   zDon't fly at allzTrain/bus instead   (   r   zYou need to travel across the country. You can take a cheap flight with multiple connections or pay more for a direct eco-friendlier option. What do you choose?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r     r    z&environmentalChoice.<locals>.<genexpr>Nr!   r"   r#   r&   r   zYou take the cheap flight with multiple layovers. It's exhausting and takes all day, but you saved money. You try not to think about the carbon footprint.r   zYou pay extra for the more efficient direct flight. It costs more, but you feel good about making a more environmentally conscious choice.rF   zqYou decide not to make the trip at all. It's disappointing, but you feel you made the right environmental choice.r	   r?   zYou take a train instead. It takes much longer and you're exhausted, but you enjoyed seeing the countryside and feel good about the lower environmental impact.)r'   r(   r*   r+   r   r   r1   r2   r   r3   r   r4   r   rU   r^   r5   r"   rI   rJ   rB   rC   rK   r   r   r   rk     sB    &

 *rk   c           	         s2  d}|| j vo4| jjdko4| jjdko4dt d k}tdddtd	d
ddtdddtdg}|r|dkrtddg}d| d}t||}||_| j	| t
||| ||S |dkrt fdd|D d| jd _| j j| jd jj8  _| j j| jd jj8  _n|r.t|dr.t|dr.|jdkr.t|drP|jnd}d}|j|d krd| d }| j jd!8  _n|j|d krd| d"}| j jd#7  _nb|j|d krd$| d%}| j jd&7  _n4|j|d' krd(}| j jd)8  _| j jd)8  _| j	| | j| dS )*z)Deciding on care for aging parent dilemmaparentCareDecisionrm   F   r   r   zNursing homei  r_   zLive with yourh   rH   r]   zHire in-home carei  zRely on siblingsr   motherfatherzYour z9 can no longer live alone safely. What's the best option?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r     r    z%parentCareDecision.<locals>.<genexpr>Nr!   r"   r#   parent_typeparentr&   r   zYou move your zx into a nursing home. They're well cared for, but you feel guilty every time you visit. They seem sad but understanding.rG   z moves in with you. It's challenging and exhausting, but you get to spend quality time together. They're grateful and you have no regrets.r	   zYou hire in-home care for your zf. They can stay in their home with professional help. It's expensive but feels like the right balance.r   r?   zYou arrange for your siblings to share care responsibilities. But they feel you're not doing your part, and family tensions increase.rF   )r'   r(   r*   r+   r   rb   r   rr   r1   r2   r   r3   r   r4   r   rU   r^   r5   r"   rI   rJ   rB   rC   )	r6   r7   r   r   r8   r9   r:   r;   rr   r   r   r   rn     sH    2



 *rn   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}tddd	td
tdddtdddg}|r|dkrd}t||}| j| t	||| ||S |dkr4t
 fdd|D d| jd _| j j| jd jj8  _| j j| jd jj8  _| jd jjdk rX| j jt| jd jj7  _n$|rXt|drXt|drX|jdkrXd}|j|d krt }|dkrd}| j jd7  _d| j_nd}| j jd7  _d| j_n|j|d krd}| j jd 7  _| j jd 8  _nJ|j|d krd!}| j jd 8  _n$|j|d" kr@d#}| j jd8  _| j| | j| dS )$z.Discovering unethical behavior at work dilemmawhistleblowerDecisionrS   rY   rZ   r   r   zReport to authoritiesrG   )rf   zReport internallyzLook for new job firstrH   r   zStay silentir_   r   zBYou discover your company is doing something unethical. Report it?c                 3   s    | ]}|j  d  kr|V  qdS r   r   r   r   r   r   r   	  r    z(whistleblowerDecision.<locals>.<genexpr>Nr!   r   r"   r#   r&   rj   zYou report to authorities. There's an investigation and the company is held accountable. You lose your job but you're protected as a whistleblower and find a better position. You did the right thing.
unemployedzYou report to authorities but the investigation goes nowhere. Your company finds out it was you and you're quietly let go. It was the right thing to do, but it cost you.zYou report internally through proper channels. The company addresses the issue quietly. You keep your job but you're watched closely now.r	   zYou start looking for a new job before saying anything. You find a position elsewhere and leave quietly. The unethical practices likely continue.r?   zyYou stay silent and keep collecting your paycheck. You rationalize it, but the guilt weighs on you. You're complicit now.)r'   r(   r*   r[   r+   r   r   r1   r2   r   r3   r   r4   r   rV   rf   r^   rU   absr5   r"   rI   rJ   rB   rC   )	r6   r7   r   r   r8   r9   r:   r;   outcomer   r   r   rt     sR    >




 "*


rt   )r   r>   rD   rL   rQ   rW   r\   rc   rg   rk   rn   rt   )r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)r   FFF)__doc__r+   Zevents.baser   r   r   r   r   r>   rD   rL   rQ   rW   r\   rc   rg   rk   rn   rt   __all__r   r   r   r   <module>   s   	
'
%
+
0
,
,
,
-
:
*
-
3