# blackmailer

if $ARGS[0] = 'init_check':
	if blackmailQW['day'] ! 0: exit
	if ($ARGS[2] = 'inside' or $ARGS[2] = 'indoors'):
		if strpos($loc, 'church') <= 0: exit
	end


	temp_prob_chance = 300
	temp_prob_chance += max(fame['pav_slut'], fame['city_slut'])
	temp_prob_chance += max(fame['pav_modelling'], fame['city_modelling']) / 10
	temp_prob_chance += max(fame['pav_porn'], fame['city_porn']) / 10
	temp_prob_chance -= 15 * min(exhibitionist_lvl * exhibitionist_lvl, 9)
	temp_prob_chance -= pcs_exhib
	if temp_prob_chance > 600: killvar 'temp_prob_chance' & exit

	if $ARGS[1] = 'tits':
		temp_prob_chance -= 40
	elseif $ARGS[1] = 'butt':
		temp_prob_chance -= 60
	elseif $ARGS[1] = 'pussy':
		temp_prob_chance -= 80
	elseif $ARGS[1] = 'full':
		temp_prob_chance -= 100
	end

	if rand(0, temp_prob_chance) >= 5: killvar 'temp_prob_chance' & exit
	killvar 'temp_prob_chance'

	gs 'blackmailer', 'init_blackmail', $ARGS[1]
end

if $ARGS[0] = 'init_blackmail':
	blackmailQW['day'] = daystart
	blackmailQW['stage'] = 1
	blackmailQW['init_day'] = daystart
	if $ARGS[1] = 'panty':
		$blackmailQW['init_flashaction'] = 'panties'
	elseif $ARGS[1] = 'pantyrear':
		$blackmailQW['init_flashaction'] = 'panty clad ass'
	elseif $ARGS[1] = 'butt_plug':
		$blackmailQW['init_flashaction'] = 'butt plug'
	elseif $ARGS[1] = 'full':
		$blackmailQW['init_flashaction'] = 'naked body'
	else
		$blackmailQW['init_flashaction'] = $ARGS[1]
	end

	$blackmailQW['init_flashimage'] = $flash_image
	$blackmailQW['init_flashloc'] = $loc
	$blackmailQW['init_flashloc_arg'] = $loc_arg
	$blackmailQW['init_flashregion'] = $region
	blackmailQW['total_material'] = 1

	if strpos($loc, 'park') > 0:
		$blackmailQW['init_flashloc_desc'] = 'in a park'
		'A flash of light briefly brightens the surrounding trees and you see a shadow darting between the trees. The light of the camera flash prickling on your exposed skin.'
	elseif strpos($loc, 'church') > 0:
		$blackmailQW['init_flashloc_desc'] = 'in a church'
		'The flash of a camera illuminates the inside of the church, but the source eludes you.'
	elseif strpos($loc, 'zaprF') > 0:
		$blackmailQW['init_flashloc_desc'] = 'while washing cars'
		'You briefly think a car turned on their headlights, before you realise it was the flash of a camera, the source of which already gone.'
	else
		$blackmailQW['init_flashloc_desc'] = ''
		'You think you notice the flash of a camera from the corner of your eye, but its source is already out of view.'
	end
	if exhibitionist_lvl > 0:
		gs 'arousal', 'flashlite', -5
		gs 'arousal', 'end'
	end
end




	!!=============================================!!
	!!                                             !!
	!!                    CIKL                     !!
	!!                                             !!
	!!=============================================!!


if $ARGS[0] = 'cikl':
	if blackmailQW['stage'] = 3 and blackmailQW['smsday'] = 0:
		blackmailQW['smsday'] = blackmailQW['dreamday'] + 3
		gs 'telefon', 'Blackmailer', 'icon_na', 1
		gs 'telefon', 'SetSMSSchedule', "", "0", "gs 'blackmailer', 'Add_SMS1'", "daystart > blackmailQW['smsday'] and (hour >= 14 and hour <= 19 and rand(0, 100) = 0 or hour = 19 and minut >= 22 or hour = 20)"
	elseif daystart = blackmailQW['smsday'] and blackmailQW['next_payment'] > 0:
		gs 'telefon', 'SetSMSSchedule', "", "0", "gs 'blackmailer', 'Add_SMS1_reminder'", "(hour >= 14 and hour <= 19 and rand(0, 100) = 0 or hour = 19 and minut >= 22 or hour = 20)"
	elseif daystart > blackmailQW['smsday'] and blackmailQW['next_payment'] > 0:
		gs 'telefon', 'SetSMSSchedule', "", "0", "gs 'blackmailer', 'Add_SMS_failure'", "(hour >= 14 and hour <= 19 and rand(0, 100) = 0 or hour = 19 and minut >= 22 or hour = 20)"

	!Currently repeating content
	elseif blackmailQW['stage'] = 5 and blackmailQW['smsday'] = 0:
		blackmailQW['smsday'] = daystart + rand(0, 13) + 6
		gs 'telefon', 'SetSMSSchedule', "", "0", "gs 'blackmailer', 'Add_SMS_repeat'", "daystart > blackmailQW['smsday'] and (hour >= 14 and hour <= 19 and rand(0, 100) = 0 or hour = 19 and minut >= 22 or hour = 20)"
	end
end





	!!=============================================!!
	!!                                             !!
	!!                   DREAMS                    !!
	!!                                             !!
	!!=============================================!!


if $ARGS[0] = 'blackmail_dreams':
	if blackmailQW['stage'] = 1:
		$sleep_events_priority[] = 'gs ''blackmailer'', ''photo_dream1'' '
	elseif blackmailQW['stage'] = 2:
		$sleep_events_priority[] = 'gt ''blackmailer'', ''photo_dream2'' '
	else
		temp_rand = rand(-2, 1)
		if temp_rand >= 1 and blackmailQW['stage'] >= 2:
			$sleep_events[] = 'gt ''blackmailer'', ''photo_dream2'' '
		elseif temp_rand = 0:
			$sleep_events[] = 'gs ''blackmailer'', ''photo_dream1'' '
		end
	end
end


if $ARGS[0] = 'photo_dream1':
	if blackmailQW['stage'] = 1: blackmailQW['stage'] = 2
	blackmailQW['dreamday'] = daystart + 3
	if strpos('panty_pantyrear_bra', $blackmailQW['init_flashaction']) > 0:
		gs 'arousal', 'flashlite', -5
	else
		gs 'arousal', 'flash', -5
	end
	gs 'arousal', 'end'

	'<center><img <<$set_imgh>> src="<<$blackmailQW[''init_flashimage'']>>.jpg"></center>'
	$temp_dream_text = 'You dream about getting caught while flashing your '
	$temp_dream_text += $blackmailQW['init_flashaction']
	$temp_dream_text += ' ' + $blackmailQW['init_flashloc_desc']
	$temp_dream_text += ', your skin prickling from the light of unending camera flashes.'

	$temp_dream_text
	killvar 'temp_dream_text'
	gs 'dream_events', 'event_end'

elseif $ARGS[0] = 'photo_dream2':
	if blackmailQW['stage'] = 2:
		blackmailQW['stage'] = 3
		blackmailQW['smsday'] = daystart + 6
		gs 'telefon', 'Blackmailer', 'icon_na', 1
		gs 'telefon', 'SetSMSSchedule', "", "0", "gs 'blackmailer', 'Add_SMS1'", "daystart > blackmailQW['smsday'] and (hour >= 14 and hour <= 19 and rand(0, 100) = 0 or hour = 19 and minut >= 22 or hour = 20)"
	end
	blackmailQW['dreamday'] = daystart + 3
	gs 'arousal', 'flash', -5
	gs 'arousal', 'end'

	if motherKnowWhore = 0 and npc_rel['A29'] > 0:
		'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/mother.jpg"></center>'
		'You dream that your <<$npc_nickname[''A29'']>> is sitting at the kitchen table, looking somber, almost defeated, reading what seems to be a letter.'

		act 'Ask your <<$npc_nickname[''A29'']>> what''s wrong':
			*clr & cla
			'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/mum_gyno2.jpg"></center>'
			'You walk up to her and ask "What''s wrong <<$npc_nickname[''A29'']>>?"'
			'She drops the letter and see that it is accompanied by a picture.'

			act 'Look at the picture':
				*clr & cla
				'<center><img <<$set_imgh>> src="<<$blackmailQW[''init_flashimage'']>>.jpg"></center>'
				$temp_dream_text = 'You get a clear look at the picture depicting you flashing your '
				$temp_dream_text += $blackmailQW['init_flashaction']
				$temp_dream_text += ' ' + $blackmailQW['init_flashloc_desc']
				$temp_dream_text += '.'
				$temp_dream_text
				killvar '$temp_dream_text'

				'Overcoming the initial shock, you can barely hear that your <<$npc_nickname[''A29'']>> is speaking to you, though you don''t register what she''s saying to you.'

				act 'Listen to your mother':
					*clr & cla
					'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/spank.jpg"></center>'
					'"Oh, you slut! Your father and I worked so hard to raise you as a decent person, hoping you would find a good husband some day and it turns out you''re a whore who gets off on showing her <<$blackmailQW[''init_flashaction'']>> to strangers!"'
					'Suddenly her expression steels, her mind made up. "You can still be saved. I will turn you away from this errant path, you will not shame this family even if I have to beat the sin out of you."'
					'She grabs your arm and yanks you over kitchen table, ripping donw your pants as she reaches for something outside of your view.'
					'You hear sound of metal and leather, the feel of thick, rough, leather against your naked behind. The sound as she cracks it like a whip. "This is for your own good, someday you''ll understand."'
					'...'
					'"Someday you will."'

					act 'Brace yourself':
						*clr & cla
						'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/hug_sad1.jpg"></center>'
						'Bracing yourself for the pain that never comes, the dream shifts. You are left on the outside looking in, the house a mess, your <<$npc_nickname[''A29'']>> crying, <<$npc_nickname[''A34'']>> and your <<$npc_nickname[''A28'']>> nowhere to be seen.'
						'The lingering feelings of a happy family quickly fading.'
						gs 'dream_events', 'event_end'
					end
				end
			end
		end
	elseif $start_type['loc'] = 'sg' and gruptipe ! 5:
		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/school/building/locker.jpg"></center>'
		'You dream that it''s the end of a long school day, a tired track back to your lockers, the drab hallways, the monotonous marching of time.'
		'Opening your locker to take your stuff, ready for the same walk home, you yelp in surprise as hundreds of polaroids flow out of your opened locker. Similar shouts of surprise happen all around you as even more polaroids burst from their lockers too.'
		'As the surprise fades you can hear snickering around you, your friends holding the pictures pointing and laughing at you.'

		act 'Grab a polaroid':
			*clr & cla
			'<center><img <<$set_imgh>> src="<<$blackmailQW[''init_flashimage'']>>.jpg"></center>'
			$temp_dream_text = 'You grab one of the pictures and see yourself flashing your '
			$temp_dream_text += $blackmailQW['init_flashaction']
			$temp_dream_text += ' ' + $blackmailQW['init_flashloc_desc']
			$temp_dream_text += '.'
			$temp_dream_text
			killvar '$temp_dream_text'
			'The laughter around you grows, you are surrounded by a sea of people holding your picture and laughing at you.'
			'Wading through the ocean of polaroids, you are ever confronted with the fact that you have lost the respect of your former friends.'
			
			gs 'dream_events', 'event_end'
		end
	else
		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/gorodok.jpg"></center>'
		'You dream that you''re walking through Pavlovsk on a beautiful, windless, cloudless, sunny afternoon, the soft hum of cars, people, wind, and birds fills your ears as the simmering heat of the sun caresses your skin.'
		'Snippets of conversations happening around you press against the edges of your mind.'
		'"...ink that''s h...", "..ooks li...", "...ouldn''t da...", "...at a sl..."'
		'You can''t really under stand what''s being said as the harsh wind rips the words from the air, but from the way that they''re looking at the newspaper you guess that''s what they''re talking about.'

		act 'Head to the post office to satiate your curriosity':
			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/pavresn.jpg"></center>'
			'You hurry to the post office to get a copy of your own, the wind howling in your ears. The cold sends shivers down you spine as the rain beats relentless in your face.'
			'When you finally arive you see the postmaster, an older man, look at you strangly. Deafening thunder shakes the building, rain drums loudly against the windows as lightning flashes outside.'

			act 'Buy a newspaper':
				'<center><img <<$set_imgh>> src="<<$blackmailQW[''init_flashimage'']>>.jpg"></center>'
				$temp_dream_text = 'The postmaster distandly hands you a newspaper, and on the front cover you see a picture of yourself flashing your '
				$temp_dream_text += $blackmailQW['init_flashaction']
				$temp_dream_text += ' ' + $blackmailQW['init_flashloc_desc']
				$temp_dream_text += '.'
				$temp_dream_text
				killvar '$temp_dream_text'
				'"I didn''t know that you were such a whore!", "That''s really her, what a slut!", "Maybe she''ll let us fuck her too!"'
				'You run outside into the raging storm, the insults piercing through, chasing you.'
				gs 'dream_events', 'event_end'
			end
		end
	end
end




	!!=============================================!!
	!!                                             !!
	!!                     SMS                     !!
	!!                                             !!
	!!=============================================!!


if $ARGS[0] = 'Add_SMS1':
	gs 'telefon', 'ClearSMSSchedule', 'Blackmailer'
	blackmailQW['stage'] = 4
	blackmailQW['smsday'] = daystart + 2
	blackmailQW['next_payment'] = rand(50, 100) * 10

	$SMSTree['0'] = '"Hello <<pcs_firstname>>!"'

		if motherKnowWhore = 0 and npc_rel['A29'] > 0:
			$SMSTree['1'] = '"If you don''t want your mother to see this image you will do exactly as I say"'
		elseif $start_type['loc'] = 'sg' and gruptipe ! 5:
			$SMSTree['1'] = '"If you don''t want your friends to see this image you will do exactly as I say"'
		else
			$SMSTree['1'] = '"If you don''t want the world to see this image you will do exactly as I say"'
		end

				$SMSTree['2'] = '"Leave <<blackmailQW[''next_payment'']>> <b>₽</b> beneath the fourth park bench, I know you know which one."'
					$SMSTree['3'] = '"You have three days"'

	gs 'SMStext_builder', 'start'
		gs 'SMStext_builder', 'receive', $SMSTree['0']
		gs 'SMSText_builder', 'receive_img', $blackmailQW['init_flashimage'] + '.jpg'
		gs 'SMStext_builder', 'receive', $SMSTree['1']
		gs 'SMStext_builder', 'receive', $SMSTree['2']
		gs 'SMStext_builder', 'receive', $SMSTree['3']
		gs 'SMStext_builder', 'send', 'Blackmailer'
	gs 'SMStext_builder', 'end'
	killvar '$SMSTree'
end

if $ARGS[0] = 'Add_SMS1_reminder':
	gs 'telefon', 'ClearSMSSchedule', 'Blackmailer'

	$SMSTree['0'] = '"Don''t forget, if you don''t leave <<blackmailQW[''next_payment'']>> <b>₽</b> beneath the fourth park bench, you will regret it"'

	gs 'SMStext_builder', 'start'
		gs 'SMStext_builder', 'receive', $SMSTree['0']
		gs 'SMSText_builder', 'receive_img', $blackmailQW['init_flashimage'] + '.jpg'
		gs 'SMStext_builder', 'send', 'Blackmailer'
	gs 'SMStext_builder', 'end'
	killvar '$SMSTree'
end

if $ARGS[0] = 'Add_SMS_failure':
	gs 'telefon', 'ClearSMSSchedule', 'Blackmailer'
	blackmailQW['stage'] = -1

	$SMSTree['0'] = '"Guess you like it when people know you''re a whore."'
		$SMSTree['1'] = '"or you didn''t think I''d go through with it"'
			$SMSTree['2'] = '"we''ll see"'

	gs 'SMStext_builder', 'start'
		gs 'SMStext_builder', 'receive', $SMSTree['0']
		gs 'SMStext_builder', 'receive', $SMSTree['1']
		gs 'SMStext_builder', 'receive', $SMSTree['2']
		gs 'SMStext_builder', 'send', 'Blackmailer'
	gs 'SMStext_builder', 'end'

	if blackmailQW['stage'] < 5:
		if blackmailQW['init_flashregion'] = 'city':
			fame['city_sex'] += 2 * blackmailQW['total_material']
		elseif blackmailQW['init_flashregion'] = 'gad':
			fame['gad_sex'] += 10 * blackmailQW['total_material']
		else
			fame['pav_sex'] += 5 * blackmailQW['total_material']
		end
	end
end


if $ARGS[0] = 'Add_SMS_repeat':
	gs 'telefon', 'ClearSMSSchedule', 'Blackmailer'
	blackmailQW['stage'] = blackmailQW['stage'] * 10 + 1
	blackmailQW['smsday'] = daystart + 2
	blackmailQW['next_payment'] = rand(50, 100) * 10

	$SMSTree['0'] = '"You know what we want"'

		if motherKnowWhore = 0 and npc_rel['A29'] > 0:
			$SMSTree['1'] = '"If you don''t want your mother to see this image you will do exactly as I say"'
		elseif $start_type['loc'] = 'sg' and gruptipe ! 5:
			$SMSTree['1'] = '"If you don''t want your friends to see this image you will do exactly as I say"'
		else
			$SMSTree['1'] = '"If you don''t want the world to see this image you will do exactly as I say"'
		end

				$SMSTree['2'] = '"Leave <<blackmailQW[''next_payment'']>> <b>₽</b> beneath the fourth park bench, I know you know which one."'
					$SMSTree['3'] = '"You have three days"'

	gs 'SMStext_builder', 'start'
		gs 'SMStext_builder', 'receive', $SMSTree['0']
		gs 'SMSText_builder', 'receive_img', $blackmailQW['init_flashimage'] + '.jpg'
		gs 'SMStext_builder', 'receive', $SMSTree['1']
		gs 'SMStext_builder', 'receive', $SMSTree['2']
		gs 'SMStext_builder', 'receive', $SMSTree['3']
		gs 'SMStext_builder', 'send', 'Blackmailer'
	gs 'SMStext_builder', 'end'
	killvar '$SMSTree'
end



	!!=============================================!!
	!!                                             !!
	!!                    PARK                     !!
	!!                                             !!
	!!=============================================!!

if $ARGS[0] = 'set_park_act':
	if blackmailQW['next_payment'] > 0:
		act 'Walk to the fourth bench to pay your blackmailer':
			minut += 3
			if blackmailQW['stage'] = 4:
				gt 'blackmailer', 'park1'
			else
				gt 'blackmailer', 'park_repeat'
			end
		end
	end
end


if $ARGS[0] = 'park1':
	menu_off = 1
	gs 'stat'

	'<center><img src="images/locations/shared/park/bench_6.jpg"></center>'
	'You spot the bench that your blackmailer is talking about, and take a seat at the edge of it.'

	if money < blackmailQW['next_payment']:
		act 'Hide the money (<font color="red"><<blackmailQW[''next_payment'']>> <b>₽</b></font>)': '<br><font color="red">You don''t have enough money to do that.</font>'
	else
		act 'Hide the money (<<blackmailQW[''next_payment'']>> <b>₽</b>)':
			*clr & cla
			money -= blackmailQW['next_payment']
			blackmailQW['total_payment'] += blackmailQW['next_payment']
			blackmailQW['next_payment'] = 0
			blackmailQW['stage'] = 5
			blackmailQW['smsday'] = 0

			minut += 1
			gs 'stat'

			act 'Quickly walk away': gt $loc, $loc_arg
		end
	end

	act 'Walk away': gt $loc, $loc_arg
end




	!!=============================================!!
	!!                                             !!
	!!                  REPEATING                  !!
	!!                                             !!
	!!=============================================!!

if $ARGS[0] = 'Add_SMS_repeat':
	gs 'telefon', 'ClearSMSSchedule', 'Blackmailer'
	blackmailQW['smsday'] = daystart + 2
	blackmailQW['next_payment'] = rand(50, 100) * 10

	$SMSTree['0'] = '"You know what we want"'

		if motherKnowWhore = 0 and npc_rel['A29'] > 0:
			$SMSTree['1'] = '"If you don''t want your mother to see this image you will do exactly as I say"'
		elseif $start_type['loc'] = 'sg' and gruptipe ! 5:
			$SMSTree['1'] = '"If you don''t want your friends to see this image you will do exactly as I say"'
		else
			$SMSTree['1'] = '"If you don''t want the world to see this image you will do exactly as I say"'
		end

				$SMSTree['2'] = '"Leave <<blackmailQW[''next_payment'']>> <b>₽</b> beneath the fourth park bench, I know you know which one."'
					$SMSTree['3'] = '"You have three days"'

	gs 'SMStext_builder', 'start'
		gs 'SMStext_builder', 'receive', $SMSTree['0']
		gs 'SMSText_builder', 'receive_img', $blackmailQW['init_flashimage'] + '.jpg'
		gs 'SMStext_builder', 'receive', $SMSTree['1']
		gs 'SMStext_builder', 'receive', $SMSTree['2']
		gs 'SMStext_builder', 'receive', $SMSTree['3']
		gs 'SMStext_builder', 'send', 'Blackmailer'
	gs 'SMStext_builder', 'end'
	killvar '$SMSTree'
end


if $ARGS[0] = 'park_repeat':
	menu_off = 1
	gs 'stat'

	'<center><img src="images/locations/shared/park/bench_6.jpg"></center>'
	'You walk to the familiar bench and take a seat at the edge of it.'

	if money < blackmailQW['next_payment']:
		act 'Hide the money (<font color="red"><<blackmailQW[''next_payment'']>> <b>₽</b></font>)': '<br><font color="red">You don''t have enough money to do that.</font>'
	else
		act 'Hide the money (<<blackmailQW[''next_payment'']>> <b>₽</b>)':
			*clr & cla
			money -= blackmailQW['next_payment']
			blackmailQW['total_payment'] += blackmailQW['next_payment']
			blackmailQW['next_payment'] = 0

			minut += 1
			gs 'stat'

			act 'Quickly walk away': gt $loc, $loc_arg
		end
	end

	act 'Walk away': gt $loc, $loc_arg
end




--- blackmailer ---------------------------------