:: cum_call[include]
	<<run console.warn('Use of cum_call is deprecated. Use <<cum>> instead.');>>

:: cum_widgets[widget]
<<widget 'cum'>>
	<<set [_cumLocation,_cumNPC,_cumNPCKnown,_cumContraception,_cumPotency] = _args>>
	<!-- TODO: Check if contraception failed -->
	<<run $pc.cum(_cumNPC,_cumLocation)>>
<</widget>>

:: cum_call_deprecated[deprecated]
<!-- !{$ARGS[0] is for the location and should be set for all but vaginal:
'labia' - 'pantyfront' - 'anus' - 'butt' - 'pantyrear' - 'clothes_hidden' - 'clothes' - 'back' - 'legs'
'arms' - 'face' - 'mouth' - 'hands' - 'stomach' - 'breasts' - 'hair' - 'internalcondom' - 'precum' - 'mouth_swallow'
'precum' - is for whenever Sveta has unprotected vaginal sex. It will automatically set the volume to 1.
'mouth_swallow' does the same as mouth but increments swallow for the cum eater trait
'feet' redirects to 'legs'
'anal' redirects to 'anus' (prevents further errors)
$ARGS[1] is for the name of the sexual partner
ARGS[2] is a for knowing the partner. Defaults to 0. If this is not set to 1 the status window message will mention "some guy" instead of his name.
0 - unknown sex partner (his name may be known, but she newer saw him before, and likely won't ever again, or she won't remeber it)
1 - sex partner is known for MC (classmate, neighbor, someone she new beforehand)
2 - MC is unaware of the act (like unconscious sex)
ARGS[3] is contraception, if left blank it will use the default, if you want to force a particular type:
1 - he thought you were on the pill but you weren''t.
2 - you are on the Pill
3 - Condom. Condoms can still fail vy the code.
4 - the Condom Broke. This is mostly used to check if cum manage resulted in a broken condom.
5 - the Condom Slipped off. Like 4, this is mostly to check if the contraception of 3 had a failure. But both 4 and 5 can be specified if you want to write an event where it fails no matter what.
6 - the condom was Sabotaged but the main character shouldn''t know that
7 - the Condom was Sabotaged by the main character.
ARGS[4] is for changing the potency, -1 for unable to impregnate, default is 10,000
NOTE volume is ignored for pregnancy risk if this or npc_spermpot[] for the partner is set
ARGS[5] is volume, default is 40 (4ml)
For a simple call you only need the first 3, ie:
gs 'cum_call', 'anus', 'Kolka', 1 - for a known partner
gs 'cum_call', 'anus' - for an unknown partner named "unknown", or
gs 'cum_call', 'anus', 'plumber' - for an unknown partner named "plumber"} -->
<<if $location_var[$here][0] != 'precum'>>
	<<set $cumboy = $sex.npcId>>
	<<if $location_var[$here][5] != 0>>
		<<set $sexvolume = $ARGS[5]>>
	<</if>>
	<<if $location_var[$here][4] != 0>>
		<<set $sexspecpot = $ARGS[4]>>
	<<else>>
		<<set $sexspecpot = 0>>
	<</if>>
	<<if $location_var[$here][3] == 1>>
		<<set $sexcontra = 1>>
	<<elseif $location_var[$here][3] == 2>>
		<<set $sexcontra = 2>>
	<<elseif $location_var[$here][3] == 3>>
		<<set $sexcontra = 3>>
	<<elseif $location_var[$here][3] == 4>>
		<<set $sexcontra = 4>>
	<<elseif $location_var[$here][3] == 5>>
		<<set $sexcontra = 5>>
	<<elseif $location_var[$here][3] == 6>>
		<<set $sexcontra = 6>>
	<<elseif $location_var[$here][3] == 7>>
		<<set $sexcontra = 7>>
	<</if>>
	<<if $location_var[$here][2] == 2>>
		<<set $sexunaware = 1>>
	<<elseif $location_var[$here][2] == 1>>
		<<set $sexpartkno = 1>>
	<<else>>
		<<set $sexpartkno = 0>>
	<</if>>
	<!-- !!This check if the name passed is not in the new MGX format-->
	<<if $location_var[$here][1] == '' or mid($ARGS[1],2,1) > 10>>
		<<if $location_var[$here][2] == 0 or $location_var[$here][2] == 2>>
			<<gs 'npcgeneratec' 0 $location_var[$here][1] `rand(18,60)`>>
			
		<<elseif $location_var[$here][2] == 1>>
			<<set $tempnpcid = arrpos('$npc_usedname', $ARGS[1])>>
			<<if getvar("$tempnpcid") > 0>>
				<<gs 'boyStat' $tempnpcid>>
				<br><b><font color="teal">DEVELOPER WARNING: Legacy name cum_call needs upgrade from <<$ARGS[1]>> to A<<tempnpcid>></font></b>
			<<else>>
				<<msg 'There has been an error in the cum_call code. Please contact a developer with what you were doing prior to receiving this message so the error may be fixed. Error type: Improper value for cum_call. Name <<$ARGS[1]>>'>>
				<!-- Boy D0 -->
			<</if>>
		<</if>>
	<<else>>
		<<gs 'boyStat' $location_var[$here][1]>>
	<</if>>
	<<if $location_var[$here][0] == 'labia'>>
		<<set $spafinloc = 1>>
	<<elseif $location_var[$here][0] == 'pantyfront'>>
		<<set $spafinloc = 2>>
	<<elseif $location_var[$here][0] == 'anus'>>
		<<set $spafinloc = 3>>
	<<elseif $location_var[$here][0] == 'anal'>>
		<<set $spafinloc = 3>>
	<<elseif $location_var[$here][0] == 'butt'>>
		<<set $spafinloc = 4>>
	<<elseif $location_var[$here][0] == 'pantyrear'>>
		<<set $spafinloc = 5>>
	<<elseif $location_var[$here][0] == 'clothes_hidden'>>
		<<set $spafinloc = 6>>
	<<elseif $location_var[$here][0] == 'clothes'>>
		<<set $spafinloc = 7>>
	<<elseif $location_var[$here][0] == 'back'>>
		<<set $spafinloc = 8>>
	<<elseif $location_var[$here][0] == 'legs'>>
		<<set $spafinloc = 9>>
	<<elseif $location_var[$here][0] == 'feet'>>
		<<set $spafinloc = 9>>
	<<elseif $location_var[$here][0] == 'arms'>>
		<<set $spafinloc = 10>>
	<<elseif $location_var[$here][0] == 'face'>>
		<<set $spafinloc = 11>>
	<<elseif $location_var[$here][0] == 'mouth'>>
		<<set $spafinloc = 12>>
	<<elseif $location_var[$here][0] == 'mouth_swallow'>>
		<<set $spafinloc = 12>>
		<<run $pc.sexStatInc('swallow','aware',1)>>
	<<elseif $location_var[$here][0] == 'hands'>>
		<<set $spafinloc = 13>>
	<<elseif $location_var[$here][0] == 'stomach'>>
		<<set $spafinloc = 14>>
	<<elseif $location_var[$here][0] == 'breasts'>>
		<<set $spafinloc = 15>>
	<<elseif $location_var[$here][0] == 'hair'>>
		<<set $spafinloc = 16>>
	<<elseif $location_var[$here][0] == 'internalcondom'>>
		<<set $spafinloc = 17>>
	<<else>>
		<<set $spafinloc = 0>>
		<!-- !Vagina and default-->
	<</if>>
	<!-- !{'boy <<$boydesc>> loc <<spafinloc>> contra <<sexcontra>> vol <<sexvolume>> ppt <<sexspecpot>> know <<sexpartkno>> unaware <<sexunaware>> cumboy <<$cumboy>>'} -->
	<<gs 'cum_manage'>>
	<<set $sex.npcId = $cumboy>>
	<<set $sexcontra = 0>>
<<else>>
	<!-- !This is to check for pregnancy and stds from precum. It is added for readability when it is used in the code.-->
	<!-- !It will call cum_call with potency of 1 40th of what it would be for a normal call.-->
	<<set $tempSexspecpot = 0>>
	<<if $location_var[$here][4] > 0>>
		<<set $tempSexspecpot = $ARGS[4] / 40>>
	<<elseif $npc($location_var[$here][1]).spermpot > 0>>
		<<set $tempSexspecpot = $npc($location_var[$here][1]).spermpot / 40>>
	<<else>>
		<<set $tempSexspecpot = 10000 / 40>>
	<</if>>
	<<cum '' $location_var[$here][1] $ARGS[2] $ARGS[3] $tempSexspecpot 1>>
	<<set $tempSexspecpot to null>>
<</if>>
