# Cum_Manage

!!
!!	THIS IS A CORE FILE TO GAME MECHANICS. Please edit CAREFULLY, and leave as many comments as possible!!
!!
!!	The comments in this file serve as tutorial to managing cum/sperm during scene writing and game-play. Please read them.
!!
!!	spafinloc and cum array naming takes precident over other naming schemes. Always import and export variables by their cum array names
!!
!!------------------------------------------------------------------------------------------------------------
!!
!!	Cum Array indices:
!!
!!	cumarrnam : Sperm Owner
!!	cumarrppt : Sperm Potential Potency (max sperm delivery)
!!	cumarrcpt : Sperm Current Potency	(current amount of sperm)
!!	cumarrdel : Sperm "Delivery" (method of *VAGINAL ONLY* acquisition)
!!	cumarrcon :	Contraception type used
!!	cumarrage : Sperm age in hours
!!	cumarrkno : Did you know/realize who did it?
!!	cumarrcnt : Unique identifier of the exact which time the MC has had this sperm incident occur.
!!
!!
!!
!!	Spatter Array indices:
!!
!!	sparrloc : Location of the sperm, as per cumarrdel
!!	sparrnam : Spatter Owner
!!	sparrppt : Spatter Potential Potency (Used to increase potency if you don't clean yourself out)
!!	sparridt : Did you know/realize who did it?
!!	sparrvol : Volume of the spatter. 40 is average.
!!	sparrslc : Spread status of the spatter. High volume can spread the contaminant from it's starting place.
!!	sparrcnt : Unique identifier of the exact which time the MC has had this spatter incident occur.
!!
!!
!!
!!	Values of 'cumarrdel' as defined by the cum_arr:
!!
!!	cumarrdel = 0 : 'Vaginal intercourse'
!!	cumarrdel = 1 : 'From spatter on labia'
!!	cumarrdel = 2 : 'From the anal area'
!!	cumarrdel = 3 : 'From sperm on clothing'
!!	cumarrdel = 4 : 'From sperm on fingers'
!!	cumarrdel = 5 : 'From sperm on wipes'
!!	cumarrdel = 6 : 'Unknown'
!!
!!
!!
!!	Values of 'cumarrcon' as defined by the cum_arr:
!!
!!	cumarrcon = 0: 'No contraception used'
!!	cumarrcon = 1: 'You lied about being on the pill'
!!	cumarrcon = 2: 'You were on the pill'
!!	cumarrcon = 3: 'You used a condom'
!!	cumarrcon = 4: 'The condom broke'
!!	cumarrcon = 5: 'The condom slipped off inside you'
!!	cumarrcon = 6: 'The condom was sabotaged by someone else'
!!	cumarrcon = 7: 'You sabotaged the condom'
!!	cumarrcon = 8: 'Precum had sperm in it'
!!	cumarrcon = 9: 'You believe are sterile'
!!
!!
!!
!!	Values of 'cumarrkno' as defined by the cum_arr:
!!
!!	cumarrkno = -2 : 'You were unaware there was sperm in you'
!!	cumarrkno = -1 : 'You do not think that any sperm has gotten into you'
!!	cumarrkno =  0 : 'You know somebody got sperm in you, but you don''t know that person'
!!	cumarrkno =  1 : 'You know who got sperm in you'
!!
!!	Setting for no STD checks
!!
!!	cumnostd = 1 : No risk of STD, resets at end of file so must be used for all related cum_management calls
!!
!!	Locations to be defined by 'spafinloc'
!!
!!	0 = 'In your Vagina'
!!	1 = 'On your labia'
!!	2 = 'On your panties over your vagina'
!!	3 = 'In your anus'
!!	4 = 'On your butt'
!!	5 = 'On your panties over your butt'
!!	6 = 'On your clothes in your groin area'
!!	7 = 'On your clothes'
!!	8 = 'On your back'
!!	9 = 'On your legs'
!!	10 = 'On your arms'
!!	11 = 'On your face'
!!	12 = 'Inside your mouth'
!!	13 = 'On your hands'
!!	14 = 'On your stomach'
!!	15 = 'On your breasts'
!!	16 = 'In your hair'
!!	17 = 'In a condom in your vagina'
!!
!!------------------------------------------------------------------------------------------------------------


if $ARGS[0] = '':

!!{ Debug information, comment out in release versions. }
!!	'<br><b><font color="red">Cum_Manage</font> called with: spafinloc=<<spafinloc>> cumarrkno=<<cumarrkno>> cummarrcon=<<cumarrcon>> cumarrdel=<<cumarrdel>></b>'

!!{ We count every time somebody cum on or inside the MC. It is used for spatter and cum matching in femcyc}

	stat['cum_count'] += 1
	condom_break = 0

!!{ no STDs from NPC you know }
	if (mid($boy,1,1) = 'A' or mid($boy,1,1) = 'B') and isnum(mid($boy,2,1)) ! 0: cumnostd = 1
	cumnostd = min(1, max(cumnostd, sexpartkno))

!!{	Here we define our important variables.}
	dick = npc_dick[$boy]
	if sexvolume <= 0: sexvolume = 40
	if sexspecpot = 0: sexspecpot = npc_spermpot[$boy]
	if sexspecpot = 0: sexspecpot = sexvolume * rand(250, 300)
	if sexspecpot < 0: sexspecpot = 0
	if vibratorIN = 1 and spafinloc = 0: vibratorIN = 0
	if isprok = 1 and spafinloc = 0: isprok = 0
	if analplugIN = 1 and spafinloc = 3: analplugIN = 0

!!{	Set the cum array temp to the current size of the cum array to add a new entry to the end of file. Then checks to see if you are on the pill. If you are and there is no contraception used, it flags this as a "done with pill" act, which means a pregnancy will be a pill failure.}

	cumarrtemp = arrsize('$cumarrnam')

	if sexcontra = 0 and pillcon2 > 1000: sexcontra = 2

!!{Check for previous deposit, and if it was by the same guy and precum, it sets cumarrtemp back by one}
!!	if $cumarrnam[cumarrtemp-1] = $boy and cumarrkno[cumarrtemp-1] = -1:cumarrtemp -= 1 & sexspecpot = cumarrppt[cumarrtemp]

	if cumprecheck = 1 and cumnostd = 0:
		cumarrkno[cumarrtemp] = -1
		gs 'dinSex', 'std_trigger'
	elseif sexunaware > 0:
		cumarrkno[cumarrtemp] = -2
	elseif sexpartkno = 1:
		cumarrkno[cumarrtemp] = 1
	else
		cumarrkno[cumarrtemp] = 0
	end

!!{ If a condom slipped in the vagina, it will pushed deeper inside the vagina during vaginal sex.}

	if spafinloc <= 0 and cumcondslip > 0:
		if dick > cumcondslip_deep:
			cumcondslip_deep = dick + rand (0,2)
		else
			cumcondslip_deep += rand (0,2)
		end
	end

	sparrtemp = arrsize('sparrvol')
!!{	Check to see if this is flagged as a preejaculate emmission. All vaginal penetrations that flag this as cumprecheck contain preejaculate. Guidelines for calling it: If your boy is likely to have masterbated, had sex, or otherwise encouraged semen to leak out of their urethra in the last 48 hours, they probably have some fertile preejaculate. If in doubt, let it leak. The chances of pregnancy from it are low, and the MC should have been wearing protection.}

	if cumprecheck ! 1:

!!{	Here it checks for anal deposit and increments anal creampie variable.}

		if spafinloc = 3:
			if sexunaware = 1 or sexcontra = 6:
				pcs_acp_unknown += 1
			else
				pcs_acp_known += 1
			end
		end

!!{	Here it checks for vaginal deposit.}

		if spafinloc <= 0:

!!{	Next it sets the variables in the array. The cumming boys name is first and cum age to 0.
!!	The cum delivery location is set to vaginally, and we check to see if this is an unknowing sex act.
!!	If it is, it makes it so the MC doesn''t know who did it.
!!	If the boy has a custom specified potency 'sexspecpot', it flags the potency. Otherwise it sets it to the default.
!!	Default potency potential is generated from a random multiplier of sexvolume.
!!	Sexvolume defaults to 40 (4 mL), but may be overwritten with 'sexvolume'.}

			$cumarrnam[cumarrtemp] = $boy
			cumarrage[cumarrtemp] = 0
			cumarrdel[cumarrtemp] = 0
			cumarrcnt[cumarrtemp] = stat['cum_count']
			cumarrppt[cumarrtemp] = sexspecpot

!!{	Now it sets up the splatter and actual internal cum.
!!	First it sets the array to the spatter end of file.	Then it checks for riding bareback.
!!	If theres a condom, it gives a chance for the condom to fail in general, slip off and remain in the vagina, or break.}

			if sexcontra > 2:
				if noprotect = 1: noprotect = 0 & sexcontra = 4

				if sexcontra = 3:
					temprand = rand(0,1000)
					dick_wid = 3

					if $dick_girth = 'skinny': dick_wid = 2

					if $dick_girth = 'slim': dick_wid = 3

					if $dick_girth = 'well proportioned': dick_wid = 3

					if $dick_girth = 'thicker than average': dick_wid = 4

					if $dick_girth = 'thick': dick_wid = 4

					if $dick_girth = 'massive': dick_wid = 5

					if $dick_girth = 'monstrous': dick_wid = 6

					break_thresh = dick_wid * 2
					break_thresh -= pcs_vag / 4
					break_thresh += dick / 4
					slip_thresh = 36 - (dick_wid * 2)
					slip_thresh -= (pcs_vag / 2)
					slip_thresh -= dick / 2

					if break_thresh < 1: break_thresh = 1

					if slip_thresh < 4: slip_thresh = 4
					break_thresh += slip_thresh
					slip_thresh = 0

					if temprand = 0:
						cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/4
						cumarrcon[cumarrtemp] = 3

					elseif temprand <= break_thresh:
						cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/2
						cumarrcon[cumarrtemp] = 4
						sexcontra = 4
						sparrage[sparrtemp] = 0
						sparrloc[sparrtemp] = 0
						$sparrnam[sparrtemp] = $boy
						sparrcnt[sparrtemp] = stat['cum_count']
						sparrppt[sparrtemp] = sexspecpot
						sparrvol[sparrtemp] += sexvolume
						cumsumbod += sexvolume
						cumsumvag += sexvolume
						condom_break = 1
						stat['broken_condoms'] += 1
						stat['last_broken_condom'] = daystart

						sparridt[sparrtemp] = cumarrkno[cumarrtemp]
						sparrslc[sparrtemp] = 0

						dynamic $ferteggfather

					else
						cumarrcpt[cumarrtemp] += 5
						cumarrcon[cumarrtemp] = 3

					end

!!{	Next it checks to see if the event is calling specifically for a burst or slipped off condom.
!!	It treats them the same as if the condom above had a failure.}

				elseif sexcontra = 4:
					cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/2
					cumarrcon[cumarrtemp] = 4
					sparrage[sparrtemp] = 0
					sparrloc[sparrtemp] = 0
					$sparrnam[sparrtemp] = $boy
					sparrcnt[sparrtemp] = stat['cum_count']
					sparrppt[sparrtemp] = sexspecpot
					sparrvol[sparrtemp] += sexvolume
					cumsumbod += sexvolume
					cumsumvag += sexvolume
					condom_break = 1

					sparridt[sparrtemp] = cumarrkno[cumarrtemp]
					sparrslc[sparrtemp] = 0

					dynamic $ferteggfather

				elseif sexcontra = 5:
					cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/200
					cumarrcon[cumarrtemp] = 5
					cumcondslip = 1
					cumcondsanb = cumarrtemp
					sparrage[sparrtemp] = 0
					sparrloc[sparrtemp] = 17
					$sparrnam[sparrtemp] = $boy
					sparrcnt[sparrtemp] = stat['cum_count']
					sparrppt[sparrtemp] = sexspecpot
					sparrvol[sparrtemp] += sexvolume
					cumsumbod += sexvolume
					cumsumvag += sexvolume

					sparridt[sparrtemp] = cumarrkno[cumarrtemp]
					sparrslc[sparrtemp] = 0

					cumcondslip += 1
					if cumcondslip_deep <= 0:cumcondslip_deep = rand(1, dick)
					if sparridt[sparrtemp] >= 0:cumcondslip_aware = 1

					dynamic $ferteggfather


!!{	Next, check for sabotaged condoms. First sabotaged by you, then sabotaged by the guy.
!!	If they were sabotaged, it acts similar to a condom failure, but worse.}

				elseif sexcontra = 6:
					cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/3
					cumarrcon[cumarrtemp] = 6

				elseif sexcontra = 7:
					cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/3
					cumarrcon[cumarrtemp] = 7

					dynamic $ferteggfather

				end
!!{	If you have no protection, you get a nice, full load of semen.}

			else
				sparrage[sparrtemp] = 0
				sparrloc[sparrtemp] = 0
				$sparrnam[sparrtemp] = $boy
				sparrcnt[sparrtemp] = stat['cum_count']
				sparrppt[sparrtemp] = sexspecpot

				sparrvol[sparrtemp] += sexvolume
				cumsumbod += sexvolume
				cumsumvag += sexvolume

				sparridt[sparrtemp] = cumarrkno[cumarrtemp]
				sparrslc[sparrtemp] = 0
				cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/5*4
				cumarrcon[cumarrtemp] = sexcontra

				dynamic $ferteggfather

			end

	!! creampie vaginal statistics:
			if spafinloc = 0:
				stat['last_creampie'] = daystart
				!!STD checks
				if cumnostd = 0: gs 'dinSex', 'std_trigger'
				!! safe creampie (if cycle > 3 or on pill or succubus):
				if cycle > 3 or birth_control['safe'] = 1 or succubusflag = 1:
					if sexunaware = 1 or sexcontra = 6:
						pcs_cp_safe_unknown += 1
					else
						pcs_cp_safe_known += 1
					end
				!! pretty safe creampie (if cycle = 3 or cycle = 0):	
				elseif cycle = 0 or cycle = 3:
					if sexunaware = 1 or sexcontra = 6:
						pcs_cp_notsafe_unknown += 1
					else
						pcs_cp_notsafe_known += 1
					end
				!! risky creampie (not on pill, fertile part of the cycle):
				else
					if sexunaware = 1 or sexcontra = 6:
						pcs_cp_risky_unknown += 1
					else
						pcs_cp_risky_known += 1
					end
				end
			end	
			
!!{	If you arent getting it in the vagina, and the boy isnt pumping it into a condom, a spatter is made and applied.
!!	If you arent wearing any panties and it was called to hit your panties, it goes directly to your groin.
!!	If you are naked and it calls for a clothing strike, it will go to your body instead.}

		elseif spafinloc > 0 and sexcontra < 3:

			sparrage[sparrtemp] = 0
			sparrcnt[sparrtemp] = stat['cum_count']

			if $pantyworntype = 'none':

				if spafinloc = 2:
					spafinloc = 1

				elseif spafinloc = 5:
					spafinloc = 4

				end

			end

			if $clothingworntype = 'nude':

				if spafinloc = 2:
					spafinloc = 1

				elseif spafinloc = 5:
					spafinloc = 4

				elseif spafinloc = 6:

					if rand(0,1) = 0:
						spafinloc = 1

					else
						spafinloc = 4

					end

				elseif spafinloc = 7:

					if rand(0,1) = 0:
						spafinloc = 14

					else
						spafinloc = 15

					end

				end

			end

			sparrloc[sparrtemp] = spafinloc

			if spafinloc = 12 and pcs_breath = 1: pcs_breath = 0
			if spafinloc = 12 and swallow >= 10 and rand(0,3) = 0: pcs_energy += 2 & pcs_hydra += 1

			$sparrnam[sparrtemp] = $boy
			sparrppt[sparrtemp] = sexspecpot
			sparrvol[sparrtemp] += sexvolume
			cumsumbod += sexvolume

			if spafinloc = 3:
				cumsumass += sexvolume
			end

			sparridt[sparrtemp] = cumarrkno[cumarrtemp]
			sparrslc[sparrtemp] = 0

		end
		if cumarrppt[cumarrtemp] < cumarrcpt[cumarrtemp]:cumarrcpt[cumarrtemp] = cumarrppt[cumarrtemp]
		sexpartkno = 0
		sexunaware = 0

!!{	And this is the pre ejaculate release talked about above.}

	elseif sexcontra < 3 and spafinloc = 0:
		$cumarrnam[cumarrtemp] = $boy
		cumarrcnt[cumarrtemp] = stat['cum_count']
		cumarrppt[cumarrtemp] = sexspecpot
		cumarrage[cumarrtemp] = 0
		cumarrdel[cumarrtemp] = 0
		cumarrcon[cumarrtemp] = sexcontra
		cumarrcpt[cumarrtemp] += cumarrppt[cumarrtemp]/12
		if cumarrppt[cumarrtemp] < cumarrcpt[cumarrtemp]:cumarrcpt[cumarrtemp] = cumarrppt[cumarrtemp]
	end

	!!STD from anal check
	if spafinloc = 3 and cumnostd = 0: gs 'dinSex', 'std_trigger'
	!!STD from oral check
	if spafinloc = 12 and cumnostd = 0: gs 'dinSex', 'std_trigger_oral'

	cumprecheck = 0
	spafinloc = 0
	sexvolume = 0

	dynamic $din_Update_Condom_Counts

	if cumsumass >= 60:
		arrmodtmp = arrpos('sparrloc',3)

		if sparrslc[arrmodtmp] <= 0: sparrslc[arrmodtmp] += 1

	end

	if cumsumvag >= 60:
		arrmodtmp = arrpos('sparrloc',0)

		if sparrslc[arrmodtmp] <= 0: sparrslc[arrmodtmp] += 1

	end
	killvar 'sexspecpot'
	killvar 'cumnostd'
end


if $ARGS[0] = 'cumgather':
	cloc = ARGS[1]
	i = arrpos('sparrloc', cloc)

	if i ! -1 and i < arrsize('sparrloc'):

		if cloc = 0:
			$part = 'pussy'
		elseif cloc = 1:
			$part = 'pussylips'
		elseif cloc = 2 or cloc = 5:
			$part = 'your panties'
		elseif cloc = 3:
			$part = 'anus'
		elseif cloc = 4:
			$part = 'buttocks'
		elseif cloc = 6 or cloc = 7:
			$part = 'clothes'
		elseif cloc = 8:
			$part = 'back'
		elseif cloc = 9:
			$part = 'legs'
		elseif cloc = 10:
			$part = 'arms'
		elseif cloc = 11:
			stat['cum_facial'] += 1
			$part = 'face'
		elseif cloc = 14:
			$part = 'stomach'
		elseif cloc = 15:
			$part = 'breasts'
		elseif cloc = 16:
			$part = 'hair'
		else
			$part = 'unknown'
		end

		if mc_inventory['makeup_wipes'] > 0:
			mc_inventory['makeup_wipes'] -= 1
			minut += 5
			'You use a wipe to clean the sperm from your <<$part>>.'
			gs 'cum_cleanup', 'cleanloc', cloc
			gs 'stat'
		end
	end
end

if $ARGS[0] = 'cumeater_icon':
	*nl
	j = 0
	:cumeater_icon_jump
	if cumloc[j] > 0 and j <> 12 and ((j <> 0 and j <> 3) or FUNC('Cum_Manage', 'check_innards', j) = 1 or cheatKlisma = 0): gs 'cum_manage', 'cumeater', j
	if j < 17: j += 1 & jump 'cumeater_icon_jump'
end

if $ARGS[0] = 'cumeater':
	cloc = ARGS[1]
	i = arrpos('sparrloc', cloc)

	if i ! -1 and i < arrsize('sparrloc'):
		cumloc[12] = 1
		spafinloc = 12 & sexvolume = sparrvol[i] & sexunaware = 0 & sexspecpot = -1 & cumarrnam = sparrnam[i] & cumarrcpt = sparrppt[i] & cumarrkno = sparridt[i] & cumarrage = sparrage[i] & cumnostd = 1 & gs 'Cum_Manage'
		pcs_breath = 0
		$part = ''

		if cloc = 13:
			gs 'cum_cleanup', 'cleanloc', cloc
			'You carefully lick the sperm residue from your hands, enjoying the tart taste.'
		else
			if cloc = 0:
				$part = 'pussy'
			elseif cloc = 1:
				$part = 'pussylips'
			elseif cloc = 2 or cloc = 5:
				$part = 'your panties'
				gs 'cum_cleanup', 'cleanloc', 2
				gs 'cum_cleanup', 'cleanloc', 5
			elseif cloc = 3:
				$part = 'anus'
			elseif cloc = 4:
				$part = 'buttocks'
			elseif cloc = 6 or cloc = 7:
				$part = 'clothes'
				gs 'cum_cleanup', 'cleanloc', 6
				gs 'cum_cleanup', 'cleanloc', 7
			elseif cloc = 8:
				$part = 'back'
			elseif cloc = 9:
				$part = 'legs'
			elseif cloc = 10:
				$part = 'arms'
			elseif cloc = 11:
				$part = 'face'
			elseif cloc = 14:
				$part = 'stomach'
			elseif cloc = 15:
				$part = 'breasts'
			elseif cloc = 16:
				$part = 'hair'
			else
				$part = 'unknown'
			end

			if rand(0, 1) = 0:
				'You collect a handful of sperm from your <<$part>> in your hand and lick it up, enjoying the tart taste.'
			else
				'You collect the sperm from your <<$part>> with your fingers and lick them, enjoying the tart taste.'
			end

			if FUNC('Cum_Manage', 'check_innards', cloc) = 1 and cheatKlisma = 1:
				cumspclnt = 15 & gs 'cum_cleanup'
			elseif (cloc <> 0 and cloc <> 3) or cheatKlisma = 0:
				gs 'cum_cleanup', 'cleanloc', cloc
			end
		end

		minut += 2
		gs 'stat'
	end
end

if $ARGS[0] = 'cum_stat_display':
	if Enable_clearcum > 0: gs 'cum_cleanup', 'reset'

	killvar 'cumvolume'
	killvar 'i'
	killvar 'knownguy'
	killvar 'cumcount'
	killvar 'cumowner'

	if arrsize('sparrvol') > 0:
		!!go through every location
		:locationloop
			!!start from the freshest load
			idx = arrsize('sparrloc')-1
			:spermitemloop
				!!if the currently examined load loaction is the location of the current cycle, execute
				if sparrloc[idx] = i:
					!!setting the age of the current load
					!! 0: mouth
					!! 1: in this hour
					!! 2: in four hours
					!! 3: at least five hours ago
					!! 4: in body (pussy or ass)
					!! 5: no more than 12 hours in condom
					!! 6: no more than 48 hours in condom
					!! 7: more than two days old, in condom
					if i = 12:
						j = 0
					elseif i = 17:
						if sparrage[idx] <= 12:
							j = 5
						elseif sparrage[idx] <= 48:
							j = 6
						else
							j = 7
						end
					elseif i = 0 or i = 3:
						j = 4
					else
						if sparrage[idx] <= 1:
							j = 1
						elseif sparrage[idx] <= 5:
							j = 2
						else
							j = 3
						end
					end

					cumvolume['<<i>>:<<j>>'] += sparrvol[idx]
					if sparrvol[idx] > 0:
						if sparridt[idx] = 0:
							!!unknown partner
							cumcount['<<i>>:<<j>>'] += 1
						elseif sparridt[idx] = 1:
							!!known partner
							!!storing the name of the cum owner (format: $cumowner[<cum location>:<age of cum>:<index of cum owner>])
							if knownguy['<<i>>:<<j>>'] > 0:
								gchk = 0
								:sameguycheck
								if $cumowner['<<i>>:<<j>>:<<gchk>>'] ! $sparrnam[idx] and gchk <= knownguy['<<i>>:<<j>>']:gchk += 1 & jump 'sameguycheck'
								if gchk > knownguy['<<i>>:<<j>>']:
									$cumowner['<<i>>:<<j>>:<<knownguy[''<<i>>:<<j>>'']>>'] = $sparrnam[idx]
									knownguy['<<i>>:<<j>>'] += 1
									cumcount['<<i>>:<<j>>'] += 1
								end
							else
								$cumowner['<<i>>:<<j>>:<<knownguy[''<<i>>:<<j>>'']>>'] = $sparrnam[idx]
								knownguy['<<i>>:<<j>>'] += 1
								cumcount['<<i>>:<<j>>'] += 1
							end
						end
					end
				end
			if idx > 0:idx -= 1 & jump 'spermitemloop'
		if i < 18:i += 1 & jump 'locationloop'
		killvar 'i'
		killvar 'idx'
		killvar 'j'
	end

	!!Clearing cum location array before positive entries are applied below in the icon and the text message codes
	killvar 'cumloc'

	$stat_cum_msg = ''
	$stat_cum_text = ''
	stat_visible_cum = 0
	stat_cumloc_check = 0
	cumsumbod = 0
	cumsumvag = 0
	cumsumass = 0

	i = 0
	:cumlocloop
		if i = 0:
			$icon_txtloc = 'your pussy'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/creampie/cumpussy'+rand(1,14)+'.jpg''">pussy</a>'
		elseif i = 1:
			$txtloc_adj = 'all over '
			$icon_txtloc = 'your labia'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/cumpussy/cumpus'+rand(1,4)+'.jpg''">labia</a>'
		elseif i = 2 and PCloPanties > 0:
			$txtloc_adj = 'across '
			$txtloc = 'the front of your panties'
			$icon_txtloc = $txtloc
		elseif i = 3:
			$txtloc_adj = 'across '
			$icon_txtloc = 'your ass'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/cumanal/cumanal'+rand(1,11)+'.jpg''">ass</a>'
		elseif i = 4:
			$txtloc_adj = 'all over '
			$icon_txtloc = 'your butt'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/cumass/cumass'+rand(1,6)+'.jpg''">butt</a>'
		elseif i = 5 and PCloPanties > 0:
			$txtloc_adj = 'painting '
			$txtloc = 'the back of your panties'
			$icon_txtloc = $txtloc
		elseif i = 6 and PCloPants > 0:
			$txtloc_adj = 'on '
			$icon_txtloc = 'your clothes near your groin'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/cumclothes/'+rand(1,3)+'.jpg''">clothes near your groin</a>'
		elseif i = 7 and $clothingworntype <> 'nude':
			$txtloc_adj = 'on '
			$icon_txtloc = 'your clothes'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/cumclothes/cumclothes'+rand(1,21)+'.jpg''">clothes</a>'
		elseif i = 8:
			$txtloc_adj = 'down '
			$txtloc = 'your back'
			$icon_txtloc = $txtloc
		elseif i = 9:
			$txtloc_adj = 'on '
			$txtloc = 'your legs'
			$icon_txtloc = $txtloc
		elseif i = 10:
			$txtloc_adj = 'on '
			$txtloc = 'your arms'
			$icon_txtloc = $txtloc
		elseif i = 11:
			if pcs_haircol = 0:
				$cum_face_image = 'brown/'
				$cum_face_image += rand(1,31)
			elseif pcs_haircol = 1:
				$cum_face_image = 'black/'
				$cum_face_image += rand(1,23)
			elseif pcs_haircol = 2:
				$cum_face_image = 'red/'
				$cum_face_image += rand(1,19)
			elseif pcs_haircol = 3:
				$cum_face_image = 'blonde/'
				$cum_face_image += rand(1,25)
			elseif pcs_haircol > 3:
				$cum_face_image = 'custom/'
				$cum_face_image += rand(1,20)
			end
			$txtloc_adj = 'across '
			$icon_txtloc = 'your face'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/cumface/<<$cum_face_image>>.jpg''">face</a>'
			killvar 'cum_face_image'
		elseif i = 13:
			$txtloc_adj = 'over '
			$txtloc = 'your hands'
			$icon_txtloc = $txtloc
		elseif i = 14:
			$txtloc_adj = 'across '
			$icon_txtloc = 'across your stomach'
			$txtloc = 'across your <a href="exec:view''images/pc/body/cum/cumbelly/cumbelly'+rand(1,12)+'.jpg''">stomach</a>'
		elseif i = 15:
			$txtloc_adj = 'on '
			$icon_txtloc = 'on your breasts'
			$txtloc = 'your <a href="exec:view''images/pc/body/cum/cumtits/cumtits'+rand(1,19)+'.jpg''">breasts</a>'
		elseif i = 16:
			$txtloc_adj = 'in '
			$icon_txtloc = 'your hair'
			$txtloc = 'your hair</a>'
		elseif i = 17:
			$txtloc = 'in your vagina in a slipped condom'
			$icon_txtloc = $txtloc
		else
			$txtloc_adj = 'on '
			$icon_txtloc = 'the gusset of your panties'
			$txtloc = 'the gusset of your panties</a>'
		end

		j = 0
		:ageloop
			if cumvolume['<<i>>:<<j>>'] > 0:
				!!Cum locations set for checking npc reactions
				cumloc[i] = 1
				cumvol[i] = cumvolume['<<i>>:<<j>>']
				if stat_cumloc_check ! 1 and i ! 12: stat_cumloc_check = 1
				!!amount setting
				if cumvolume['<<i>>:<<j>>'] > 250:
					!! 25 ml, about four-five load, gushing
					$txtamount = 'Enormous '
				elseif cumvolume['<<i>>:<<j>>'] > 100:
					!! 10 ml, about two load, flowing
					$txtamount = 'Huge '
				elseif cumvolume['<<i>>:<<j>>'] >= 20:
					!! 2 ml, seeping out
					$txtamount = 'Decent '
				else
					!! residue amount, no leakage
					$txtamount = 'Small '
				end

				!! if sperm age stage is 4, it means inside the body
				if j = 4:
					cumsumbod += cumvolume['<<i>>:<<j>>']
					cumsumvag += iif(i=0,cumvolume['<<i>>:<<j>>'],0)
					cumsumass += iif(i=3,cumvolume['<<i>>:<<j>>'],0)
					if ((vibratorIN = 1 or isprok = 1) and i = 0) or (analplugin = 1 and i = 3):
						$txtproxy = 'being plugged in '
					elseif i = 0 and cumvolume['<<i>>:<<j>>'] < FUNC('Cum_Manage', 'check_innards', 0, 1):
						$txtproxy = 'staying inside '
					elseif i = 3 and cumvolume['<<i>>:<<j>>'] < FUNC('Cum_Manage', 'check_innards', 3, 1):
						$txtproxy = 'staying inside '
					else
						if cumvolume['<<i>>:<<j>>'] > 250:
							$txtproxy = 'gushing out of '
						elseif cumvolume['<<i>>:<<j>>'] > 100:
							$txtproxy = 'flowing out of '
						elseif cumvolume['<<i>>:<<j>>'] >= 40:
							$txtproxy = 'seeping out of '
						else
							$txtproxy = 'staying inside '
						end
					end
				elseif j >= 5:
				!! if sperm age stage is over 4, meaning in condom
					if j = 5:
						$txtproxy = 'buried '
					elseif j = 6:
						$txtproxy = 'marinating '
					else
						$txtproxy = 'rotting '
					end
					if cumcondslip_deep > (vagina / 2): $txtproxy += 'deep '
				elseif j < 4 and j > 0:
					cumsumbod += cumvolume['<<i>>:<<j>>']
					!!amount setting
					if cumvolume['<<i>>:<<j>>'] > 160:
						!! 10 ml, about two load, flowing
						$txtproxy = 'coating '
					elseif cumvolume['<<i>>:<<j>>'] > 40:
						!! 2 ml, seeping out
						$txtproxy = 'covering '
					else
						!! residue amount, no leakage
						$txtproxy = 'spattered '
					end
					if j = 1:
						$txtproxy += 'wetly '
					elseif j = 2:
						$txtproxy += 'dryly '
					else
						$txtproxy += 'powderly '
					end
					if cumvolume['<<i>>:<<j>>'] < 40:
						$txtproxy += $txtloc_adj
					end
				end

				$txtperson = ''
				if cumcount['<<i>>:<<j>>'] = 0:
	!!ToDo: No idea how to do the icon here (julzor)
					$txtiscum = 'some whitish substance '
				else
					$txtiscum = 'cum'
					if cumcount['<<i>>:<<j>>'] = knownguy['<<i>>:<<j>>']:
					!! everyone is known (one or more)
						if knownguy['<<i>>:<<j>>'] = 1:
							if $npc_usedname[$cumowner['<<i>>:<<j>>:0']] = 'stranger':
								$txtperson = $npc_firstname[$cumowner['<<i>>:<<j>>:0']] + ' '
							else
								$txtperson = $npc_usedname[$cumowner['<<i>>:<<j>>:0']] + ' '
							end
						else
							kmax = 0
							:nullocator1
							if $cumowner['<<i>>:<<j>>:<<kmax>>'] ! '':kmax += 1 & jump 'nullocator1'
							kmax -= 1
							k = 0
							:knownloop
								$txtperson += $npc_usedname[$cumowner['<<i>>:<<j>>:<<k>>']]
							if k < kmax-1:$txtperson += ', ' & k += 1 & jump 'knownloop'
							k += 1
							if $npc_usedname[$cumowner['<<i>>:<<j>>:<<k>>']] = 'stranger':
								$txtperson += ' and ' + $npc_firstname[$cumowner['<<i>>:<<j>>:<<k>>']] + ' '
							else
								$txtperson += ' and ' + $npc_usedname[$cumowner['<<i>>:<<j>>:<<k>>']] + ' '
							end
						end
					elseif knownguy['<<i>>:<<j>>'] = 0:
					!! no one is known (one or more)
						if cumcount['<<i>>:<<j>>'] = 1:
							$txtperson += 'some guy '
						else
							$txtperson += 'some guys '
						end
					else
					!! there are known and unknown guys in the mix
						if knownguy['<<i>>:<<j>>'] = 1:
							if $npc_usedname[$cumowner['<<i>>:<<j>>:<<k>>']] = 'stranger':
								$txtperson = $npc_firstname[$cumowner['<<i>>:<<j>>:0']] + ' and some guy'
							else
								$txtperson = $npc_usedname[$cumowner['<<i>>:<<j>>:0']] + ' and some guy'
							end
						else
							kmax = 0
							:nullocator2
							if $cumowner['<<i>>:<<j>>:<<kmax>>'] ! '':kmax += 1 & jump 'nullocator2'
							kmax -= 1
							k = 0
							:mixloop
								if $npc_usedname[$cumowner['<<i>>:<<j>>:<<k>>']] = 'stranger':
									$txtperson += $npc_firstname[$cumowner['<<i>>:<<j>>:<<k>>']] + ', '
								else
									$txtperson += $npc_usedname[$cumowner['<<i>>:<<j>>:<<k>>']] + ', '
								end
							if k < kmax: k += 1 & jump 'mixloop'
							$txtperson += 'and some guy'
						end
						if cumcount['<<i>>:<<j>>'] - knownguy['<<i>>:<<j>>'] > 1:
							$txtperson += 's '
						else
							$txtperson += ' '
						end
					end
				end
				$icon_txtiscum = $txtiscum
				if j <= 4 and pcs_traits['cumeater'] = 1 and $txtiscum = 'cum' _ 
				and FUNC('Cum_Manage', 'check_private', i) = 1 and ((i <> 0 and i <> 3) or FUNC('Cum_Manage', 'check_innards', i) = 1 or cheatKlisma = 0):
					$txtiscum = '<a href="exec:gs ''cum_manage'', ''cumeater'', <<i>>"><font color=#0064FF>' + $txtiscum + '</font></a>'
				end
				if $txtperson ! '':
					$txtperson = ' from ' + $txtperson
				end
				if i = 0 and j = 4 and vibratorIN = 0 and pcs_vag*10 < cumvolume['<<i>>:<<j>>'] and cumvolume['<<i>>:<<j>>'] >= 20:
					$stat_cum_text += '<BR><b><font color="red">' + $txtamount + 'amounts of ' + $txtiscum + $txtperson + 'is ' + $txtproxy + $txtloc + iif($pantyworntype ! 'none', ' into your panties.', ' down your legs.')+'</font></b>'
					if $stat_cum_msg ! '': $stat_cum_msg += '<br>'
					$stat_cum_msg += $txtamount + 'amounts of ' + $icon_txtiscum + $txtperson + 'is ' + $txtproxy + $icon_txtloc + iif($pantyworntype ! 'none', ' into your panties.', ' down your legs.')
				elseif sparragestage >= 5:
					if cumcondslip_aware > 0: $stat_cum_text += '<BR><b><font color="red">' + $txtamount + 'amounts of ' + $txtiscum + $txtperson + 'is ' + $txtproxy + $txtloc + '.</font></b>'
					if $stat_cum_msg ! '': $stat_cum_msg += '<br>'
					$stat_cum_msg += $txtamount + 'amounts of ' + $icon_txtiscum + $txtperson + 'is ' + $txtproxy + $icon_txtloc + '.'
				elseif j ! 0:
					$stat_cum_text += '<BR><b><font color="red">' + $txtamount + 'amounts of ' + $txtiscum + $txtperson + 'is ' + $txtproxy + $txtloc + '.</font></b>'
					if $stat_cum_msg ! '': $stat_cum_msg += '<br>'
					$stat_cum_msg += $txtamount + 'amounts of ' + $icon_txtiscum + $txtperson + 'is ' + $txtproxy + $icon_txtloc + '.'
				else
					$stat_cum_text += '<BR><b><font color="red">Your mouth has the tangy aftertaste of sperm.</font></b>'
					if $stat_cum_msg ! '': $stat_cum_msg += '<br>'
					$stat_cum_msg += 'Your mouth has the tangy aftertaste of sperm.'
				end
			end
		if j < 7: j+=1 & jump 'ageloop'

		if stat_cumloc_check = 1 and (FUNC('Cum_Manage', 'check_private', i) = 0 _ 
		or (i <> 0 and cumsumass = 0 and cumsumvag > 0 and FUNC('Cum_Manage', 'check_innards', 0) = 0) _ 
		or (i <> 3 and cumsumvag = 0 and cumsumass > 0 and FUNC('Cum_Manage', 'check_innards', 3) = 0) _ 
		or (i > 3 and cumsumvag > 0 and FUNC('Cum_Manage', 'check_innards', 0) = 0 and cumsumass > 0 and FUNC('Cum_Manage', 'check_innards', 3) = 0)):
			stat_cumloc_check = 2
		end

	if i < 18: i+=1 & jump 'cumlocloop'
	killvar 'i'
	killvar 'j'
	killvar 'txtperson'
	killvar 'k'
	killvar 'kmax'
	killvar 'txtamount'
	killvar 'txtiscum'
	killvar '$icon_txtiscum'
	killvar 'txtperson'
	killvar 'txtproxy'
	killvar 'txtloc'
	killvar '$icon_txtloc'
	killvar 'cumvolume'
	killvar 'cumcount'
	killvar 'knownguy'
	killvar 'cumowner'

	$stat_visible_cum_temp = ''
	$stat_visible_cum_msg = ''

	if cumloc[6] = 1 or cumloc[7] = 1 or cumloc[11] = 1 or cumloc[13] = 1 or cumloc[16] = 1:
		if cumloc[6] = 1:
			stat_visible_cum = 1
			if $stat_visible_cum_temp ! '': $stat_visible_cum_temp += ', '
			$stat_visible_cum_temp += 'on your clothes near your groin'
		end
		if cumloc[7] = 1:
			stat_visible_cum = 1
			if $stat_visible_cum_temp ! '': $stat_visible_cum_temp += ', '
			$stat_visible_cum_temp += 'on your clothes'
		end
		if cumloc[11] = 1:
			stat_visible_cum = 1
			if $stat_visible_cum_temp ! '': $stat_visible_cum_temp += ', '
			$stat_visible_cum_temp += 'on your face'
		end
		if cumloc[13] = 1:
			stat_visible_cum = 1
			if $stat_visible_cum_temp ! '': $stat_visible_cum_temp += ', '
			$stat_visible_cum_temp += 'on your hands'
		end
		if cumloc[16] = 1:
			stat_visible_cum = 1
			if $stat_visible_cum_temp ! '': $stat_visible_cum_temp += ', '
			$stat_visible_cum_temp += 'in your hair'
		end

		$stat_visible_cum_msg = 'People can see the cum '+ $stat_visible_cum_temp + '.'
	end
	cum_loc['vagina'] = cumloc[0]
	cum_loc['labia'] = cumloc[1]
	cum_loc['panty_front'] = cumloc[2]
	cum_loc['anus'] = cumloc[3]
	cum_loc['butt'] = cumloc[4]
	cum_loc['panty_back'] = cumloc[5]
	cum_loc['clothes_groin'] = cumloc[6]
	cum_loc['clothes'] = cumloc[7]
	cum_loc['back'] = cumloc[8]
	cum_loc['legs'] = cumloc[9]
	cum_loc['arms'] = cumloc[10]
	cum_loc['face'] = cumloc[11]
	cum_loc['mouth'] = cumloc[12]
	cum_loc['hands'] = cumloc[13]
	cum_loc['stomach'] = cumloc[14]
	cum_loc['tits'] = cumloc[15]
	cum_loc['hair'] = cumloc[16]
	cum_loc['condom_in_pussy'] = cumloc[17]
	
	cum_vol['vagina'] = cumvol[0]
	cum_vol['labia'] = cumvol[1]
	cum_vol['panty_front'] = cumvol[2]
	cum_vol['anus'] = cumvol[3]
	cum_vol['butt'] = cumvol[4]
	cum_vol['panty_back'] = cumvol[5]
	cum_vol['clothes_groin'] = cumvol[6]
	cum_vol['clothes'] = cumvol[7]
	cum_vol['back'] = cumvol[8]
	cum_vol['legs'] = cumvol[9]
	cum_vol['arms'] = cumvol[10]
	cum_vol['face'] = cumvol[11]
	cum_vol['mouth'] = cumvol[12]
	cum_vol['hands'] = cumvol[13]
	cum_vol['stomach'] = cumvol[14]
	cum_vol['tits'] = cumvol[15]
	cum_vol['hair'] = cumvol[16]
	cum_vol['condom_in_pussy'] = cumvol[17]
end

if $ARGS[0] = 'check_private':
!! Checks whether the current location is private for cleaning cum in intimate places
!! ARGS[1] - cum location (see cum_cleanup)
!! no ARGS[1] means 0, means vagina, means you must be in a private location to interact
!! FUNC('Cum_Manage', 'check_private') = 1
!! FUNC('Cum_Manage', 'check_private', 7) = 1

	RESULT = 0

	if $location_type = 'private' or $location_type = 'private_indoors' or $location_type = 'private_shared' or $location_type = 'bathroom': RESULT = 1
	if ARGS[1] > 5 and ARGS[1] <> 15 and ARGS[1] <> 17: RESULT = 1

end

if $ARGS[0] = 'check_innards':
!! Cum overflow check inside vagina or anus
!! ARGS[1] - 0 (vagina) or 3 (anus)
!! ARGS[2] - return max capacity
!! capvag - vagina max capacity
!! capanus - anus max capacity
!! FUNC('Cum_Manage', 'check_innards') = 1
!! FUNC('Cum_Manage', 'check_innards', 3) = 1
!! FUNC('Cum_Manage', 'check_innards', 0, 1) <= cumsumvag

	capvag  = pcs_vag*3 - vgape*30 - min(100,pcs_horny)/10
	capanus = pcs_ass*6 - agape*40
	RESULT = 0

	if ARGS[1] = 0:
		if ARGS[2] > 0:
			RESULT = capvag
		elseif cumsumvag >= capvag and isprok = 0 and vibratorIN = 0:
			RESULT = 1
		end
	elseif ARGS[1] = 3:
		if ARGS[2] > 0:
			RESULT = capanus
		elseif cumsumass >= capanus and analplugin = 0:
			RESULT = 1
		end
	end

	killvar 'capvag'
	killvar 'capanus'
end

if $ARGS[0] = 'cum_decay':
!! ARGS[1] forced cum leak (sex intercourse) in values like 20-100

	cumforced = ARGS[1]
	if ((menu_off = 1 or cumdectime+15 > totminut) and cumforced = 0) or no_cum_leak = 1: exit

	if arrsize('sparrvol') > 0:
		cumsumvag = 0
		cumsumass = 0
        killvar 'cumloc'
        killvar 'cumvol'
		i = 0

		!!go through every location
		:sparrvolloop
			!!start from the freshest load
			idx = arrsize('sparrloc')-1
			:sparrlocloop
				!!if the currently examined load loaction is the location of the current cycle, execute
				if sparrloc[idx] = i and sparrvol[idx] > 0:
					!! 0 = 'In your Vagina'
					if i = 0:
						!! passive absorption, succubus has its own
						!! InSleep - increase the amount during sleep, isprok - tampon absorption
						if succubusflag = 0:
							cumamount = (totminut-cumdectime)/15 * max(rand(0,1), rand(sparrvol[idx]/60, sparrvol[idx]/30) + rand(0, InSleep*rand(1,3)) + isprok*rand(5,10) + rand(0, iif(pcs_hydra<30,(30-pcs_hydra)/10,0)) + rand(0, iif(pcs_horny<100,(100-pcs_horny)/20,0)))
							sparrvol[idx] -= cumamount
						end

						if sparrvol[idx] > 0:
							cumsumvag += sparrvol[idx]
							!! seeping out
							if FUNC('Cum_Manage', 'check_innards', 0) = 1 or cumforced/rand(2,3) > sparrvol[idx]:
								cumamount = min(sparrvol[idx]*3/2, (totminut-cumdectime)/15 * max(rand(1,3), rand(sparrvol[idx]/max(1,pcs_vag), vgape*40) - InSleep*rand(2,5) + iif(pcs_horny>50, min(100,pcs_horny)/10 - 4,0)) + cumforced/rand(5,10))
								sparrvol[idx] -= cumamount & cumsumvag -= cumamount
								cumvol[0] -= cumamount

								!! 1 = 'On your labia'
								sexvolume = max(cumamount/10, cumamount/2 - iif(cumforced=0,isprokp*rand(10,20),0))
								if sexvolume > 0:
									spafinloc = 1
									sexunaware = iif(cumforced=0,iif(rand(0,4)=1 or sparridt[idx]=-2,1,0),0)
									sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = 0 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
									gs 'Cum_Manage'
									cumvol[1] += sexvolume & cumloc[1] = 1
								end
								if cumforced = 0:
									!! 2 = 'On your panties over your vagina'
									if $pantyworntype <> 'none' or PCloPanties > 0:
										!! isprokp - sanitary pad absorption
										if isprokp <> 1:
											spafinloc = 2
											sexvolume = max(1, cumamount/2)
											sexunaware = iif(rand(0,3)=1 or sparridt[idx]=-2,1,0)
											sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = 0 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
											gs 'Cum_Manage'
											cumvol[2] += sexvolume & cumloc[2] = 1
										end
									!! 9 = 'On your legs'
									elseif ($clothingworntype = 'nude' or PCloSkirt > 0 or PCloDress > 0) and rand(1,10) > 6 + InSleep*2:
										sexvolume = max(0, cumamount/4)
										if sexvolume > 0:
											spafinloc = 9
											sexunaware = iif(rand(0,2)=1 or sparridt[idx]=-2,1,0)
											sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = 0 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
											gs 'Cum_Manage'
											cumvol[9] += sexvolume & cumloc[9] = 1
										end
									end
									!! 6 = 'On your clothes in your groin area'
									if PCloPants > 0:
										sexvolume = max(0, cumamount / (3 + iif($pantyworntype<>'none',12,0)))
										if sexvolume > 0:
											spafinloc = 6
											sexunaware = iif(rand(0,4)=1 or sparridt[idx]=-2,1,0)
											sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = 0 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
											gs 'Cum_Manage'
											cumvol[6] += sexvolume & cumloc[6] = 1
										end
									end
								end
							end
						end
						if sparrvol[idx] <= 0: gs 'cum_cleanup', 'cleandeposit', idx
					!! 3 = 'In your anus'
					elseif i = 3:
						!! passive absorption, succubus has its own
						if succubusflag = 0:
							cumamount = (totminut-cumdectime)/15 * max(rand(0,2), rand(sparrvol[idx]/40, sparrvol[idx]/20) + rand(0, InSleep*rand(3,6)) + rand(0, iif(pcs_hydra<50,(50-pcs_hydra)/10,0)))
							sparrvol[idx] -= cumamount
						end

						if sparrvol[idx] > 0:
							cumsumass += sparrvol[idx]
							!! seeping out
							if FUNC('Cum_Manage', 'check_innards', 3) = 1 or cumforced/rand(2,4) > sparrvol[idx]:
								cumamount = min(sparrvol[idx]*3/2, (totminut-cumdectime)/15 * max(rand(0,1), rand(sparrvol[idx]/max(1,(pcs_ass*3/2)), agape*20) - InSleep*rand(4,8)) + cumforced/rand(7,15))
								sparrvol[idx] -= cumamount & cumsumass -= cumamount
								cumvol[3] -= cumamount

								!! 1 = 'On your labia'
								sexvolume = max(cumamount/10, cumamount/4 - iif(cumforced=0,isprokp*rand(10,20),0))
								if sexvolume > 0:
									spafinloc = 1
									sexunaware = iif(cumforced=0,iif(rand(0,4)=1 or sparridt[idx]=-2,1,0),0)
									sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx]/2 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
									gs 'Cum_Manage'
									cumvol[1] += sexvolume & cumloc[1] = 1
								end
								if cumforced > 0:
									!! 4 = 'On your butt'
									sexvolume = max(cumamount/15, cumamount/3)
									if sexvolume > 0:
										spafinloc = 4
										sexvolume = max(0, cumamount/2)
										sexunaware = 0
										sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx]/3 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
										gs 'Cum_Manage'
										cumvol[4] += sexvolume & cumloc[4] = 1
									end
								else
									!! 5 = 'On your panties over your butt'
									if $pantyworntype <> 'none' or PCloPanties > 0:
										!! isprokp - sanitary pad absorption
										if isprokp <> 1:
											spafinloc = 5
											sexvolume = max(1, cumamount/3)
											sexunaware = iif(rand(0,3)=1 or sparridt[idx]=-2,1,0)
											sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx]/3 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
											gs 'Cum_Manage'
											cumvol[5] += sexvolume & cumloc[5] = 1
										end
									!! 9 = 'On your legs'
									elseif ($clothingworntype = 'nude' or PCloSkirt > 0 or PCloDress > 0) and rand(1,10) > 4 + InSleep*3:
										sexvolume = max(0, cumamount/5)
										if sexvolume > 0:
											spafinloc = 9
											sexunaware = iif(rand(0,2)=1 or sparridt[idx]=-2,1,0)
											sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx]/4 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
											gs 'Cum_Manage'
											cumvol[9] += sexvolume & cumloc[9] = 1
										end
									end
									!! 6 = 'On your clothes in your groin area'
									if PCloPants > 0:
										sexvolume = max(0, cumamount / (4 + iif($pantyworntype<>'none',16,0)))
										if sexvolume > 0:
											spafinloc = 6
											sexunaware = iif(rand(0,4)=1 or sparridt[idx]=-2,1,0)
											sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx]/3 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
											gs 'Cum_Manage'
											cumvol[6] += sexvolume & cumloc[6] = 1
										end
									end
								end
							end
						end
						if sparrvol[idx] <= 0: gs 'cum_cleanup', 'cleandeposit', idx
					!! 1 = 'On your labia'  4 = 'On your butt'
					elseif (i = 1 and sparrvol[idx]*((totminut-cumdectime)/15) > rand(2,5)) _ 
						or (i = 4 and sparrvol[idx]*((totminut-cumdectime)/15) > rand(4,8)):
						if $pantyworntype <> 'none' or PCloPanties > 0:
							!! 2 = 'On your panties over your vagina'  5 = 'On your panties over your butt'
							sexvolume = rand(sparrvol[idx]/2, sparrvol[idx]) - iif(i=1,isprokp*rand(15,30),0)
							if sexvolume > 0:
								sparrvol[idx] -= sexvolume
								spafinloc = iif(i=1,2,5)
								sexunaware = 1
								sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx] & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 0
								gs 'Cum_Manage'
								cumvol[iif(i=1,2,5)] += sexvolume & cumloc[iif(i=1,2,5)] = 1
							end
						!! 6 = 'On your clothes in your groin area'
						elseif PCloPants > 0:
							sexvolume = rand(sparrvol[idx]/2, sparrvol[idx])
							if sexvolume > 0:
								spafinloc = 6
								sexunaware = iif(rand(0,4)=1 or sparridt[idx]=-2,1,0)
								sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx]/3 & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 1
								gs 'Cum_Manage'
								cumvol[6] += sexvolume & cumloc[6] = 1
							end
						end
						if sparrvol[idx] <= 0: gs 'cum_cleanup', 'cleandeposit', idx
					!! 17 = 'In a condom in your vagina'
					elseif i = 17 and sparrvol[idx] > rand(10,15):
						!! 0 = 'In your Vagina'
						sexvolume = min(sparrvol[idx]/3, (totminut-cumdectime)/15 * max(0, cumamount/5 - isprokp*rand(2,5)) + cumforced/rand(5,10))
						if sexvolume > 0:
							!! condom in vagina is summed in cumsumvag and Cum_Manage call will added more, so subtract here
							cumsumvag -= sexvolume
							sparrvol[idx] -= sexvolume
							spafinloc = 0
							sexunaware = 1
							sexspecpot = -1 & cumarrnam = sparrnam[idx] & cumarrcpt = sparrppt[idx] & cumarrkno = sparridt[idx] & cumarrage = sparrage[idx] & cumnostd = 0
							gs 'Cum_Manage'
							cumvol[17] -= sexvolume & cumvol[0] += sexvolume & cumloc[0] = 1
						end
					!! 12 = 'Inside your mouth'
					elseif i <> 12 and sparrvol[idx] > rand(0,3):
						!! dry out
						!! 1: in this hour
						!! 2: in four hours
						!! 3: at least five hours ago
						if rand(min(-1+InSleep, sparrvol[idx]/-5), sparrage[idx] + (totminut-cumdectime)/30) >= 1:
							!! 5 and 7 = not clothes
							if i <> 6 and i <> 7: pcs_sweat += rand(0, max(1,sparrvol[idx]/10))
							gs 'cum_cleanup', 'cleandeposit', idx
						end
					end
					if sparrvol[idx] > 0: cumloc[i] = 1 & cumvol[inx] += sparrvol[idx] else cumloc[i] = 0 & cumvol[inx] = 0
				end
				!! reset just in case
				sexvolume = 0 & cumnostd = 0 & cumarrkno = 0
			if idx > 0:idx -= 1 & jump 'sparrlocloop'
		if i < 18:i += 1 & jump 'sparrvolloop'
		killvar 'i'
		killvar 'idx'
		killvar 'cumamount'
		if cumsumvag <= 0: cumsumvag = 0 & cum_vol['vagina'] = 0 & cumvol[0] = 0 & cum_loc['vagina'] = 0 & cumloc[0] = 0
		if cumsumass <= 0: cumsumass = 0 & cum_vol['anus'] = 0   & cumvol[3] = 0 & cum_loc['anus'] = 0   & cumloc[3] = 0
		if cumsumbod < 0: cumsumbod = 0
	end
	killvar 'cumforced'
	cumdectime = totminut
end

--- Cum_Manage ---------------------------------

