# prostitution_functions

!! ---- Variables -------------------------------------------------------------------------------------------------------
!!
!! prostitute['payment_method']: 1 - Sveta works for herself; 0 - Sveta works for someone else who will take a cut
!! prostitute['wl_block']: 1 - WLife is loaded which blocks some of the locations: Pavlovsk will rely on the WLife mod
!!							  and the Gas Station will be completely blocked
!!						  0 - WLife is not loaded, or WLife released the lock, everything works as normal.
!! prostitute['full_block']: 1 - Some mod or some other event completely blocked the prostitution content.
!! prostitute[<<$location>>]: 1 - Sveta can work at the location.
!!                            0 - Sveta can''t work at the location
!!     current locations: Pavlovsk - ''pavlovsk'', Gadukino - ''gadukino'',
!!                        Road between Pavlovsk and St Petersburg - ''road'', Gas Station ''gas_station''
!! prostitute['active']: 1- Sveta ''unlocked'' prostitution somewhere. It is use for non-location specific checks, like
!!							being able set a default prostitute outfit at home, or finding new places to work at.
!! prostitute['work_clothes']: 1 - Sveta is wearing a prostitute outfit, i.e. clothes and shoes
!! prostitute['outfit_is_set']: 1 - Sveta has a default outfit set up. Needed if she wants to change in restrooms
!!									or in the car on location, and not travel wearing that outfit
!! prostitute['changed_for_work']: 1 - It means that Sveta changed into her prostitute outfit on site from some regular
!!                                     clothes. This enables the 'Change into regular clothes' action in the changing
!!									   location.
!!								   0 - Sveta didn''t change which means she can''t change into regular clothing.

!!---------- Initial set up, enabling locations, etc. -------------------------------------------------------------------
!!-----------------------------------------------------------------------------------------------------------------------

$solicitation_locations[0] = 'pav_commcenter'
$solicitation_locations[1] = 'pav_residential'
$solicitation_locations[2] = 'pav_industrial'
$solicitation_locations[3] = 'pav_commercial'
$solicitation_locations[4] = 'pav_market'
$solicitation_locations[5] = 'pav_complex'
$solicitation_locations[6] = 'pav_park'
$solicitation_locations[7] = 'pushkin'

!! Set the Pavlovsk 'working' hours
!! Not used at the moment.
if $ARGS[0] = 'set_pavlovsk_hours':
	prostitute['pav_start_hour'] = ARGS[1]
	prostitute['pav_end_hour'] = ARGS[2]
end

!! Blocks the content that would clash with the Whore Life mod.
if $ARGS[0] = 'wl_block':
	prostitute['wl_block'] = ARGS[1]
	if prostitute['wl_block']:
		gs 'prostitution_functions', 'set_pavlovsk_hours', 6, 23
	else
		gs 'prostitution_functions', 'set_pavlovsk_hours', 14, 2
	end
end

!! Completely blocks the content - it is just here in case some mod needs to block off prostitution.
if $ARGS[1] = 'block':
	prostitute['full_block'] = ARGS[1]
end

if $ARGS[0] = 'check_for_wlife':
    if mod_list > 0:
        mod_i=1
        :mod_exec
        if $mod_name[mod_i] = 'wlife':
			if prostitute['payment_method'] = 0: prostitute['wl_block'] = 1
        end
        if mod_list > mod_i:
            mod_i+=1
            jump 'mod_exec'
        end
    end
end

if $ARGS[0] = 'update_prostitution_locations':
	gs 'prostitution_functions', 'set_pavlovsk_prostitute'
	if prostitute['gadukino'] = 0: gs 'prostitution_functions', 'set_gadukion_prostitute'
	if prostitute['road'] = 0: gs 'prostitution_functions', 'set_highway_prostitute'
end

if $ARGS[0] = 'set_pavlovsk_prostitute':
!!  if fame['pav_prostitute'] > 100 or fame['pav_slut'] > 150 and prostitute['wl_block'] = 0 and prostitute['full_block'] = 0:
    if (fame['pav_prostitute'] > 250 or fame['pav_slut'] > 250) and prostitute['wl_block'] = 0 and prostitute['full_block'] = 0:
        prostitute['pavlovsk'] = 1
		prostitute['active'] = 1
        prostitute['payment_method'] = 1
    else
        prostitute['pavlovsk'] = 0
    end
end

if $ARGS[0] = 'set_gadukion_prostitute':
	if gadriver_gang = 2 and (mirapimp = 0 or mirapimp = 2) and prostitute['full_block'] = 0:
		prostitute['gadukino'] = 1
		prostitute['active'] = 1
		prostitute['payment_method'] = 1
	else
		prostitute['gadukino'] = 0
	end
end

if $ARGS[0] = 'set_highway_prostitute':
	if prostitute['highway_idea'] = 2 and prostitute['active'] = 1 and ((prostitute['full_block'] = 0 and prostitute['wl_block'] = 0) or (prostitute['wl_block'] = 1 and prostitute['payment_method'] = 1)): prostitute['road'] = 1
end

if $ARGS[0] = 'prostitute_work_hours':
	if $region = 'pushkin':
		RESULT = (hour >= 0 and hour < 2) or (hour >= 12 and hour < 14) or (hour >= 17 and hour <= 23)
	elseif $region = 'pav' or $MID($loc,1,4) = 'pav_':
		RESULT = (hour >= 12 and hour < 14) or (hour >= 17 and hour <= 23)
	else
		RESULT = 0
	end
end

if $ARGS[0] = 'is_solicitation_location':
	RESULT = $curloc ! 'shop' and $curloc ! 'prostitution_pavlovsk' and $loc = $curloc and menu_off = 0 and ($loc_arg = '' or $loc_arg = 'start') and (ARRPOS('$solicitation_locations', $loc) ! -1)
end
!!-----------------------------------------------------------------------------------------------------------------------
!!-----------------------------------------------------------------------------------------------------------------------
!!


!!---------- Setting default working outfit -----------------------------------------------------------------------------
!! When calling check if Sveta is at home (i.e. the wardrobe is in her current home)

if $ARGS[0] = 'prostitute_outfit_at_home':
	if func('homes_properties', 'is_current_home') and prostitute['active']:
		gs 'prostitution_functions', 'work_clothes'
		if prostitute['work_clothes']:
			if prostitute['outfit_is_set'] = 1 and func('prostitution_functions', 'is_default') = 0:
				act 'Replace your default prostitute outfit with the current outfit':
					gs 'prostitution_functions', 'set_default_outfit'
					gt $loc, $loc_arg
				end
			elseif prostitute['outfit_is_set'] = 0:
				act 'Set the current as your default prostitute outfit':
					gs 'prostitution_functions', 'set_default_outfit'
					gt $loc, $loc_arg
				end
			end
			act 'Change into regular clothes':
				gs 'prostitution_functions', 'change_into_regular_clothes'
				gt $loc, $loc_arg
			end
		elseif prostitute['outfit_is_set']:
			act 'Change into prostitute outfit':
				gs 'prostitution_functions', 'change_into_prostitute_outfit'
				gt $loc, $loc_arg
			end
		end
	end
end

!!---- Random approach modifiers ---------------------------------------------------------------------

!! Result Range: -45  to +35
!! Based on worn outfit, how likely is that someone will believe that the player is
!! a hooker working on the street

if $ARGS[0] = 'clothing_chance_modifier':
	!! PCloStyle: 1 Girlie, 2 Rebel, 3 Wealthy, 4 Prostitute, 5 is Loose fit
	!! PCloStyle2: 1 Maid, 2 Server, 3 Stripper, 4 School
	if PCloStyle = 4: temp_result_attr += 10
	if PCloStyle2 = 3: temp_result_attr += 5

	temp_mult = 1

	if $ARGS[2] = 'upclose' and $loc ! 'road' and $loc ! 'gas_station_gp_117':
		if hour > 19 : temp_mult = 2

		if PCloStyle = 3: temp_result_attr -= 15 * temp_mult

		if PCloQuality = 7:
			temp_result_attr -= 15 * temp_mult
		elseif PCloQuality = 6:
			temp_result_attr -= 10 * temp_mult
		elseif PCloQuality = 5:
			temp_result_attr -= 5 * temp_mult
		elseif PCloQuality >= 3:
			if temp_mult > 1: temp_result_attr -= 10
		else
			temp_result_attr += 5
		end
	end

	!! PCloThinness:
	!!	6: intentionally reveals breast/pubic areas, with translucent/transparent areas,
	!!	   indecent exposure/arrest event if worn in public without underwear.
	!!	5: see through only in bright light, or tight enough to show the body in detail if opaque.
	!!	4: is thin or tight enough to be flirty, fine in most places except the most conservative (church, school, etc).
	!!	3-2 standard publicly worn outfit.
	!!	1 baggy, hiding the body, makes it hard to see the body shape.
	!! PCloTopCut:
	!!	4: reveals over half the skin on the torso area,
	!!	3: has a deep neckline that reaches the cleavage between the breasts,
	!!	2: is a cut high enough to be considered appropriate in most places (above the cleavage, or just below where it starts),
	!!	1: is a neckline that ends very near the neck or higher.
	!! PCloBra
	!!	2: Your chest is not covered at all by the outfit, if you wear a bra that will be your top
	!!	1: 1 the top is no more than a bra and wearing a bra underneath is pointless

	if PCloThinness = 6: temp_result_attr += 6
	if PCloThinness = 5: temp_result_attr += 3
	if PCloThinness = 4: temp_result_attr += 1
	if PCloThinness = 1: temp_result_attr -= 4

	!! Top outfit
	if PCloTopCut = 7: temp_result_attr += 7
	if PCloTopCut = 6: temp_result_attr += 6
	if PCloTopCut = 5: temp_result_attr += 5
	if PCloTopCut = 4: temp_result_attr += 3
	if PCloTopCut = 3: temp_result_attr += 1
	if PCloTopCut = 1: temp_result_attr -= 4

	if PCloBra = 2 and $braworntype = 'none': temp_result_attr += 6
	if PCloBra = 2 and $braworntype ! 'none': temp_result_attr += 3
	if PCloBra = 1: temp_result_attr += 3

	!! Bottom outfit
	!!	CloSkirtShortness
	!! IMPORTANT: CloSkirtShortness is mapped to PCloSkirt
	!!	6: is short enough to reveal pubic areas at all times
	!!	5 is ~20% thigh length or less (micro-skirt), and can reveal underwear frequently
	!!	4 is ~40% thigh length (miniskirt) and may show underwear if bending over
	!!	3 is up to ~60% thigh length (skirt) and normally never reveals underwear
	!!	2 is ending immediately above, at or below the knees (knee-length)
	!!	1 is ankle-length.
	!! CloPantsShortness = 1-6 scale. Higher values are shorter.
	!! IMPORTANT: CloPantsShortness is mapped to PCloPants
	!!	6 are high-cut shorts (legs end significantly above the crotch, usually reveals a large amount of the ass cheek)
	!!	5 is mini shorts (legs do not reach below the crotch)
	!!	4 are shorts (close to mid thigh)
	!!	3 is knee-length shorts
	!!	2 is calf length
	!!	1 is ankle length
	!! CloPanties = 1 for yes
	!!	1: The bottom of this outfit offers no more coverage than panties and it will
	!!		replace your panties (if worn)

	if PCloSkirt = 6: temp_result_attr += 6
	if PCloSkirt = 5: temp_result_attr += 4
	if PCloSkirt = 4: temp_result_attr += 2
	if PCloSkirt = 1: temp_result_attr -= 4

	if PCloPants = 6: temp_result_attr += 6
	if PCloPants = 5: temp_result_attr += 4
	if PCloPants = 1: temp_result_attr -= 4

	if PCloPanties = 1: temp_result_attr += 8


	temp_result_attr = MAX(temp_result_attr, temp_result_style)

	!! PShoHeels values: 1 flats (<5cm), 2 low heel (~5cm), 3 Mid heel (~7.5cm),
	!!		 4 High heel (~10cm), 5 ultra high heel (~15cm), 6 fetish heel (>15cm)
	!! PShoStyle values: 1 stripping or whoring, 2: bimbo style, 3: alternative style
	!! PShoCut values: 1: shoes 2: ankle boots, 3: calf high, 4: knee high, 5: thigh high, 6: groin high

	if PShoHeels = 6: temp_result_attr += 3
	if PShoHeels = 5: temp_result_attr += 2
	if PShoHeels = 4: temp_result_attr += 1
	if PShoHeels = 2: temp_result_attr -= 2
	if PShoHeels = 1: temp_result_attr -= 3

	if PShoStyle = 1: temp_result_attr += 2
	if PShoStyle = 2: temp_result_attr += 1
	if PShoStyle = 3: temp_result_attr -= 1

	if PShoCut = 6: temp_result_attr += 2
	if PShoCut = 5: temp_result_attr += 1

	result = temp_result_attr

	killvar 'temp_result_attr'
	killvar 'temp_result_style'
end

if $ARGS[0] = 'upclose_chance':
	temp_base_app_mod = func('prostitution_functions', 'base_appearance_modifier')
	temp_makeup_mod = func('prostitution_functions', 'makeup_modifier')
	temp_groom_mod = func('prostitution_functions', 'grooming_modifier')
	temp_tat_pierc_mod = func('prostitution_functions', 'tattoo_and_piercing_modifier')
	temp_clothes_base = func('prostitution_functions', 'clothing_chance_modifier', 'upclose')


	result = (temp_base_app_mod + temp_makeup_mod + temp_groom_mod + temp_tat_pierc_mod + temp_clothes_base)

	killvar 'temp_base_app_mod'
	killvar 'temp_makeup_mod'
	killvar 'temp_groom_mod'
	killvar 'temp_tat_pierc_mod'
	killvar 'temp_clothes_base'
end

!! Range -10 to +10
if $ARGS[0] = 'makeup_modifier':
	!! pcs_makeup:
	!! 0: Smeared makeup
	!! 1: No makeup
	!! 2: Light makeup
	!! 3: Vibrant makeup
	!! 4: Heavy makeup
	!! 5: Professional makeup
	!! 6: Bimbo makeup
	if pcs_makeup = 6: result += 5
	if pcs_makeup = 5: result -= 5
	if pcs_makeup = 4: result += 10
	if pcs_makeup = 3: result += 5
	if pcs_makeup = 1: result -= 5
	if pcs_makeup = 0: result -= 10
	temp_display = result

	killvar 'temp_display'
end

!! Result Range: -100 to +30
if $ARGS[0] = 'base_appearance_modifier':

	!! The following can lower the penalty from high appearance
	!! A stunningly pretty girl being a street hooker is hard to believe
	!! but a stunningly pretty but somewhat ran down girl is easier to
	!! accept.
	temp_hair -= (1 - pcs_hairbsh) * 10

	if pcs_haircol ! nathcol:
		if dyefade > 0 and dyefade < 7: temp_dyefade = 5
		if dyefade = 0: temp_dyefade = 15
	end

	if pcs_makeup = 0: temp_makeup_corr = 20

	if pcs_apprncbase <= 20:
		result -= 100
	elseif pcs_apprncbase <= 40:
		result -= 20
	elseif pcs_apprncbase <= 60:
		result -= 10
	elseif pcs_apprncbase <= 80:
		result += 10
	elseif pcs_apprncbase <= 100:
		result += 30
	elseif pcs_apprncbase <= 120:
		result += 30
	elseif pcs_apprncbase <= 140:
		result += 10
	!! Over a certain beauty people will be less likely to think that Sveta is a prostitute working
	!! the highway unless she is acting like one, or looks really neglected.
	elseif pcs_apprncbase <= 160:
		result -= 30 + temp_dyefade + pcs_leghair + temp_hair
	elseif pcs_apprncbase <= 179:
		result -= 40 + temp_dyefade + pcs_leghair + temp_hair
	else
		result -= 50 + temp_dyefade + pcs_leghair + temp_hair + temp_makeup_corr
	end

	!! Being high or looking like someone fighting withdrawal, downbeat or exhausted, dirty, etc.
	!! will lessen the high appearance penalty. Will add those later when I figure out a sensible way.

	killvar 'temp_display'

	killvar 'temp_dyefade'
	killvar 'temp_leghair'
	killvar 'temp_makeup_corr'
end

!! Result Range: -78 - 0
if $ARGS[0] = 'grooming_modifier':
	if pcs_sweat < 22:
		result -= 0
	elseif pcs_sweat < 38:
		result -= (pcs_sweat - 10) / 4 & !! 28/4 = 7
	elseif pcs_sweat < 54:
		result -= (pcs_sweat - 10) / 2 & !! 54-10 / 2 = 22
	else
		result -= 3 * (pcs_sweat - 10) / 4 & !! 3 * 100-10 / 4 = 67
	end

	temp_display = result
	killvar 'temp_display'
end


!! Result Range: 0
if $ARGS[0] = 'tattoo_and_piercing_modifier':
	result = 0
	if (PCloSkirt >= 4 or PCloPants >= 4 or PCloPanties = 1) and PShoCut = 1 and tatankle > 0: temp_tattoo_mod += 3
	if (PCloSkirt >= 4 or PCloPants >= 4 or PCloPanties = 1) and PShoCut < 5 and tatleg > 0: temp_tattoo_mod += 5
	if PCloSKirt = 6 and $pantyworntype = 'none' and tatvag > 0: temp_tattoo_mod += 5
	if PCloSkirt >= 5 and tatass > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 5 or PCloTopCut >= 4 or PCloBra = 1) and tatblly > 0: temp_tattoo_mod += 5
	if (PCloThinness >= 5 or PCloTopCut >= 3 or PCloBra = 1 or PCloStyle = 4 or PCloStyle2 = 3) and tatupb > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 5 or PCloTopCut >= 4 or PCloBra = 1) and tatback > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 5 or PCloTopCut >= 3 or PCloBra = 1 or PCloStyle = 4 or PCloStyle2 = 3) and tatunder > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 5 or PCloTopCut >= 3 or PCloBra = 1 or (PCloBra = 2 and $braworntype = 'none')) and tatbrst > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 5 or PCloTopCut >= 3 or PCloBra = 1 or (PCloBra = 2 and $braworntype = 'none')) and tatchst > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 5 or PCloTopCut >= 3 or PCloBra = 1 or PCloStyle = 4 or PCloStyle2 = 3) and tatside > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 5 or PCloBra = 1) and tatarm > 0: temp_tattoo_mod += 2
	if (PCloThinness >= 5 or PCloTopCut >= 3 or PCloBra = 1 or PCloStyle = 4 or PCloStyle2 = 3) and tatlech > 0: temp_tattoo_mod += 3
	if (PCloThinness >= 3 or PCloTopCut >= 2 or PCloBra = 1 or PCloStyle = 4 or PCloStyle2 = 3) and tatneck > 0: temp_tattoo_mod += 5
	if tatfce > 0: temp_tattoo_mod += 3

	result = temp_tattoo_mod

	killvar 'temp_tattoo_mod'
end

!!---- Outfit checks ---------------------------------------------------------------------------------
if $ARGS[0] = 'work_clothes':
	prostitute['work_clothes'] = (PCloStyle = 4 and (PShoStyle = 1 or PShoStyle = 2 or PShoHeels >= 3))
end

if $ARGS[0] = 'is_default':
	RESULT = prostitute['clothingwornnumber'] = clothingwornnumber and prostitute['shoewornnumber'] = shoewornnumber and prostitute['currentpursenumber'] = currentpursenumber and prostitute['coatwornnumber'] = coatwornnumber and (prostitute['bodysuitwornnumber'] = bodysuitwornnumber or (prostitute['pantywornnumber'] = pantywornnumber and prostitute['brawornnumber'] = brawornnumber))
end



!!---- Setting, clearing and changing outfits ------------------------------------------------------------------
if $ARGS[0] = 'set_default_outfit':
	!!-- Clothing
	$prostitute['clothingworntype'] = $clothingworntype
	prostitute['clothingwornnumber'] = clothingwornnumber

	!!-- Underwear
	prostitute['underweartype'] = 0
	if underwear['type'] = 2:
		prostitute['underweartype'] = 2
		$prostitute['bodysuitworntype'] = $bodysuitworntype
		prostitute['bodysuitwornnumber'] = bodysuitwornnumber
	else
		$prostitute['pantyworntype'] = $pantyworntype
		prostitute['pantywornnumber'] = pantywornnumber
		$prostitute['braworntype'] = $braworntype
		prostitute['brawornnumber'] = brawornnumber
	end
	!!-- Shoes
	$prostitute['shoeworntype'] = $shoeworntype
	prostitute['shoewornnumber'] = shoewornnumber

	!!-- Bag
	$prostitute['currentpursetype'] = $currentpursetype
	prostitute['currentpursenumber'] = currentpursenumber

	!!-- Coat
	$prostitute['coatworntype'] = $coatworntype
	prostitute['coatwornnumber'] = coatwornnumber

	prostitute['outfit_is_set'] = 1
end

if $ARGS[0] = 'clearing_default_outfit':
	!!-- Clothing
	$prostitute['clothingworntype'] = ''
	prostitute['clothingwornnumber'] = 0

	!!-- Underwear
	$prostitute['bodysuitworntype'] = ''
	prostitute['bodysuitwornnumber'] = 0
	$prostitute['pantyworntype'] = ''
	prostitute['pantywornnumber'] = 0
	$prostitute['braworntype'] = ''
	prostitute['brawornnumber'] = 0

	!!-- Shoes
	$prostitute['shoeworntype'] = ''
	prostitute['shoewornnumber'] = 0

	!!-- Bag
	$prostitute['currentpursetype'] = ''
	prostitute['currentpursenumber'] = 0

	!!-- Coat
	$prostitute['coatworntype'] = ''
	prostitute['coatwornnumber'] = 0

	prostitute['outfit_is_set'] = 0
end


if $ARGS[0] = 'change_into_prostitute_outfit':
	if dyneval('RESULT = <<$prostitute["clothingworntype"]>>_h[<<prostitute["clothingwornnumber"]>>]') <= 0:
		msg '<font color="red">Unavailable as outfit is worn out!</font>'
		exit
	end
	!! if last outfit is sport outfit
	gs 'wardrobe', 'is_sport'
	gs 'wardrobe', 'back_to_regular_clothes'

	!!-- Backup
	$lastwornclothingtype['prostitute'] = $clothingworntype
	lastwornclothingnumber['prostitute'] = clothingwornnumber
	lastwornunderwear['prostitute'] = 0
	if underwear['type'] = 2:
		lastwornunderwear['prostitute'] = 2
		$lastwornbodysuittype['prostitute'] = $bodysuitworntype
		lastwornbodysuitnumber['prostitute'] = bodysuitwornnumber
	else
		$lastwornpantytype['prostitute'] = $pantyworntype
		lastwornpantynumber['prostitute'] = pantywornnumber
		$lastwornbratype['prostitute'] = $braworntype
		lastwornbranumber['prostitute'] = brawornnumber
	end
	$lastwornshoetype['prostitute'] = $shoeworntype
	lastwornshoenumber['prostitute'] = shoewornnumber
	$lastwornpursetype['prostitute'] = $currentpursetype
	lastwornpursenumber['prostitute'] = currentpursenumber
	$lastworncoattype['prostitute'] = $coatworntype
	lastworncoatnumber['prostitute'] = coatwornnumber
	
	!!-- Clothing
	gs 'clothing', 'wear', $prostitute['clothingworntype'], prostitute['clothingwornnumber']
	!!-- Underwear
	if prostitute['underweartype'] = 2:
		gs 'underwear_bodysuits', 'wear', $lastwornbodysuittype['prostitute'], lastwornbodysuitnumber['prostitute']
	else
		gs 'panties', 'wear', $prostitute['pantyworntype'], prostitute['pantywornnumber']
		gs 'bras', 'wear', $prostitute['braworntype'], prostitute['brawornnumber']
	end
	!!-- Shoes
	gs 'shoes', 'wear', $prostitute['shoeworntype'], prostitute['shoewornnumber']
	!!-- Bag
	gs 'purses', 'wear', $prostitute['currentpursetype'], prostitute['currentpursenumber']
	!!-- Coat
	gs 'coats', 'wear', $prostitute['coatworntype'], prostitute['coatwornnumber']
	!! TODO: Check for worn out here?

	!! CHeck if the change happened not at home and if yes, then store the fact of change.
	gs 'prostitution_functions', 'work_clothes'
	if $ARGS[1] = 'work': prostitute['changed_for_work'] = 1
end

if $ARGS[0] = 'change_into_regular_clothes':
	gs 'wardrobe', 'back_to_regular_clothes'

	!! if last outfit is sport outfit
	gs 'wardrobe', 'is_sport'
	gs 'wardrobe', 'back_to_regular_clothes'
end

!!---------- Chaging outfits in public locations ------------------------------------------------------------------------
!!------ Changing clothes --------------------------
if $ARGS[0] = 'change_to_work':
	cla & *clr
	minut += 10
	if $ARGS[1] = 'car':
		!! TODO: Video / image and some text describing the cloth change in the car
		''+iif($loc_desc = '', 'You quickly change into your working outfit in your car.', $loc_desc)
	end

	if $ARGS[1] = 'restroom':
		!! TODO: Video / image and some text describing the cloth change in the men''s restroom
		!! Is there a way to know if it''s a men''s or women''s restroom?
		''+iif($loc_desc = '',  'You slip into a stall and quickly change into your working outfit, trying to avoid your clothes touching the floor or, really, anything before you place them safely in your bag.', $loc_desc)
	end

	if $ARGS[1] = 'road_side':
		!! TODO: Video / image and some text describing the cloth change next to a road
		''+iif($loc_desc = '', 'You quickly change into your working outfit behind some bushes by the road.', $loc_desc)
	end

	gs 'prostitution_functions', 'change_into_prostitute_outfit', 'work'
	act 'Finish': gt $loc, $loc_arg
end

if $ARGS[0] = 'change_back':
	cla & *clr
	minut += 10
	if $ARGS[1] = 'car':
		!! TODO: Video / image and some text describing the cloth change in the car
		'You quickly change into your working everyday clothes in your car.'
	end

	if $ARGS[1] = 'restroom':
		!! TODO: Video / image and some text describing the cloth change in the men''s restroom
		'You quickly change into your everyday clothes in the men''s restroom..'
	end

	if $loc_arg = 'restroom_women':
		!! TODO: Video / image and some text describing the cloth change in the women''s restroom
		'You quickly change into your everyday clothes in the women''s restroom.'
	end

	if $ARGS[1] = 'road_side':
		!! TODO: Video / image and some text describing the cloth change next to a road
		'You quickly change into your everyday clothes behind some bushes by the road.'
	end


	gs 'prostitution_functions', 'change_into_regular_clothes'
	act 'Finish': gt $loc, $loc_arg
end



!!-----------------------------------------------------------------------------------------------------------------------
!!---------- Checking for events ----------------------------------------------------------------------------------------
!!-----------------------------------------------------------------------------------------------------------------------

if $ARGS[0] = 'check_solicitation_event':
	gs 'prostitution_functions', 'work_clothes'
	if prostitute['wl_block'] = 0 and prostitute['full_block'] = 0 and func('prostitution_functions', 'prostitute_work_hours') and func('prostitution_functions','is_solicitation_location'):
		if prostitute['pavlovsk'] = 1 and prostitute['pav_time_hour'] ! hour and rand(-20, 70) < minut:
			gs 'prostitution_pavlovsk', 'chance'
		end

		if prostitute['pavlovsk'] = 1 and prostitute['work_clothes'] :
			pl '<center><a href="exec: gt ''prostitution_pavlovsk'', ''search''"><img title="Click to start working in Pavlovsk." height = 80 src="images/system/icons/icon_prostitute.png"></a></center>'
		end

		if prostitute['pav_residential_prost_day'] ! daystart: prostitute['pav_residential_prost_day'] = daystart
		!!pav_residential_prost_day
	end
end


!!-----------------------------------------------------------------------------------------------------------------------
!!---------- Willpower checks -------------------------------------------------------------------------------------------
!!-----------------------------------------------------------------------------------------------------------------------

if $ARGS[0] = 'will_unprotected':
	gs 'willpower', 'calc'
	will_cost = 0
	if missCum >= timeTresh: will_calc += 100
	if $ARGS[1] = 'resist':
		if pro_stats['unprotected'] <= 90:
			will_cost = (10 + pro_stats['unprotected'] + will_calc) / 10
		else
			will_cost = (100 + will_calc)/10
		end
	else
		if pro_stats['unprotected'] <= 90:
			will_cost = (100 - pro_stats['unprotected'] + will_calc) / 10
		else
			will_cost = (10 + will_calc)/10
		end
	end
	gs 'willpower', 'difficulty', '<<$ARGS[2]>>'
end

if $ARGS[0] = 'will_rimming':
	gs 'willpower', 'calc'

	if $ARGS[1] = 'self':
		if stat['rimming_give'] <= 90:
			will_cost = (100 - stat['rimming_give'] + will_calc)/10
		else
			will_cost = (10 + will_calc)/10
		end
	elseif $ARGS[1] = 'force':
		if stat['rimming_give'] <= 40:
			will_cost = (110 - will_enforced - stat['rimming_give'] + will_calc)/10
		else
			will_cost = (70 - will_enforced + will_calc)/10
		end
	else
		if stat['rimming_give'] <= 90:
			will_cost = (10 + stat['rimming_give'] + will_calc)/10
		else
			will_cost = (100 + will_calc)/10
		end
	end
	gs 'willpower', 'difficulty', '<<$ARGS[2]>>'
end

if $ARGS[0] = 'will_atm':
	gs 'willpower', 'calc'

	if $ARGS[1] = 'self':
		if pro_stats['atm'] <= 90:
			will_cost = (100 - pro_stats['atm'] + will_calc)/10
		else
			will_cost = (10 + will_calc)/10
		end
	elseif $ARGS[1] = 'force':
		if pro_stats['atm'] <= 40:
			will_cost = (110 - will_enforced - pro_stats['atm'] + will_calc)/10
		else
			will_cost = (70 - will_enforced + will_calc)/10
		end
	else
		if pro_stats['atm'] <= 90:
			will_cost = (10 + pro_stats['atm'] + will_calc)/10
		else
			will_cost = (100 + will_calc)/10
		end
	end
	gs 'willpower', 'difficulty', '<<$ARGS[2]>>'
end


!!-----------------------------------------------------------------------------------------------------------------------
!!---------- Condoms & STDs----------------------------------------------------------------------------------------------
!!-----------------------------------------------------------------------------------------------------------------------


if $ARGS[0] = 'std_check':
	gs 'dinSex', 'std_trigger', $ARGS[1]
	killvar 'pro_std_check_rand'
	killvar 'pro_std_rand'
end

if $ARGS[0] = 'std_check_oral':
	gs 'dinSex', 'std_trigger_oral', $ARGS[1]
	killvar 'pro_std_check_rand'
	killvar 'pro_std_rand'
end

if $ARGS[0] = 'remove_condom':
	if mc_inventory['equipped_condoms'] > 0:
		mc_inventory['equipped_condoms'] -= 1
	elseif mc_inventory['sabotaged_condoms'] > 0 and preziktype = 2:
		mc_inventory['sabotaged_condoms'] -= 1
	elseif mc_inventory['normal_condoms'] > 0 and preziktype <> 2:
		mc_inventory['normal_condoms'] -= 1
	end
end

if $ARGS[0] = 'your_condom':
	prostitute['condom'] = 1
	protect = iif(mc_inventory['equipped_condoms'] > 0,1,0)
	if mc_inventory['equipped_condoms'] > 0:
		if rand(1,mc_inventory['equipped_condoms']) <= mc_inventory['bad_condoms']:
			mc_inventory['bad_condoms'] -= 1
			noprotect = 1
			sexcontra = rand(4,5)
		else
			sexcontra = 3
		end
		mc_inventory['equipped_condoms'] -= 1
		if preziktype = 2: sexcontra = 7 & noprotect = 1
	else
		sexcontra = 0
	end
end

if $ARGS[0] = 'his_condom':
	$bwa_boy = iif($ARGS[1] = '',$boydesc,$ARGS[1])
	protect = 1
	sexcontra = 3
	*p '<<ucase(mid($bwa_boy,1,1))>><<mid($bwa_boy,2,len($bwa_boy)-1)>> takes his condom and puts it on his <<dick>> centimeter dick.'
end


!!---------- Background: Black-----------------------------------------------------------------------------------

if $ARGS[0] = 'darkness':
	fcolor = rgb(255, 255, 255)
	bcolor = rgb(0, 0, 0)
	lcolor = rgb(106, 90, 205)
end

if $ARGS[0] = 'parameters':
	!!Reset
	protect = 0
	sexcontra = 0
	$pro_client_condom = 'tbd'
	$pro_client_cumshot = 'tbd'

	!!Client
	gs 'npcgeneratec', 0, 'client', rand(18,65)
	gs 'boyStat', $npclastgenerated

	!!
!!---------- Time -----------------------------------------------------------------------------------------------

	if hour > 19 or hour < 7:
		$pro_work_time = 'night'
	else
		$pro_work_time = 'day'
	end

	gs 'prostitution_functions', 'std_cum_check'

!!---------- Client Likes/Dislikes ------------------------------------------------------------------------------

	if rand(1,10) = 10:
		prostitute['mesec_mod'] = 1
	else
		prostitute['mesec_mod'] = 0
	end

	if rand(1,100) > 97:
		prostitute['dirty_anal_mod'] = 1
	else
		prostitute['dirty_anal_mod'] = 0
	end

	if rand(1,10) = 10:
		prostitute['cum_visible_mod'] = 1
	else
		prostitute['cum_visible_mod'] = 0
	end

!!---------- Prostitution long term effects ---------------------------------------------------------------------
if $ARGS[0] = 'solicitation_effort':
	cost = ARGS[1]
	prostitute['skin_penalty'] += 5
	if temper < 15: prostitute['skin_penalty'] += 5
	if temper > 25: prostitute['skin_penalty'] += 5
	if cost <= willpowermax/4:
		prostitute['age_mod'] += 5
	elseif cost <= willpowermax/3:
		prostitute['age_mod'] += 10
	elseif cost <= willpowermax/2:
		prostitute['age_mod'] += 15
	else
		prostitute['age_mod'] += 20
	end
end

if $ARGS[0] = 'client_effort':
	$client_type = iif($ARGS[1] = '', 'normal', $ARGS[1])
	if $client_type = 'nice':
		prostitute['age_mod'] += 5
	elseif $client_type = 'normal':
		prostitute['age_mod'] += 10
	elseif $client_type = 'abusive':
		prostitute['age_mod'] += 20
	end
end

if $ARGS[0] = 'daily_effects':
	if prostitute['age_mod'] >= 100:
		temp_age_mod_remain = prostitute['age_mod'] MOD 100
		vidageday -= ((prostitute['age_mod'] - temp_age_mod_remain) / 100)
		prostitute['age_mod'] = temp_age_mod_remain
		killvar 'temp_age_mod_remain'
	end
	if prostitute['skin_penalty'] >= 100:
		temp_skin_remain = prostitute['skin_penalty'] MOD 100
		skinDailyPenalty += ((prostitute['skin_penalty'] - temp_skin_remain) / 100)
		prostitute['skin_penalty'] = temp_skin_remain
		killvar 'temp_skin_remain'
	end
end
!!---------- Age ------------------------------------------------------------------------------------------------

	if vidage < 18 and rand(1,10) < 7:
		prostitute['vidage_mod'] = 1
	else
		prostitute['vidage_mod'] = 0
	end

!!---------- Scenes ----------------------------------------------------------------------------------------------
!!----------------------------------------------------------------------------------------------------------------

	pro_scene_rand = rand(1,100)

	if pro_scene_rand <= 50:
		if mesec = 0 or prostitute['mesec_mod'] = 1:
			$prostitute['client_scene'] = 'Vaginal'
		elseif mesec > 0 and prostitute['mesec_mod'] = 0 and (klismaday = daystart or prostitute['dirty_anal_mod'] = 1):
			$prostitute['client_scene'] = 'Anal'
		else
			$prostitute['client_scene'] = 'Blowjob'
		end
	elseif pro_scene_rand > 50 and pro_scene_rand <= 75:
		if klismaday = daystart or prostitute['dirty_anal_mod'] = 1:
			$prostitute['client_scene'] = 'Anal'
		elseif klismaday ! daystart and prostitute['dirty_anal_mod'] = 0 and (mesec = 0 or prostitute['mesec_mod'] = 1):
			$prostitute['client_scene'] = 'Vaginal'
		else
			$prostitute['client_scene'] = 'Blowjob'
		end
	else
		$prostitute['client_scene'] = 'Blowjob'
	end

	!!---- Regular Worker ----------------------------------------------------------------------------------------

	if prostitute['customer_total'] < 10:
		prostitute['regular_chance'] = 0
	elseif prostitute['customer_total'] >= 10 and prostitute['customer_total'] <= 25:
		prostitute['regular_chance'] = 1
	elseif prostitute['customer_total'] > 25 and prostitute['customer_total'] <= 50:
		prostitute['regular_chance'] = 2
	elseif prostitute['customer_total'] > 50 and prostitute['customer_total'] <= 100:
		prostitute['regular_chance'] = 3
	elseif prostitute['customer_total'] > 100 and prostitute['customer_total'] <= 250:
		prostitute['regular_chance'] = 4
	end

	!!---- Chance to find a client --------------------------------------------------------------------------------

	prostitute['client_chance'] = hotcat * 10 + prostitute['regular_chance'] * 5 + rand(1,100) + prostitute['pity_counter']
	if $pantyworntype = 'eroto' and CloSkirtShortness > 4: prostitute['client_chance'] += 10

	!!---- Client ------------------------------------------------------------------------------------------------

	if prostitute['regular_timer'] ! daystart and $prostitute['client_scene'] ! 'Blowjob':
		if (prostitute['regular_chance'] = 1 and rand(1,100) > 95) or (prostitute['regular_chance'] = 2 and rand(1,100) > 90) or (prostitute['regular_chance'] = 3 and rand(1,100) > 80) or (prostitute['regular_chance'] = 4 and rand(1,100) > 60):
			prostitute['regular'] = 1
		else
			prostitute['regular'] = 0
		end
	else
		prostitute['regular'] = 0
	end

!!ToDo: Rough Clients
!!	if prostitute['regular'] = 0:
!!		if (pro_work_day = 0 and rand(1,100) > 90) or (pro_work_day = 1 and rand(1,100) > 95):
!!			if prostitute['rough'] = 1
!!		else
!!			prostitute['rough'] = 0
!!		end
!!	end

	if prostitute['regular'] = 0 and prostitute['rough'] = 0 and prostitute['std_mod'] = 0 and rand(1,100) > iif($pro_brand['text_pubic'] = 'cumslut', 84, 92):
		prostitute['client_creampie'] = 1
	else
		prostitute['client_creampie'] = 0
	end

	if prostitute['rough'] = 1 or (prostitute['rough'] = 0 and rand(1,100) > 40):
		prostitute['propose'] = 0
	else
		prostitute['propose'] = 1
	end
end

!!---------- Payment ---------------------------------------------------------------------------------------------

if $ARGS[0] = 'payment':
	!!---- Basic Payment -----------------------------------------------------------------------------------------

	if $ARGS[1] = 'pav':
		if $prostitute['pav_scene'] = 'blowjob':
			prostitute['payment'] = 425
		elseif $prostitute['pav_scene'] = 'anal':
			prostitute['payment'] = 1200
		else
			prostitute['payment'] = 1000
		end
	else
		if $prostitute['client_scene'] = 'Blowjob':
			prostitute['payment'] = 350
			if $ARGS[1] = 'condom_no': prostitute['payment'] += 75
			if $ARGS[2] = 'inside_yes': prostitute['payment'] += 50
		elseif $prostitute['client_scene'] = 'Vaginal':
			prostitute['payment'] = 700
			if $ARGS[1] = 'condom_no': prostitute['payment'] += 300
			if $ARGS[2] = 'inside_yes': prostitute['payment'] += 300
		elseif $prostitute['client_scene'] = 'Anal':
			prostitute['payment'] = 900
			if $ARGS[1] = 'condom_no': prostitute['payment'] += 200
			if $ARGS[2] = 'inside_yes': prostitute['payment'] += 100
		end
	end

	!!---- Bonus -------------------------------------------------------------------------------------------------

	prostitute['payment_mod'] = hotcat * 10
	if pcs_makeup = 0:
		prostitute['payment_mod'] -= 20
	elseif pcs_makeup > 1:
		prostitute['payment_mod'] += pcs_makeup * 10
	end

	if mesec > 0 and $prostitute['client_scene'] = 'Vaginal':
		if prostitute['mesec_mod'] = 0:
			prostitute['payment_mod'] -= 200
		else
			prostitute['payment_mod'] += 300
		end
	end

	if klismaday ! daystart and $prostitute['client_scene'] = 'Anal':
		if prostitute['dirty_anal_mod'] = 0:
			if $ARGS[1] = 'condom_no':
				prostitute['payment_mod'] -= 600
			elseif $ARGS[1] = 'condom_yes':
				prostitute['payment_mod'] -= 300
			end
		else
			prostitute['payment_mod'] += 300
		end
	end

	if prostitute['cum_dressed'] = 1:
		if prostitute['cum_visible_mod'] = 0:
			prostitute['payment_mod'] -= 200
		else
			prostitute['payment_mod'] += 300
		end
	end

	prostitute['payment_mod'] += pcs_mood - 50

	if $pantyworntype = 'eroto' and CloSkirtShortness > 4: prostitute['payment_mod'] += 50

	if prostitute['vidage_mod'] = 1:
		prostitute['payment_mod'] += 50 * (18 - vidage)
	else
		prostitute['payment_mod'] -= 50 * (18 - vidage)
	end

	if ($prostitute['client_scene'] = 'Blowjob') or ($prostitute['pav_scene'] = 'blowjob'):
		prostitute['payment_mod'] = prostitute['payment_mod'] / 2
		if pirsA = 2:
			prostitute['payment_mod'] += 50
		elseif pirsA = 4:
			prostitute['payment_mod'] += 75
		elseif pirsA > 0 and pirsA < 10000:
			prostitute['payment_mod'] += 25
		end
	end
	prostitute['payment'] += prostitute['payment_mod']
	prostitute['payment_backup'] = prostitute['payment']

	prostitute['payment'] = (prostitute['payment'] * (100 + prostitute['client_satisfaction'])) / 100

	!!Rounding
	prostitute['payment'] = func('prostitution_functions', 'exact_round', prostitute['payment'], 10)
	prostitute['payment_backup'] = func('prostitution_functions', 'exact_round', prostitute['payment_backup'], 10)
end

!!---------- Abortion --------------------------------------------------------------------------------------------

if $ARGS[0] = 'abortion':
	abort += 1
	abortionbirthdate = daystart

	gs 'medical_din', 'remove_preg'
	knowpregloss = 1

	abortrand = rand(0, 10)
	if age > 18:
		if abortrand < 10:sterilewb += 1
		if abortrand = 10:sterilewb += 10
	else
		if abortrand < 7:sterilewb += 2
		if abortrand >= 7:sterilewb += 10
	end
	killvar 'abortrand'

	pcs_hydra += 20

	if broodcurse > 0: over = 13 & gt'gameover'
end

!!---------- Random Name -----------------------------------------------------------------------------------------

if $ARGS[0] = 'random_name':

	$pro_boyname[1] = ''
	$pro_boyname[2] = ''

	:pro_rng_jump

	pro_temp = rand(0,23)

	if pro_temp = 0:
		$pro_temp = 'Abram'
	elseif pro_temp = 1:
		$pro_temp = 'Alexei'
	elseif pro_temp = 2:
		$pro_temp = 'Adrian'
	elseif pro_temp = 3:
		$pro_temp = 'Dima'
	elseif pro_temp = 4:
		$pro_temp = 'Dimitri'
	elseif pro_temp = 5:
		$pro_temp = 'Igor'
	elseif pro_temp = 6:
		$pro_temp = 'Leonid'
	elseif pro_temp = 7:
		$pro_temp = 'Petka'
	elseif pro_temp = 8:
		$pro_temp = 'Michail'
	elseif pro_temp = 9:
		$pro_temp = 'Vasily'
	elseif pro_temp = 10:
		$pro_temp = 'Oleg'
	elseif pro_temp = 11:
		$pro_temp = 'Olezka'
	elseif pro_temp = 12:
		$pro_temp = 'Pasha'
	elseif pro_temp = 13:
		$pro_temp = 'Pavel'
	elseif pro_temp = 14:
		$pro_temp = 'Sacha'
	elseif pro_temp = 15:
		$pro_temp = 'Slava'
	elseif pro_temp = 16:
		$pro_temp = 'Ruslan'
	elseif pro_temp = 17:
		$pro_temp = 'Taras'
	elseif pro_temp = 18:
		$pro_temp = 'Timofey'
	elseif pro_temp = 19:
		$pro_temp = 'Vanya'
	elseif pro_temp = 20:
		$pro_temp = 'Viktor'
	elseif pro_temp = 21:
		$pro_temp = 'Vladimir'
	elseif pro_temp = 22:
		$pro_temp = 'Yaromir'
	elseif pro_temp = 23:
		$pro_temp = 'Yevgeni'
	end

	if $pro_boyname[1] = '':
		$pro_boyname[1] = $pro_temp
		jump 'pro_rng_jump'
	elseif $pro_boyname[2] = '':
		$pro_boyname[2] = $pro_temp
	end

	if $pro_boyname[1] = $pro_boyname[2]:
		$pro_boyname[2] = ''
		jump 'pro_rng_jump'
	end

	killvar 'pro_temp'
	killvar '$pro_temp'
end

!!---------- Payment ---------------------------------------------------------------------------------------------

if $ARGS[0] = 'tat_pierce_count':
	tattCount = 0

	if tatarm >= 1: tattCount += 1
	if tatass >= 1:	tattCount += 1
	if tatback >= 1: tattCount += 1
	if tatblly >= 1: tattCount += 1
	if tatbrst >= 1: tattCount += 1
	if tatchst >= 1: tattCount += 1
	if tatfce >= 1:	tattCount += 1
	if tatankle >= 1: tattCount += 1
	if tatleg >= 1:	tattCount += 1
	if tatlip >= 1:	tattCount += 1
	if tatneck >= 1: tattCount += 1
	if tatvag >= 1: tattCount += 1
	if tatlech >= 1: tattCount += 1
	if tatside >= 1: tattCount += 1
	if tatupb >= 1: tattCount += 1
	if tatunder >= 1: tattCount += 1
	if tatwrist >= 1: tattCount += 1
	if tathand >= 1: tattCount += 1

	pierWearCount = 0

	if pirsA > 0 and pirsA ! 10000:	pierWearCount += 1
	if pirsB > 0 and pirsB ! 10000:	pierWearCount += 1
	if pirsC > 0 and pirsC ! 10000:	pierWearCount += 1
	if pirsD > 0 and pirsD ! 10000:	pierWearCount += 1
	if pirsE > 0 and pirsE ! 10000:	pierWearCount += 1
	if pirsF > 0 and pirsF ! 10000:	pierWearCount += 1
	if pirsG > 0 and pirsG ! 10000:	pierWearCount += 1
	if pirsN > 0 and pirsN ! 10000:	pierWearCount += 1
end

!!---------- Random Name -----------------------------------------------------------------------------------------

if $ARGS[0] = 'pav_client':
	!!Reset
	prostitute['pav_internal'] = 0

	gs 'prostitution_functions', 'std_cum_check'

	!!Regular
	if prostitute['pav_total'] < 10:
		prostitute['pav_chance'] = 0
	elseif prostitute['pav_total'] >= 10 and prostitute['pav_total'] <= 25:
		prostitute['pav_chance'] = 1
	elseif prostitute['pav_total'] > 25 and prostitute['pav_total'] <= 50:
		prostitute['pav_chance'] = 2
	elseif prostitute['pav_total'] > 50 and prostitute['pav_total'] <= 100:
		prostitute['pav_chance'] = 3
	elseif prostitute['pav_total'] > 100 and prostitute['pav_total'] <= 250:
		prostitute['pav_chance'] = 4
	end

	if ((prostitute['pav_chance'] = 1 and rand(1,100) > 95) or (prostitute['pav_chance'] = 2 and rand(1,100) > 90) or (prostitute['pav_chance'] = 3 and rand(1,100) > 80) or (prostitute['pav_chance'] = 4 and rand(1,100) > 60)) and (pro_rand ! 8 or (pro_rand = 8 and prostitute['pav_regular_s8'] = 1)):
		prostitute['pav_regular'] = 1
!!	elseif prostitute['pav_chance'] > 0 and rand(1,100) > 92:
!!		prostitute['pav_regular'] = -1
	else
		prostitute['pav_regular'] = 0
	end

!!ToDo: Add cheat for this chance
	$prostitute['client_behavior'] = iif(rand(1,100) < prostitute['client_behavior_chance'] or prostitute['pav_regular'] = -1, 'nice', 'abusive')

	!!---- Scene --------------------------------------------------------------------------------------------------

	if pro_rand > 7:
		$prostitute['pav_scene'] = 'anal'
	elseif mesec = 0 and rand(0,100) < 50:
		$prostitute['pav_scene'] = 'pussy'
	else
		$prostitute['pav_scene'] = 'blowjob'
	end

	if pro_rand = 0 or pro_rand = 8 or pro_rand = 9 or ((pro_rand = 2 or pro_rand = 3 or (pro_rand = 5 and $prostitute['client_behavior'] = 'nice') or pro_rand = 6 or pro_rand = 7) and $prostitute['pav_scene'] = 'pussy'):
		$prostitute['pav_location'] = 'private'
		if pro_rand = 3 or pro_rand = 8: $prostitute['client_behavior'] = 'abusive'
	elseif pro_rand = 1 and $prostitute['pav_scene'] = 'pussy':
		$prostitute['pav_location'] = iif($prostitute['client_behavior'] = 'nice', 'private', 'public')
	elseif ((pro_rand = 2 or pro_rand = 3 or pro_rand = 6 or pro_rand = 7) and $prostitute['pav_scene'] = 'blowjob') or pro_rand = 4 or pro_rand = 5:
		$prostitute['pav_location'] = 'public'
		if pro_rand = 5: $prostitute['client_behavior'] = 'abusive'
	else
		gt 'prostitution_pavlovsk', 'rng'
	end

	if prostitute['pav_regular_s8'] = 1 and pro_rand = 8: prostitute['pav_regular'] = 1

	if (pro_rand = 3 or pro_rand = 8) and $prostitute['pav_scene'] = 'private' and prostitute['pav_regular'] = 1:
		prostitute['pav_condom_refusal'] = 1
	else
		prostitute['pav_condom_refusal'] = 0
	end

	!!---- Generator ----------------------------------------------------------------------------------------------

	gs 'npcgeneratec', 0, 'pavlovsk client', rand(18,45)
	gs 'boyStat', $npclastgenerated
end

!!---- Checking visible STD and cum -------------------------------------------------------------------------------

if $ARGS[0] = 'std_cum_check':
	!!---- Visible STD --------------------------------------------------------------------------------------------

	if pcs_apprnc = -10 and rand(1,10) < 8:
		prostitute['std_mod'] = 1
	else
		prostitute['std_mod'] = 0
	end

	!!---- Non-Visible Cum ----------------------------------------------------------------------------------------

	if cumloc[0] = 1:
		prostitute['cum_vaginal_mod'] = 1
	else
		prostitute['cum_vaginal_mod'] = 0
	end

	if cumloc[3] = 1:
		prostitute['cum_anal_mod'] = 1
	else
		prostitute['cum_anal_mod'] = 0
	end

	!!---- Visible Cum (Dressed) ----------------------------------------------------------------------------------

	if cumloc[7] = 1 or cumloc[11] = 1 or cumloc[13] = 1 or cumloc[15] = 1:
		prostitute['cum_dressed'] = 1
	else
		prostitute['cum_dressed'] = 0
	end

	!!Visible Cum (Undressed)
	if cumloc[1] = 1 or cumloc[4] = 1 or cumloc[8] = 1 or cumloc[14] = 1 or cumloc[16] = 1:
		prostitute['cum_undressed'] = 1
	else
		prostitute['cum_undressed'] = 0
	end
end


!!---------- Exact Rounding --------------------------------------------------------------------------------------
if $ARGS[0] = 'exact_round':
	!! ARGS[1] = value you want divided
	!! ARGS[2] = divider
	!!  func('prostitution_functions','exact_round', number, divider)
	!!  func('prostitution_functions','exact_round', 12345, 7)
	if ARGS[2] ! 0:
		round_number = ARGS[1]/ARGS[2]
		if (ARGS[2] mod 2 ! 0 and ARGS[1] mod ARGS[2] > ARGS[2]/2) or (ARGS[2] mod 2 = 0 and ARGS[1] mod ARGS[2] >= ARGS[2]/2): round_number += 1
		round_number = round_number * ARGS[2]
		result = round_number
		killvar 'round_number'
	else
		'<b>Developer Note: No division by 0. Please report this and some text from the mainscreen as a bug in the whore life thread.</b>'
	end
end


--- prostitution_functions ---------------------------------
