:: cum_cleanup
<<warn "Usage of cum_cleanup is deprecated. Use $pc.cumCleanByActivity() instead.">>
<<run $pc.cumCleanAll()>>

:: cum_cleanup_old
<!-- !!{To use set a value for cumspclnt then gosub cum_cleanup
Values for cumspclnt:
1	'full external clean'
2	'teeth clean'
3	'internal clean'
4	'external body clean'
5	'hair clean'
6	'clothes clean'
7	'enema'
8	'blank'
9	'wash hands'
10	'full external clean'
11	'wash face'
12	'face and hair'
13	'head'
14	'belly'
15	'wipe ass/pussy'
16	'Breasts'
17	'Arms/legs'
18	'full clean but skipping internal due to hypno'
19
20	'Clean everything' - Full reset
ie.
cumspclnt = 5
gs 'cum_cleanup'} -->
<!-- !!{	Locations of cum on Sveta which correspond to the toclean variable
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 $location_var[$here][0] == 'cleanloc' and arrsize('ARGS') > 1>>
	<<set $i = 0>>
	<<warn 'JUMP MARKER ENCOUNTERED: :cleanlocloop'>>
	<<if $i < arrsize('$sparrnam')>>
		<<if $sparrloc[$i] == $ARGS[1]>>
			<<if getvar("$sparrloc["+$i+"]") == 0 or getvar("$sparrloc["+$i+"]") == 3>>
				<<setinit $sparrvol[$i] = 0>>
				<<setinit $sparrslc[$i] = 0>>
			<<else>>
				<<gs 'cum_cleanup' 'cleandeposit' $i>>
			<</if>>
		<</if>>
		<<set $i += 1>>
		<<warn 'JUMP COMMAND ENCOUNTERED: jump cleanlocloop'>>
	<</if>>
<<elseif $location_var[$here][0] == 'cleandeposit' and arrsize('ARGS') > 1>>
	<<set $cumsumbod -= $sparrvol[$ARGS[1]]>>
	<<set $sparrage[$ARGS[1]] to null>>
	<<set $sparrloc[$ARGS[1]] to null>>
	<<set $sparrnam[$ARGS[1]] to null>>
	<<set $sparrppt[$ARGS[1]] to null>>
	<<set $sparridt[$ARGS[1]] to null>>
	<<set $sparrvol[$ARGS[1]] to null>>
	<<set $sparrslc[$ARGS[1]] to null>>
	<<set $sparrcnt[$ARGS[1]] to null>>
<<elseif $location_var[$here][0] == 'cleanwomb' and arrsize('ARGS') > 1>>
	<<set $cumarrcpt[$ARGS[1]] to null>>
	<<set $cumarrppt[$ARGS[1]] to null>>
	<<set $cumarrnam[$ARGS[1]] to null>>
	<<set $cumarrage[$ARGS[1]] to null>>
	<<set $cumarrdel[$ARGS[1]] to null>>
	<<set $cumarrkno[$ARGS[1]] to null>>
	<<set $cumarrcnt[$ARGS[1]] to null>>
	<<set $cumarrcon[$ARGS[1]] to null>>
<<elseif $location_var[$here][0] == 'cumcondslip'>>
	<<if $cumcondslip_deep > (pcs_vag / 2)>>
		<p>The condom is too deep inside you to be pulled out by hand. You need to seek professional help!</p>
	<<else>>
		<<gs 'cum_cleanup' 'cleanloc' 17>>
		<<set $cumcondslip = 0>>
		With some effort, you manage to remove the condom.
	<</if>>
<<elseif $location_var[$here][0] == 'reset'>>
	<!-- !!{ Used in cheat and when giving birth.} -->
	<<set $cleanloc to null>>
	<<set $cumarrcpt to null>>
	<<set $cumarrppt to null>>
	<<set $cumarrnam to null>>
	<<set $cumarrage to null>>
	<<set $cumarrdel to null>>
	<<set $cumarrkno to null>>
	<<set $cumarrcnt to null>>
	<<set $cumarrcon to null>>
	<<set $cumcount to null>>
	<<set $cumloc to null>>
	<<set $cumowner to null>>
	<<set $cumspclnt to null>>
	<<set $cumvolume to null>>
	<<set $spafinloc to null>>
	<<set $sparrage to null>>
	<<set $sparrloc to null>>
	<<set $sparrnam to null>>
	<<set $sparrppt to null>>
	<<set $sparridt to null>>
	<<set $sparrvol to null>>
	<<set $sparrslc to null>>
	<<set $sparrcnt to null>>
	<<set $toclean to []>>
	<<set $deresidue to null>>
	<<set $cumcondslip = 0>>
	<<set $cumcondslip_deep = 0>>
	<<set $cumSUM = 0>>
	<<set $cumsumbod = 0>>
	<<set $cumsumvag = 0>>
	<<set $cumsumass = 0>>
	<<set $Enable_clearcum = 0>>
	<<set $spdirtyn = 0>>
	<<set $spdirtyv = 0>>
	<<set $spdirty = 0>>
<<elseif !$location_var[$here][0]>>
	<<set $cumsumbod = 0>>
	<<set $cumsumvag = 0>>
	<<set $cumsumass = 0>>
	<<set $spafinloc to null>>
	<<set $toclean to []>>
	<<set $deresidue to null>>
	<<if getvar("$cumspclnt") == 1 or getvar("$cumspclnt") == 10>>
		<!-- !{full external clean} -->
		<<run $deresidue.push(0)>>
		<<run $deresidue.push(3)>>
		<<run $toclean.push(1)>>
		<<run $toclean.push(2)>>
		<<run $toclean.push(4)>>
		<<run $toclean.push(5)>>
		<<run $toclean.push(6)>>
		<<run $toclean.push(7)>>
		<<run $toclean.push(8)>>
		<<run $toclean.push(9)>>
		<<run $toclean.push(10)>>
		<<run $toclean.push(11)>>
		<<run $toclean.push(12)>>
		<<run $toclean.push(13)>>
		<<run $toclean.push(14)>>
		<<run $toclean.push(15)>>
		<<run $toclean.push(16)>>
	<<elseif getvar("$cumspclnt") == 2>>
		<!-- !{teeth clean} -->
		<<run $toclean.push(12)>>
	<<elseif getvar("$cumspclnt") == 3>>
		<!-- !{internal clean} -->
		<<run $toclean.push(0)>>
		<<run $toclean.push(3)>>
		<<run $toclean.push(17)>>
	<<elseif getvar("$cumspclnt") == 4>>
		<!-- !{external body clean} -->
		<<run $deresidue.push(0)>>
		<<run $deresidue.push(3)>>
		<<run $toclean.push(1)>>
		<<run $toclean.push(4)>>
		<<run $toclean.push(8)>>
		<<run $toclean.push(9)>>
		<<run $toclean.push(10)>>
		<<run $toclean.push(11)>>
		<<run $toclean.push(13)>>
		<<run $toclean.push(14)>>
		<<run $toclean.push(15)>>
		<<run $toclean.push(16)>>
	<<elseif getvar("$cumspclnt") == 5>>
		<!-- !{hair clean} -->
		<<run $toclean.push(16)>>
	<<elseif getvar("$cumspclnt") == 6>>
		<!-- !{clothes clean} -->
		<<run $toclean.push(2)>>
		<<run $toclean.push(5)>>
		<<run $toclean.push(6)>>
		<<run $toclean.push(7)>>
	<<elseif getvar("$cumspclnt") == 7>>
		<!-- !{enema} -->
		<<run $toclean.push(3)>>
	<<elseif getvar("$cumspclnt") == 8>>
		<!-- !{blank} -->
	<<elseif getvar("$cumspclnt") == 9>>
		<!-- !{wash hands} -->
		<<run $toclean.push(13)>>
	<<elseif getvar("$cumspclnt") == 11>>
		<!-- !{wash face} -->
		<<run $toclean.push(11)>>
	<<elseif getvar("$cumspclnt") == 12>>
		<!-- !{face and hair} -->
		<<run $toclean.push(11)>>
		<<run $toclean.push(16)>>
	<<elseif getvar("$cumspclnt") == 13>>
		<!-- !{head} -->
		<<run $toclean.push(11)>>
		<<run $toclean.push(12)>>
		<<run $toclean.push(16)>>
	<<elseif getvar("$cumspclnt") == 14>>
		<!-- !{belly} -->
		<<run $toclean.push(14)>>
	<<elseif getvar("$cumspclnt") == 15>>
		<!-- !{wipe ass/pussy} -->
		<<run $toclean.push(1)>>
		<<run $toclean.push(4)>>
		<<run $deresidue.push(0)>>
		<<run $deresidue.push(3)>>
	<<elseif getvar("$cumspclnt") == 16>>
		<!-- !{Breasts} -->
		<<run $toclean.push(15)>>
	<<elseif getvar("$cumspclnt") == 17>>
		<!-- !{Arms/legs} -->
		<<run $toclean.push(9)>>
		<<run $toclean.push(10)>>
	<<elseif getvar("$cumspclnt") == 18>>
		<!-- !{full clean but skipping internal due to hypno} -->
		<<run $toclean.push(1)>>
		<<run $toclean.push(2)>>
		<<run $toclean.push(4)>>
		<<run $toclean.push(5)>>
		<<run $toclean.push(6)>>
		<<run $toclean.push(7)>>
		<<run $toclean.push(8)>>
		<<run $toclean.push(9)>>
		<<run $toclean.push(10)>>
		<<run $toclean.push(11)>>
		<<run $toclean.push(12)>>
		<<run $toclean.push(13)>>
		<<run $toclean.push(14)>>
		<<run $toclean.push(15)>>
		<<run $toclean.push(16)>>
	<<elseif getvar("$cumspclnt") == 20>>
		<!-- !{Clean everything} -->
		<<set $sparrage to null>>
		<<set $sparrloc to null>>
		<<set $sparrnam to null>>
		<<set $sparrppt to null>>
		<<set $sparridt to null>>
		<<set $sparrvol to null>>
		<<set $sparrslc to null>>
		<<set $sparrcnt to null>>
	<</if>>
	<<for $i = 0; $i < arrsize('$sparrnam'); $i += 1>>
		<<set $tmp = arrpos('deresidue', sparrloc[$i])>>
		<<if getvar("$tmp") != -1 and $tmp < arrsize('deresidue')>>
			<<setinit $sparrslc[$i] = 0>> <<setinit $sparrvol[$i] = 0>>

		<</if>>
		<<set $tmp = arrpos('$toclean', $sparrloc[$i])>>
		<<if getvar("$tmp") != -1 and $tmp < arrsize('$toclean')>>
			<<gs 'cum_cleanup' 'cleandeposit' $i>>
		<<else>>
			<<set $cumsumbod += $sparrvol[$i]>>
			<<if getvar("$sparrloc["+$i+"]") == 0>>
				<<set $cumsumvag += $sparrvol[$i]>>
			<<elseif getvar("$sparrloc["+$i+"]") == 3>>
				<<set $cumsumass += $sparrvol[$i]>>
			<</if>>
		<</if>>
	<</for>>
	<<set $spdirty = 0>>
	<<setinit $pc.cumAtLocation(0) = 0>>
	<<set $spdirtyn = 0>>
	<<set $spdirtyv = 0>>
	<<setinit $pc.cumAtLocation(12) = 0>>
	<<setinit $pc.cumAtLocation(6) = 0>>
	<<setinit $pc.cumAtLocation(7) = 0>>
	<<set $cumloc to null>>
<</if>>
