# sentence

!if Sveta has a home, receives an envelope home from the court to appear. If possible make it trigger as Sveta enters the home
!!shows up when courtletter_date = daystart
!!adding a version if Sveta has gone to court and not paid the fine within 30 days


!! gs 'add_fine', fine
if $ARGS[0] = 'add_fine':
	policeQW['legal_fine'] += ARGS[1]

	temp_tot_missed = max(0, policeQW['tot_court_dates_missed'] + policeQW['tot_fines_deadlines_missed'])
	temp_current_missed = max(0, policeQW['missed_fine_deadlines'] + policeQW['missed_court_dates'] - 1)

	if policeQW['fine_deadline'] = 0:
		policeQW['fine_deadline'] = daystart + 28 - min(14, temp_tot_missed / 4)
	else
		policeQW['fine_deadline'] = max(daystart, policeQW['fine_deadline']) + 14 - min(7, 2 * temp_current_missed + temp_tot_missed / 4)
	end

	killvar 'temp_current_missed'
	killvar 'temp_tot_missed'
end


if $ARGS[0] = 'start':
	*clr & cla
	minut += 2
	gs'stat'

	'<center><img <<$set_imgh>> src="images/locations/city/shared/court/courthouse.jpg"></center>'
	'You are standing in the middle of the Greco-Roman inspired main courthouse for the whole city of St. Petersburg.'
	'There are many statues of political and legal figures in the region going right back to a bust of Catherine the Great.'

	act 'Leave': gt 'city_center'

	if policeQW_courthearing_dates[0] = daystart and hour >= 7 and hour < 11: act 'Go to your hearing': gt 'sentence', 'hearing'

	if AlexandriaQW = 13: 
		act 'Look for Filipp Kudashov''s office.': gt 'alexandriaEv', 'filipp'

	elseif $clothingworntype = 'danilovich_outfits' and $shoeworntype = 'danilovich' and pregchem < 1800 and AlexandriaQW = 15:
		act 'You found Ana': gt 'alexandriaEv', 'anachase1'
	end
end


if $ARGS[0] = 'hearing':
	minut += 10
	gs 'stat'

	'<center><img <<$set_imgh>> src="images/locations/city/shared/court/entrance.jpg"></center>'
	'You walk inside the courthouse dragging your legs and as you enter you notice a line has formed while people are walking through a body scanner. You patiently await your turn and head straight to the reception area.'
	'"Hello, my name is <<$pcs_firstname>> <<$pcs_lastname>> and I got this summon in the mail," you tell the woman sitting there.'
	'She tells you to hand it over and looks through it and nonchalantly says, "Okay, head to courtroom number 5 and they''ll call out your name when it''s your turn."'
	'Nervously you nod and head over to the designated courtroom.'

	act 'Head to the courtroom':
		*clr & cla
		minut += 10
		gs 'stat'

		'<center><img <<$set_imgh>> src="images/locations/city/shared/court/courtroom.jpg"></center>'
		'You spend some time searching for the correct courtroom and you stop and ask several people where the room is located. Thankfully, they''re really helpful and point you in the right direction.'
		'Before opening the door you take a deep breath as you try to shake off the nervousness and after a few seconds you grab the handle and push the door to let yourself in.'
		'Hardly anyone pays attention to you as you walk in as there''s already a sentencing in process.'

		act 'Wait':
			*clr & cla
			minut += 120
			gs 'stat'

			'<center><img <<$set_imgh>> src="images/locations/city/shared/court/wait.jpg"></center>'
			'For what feels like an eternity you sit there and listen to a court-case after another. The process seems to be quite streamlined, the judge starts out by telling the accused what they''re accused of and then lets the defendant state their case.'
			'You try your best to listen to some of the defenses maybe you can pick up something useful before seeing the judge but it doesn''t take long before you lose focus and dream yourself away not really focusing on what''s happening around you.'
			'All of a sudden you''re interrupted as you hear your name being called out. Startled, you quickly let the whole room know that you''re here as you hear some people quietly let out a laugh.'

			if mid($policeQW_courthearing_subjects[0], 1, 8) = 'shoplift':
				act 'Stand in front of the judge':
					*clr & cla
					minut += 20
					gs 'stat'

					'<center><img <<$set_imgh>> src="images/locations/city/shared/court/judge.jpg"></center>'
					'The judge speaks up with a stern voice, "So I see that you''re here because of you''ve gotten caught stealing."'
					'You sink your glance in shame and nod meekly.'
					'The judge continues on, "Let''s see what the detectives concluded during their investigation."'

					if mid($policeQW_courthearing_subjects[0], 10, 4) = 'easy':
						'The judge sits and quietly glances through the report, looking towards you from time to time, "Miss <<$pcs_lastname>>, the detective seem to be quite positive in the report."'
						'Suddenly, you feel a bit emboldened as the detective seems to have come through for you. You even manage to let out a little smirk.'
						'"Well as you''ve already admitted being guilty I guess we don''t need to listen to your pleading," he sternly looks at you.'
						'"Yes your honor." you respectfully answer.'

!!do a check if the player missed any earlier sentencing
						if policeQW['missed_court_dates'] > 0:
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>," and just as he''s about to close it, he stops at the last page, "Wait! What is this? Have you missed a sentencing?" he inquirers.'
							'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "Yes..." you meekly answer.'
							'With the judges eyes piercing through you, they clear their throat, "Well then this will affect your punishment. This is a serious thing Miss <<$pcs_lastname>>. The court can''t turn a blind eye to this. We''ll have to take this into the consideration when deciding your punishment."'
							'You try your best to hold back the tears as you nod that you understand.'

							act 'Await punishment': gt 'sentence', 'punishment'

						else
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>, shall we proceed to the punishment?" the judge asks.'
							'You nod and take a deep breath as you await your punishment.'

							act 'Await punishment': gt 'sentence', 'punishment'
						end

					elseif mid($policeQW_courthearing_subjects[0], 10, 4) = 'norm':
						'The judge sits and quietly glances through the report, looking towards you from time to time, "Miss <<$pcs_lastname>>, the detective has only written neutral comments in the report."'
						'Suddenly, you feel a bit looser as you can probably expect a lighter sentencing than usual. You let out a relieving sigh.'
						'"Well as you''ve already admitted being guilty I guess we don''t need to listen to your pleading," he sternly looks at you.'
						'"Yes your honor." you respectfully answer.'

!!do a check if the player missed any earlier sentencing
						if policeQW['missed_court_dates'] > 0:
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>," and just as he''s about to close it, he stops at the last page, "Wait! What is this? Have you missed a sentencing?" he inquirers.'
							'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "Yes..." you meekly answer.'
							'With the judges eyes piercing through you, they clear their throat, "Well then this will affect your punishment. This is a serious thing Miss <<$pcs_lastname>>. The court can''t turn a blind eye to this. We''ll have to take this into the consideration when deciding your punishment."'
							'You try your best to hold back the tears as you nod that you understand.'
							act 'Await punishment': gt 'sentence', 'punishment'

						else
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>, shall we proceed to the punishment?" the judge asks.'
							'You nod and take a deep breath as you await your punishment.'
							act 'Await punishment': gt 'sentence', 'punishment'
						end

					else
						'The judge sits and quietly glances through the report, looking towards you from time to time, "Miss <<$pcs_lastname>>, what is wrong with you? The report written by the detective is quite damaging and you will be getting a harsher sentencing."'
						'You look nonchalantly at the judge, almost ignoring what he has to say.'
						'"Well as you''ve already admitted being guilty, no need listening to your pleading," he sternly looks at you.'
						'"Whatever." you shrug your shoulders.'

!!do a check if the player missed any earlier sentencing
						if policeQW['missed_court_dates'] > 0:
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>," and just as he''s about to close it, he stops at the last page, "Wait! What is this? Have you missed a sentencing?" he inquirers.'
							'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "Yes..." you meekly answer.'
							'With the judges eyes piercing through you, they clear their throat, "Well then this will affect your punishment. This is a serious thing Miss <<$pcs_lastname>>. The court can''t turn a blind eye to this. We''ll have to take this into the consideration when deciding your punishment."'
							'You try your best to hold back the tears as you nod that you understand.'

							act 'Await punishment': gt 'sentence', 'punishment'

						else
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>, shall we proceed to the punishment?" the judge asks.'
							'You nod and take a deep breath as you await your punishment.'

							act 'Await punishment': gt 'sentence', 'punishment'
						end
					end
				end

			elseif mid($policeQW_courthearing_subjects[0], 1, 12) = 'prostitution':
				act 'Stand in front of the judge':
					*clr & cla
					minut += 20
					gs 'stat'

					'<center><img <<$set_imgh>> src="images/locations/city/shared/court/judge.jpg"></center>'
					'The judge speaks up with a stern voice, "So I see that you''re here because of you''ve gotten caught prostituting."'
					'You sink your glance in shame and nod meekly.'
					'The judge continues on, "Let''s see what the detectives concluded during their investigation."'

					if mid($policeQW_courthearing_subjects[0], 14, 4) = 'easy':
						'Suddenly, you feel a bit emboldened as the detective seems to have come through for you. You even manage to let out a little smirk.'
						'"Well as you''ve already admitted being guilty I guess we don''t need to listen to your pleading," he sternly looks at you.'
						'"Yes your honor." you respectfully answer.'

!!do a check if the player missed any earlier sentencing
						if policeQW['missed_court_dates'] > 0:
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>," and just as he''s about to close it, he stops at the last page, "Wait! What is this? Have you missed a sentencing?" he inquirers.'
							'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "Yes..." you meekly answer.'
							'With the judges eyes piercing through you, they clear their throat, "Well then this will affect your punishment. This is a serious thing Miss <<$pcs_lastname>>. The court can''t turn a blind eye to this. We''ll have to take this into the consideration when deciding your punishment."'
							'You try your best to hold back the tears as you nod that you understand.'

							act 'Await punishment': gt 'sentence', 'punishment'

						else
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>, shall we proceed to the punishment?" the judge asks.'
							'You nod and take a deep breath as you await your punishment.'

							act 'Await punishment': gt 'sentence', 'punishment'
						end

					elseif mid($policeQW_courthearing_subjects[0], 14, 4) = 'norm':
						'The judge sits and quietly glances through the report, looking towards you from time to time, "Miss <<$pcs_lastname>>, the detective has only written neutral comments in the report."'
						'Suddenly, you feel a bit looser as you can probably expect a lighter sentencing than usual. You let out a relieving sigh.'
						'"Well as you''ve already admitted being guilty I guess we don''t need to listen to your pleading," he sternly looks at you.'
						'"Yes your honor." you respectfully answer.'

!!do a check if the player missed any earlier sentencing
						if policeQW['missed_court_dates'] > 0:
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>," and just as he''s about to close it, he stops at the last page, "Wait! What is this? Have you missed a sentencing?" he inquirers.'
							'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "Yes..." you meekly answer.'
							'With the judges eyes piercing through you, they clear their throat, "Well then this will affect your punishment. This is a serious thing Miss <<$pcs_lastname>>. The court can''t turn a blind eye to this. We''ll have to take this into the consideration when deciding your punishment."'
							'You try your best to hold back the tears as you nod that you understand.'

							act 'Await punishment': gt 'sentence', 'punishment'

						else
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>, shall we proceed to the punishment?" the judge asks.'
							'You nod and take a deep breath as you await your punishment.'

							act 'Await punishment': gt 'sentence', 'punishment'
						end

					else
						'The judge sits and quietly glances through the report, looking towards you from time to time, "Miss <<$pcs_lastname>>, what is wrong with you? The report written by the detective is quite damaging and you will be getting a harsher sentencing."'
						'You look nonchalantly at the judge, almost ignoring what he has to say.'
						'"Well as you''ve already admitted being guilty, no need listening to your pleading," he sternly looks at you.'
						'"Whatever." you shrug your shoulders.'

!!do a check if the player missed any earlier sentencing
						if policeQW['missed_court_dates'] > 0:
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>," and just as he''s about to close it, he stops at the last page, "Wait! What is this? Have you missed a sentencing?" he inquirers.'
							'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "Yes..." you meekly answer.'
							'With the judges eyes piercing through you, they clear their throat, "Well then this will affect your punishment. This is a serious thing Miss <<$pcs_lastname>>. The court can''t turn a blind eye to this. We''ll have to take this into the consideration when deciding your punishment."'
							'You try your best to hold back the tears as you nod that you understand.'

							act 'Await punishment': gt 'sentence', 'punishment'

						else
							'The judge continues on flipping throughout the report, "Well everything seems to check out <<$pcs_lastname>>, shall we proceed to the punishment?" the judge asks.'
							'You nod and take a deep breath as you await your punishment.'

							act 'Await punishment': gt 'sentence', 'punishment'
						end
					end
				end
			else
				gs 'LOCA', 'hearing', 'mod_sentenceevents'
			end
		end
	end
end


if $ARGS[0] = 'punishment':
	minut += 20
	gs 'stat'

	'<center><img <<$set_imgh>> src="images/locations/city/shared/court/sentence.jpg"></center>'
	'The judge is looking sternly at you, "So miss <<$pcs_lastname>>. You''ve caused quite ruckus. Now the law is quite stern when it comes to even petty crimes."'
	'You tremble a bit in fear as he keeps on talking, "With that said, I believe in a more soft approach and that you can improve yourself by learning from your mistakes."'
	'You meekly nod and feel a bit relieved as you hear that.'

	temp_fine = 0
	if mid($policeQW_courthearing_subjects[0], 1, 8) = 'shoplift':
		policeQW['shoplift_counter'] += 1

		if policeQW['shoplift_counter'] <= 5:
		!Stage 1
			if mid($policeQW_courthearing_subjects[0], 10, 4) = 'easy':
				temp_fine += 5000 + (policeQW['shoplift_value'] / 2)

				'"I hereby sentence you to a fine of <<temp_fine>> <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office. You''ve been lucky this time Miss <<$pcs_lastname>>." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 10, 4) = 'norm':
				temp_fine += 5000 + policeQW['shoplift_value']

				'"I hereby sentence you to a fine of <<temp_fine>> <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 5000 + (3 * policeQW['shoplift_value'] / 2)

				'"I hereby sentence you to a fine of <<temp_fine>> <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office. And if it happens that you appear in front of this court again, check your attitude." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['shoplift_counter'] <= 10:
		!Stage 2
			if mid($policeQW_courthearing_subjects[0], 10, 4) = 'easy':
				temp_fine += 7500 + (3 * policeQW['shoplift_value'] / 4)

				'"Seems that I need to increase the fine for you to pay back to a sum of <<temp_fine>> <b>₽</b>. Hopefully, this will teach you a lesson." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 10, 4) = 'norm':
				temp_fine += 7500 + (3 * policeQW['shoplift_value'] / 2)

				'"Seems that I need to increase the fine for you to pay back to a sum of <<temp_fine>> <b>₽</b>. Hopefully, this will teach you a lesson." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 7500 + (9 * policeQW['shoplift_value'] / 4)

				'"I sentence you hereby to pay back a sum of <<temp_fine>> <b>₽</b> and I''ll also sentence you to some community service at the Mercy Clinic to 20 hours, hopefully this will help." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic? I see you''ve still got an attitude issue." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['shoplift_counter'] <= 15:
		!Stage 3
			if mid($policeQW_courthearing_subjects[0], 10, 4) = 'easy':
				temp_fine += 10000 + policeQW['shoplift_value']

				'"<<$pcs_lastname>> I see that name come up quite often here. Seems like I need to increase the fine even further to a sum of <<temp_fine>> <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 10, 4) = 'norm':
				temp_fine += 10000 + (2 * policeQW['shoplift_value'])

				'"<<$pcs_lastname>> I see that name come up quite often here. Seems like I need to increase the fine even further to a sum of <<temp_fine>> <b>₽</b> and sentence you to community service at the Mercy Clinic to 20 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and by now you should know where to find the Mercy Clinic." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 10000 + (5 * policeQW['shoplift_value'] / 2)

				'"<<$pcs_lastname>> I see that name come up quite often here. Seems like I need to increase the fine even further to a sum of <<temp_fine>> <b>₽</b> and increase the community service at the Mercy Clinic to 40 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and by now you should know where to find the Mercy Clinic." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['shoplift_counter'] <= 20:
		!Stage 4
			if mid($policeQW_courthearing_subjects[0], 10, 4) = 'easy':
				temp_fine += 15000 + (5 * policeQW['shoplift_value'] / 4)

				'"This is starting to get out of hand, <<$pcs_lastname>>! Seems like I need to increase the fine even further to a sum of <<temp_fine>> <b>₽</b> and sentence you to community service at the Mercy Clinic to 20 hours." the judge reads out your sentence.'
				'"You already know what you need to do." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 10, 4) = 'norm':
				temp_fine += 15000 + (5 * policeQW['shoplift_value'] / 2)

				'"This is starting to get out of hand, <<$pcs_lastname>>! Seems like I need to increase the fine even further to a sum of <<temp_fine>> <b>₽</b> and increase the community service at the Mercy Clinic to 40 hours." the judge reads out your sentence.'
				'"You already know what you need to do." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 15000 + (3 * policeQW['shoplift_value'])

				'"This is starting to get out of hand, <<$pcs_lastname>>! Seems like I need to increase the fine even further to a sum of <<temp_fine>> <b>₽</b> and increase the community service at the Mercy Clinic to 80 hours." the judge reads out your sentence.'
				'"You already know what you need to do." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['shoplift_counter'] <= 25:
		!Stage 5
			if mid($policeQW_courthearing_subjects[0], 10, 4) = 'easy':
				temp_fine += 25000 + (3 * policeQW['shoplift_value'] / 2)

				'"Well well, what a surprise, <<$pcs_lastname>> stands in front of me again. You''re starting to annoy me! Are you doing this on purpose? Don''t answer and instead pay this fine of <<temp_fine>> <b>₽</b> and enjoy your community service at the Mercy Clinic for 40 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic?" the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 10, 4) = 'norm':
				temp_fine += 25000 + (3 * policeQW['shoplift_value'])

				'"Well well, what a surprise, <<$pcs_lastname>> stands in front of me again. You''re starting to annoy me! Are you doing this on purpose? Don''t answer and instead pay the fine of <<temp_fine>> <b>₽</b> and enjoy your community service at the Mercy Clinic for 80 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic?" the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 25000 + (4 * policeQW['shoplift_value'])

				'"Well well, what a surprise, <<$pcs_lastname>> stands in front of me again. You''re starting to annoy me! Are you doing this on purpose? Don''t answer and instead pay the fine of <<temp_fine>> <b>₽</b> and enjoy your community service at the Mercy Clinic for 120 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic?" the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		else
		!Stage 6
			if mid($policeQW_courthearing_subjects[0], 10, 4) = 'easy':
				temp_fine += 50000 + (2 * policeQW['shoplift_value'])

				'The judge sighs, "Here we are again <<$pcs_lastname>>! I''m getting tired of being lenient so you''re getting the maximum sentence. The fine will be set to <<temp_fine>> <b>₽</b> and the community service at the Mercy Clinic for 80 hours." the judge reads out your sentence.'
				'"You already know what you need to do. I hope you will think about your actions before stealing again." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 10, 4) = 'norm':
				temp_fine += 50000 + (4 * policeQW['shoplift_value'])

				'The judge sighs, "Here we are again <<$pcs_lastname>>! I''m getting tired of being lenient so you''re getting the maximum sentence. The fine will be set to <<temp_fine>> <b>₽</b> and the community service at the Mercy Clinic for 120 hours." the judge reads out your sentence.'
				'"You already know what you need to do. I hope you will think about your actions before stealing again." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 50000 + (5 * policeQW['shoplift_value'])
				'The judge sighs, "Here we are again <<$pcs_lastname>>! I''m getting tired of being lenient so you''re getting the maximum sentence. The fine will be set to <<temp_fine>> <b>₽</b> and the community service at the Mercy Clinic for 160 hours." the judge reads out your sentence.'
				'"You already know what you need to do. I hope you will think about your actions before stealing again." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end
		end

	elseif mid($policeQW_courthearing_subjects[0], 1, 12) = 'prostitution':
		policeQW['prostitution_counter'] += 1

		if policeQW['prostitution_counter'] <= 5:
		!Stage 1
			if mid($policeQW_courthearing_subjects[0], 14, 4) = 'easy':
				temp_fine += 6000

				'"I hereby sentence you to a fine of 6000 <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office. You''ve been lucky this time Miss <<$pcs_lastname>>." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 14, 4) = 'norm':
				temp_fine += 7000

				'"I hereby sentence you to a fine of 7000 <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 8000

				'"I hereby sentence you to a fine of 8000 <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office. And if it happens that you appear in front of this court again, check your attitude." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['prostitution_counter'] <= 10:
		!Stage 2
			if mid($policeQW_courthearing_subjects[0], 14, 4) = 'easy':
				temp_fine += 9000

				'"I need to increase the fine to 9000 <b>₽</b>. Hopefully, this will get you to reconsider your actions." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 14, 4) = 'norm':
				temp_fine += 10500

				'"I need to increase the fine to 10,500 <b>₽</b>. Hopefully, this will get you to reconsider your actions." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 11500

				'"I sentence you hereby to pay a fine of 11,500 <b>₽</b> and I''ll also add some community service at the Mercy Clinic to 20 hours, hopefully this will help you reconsider your actions." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic? I see you''ve still got an attitude issue." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['prostitution_counter'] <= 15:
		!Stage 3
			if mid($policeQW_courthearing_subjects[0], 14, 4) = 'easy':
				temp_fine += 12000

				'"<<$pcs_lastname>> I see that name come up quite often here. Seems like I need to increase the fine even further to 12000 <b>₽</b>." the judge reads out your sentence.'
				'"You can pay your fine at the post office." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 14, 4) = 'norm':
				temp_fine += 14000

				'"<<$pcs_lastname>> I see that name come up quite often here. Seems like I need to increase the fine even further to 14000 <b>₽</b> and sentence you to community service at the Mercy Clinic for 20 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and by now you should know where to find the Mercy Clinic." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 15000

				'"<<$pcs_lastname>> I see that name come up quite often here. Seems like I need to increase the fine even further to 15000 <b>₽</b> and increase the community service at the Mercy Clinic to 40 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and by now you should know where to find the Mercy Clinic." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['prostitution_counter'] <= 20:
		!Stage 4
			if mid($policeQW_courthearing_subjects[0], 14, 4) = 'easy':
				temp_fine += 17500

				'"This is starting to get out of hand, <<$pcs_lastname>>! Seems like I need to increase the fine even further to 17500 <b>₽</b> and sentence you to community service at the Mercy Clinic to 20 hours." the judge reads out your sentence.'
				'"You already know what you need to do." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 14, 4) = 'norm':
				temp_fine += 20000

				'"This is starting to get out of hand, <<$pcs_lastname>>! Seems like I need to increase the fine even further to 20000 <b>₽</b> and increase the community service at the Mercy Clinic to 40 hours." the judge reads out your sentence.'
				'"You already know what you need to do." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 21000

				'"This is starting to get out of hand, <<$pcs_lastname>>! Seems like I need to increase the fine even further to 21000 <b>₽</b> and increase the community service at the Mercy Clinic to 80 hours." the judge reads out your sentence.'
				'"You already know what you need to do." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		elseif policeQW['prostitution_counter'] <= 25:
		!Stage 5
			if mid($policeQW_courthearing_subjects[0], 14, 4) = 'easy':
				temp_fine += 28000

				'"Well well, what a surprise, <<$pcs_lastname>> stands in front of me again. You''re starting to annoy me! Are you doing this on purpose? Don''t answer and instead pay this fine of 28000 <b>₽</b> and enjoy your community service at the Mercy Clinic for 40 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic?" the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 14, 4) = 'norm':
				temp_fine += 21000

				'"Well well, what a surprise, <<$pcs_lastname>> stands in front of me again. You''re starting to annoy me! Are you doing this on purpose? Don''t answer and instead pay the fine of 31000 <b>₽</b> and enjoy your community service at the Mercy Clinic for 80 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic?" the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine +=32000

				'"Well well, what a surprise, <<$pcs_lastname>> stands in front of me again. You''re starting to annoy me! Are you doing this on purpose? Don''t answer and instead pay the fine of 32000 <b>₽</b> and enjoy your community service at the Mercy Clinic for 120 hours." the judge reads out your sentence.'
				'"You can pay your fine at the post office and I suppose you know where to find the Mercy Clinic?" the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end

		else
		!Stage 6
			if mid($policeQW_courthearing_subjects[0], 14, 4) = 'easy':
				temp_fine += 55000

				'The judge sighs, "Here we are again <<$pcs_lastname>>! I''m getting tired of being lenient so you''re getting the maximum sentence. The fine will be set to 55000 <b>₽</b> and the community service at the Mercy Clinic for 80 hours." the judge reads out your sentence.'
				'"You already know what you need to do. I hope you will think about your actions before prostituting yourself again." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			elseif mid($policeQW_courthearing_subjects[0], 14, 4) = 'norm':
				temp_fine += 57500

				'The judge sighs, "Here we are again <<$pcs_lastname>>! I''m getting tired of being lenient so you''re getting the maximum sentence. The fine will be set to 57500 <b>₽</b> and the community service at the Mercy Clinic for 120 hours." the judge reads out your sentence.'
				'"You already know what you need to do. I hope you will think about your actions before prostituting yourself again." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'

			else
				temp_fine += 60000

				'The judge sighs, "Here we are again <<$pcs_lastname>>! I''m getting tired of being lenient so you''re getting the maximum sentence. The fine will be set to 60000 <b>₽</b> and the community service at the Mercy Clinic for 160 hours." the judge reads out your sentence.'
				'"You already know what you need to do. I hope you will think about your actions before prostituting yourself again." the judge finishes.'
				'You nod and quickly make your way out of courtroom.'
			end
		end
	else
		gs 'LOCA', 'punishment', 'mod_sentenceevents'
	end

	gs 'sentence', 'add_fine', temp_fine
	policeQW['fine_deadline'] += 14
	killvar 'temp_fine'
	killvar 'policeQW_courthearing_dates', 0
	killvar '$policeQW_courthearing_subjects', 0
	act 'Leave the court': gt 'city_center', 'mom_check'
end


!!this should trigger the next time Sveta is home after having not gone to court
if $ARGS[0] = 'police_arrest':
	gs 'stat'

	'<center><img <<$set_imgh>> src="images/locations/shared/police/police_door.jpg"></center>'
	'There is a loud knock at the door. You walk up to the door and open it. You see a two police officers in uniform standing in the hallway. "<<$pcs_firstname>> <<$pcs_lastname>>! You are under arrest."'

	act 'Get Arrested':
		*clr & cla
		gs 'stat'

		'<center><img <<$set_imgh>> src="images/locations/shared/police/police_arrested.jpg"></center>'
		'Wondering what they want from you, you ask. "What is this all about?"'
		'One of them holds up a piece of paper for you to read. "This is a warrant for your arrest for failure to show up for court or pay your fines." You get to read part of it before he puts it away. It seems all those letters you got about court was not a joke. The other office handcuffs your hands behind your back. Then they take you down to their police car and drive you to the city police station, where they throw you in a holding cell.'

		act 'Next morning':
			if ARGS[1] = 1:
				gt 'sentence', 'police_arrest2'
			elseif ARGS[1] = 2:
				gt 'sentence', 'police_arrest3'
			else
				gt 'sentence', 'police_arrest1'
			end
		end
	end
end


!!this should trigger the next time Sveta is home after having not gone to court
if $ARGS[0] = 'police_arrest1':
	gs 'stat'

	'<center><img <<$set_imgh>> src="images/locations/city/shared/court/judge.jpg"></center>'
	'You are taken out of holding and over to the courthouse to await your hearing. The judge reviews your case, "It seems you have missed your hearings, Miss <<$pcs_lastname>>, what do you have to say for yourself?"'
	'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "I have no excuse your honor." you meekly answer.'

	$policeQW_courthearing_subjects[] = mid($policeQW_courtletter_subjects[0], 14)
	policeQW_courthearing_dates[] = -1
	gs 'shortgs', 'coupled_array_sort', 'policeQW_courthearing_dates', '$policeQW_courthearing_subjects'

	killvar 'policeQW_courtletter_dates', 0
	killvar 'policeQW_courtletter_subjects', 0

	act 'Await punishment': gt 'sentence', 'punishment'
end


!!this should trigger the next time Sveta is home after having not payed the fine
if $ARGS[0] = 'police_arrest2':
	gs 'stat'

	'You are taken out of holding and over to the courthouse to await your hearing. The judge reviews your case, "It seems you refused to pay your fines Miss <<$pcs_lastname>>, what do you have to say for yourself?"'
	'You begin to look around, trying to come up with an excuse. But in the end you decide it''s best to admit, "I have no excuse your honor." you meekly answer.'
	'With the judges eyes piercing through you, they clear their throat, "I see, you have thirty days to pay your fine. If you fail to do so you will be arrested again and next time I will sentence you to one year in prison."'
	'You try your best to hold back the tears as you nod that you understand.'
!!can we add a out of character note that stats. If you fail to pay your fines again and get arrested a second time it will lead to a game over.

	policeQW['fine_deadline'] = max(policeQW['fine_deadline'], daystart + 30)

	killvar 'policeQW_courtletter_dates', 0
	killvar 'policeQW_courtletter_subjects', 0

	act 'Leave the court': gt 'city_center', 'mom_check'
end


if $ARGS[0] = 'police_arrest3':
	gs 'stat'

	'<center><img <<$set_imgh>> src="images/locations/city/shared/court/judge.jpg"></center>'
	if policeQW['arrest_court'] = 1:
		'You are taken out of holding and over to the courthouse to await your hearing. The judge reviews your case, "It seems you believe you are above the law, I assure you, you are not. I sentence you to one year in prison." You break down into tears as you are hauled away to serve your time.'
		act 'Continue': over = 14 & gt 'gameover'
		!!can we make this in big red letters and then it is a game over not sure how to code that.
	end
end


--- sentence ---------------------------------

