code:
:: Widgets Swarm Actions Generation [widget]
<<widget "generateActionsSwarm">>
<<set $combat to 1>>
<<if _targetlist is undefined>>
	<<getTargetList>>
<</if>>

		<<if $lefttarget is "self">>
			<<leftActionInitSelf>>
		<<else>>
			<<leftActionInitSwarm>>
		<</if>>

		<<if $righttarget is "self">>
			<<rightActionInitSelf>>
		<<else>>
			<<rightActionInitSwarm>>
		<</if>>

		<<feetActionInitSwarm>>

	<<if ($mouthuse is 0 and !($dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)))>>

			<<mouthActionInit>>

	<</if>>

<</widget>>

<<widget "leftActionInitSwarm">>
<<set $lefttarget to "swarm">>
<<switch $leftarm>>
<<case 0>>
	<<if $orgasmdown gte 1>>
		<<set _leftOptions to "orgasm">>
		Your left arm is free, but you can't stop the spasms.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _leftOptions to "pain">>
		Your left arm is free, but hurts to move.
	<<elseif $dissociation gte 2>>
		<<set _leftOptions to "unreal">>
		Your left arm is free, but doesn't feel real.
	<<else>>
		<<if _targetYourself is true and _targetnumber gt 1>>
			<<set _targetlistarms["Yourself"] to "self">>
		<</if>>
		<<if $combatControls isnot "radio" and _targetnumber gt 1>>
			Target:
			<<listbox "$lefttarget" autoselect>>
				<<optionsfrom _targetlistarms>>
			<</listbox>>

		<</if>>
		<<set _leftOptions to "free">>
		Your left arm is free.
		<<if $combatControls is "radio" and _targetnumber gt 1>>

			Target:
			<<listbox "$lefttarget" autoselect>>
				<<optionsfrom _targetlistarms>>
			<</listbox>>

		<</if>>
	<</if>>
<<case "swarmgrappled">>
	<<set _leftOptions to "unable">>
	The $swarm["type"] are constricting your left arm!<<if $combatControls is "radio">>
<</if>>
<<case "bound">>
	<<if $orgasmdown gte 1>>
		<<set _leftOptions to "unable">>
		Your left arm jerks against its bonds.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _leftOptions to "unable">>
		Your left arm is held in a painful bind.
	<<elseif $dissociation gte 2>>
		<<set _leftOptions to "unable">>
		Your left arm lies limp in its bonds.
	<<else>>
		<<set _leftOptions to "bound">>
		Your left arm is bound and helpless.
	<</if>><<if $combatControls is "radio">>
<</if>>
<<case "trapped">>
	<<set $_changetype to true>><<leftActionInitVore>>
<<case "grappled" "penis" "othervagina" "vagina" "coverpenis" "anus" "behind">>
	<<set $_changetype to true>><<leftActionInit>>
<<case "struggle">>
	<<set $_changetype to true>><<leftActionInitStruggle>>
<<case "mechgrappled">>
	<<set $_changetype to true>><<leftActionInitMachine>>
<<default>>
	<<set $_changetype to true>><<leftActionInitTentacle>>
<</switch>>
<<if $_changetype isnot true>>
	<<leftActionsSwarm>>
	<<if Object.keys(_leftaction).length gt 0>>
		<<if !(Object.values(_leftaction).includes($leftactiondefault))>>
			<<set $leftactiondefault to "swarmrest">>
		<</if>>
		<<set $leftaction to $leftactiondefault>>
		<<set _textColor to combatListColor('leftaction', (Object.values(_leftaction).includes($leftaction) ? $leftaction : Object.values(_leftaction)[0]), "Swarm")>>

			<<generateCombatActionOthers _leftaction "leftaction" _textColor $leftaction "Swarm">>

		<<if $combatControls.includes("ists")>>

				<<leftactionDifficulty>>

		<</if>>
	<</if>>
	<<set $lastOptions.left to clone(_leftOptions)>>
<</if>>
<</widget>>

<<widget "leftactionDifficultySwarm">>/* Yes, it is supposed to be blank. */
<</widget>>

<<widget "leftActionsSwarm">>
<<set _leftaction to {}>>
<<switch _leftOptions>>
<<case "free">>
	<<if $rightarm is "swarmgrappled" and ($lefttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _leftaction["Free your right arm"] to "leftfree">>
	<<elseif _swarmamounts.active[2] gte 1 and $lefttarget isnot "self">>
		<<silently>><<swarmName>><</silently>>
		<<set _leftaction[_swarmsteady + " one of the " + _swarmname] to "leftswarm">>
	<</if>>
	<<if _swarmamounts.genital[0] lte 0 and _swarmamounts.genital[1] lte 0 and ($lefttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<silently>><<genitals>><</silently>>
		<<set _leftaction["Cover your "+ _text_output] to "frontcoverleft">>
	<</if>>
	<<if _swarmamounts.butt[0] lte 0 and _swarmamounts.butt[1] lte 0 and ($lefttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _leftaction["Cover your butt"] to "backcoverleft">>
	<</if>>
	<<if _swarmamounts.chest lte 0 and ($lefttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _leftaction["Cover your chest"] to "chestcoverleft">>
	<</if>>
	<<if $lefttarget isnot "self">>
		<<if _swarmamounts.genital[1] gte 1 and !$worn.genitals.type.includes("chastity")>>
			<<silently>><<genitals>><</silently>>
			<<set _leftaction["Pull the "+ $swarm["type"] + " from your " + _text_output] to "frontpurgeleft">>
		<</if>>
		<<if _swarmamounts.genital[0] gte 1 and !$worn.genitals.type.includes("chastity")>>
			<<silently>><<genitals>><</silently>>
			<<set _leftaction["Keep the "+ $swarm["type"] + " away from your " + _text_output] to "frontclearleft">>
		<</if>>
		<<if _swarmamounts.butt[1] gte 1 and $worn.genitals.anal_shield isnot 1>>
			<<set _leftaction["Pull the "+ $swarm["type"] + " out of your anus"] to "backpurgeleft">>
		<</if>>
		<<if _swarmamounts.butt[0] gte 1 and $worn.genitals.anal_shield isnot 1>>
			<<set _leftaction["Keep the "+ $swarm["type"] + " away from your butt"] to "backclearleft">>
		<</if>>
		<<if _swarmamounts.chest gte 1>>
			<<set _leftaction["Clear the "+ $swarm["type"] + " off of your chest"] to "chestclearleft">>
		<</if>>
	<</if>>
	<<if $water is 1 and $vorecreature is 0 and ($consensual isnot 1 or $gamemode is "soft") and ($lefttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _leftaction["Swim to safety"] to "swim">>
	<</if>>
	<<if $vorecreature is 0>>
		<<set _leftaction["Rest"] to "swarmrest">>
	<</if>>
<<case "bound">>
	<<if $gamemode is "soft" and $nowiggle isnot true>>
		<<set _leftaction["Wriggle free"] to "leftwriggle">>
	<</if>>
<<case "orgasm">>
	<<set _leftaction["Fold"] to "leftfold">>
	<<set _leftaction["Grip"] to "leftgrip">>
<<case "pain">>
	<<set _leftaction["Struggle"] to "leftstruggleweak">>
	<<set _leftaction["Protect"] to "leftprotect">>
<<case "unreal">>
	<<set _leftaction["Poke yourself"] to "leftpoke">>
	<<set _leftaction["Keep your arms out of the way"] to "leftcurl">>
<</switch>>
<</widget>>

<<widget "rightActionInitSwarm">>
<<set $righttarget to "swarm">>
<<switch $rightarm>>
<<case 0>>
	<<if $orgasmdown gte 1>>
		<<set _rightOptions to "orgasm">>
		Your right arm is free, but you can't stop the spasms.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _rightOptions to "pain">>
		Your right arm is free, but hurts to move.
	<<elseif $dissociation gte 2>>
		<<set _rightOptions to "unreal">>
		Your right arm is free, but doesn't feel real.
	<<else>>
		<<if _targetYourself is true and _targetnumber gt 1>>
			<<set _targetlistarms["Yourself"] to "self">>
		<</if>>
		<<if $combatControls isnot "radio" and _targetnumber gt 1>>
			Target:
			<<listbox "$righttarget" autoselect>>
				<<optionsfrom _targetlistarms>>
			<</listbox>>

		<</if>>
		<<set _rightOptions to "free">>
		Your right arm is free.
		<<if $combatControls is "radio" and _targetnumber gt 1>>

			Target:
			<<listbox "$righttarget" autoselect>>
				<<optionsfrom _targetlistarms>>
			<</listbox>>

		<</if>>
	<</if>>
<<case "swarmgrappled">>
	<<set _rightOptions to "unable">>
	The $swarm["type"] are constricting your right arm!<<if $combatControls is "radio">>
<</if>>
<<case "bound">>
	<<if $orgasmdown gte 1>>
		<<set _rightOptions to "unable">>
		Your right arm jerks against its bonds.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _rightOptions to "unable">>
		Your right arm is held in a painful bind.
	<<elseif $dissociation gte 2>>
		<<set _rightOptions to "unable">>
		Your right arm lies limp in its bonds.
	<<else>>
		<<set _rightOptions to "bound">>
		Your right arm is bound and helpless.
	<</if>><<if $combatControls is "radio">>
<</if>>
<<case "trapped">>
	<<set $_changetype to true>><<rightActionInitVore>>
<<case "grappled" "penis" "othervagina" "vagina" "coverpenis" "anus" "behind">>
	<<set $_changetype to true>><<rightActionInit>>
<<case "struggle">>
	<<set $_changetype to true>><<rightActionInitStruggle>>
<<case "mechgrappled">>
	<<set $_changetype to true>><<rightActionInitMachine>>
<<default>>
	<<set $_changetype to true>><<rightActionInitTentacle>>
<</switch>>
<<if $_changetype isnot true>>
	<<rightActionsSwarm>>
	<<if Object.keys(_rightaction).length gt 0>>
		<<if !(Object.values(_rightaction).includes($rightactiondefault))>>
			<<set $rightactiondefault to "swarmrest">>
		<</if>>
		<<set $rightaction to $rightactiondefault>>
		<<set _textColor to combatListColor('rightaction', (Object.values(_rightaction).includes($rightaction) ? $rightaction : Object.values(_rightaction)[0]), "Swarm")>>

			<<generateCombatActionOthers _rightaction "rightaction" _textColor $rightaction "Swarm">>

		<<if $combatControls.includes("ists")>>

				<<rightactionDifficulty>>

		<</if>>
	<</if>>
	<<set $lastOptions.right to clone(_rightOptions)>>
<</if>>
<</widget>>

<<widget "rightactionDifficultySwarm">>/* No, it cannot be removed. */
<</widget>>

<<widget "rightActionsSwarm">>
<<set _rightaction to {}>>
<<switch _rightOptions>>
<<case "free">>
	<<if $leftarm is "swarmgrappled" and ($righttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _rightaction["Free your left arm"] to "rightfree">>
	<<elseif _swarmamounts.active[2] gte 1 and $righttarget isnot "self">>
		<<silently>><<swarmName>><</silently>>
		<<set _rightaction[_swarmsteady + " one of the " + _swarmname] to "rightswarm">>
	<</if>>
	<<if _swarmamounts.genital[0] lte 0 and _swarmamounts.genital[1] lte 0 and ($righttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<silently>><<genitals>><</silently>>
		<<set _rightaction["Cover your "+ _text_output] to "frontcoverright">>
	<</if>>
	<<if _swarmamounts.butt[0] lte 0 and _swarmamounts.butt[1] lte 0 and ($righttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _rightaction["Cover your butt"] to "backcoverright">>
	<</if>>
	<<if _swarmamounts.chest lte 0 and ($righttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _rightaction["Cover your chest"] to "chestcoverright">>
	<</if>>
	<<if $righttarget isnot "self">>
		<<if _swarmamounts.genital[1] gte 1 and !$worn.genitals.type.includes("chastity")>>
			<<silently>><<genitals>><</silently>>
			<<set _rightaction["Pull the "+ $swarm["type"] + " from your " + _text_output] to "frontpurgeright">>
		<</if>>
		<<if _swarmamounts.genital[0] gte 1 and !$worn.genitals.type.includes("chastity")>>
			<<silently>><<genitals>><</silently>>
			<<set _rightaction["Keep the "+ $swarm["type"] + " away from your " + _text_output] to "frontclearright">>
		<</if>>
		<<if _swarmamounts.butt[1] gte 1 and $worn.genitals.anal_shield isnot 1>>
			<<set _rightaction["Pull the "+ $swarm["type"] + " out of your anus"] to "backpurgeright">>
		<</if>>
		<<if _swarmamounts.butt[0] gte 1 and $worn.genitals.anal_shield isnot 1>>
			<<set _rightaction["Keep the "+ $swarm["type"] + " away from your butt"] to "backclearright">>
		<</if>>
		<<if _swarmamounts.chest gte 1>>
			<<set _rightaction["Clear the "+ $swarm["type"] + " off of your chest"] to "chestclearright">>
		<</if>>
	<</if>>
	<<if $water is 1 and $vorecreature is 0 and ($consensual isnot 1 or $gamemode is "soft") and ($righttarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _rightaction["Swim to safety"] to "swim">>
	<</if>>
	<<if $vorecreature is 0>>
		<<set _rightaction["Rest"] to "swarmrest">>
	<</if>>
<<case "bound">>
	<<if $gamemode is "soft" and $nowiggle isnot true>>
		<<set _rightaction["Wriggle free"] to "rightwriggle">>
	<</if>>
<<case "orgasm">>
	<<set _rightaction["Fold"] to "rightfold">>
	<<set _rightaction["Grip"] to "rightgrip">>
<<case "pain">>
	<<set _rightaction["Struggle"] to "rightstruggleweak">>
	<<set _rightaction["Protect"] to "rightprotect">>
<<case "unreal">>
	<<set _rightaction["Poke yourself"] to "rightpoke">>
	<<set _rightaction["Keep your arms out of the way"] to "rightcurl">>
<</switch>>
<</widget>>

<<widget "feetActionInitSwarm">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<set $feettarget to "swarm">>
	<<switch $feetuse>>
	<<case 0>>
		<<if _targetYourself is true and _targetnumber gt 1>>
			<<set _targetlistall["Yourself"] to "self">>
		<</if>>
		<<if $combatControls isnot "radio" and _targetnumber gt 1>>
			<<if ($leftleg is "grappled" and $rightleg is "grappled") or ($leftleg is "bound" and $rightleg is "bound")>>
			<<else>>
				Target:
				<<listbox "$feettarget" autoselect>>
					<<optionsfrom _targetlistall>>
				<</listbox>>

			<</if>>
		<</if>>
		<<if $leftleg is 0 and $rightleg is 0>>
			<<set _feetOptions to "free">>
			Your feet are free.
		<<elseif $leftleg is 0>>
			<<set _feetOptions to "leftfree">>
			Your left leg is free.
		<<elseif $rightleg is 0>>
			<<set _feetOptions to "rightfree">>
			Your right leg is free.
		<<elseif $leftleg is "grappled" and $rightleg is "grappled">>
			<<set $_changetype to true>><<feetActionInitTentacle>>
		<<elseif $leftleg is "bound" and $rightleg is "bound">>
			<<set $_changetype to true>><<feetActionInitTentacle>>
		<<else>>
			<<set _feetOptions to "free">>
			Your feet are free.
		<</if>>
		<<if $combatControls is "radio" and _targetnumber gt 1 and _feetOptions.toLowerCase().includes("free")>>

			Target:
			<<listbox "$feettarget" autoselect>>
				<<optionsfrom _targetlistall>>
			<</listbox>>

		<</if>>
		<<if _targetnumber is 1>>
			<<set $feettarget to _firsttarget>>
		<</if>>
	<<case "bound" "penis" "othervagina" "walk" "run" "none">>
		<<set $_changetype to true>><<feetActionInit>>
	<<case "mechgrappled">>
		<<set $_changetype to true>><<feetActionInitMachine>>
	<<default>>
		<<set $_changetype to true>><<feetActionInitTentacle>>
	<</switch>>
	<<if $lastOptions.feet isnot _feetOptions>>
		<<set _feetGold to true>>
	<</if>>
	<<if $_changetype isnot true>>
		<<feetActionsSwarm>>
		<<if Object.keys(_feetaction).length gt 0>>
			<<if !(Object.values(_feetaction).includes($feetactiondefault))>>
				<<set $feetactiondefault to "swarmrest">>
			<</if>>
			<<set $feetaction to $feetactiondefault>>
			<<set _textColor to combatListColor('feetaction', (Object.values(_feetaction).includes($feetaction) ? $feetaction : Object.values(_feetaction)[0]), "Swarm")>>

				<<generateCombatActionOthers _feetaction "feetaction" _textColor $feetaction "Swarm">>

			<<if $combatControls.includes("ists")>>

					<<feetactionDifficulty>>

			<</if>>
		<</if>>
		<<set $lastOptions.feet to clone(_feetOptions)>>
	<</if>>
<<else>>
	<<timed 100ms>>
		<<run jQuery("#feetaction").remove();>>
	<</timed>>
<</if>>
<</widget>>

<<widget "feetactionDifficultySwarm">>/* If removed, expect errors in combats with controls set to "lists". */
<</widget>>

<<widget "feetActionsSwarm">>
<<set _feetaction to {}>>
<<if $swarm.amount.active[2] gte 1 and $feettarget isnot "self">>
	<<silently>><<swarmName>><</silently>>
	<<set _feetaction[_swarmsteady + " one of the " + _swarmname] to "feetswarm">>
<</if>>
<<if _feetOptions is "free">>
	<<if $water is 1 and $vorecreature is 0 and $swimmingskill gt 700 and $consensual isnot 1 and ($feettarget is "self" or $targetYourself is false or _targetnumber is 1)>>
		<<set _feetaction["Swim to safety"] to "swim">>
	<</if>>
<</if>>
<<if $vorecreature is 0>>
	<<set _feetaction["Rest"] to "swarmrest">>
<</if>>
<</widget>>

:: Widgets Swarm Actions [widget]
<<widget "swarmactions">>

	<<set $chest to 0>>
	<<set $front to 0>>
	<<set $back to 0>>
	<<if $vorecreature is 0>>
		<<if $images is 1>>
			<<if $swarm.amount.active>>
				<<set _swarmactive to $swarm.amount.active[0]>>
			<<else>>
				<<set _swarmactive to 0>>
			<</if>>
			<<timed 100ms>>
				<<combatimg>>

			<</timed>>
		<</if>>
	<</if>>
	<<willpowerpain>>
	<<willpowerorgasm>>
	<<actioncarry>>
	<<actioncarrydrop>>

	<<combatstate>>
	<<carryblock>>

	<<if $trance lte 0 and $panicparalysis is 0 and $panicviolence is 0 and $combatControls isnot "disabled">>
		<<set _swarmsteady to $swarm["steady"].toUpperFirst()>>
		<<set _swarmamounts to $swarm.amount>>
		<<generateActionsSwarm>>
	<</if>>
	<<if $trance lte 0 and $dissociation lte 1 and $panicparalysis is 0 and $panicviolence is 0 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined) and $combatControls is "disabled">>
		<<set _swarmsteady to $swarm["steady"].toUpperFirst()>>
		<<set _swarmamounts to $swarm.amount>>

		<<if $leftarm is "bound">>
			Your left arm is bound and helpless.
			<<if $gamemode is "soft" and $nowiggle isnot true>>

				Wriggle free<<radiobutton "$leftaction" "leftwriggle" checked>> |
			<</if>>

		<<elseif $leftarm is "swarmgrappled">>
			The $swarm["type"] are constricting your left arm!

		<<elseif $leftarm is 0>>
			Your left arm is free.

			<<if $rightarm is "swarmgrappled">>
				Free your right arm <<radiobutton "$leftaction" "leftfree">> |
			<<elseif _swarmamounts.active[2] gte 1>>
				_swarmsteady one of the <<swarmName>> <<radiobutton "$leftaction" "leftswarm">> |
			<</if>>

			<<if _swarmamounts.genital[0] lte 0 and _swarmamounts.genital[1] lte 0>>
				Cover your <<genitals>> <<radiobutton "$leftaction" "frontcoverleft">> |
			<</if>>

			<<if _swarmamounts.butt[0] lte 0 and _swarmamounts.butt[1] lte 0>>
				Cover your butt <<radiobutton "$leftaction" "backcoverleft" checked>> |
			<</if>>

			<<if _swarmamounts.chest lte 0>>
				Cover your chest <<radiobutton "$leftaction" "chestcoverleft">> |
			<</if>>

			<<if _swarmamounts.genital[1] gte 1 and !$worn.genitals.type.includes("chastity")>>
				Pull the $swarm["type"] from your <<genitals>> <<radiobutton "$leftaction" "frontpurgeleft">> |
			<</if>>

			<<if _swarmamounts.genital[0] gte 1 and !$worn.genitals.type.includes("chastity")>>
				Keep the $swarm["type"] away from your <<genitals>> <<radiobutton "$leftaction" "frontclearleft">> |
			<</if>>

			<<if _swarmamounts.butt[1] gte 1 and $worn.genitals.anal_shield isnot 1>>
				Pull the $swarm["type"] out of your anus <<radiobutton "$leftaction" "backpurgeleft" checked>> |
			<</if>>

			<<if _swarmamounts.butt[0] gte 1 and $worn.genitals.anal_shield isnot 1>>
				Keep the $swarm["type"] away from your butt <<radiobutton "$leftaction" "backclearleft" checked>> |
			<</if>>

			<<if _swarmamounts.chest gte 1>>
				Clear the $swarm["type"] off of your chest <<radiobutton "$leftaction" "chestclearleft">> |
			<</if>>

			<<if $water is 1 and $vorecreature is 0 and ($consensual isnot 1 or $gamemode is "soft")>>
				Swim to safety <<radiobutton "$leftaction" "swim" checked>> |
			<</if>>

			<<if $vorecreature is 0>>
				Rest <<radiobutton "$leftaction" "swarmrest">> |
			<</if>>

		<</if>>

		<<if $rightarm is "bound">>
			Your right arm is bound and helpless.
			<<if $gamemode is "soft" and $nowiggle isnot true>>

				Wriggle free<<radiobutton "$rightaction" "rightwriggle" checked>> |
			<</if>>

		<<elseif $rightarm is "swarmgrappled">>
			The $swarm["type"] are constricting your right arm!

		<<elseif $rightarm is 0>>
			Your right arm is free.

			<<if $leftarm is "swarmgrappled">>
				Free your left arm <<radiobutton "$rightaction" "rightfree">> |
			<<elseif _swarmamounts.active[2] gte 1>>
				_swarmsteady one of the <<swarmName>> <<radiobutton "$rightaction" "rightswarm">> |
			<</if>>

			<<if _swarmamounts.genital[0] lte 0 and _swarmamounts.genital[1] lte 0>>
				Cover your <<genitals>> <<radiobutton "$rightaction" "frontcoverright" checked>> |
			<</if>>

			<<if _swarmamounts.butt[0] lte 0 and _swarmamounts.butt[1] lte 0>>
				Cover your butt <<radiobutton "$rightaction" "backcoverright">> |
			<</if>>

			<<if _swarmamounts.chest lte 0>>
				Cover your chest <<radiobutton "$rightaction" "chestcoverright">> |
			<</if>>

			<<if _swarmamounts.genital[1] gte 1 and !$worn.genitals.type.includes("hidden")>>
				Pull the $swarm["type"] from your <<genitals>> <<radiobutton "$rightaction" "frontpurgeright" checked>> |
			<</if>>

			<<if _swarmamounts.genital[0] gte 1 and !$worn.genitals.type.includes("hidden")>>
				Keep the $swarm["type"] away from your <<genitals>> <<radiobutton "$rightaction" "frontclearright" checked>> |
			<</if>>

			<<if _swarmamounts.butt[1] gte 1 and $worn.genitals.anal_shield isnot 1>>
				Pull the $swarm["type"] out of your anus <<radiobutton "$rightaction" "backpurgeright">> |
			<</if>>

			<<if _swarmamounts.butt[0] gte 1 and $worn.genitals.anal_shield isnot 1>>
				Keep the $swarm["type"] away from your butt <<radiobutton "$rightaction" "backclearright">> |
			<</if>>

			<<if _swarmamounts.chest gte 1>>
				Clear the $swarm["type"] off of your chest <<radiobutton "$rightaction" "chestclearright">> |
			<</if>>

			<<if $water is 1 and $vorecreature is 0 and ($consensual isnot 1 or $gamemode is "soft")>>
				Swim to safety <<radiobutton "$rightaction" "swim" checked>> |
			<</if>>

			<<if $vorecreature is 0>>
				Rest <<radiobutton "$rightaction" "swarmrest">> |
			<</if>>

		<</if>>

		<<if $feetuse is 0>>
			Your feet are free.

			<<if $swarm.amount.active[2] gte 1>>
				_swarmsteady one of the <<swarmName>> <<radiobutton "$feetaction" "feetswarm" checked>> |
			<</if>>

			<<if $water is 1 and $vorecreature is 0 and $swimmingskill gt 700 and $consensual isnot 1>>
				Swim to safety <<radiobutton "$feetaction" "swim" checked>> |
			<</if>>

			<<if $vorecreature is 0>>
				Rest <<radiobutton "$feetaction" "swarmrest">> |
			<</if>>

		<</if>>

	<</if>>

<</widget>>

:: Widgets Swarm Effects [widget]
<<widget "swarmeffects">>
	<<effectspain>>
	<<effectsorgasm>>
	<<effectsdissociation>>

	<<set _swarmamounts to $swarm.amount>>

	/* -------- Left Arm -------- */
	<<set $leftactiondefault to $leftaction>>
	<<if $leftaction is "leftwriggle">><<set $leftaction to 0>>
		<<if $leftarm is "bound">>
			<<unbind>>You wriggle free from your bonds.
		<</if>>
	<</if>>

	<<if $leftaction is "leftfree">><<set $leftaction to 0>><<set $rightarm to 0>>
		You push away the $swarm["type"] covering your right arm, freeing it.
	<</if>>

	<<if $leftaction is "leftswarm">><<set $leftaction to 0>>
		<<set _swarmamounts.active[2] -= 1>><<set _swarmamounts.active[3] += 1>>
		You $swarm["steady"] one of the <<swarmName>> with your left hand.
	<</if>>

	<<if $leftaction is "frontcoverleft">><<set $leftaction to 0>>
		<<set $front to "covered">>
		You cover your <<genitals>> with your left hand to prevent the $swarm["type"] from violating you.
	<</if>>

	<<if $leftaction is "backcoverleft">><<set $leftaction to 0>>
		<<set $back to "covered">>
		You cover your butt with your left hand. Hopefully it will keep the $swarm["type"] from invading your rear.
	<</if>>

	<<if $leftaction is "chestcoverleft">><<set $leftaction to 0>>
		<<set $chest to "covered">>
		You cover your chest with your left hand, keeping the $swarm["type"] away from your sensitive bust.
	<</if>>

	<<if $leftaction is "frontpurgeleft">><<set $leftaction to 0>>
		<<set _swarmamounts.genital[1] -= 1>><<set _swarmamounts.active[4] += 1>>
		You remove some of the $swarm["type"] that are <<print ($player.vaginaExist ? "penetrating" : "wrapped around")>> your <<if $player.vaginaExist and $player.penisExist>><<pussy>><<else>><<genitals>><</if>>.
		<<if _swarmamounts.genital[1] gte 1>>However, there are still some violating you.<<else>>You think you got them all, for now.<</if>>
	<</if>>

	<<if $leftaction is "frontclearleft">><<set $leftaction to 0>>
		<<set _swarmamounts.genital[0] -= 1>><<set _swarmamounts.active[4] += 1>>
		You prevent the encroaching $swarm["type"] from <<print ($player.vaginaExist ? "entering" : "enveloping")>> your <<if $player.vaginaExist and $player.penisExist>><<pussy>><<else>><<genitals>><</if>>.
		<<if _swarmamounts.genital[0] gte 1>>There are so many however, that some make it through your guard.<</if>>
	<</if>>

	<<if $leftaction is "backpurgeleft">><<set $leftaction to 0>>
		<<set _swarmamounts.butt[1] -= 1>><<set _swarmamounts.active[4] += 1>>
		You extract some of the $swarm["type"] from your anus.
		<<if _swarmamounts.butt[1] gte 1>>However, there are still some infesting you.<<else>>You think you got them all.<</if>>
	<</if>>

	<<if $leftaction is "backclearleft">><<set $leftaction to 0>>
		<<set _swarmamounts.butt[0] -= 1>><<set _swarmamounts.active[4] += 1>>
		You prevent the encroaching $swarm["type"] from burrowing into your anus.
		<<if _swarmamounts.butt[0] gte 1>>There are so many however, that some make it through your guard.<</if>>
	<</if>>

	<<if $leftaction is "chestclearleft">><<set $leftaction to 0>>
		<<set _swarmamounts.chest -= 1>><<set _swarmamounts.active[4] += 1>>
		You clear away some of the $swarm["type"] around your sensitive nipples.
		<<if _swarmamounts.chest gte 1>>Many more remain however.<</if>>
	<</if>>

	<<if $leftaction is "swim">><<set $leftaction to 0>>
		<<set $swimdistance -= 1>>
		You paddle towards safety with your left arm.
	<</if>>

	<<if $leftaction is "swarmrest">><<set $leftaction to 0>>
		You rest your left arm.
	<</if>>

	/* -------- Right Arm -------- */
	<<set $rightactiondefault to $rightaction>>
	<<if $rightaction is "rightwriggle">><<set $rightaction to 0>>
		<<if $rightarm is "bound">>
			<<unbind>>You wriggle free from your bonds.
		<</if>>
	<</if>>

	<<if $rightaction is "rightfree">><<set $rightaction to 0>><<set $leftarm to 0>>
		You push away the $swarm["type"] covering your left arm, freeing it.
	<</if>>

	<<if $rightaction is "rightswarm">><<set $rightaction to 0>>
		<<set _swarmamounts.active[2] -= 1>><<set _swarmamounts.active[3] += 1>>
		You $swarm["steady"] one of the <<swarmName>> with your right hand.
	<</if>>

	<<if $rightaction is "frontcoverright">><<set $rightaction to 0>>
		<<set $front to "covered">>
		You cover your <<genitals>> with your right hand to prevent the $swarm["type"] from violating you.
	<</if>>

	<<if $rightaction is "backcoverright">><<set $rightaction to 0>>
		<<set $back to "covered">>
		You cover your butt with your right hand. Hopefully it will keep the $swarm["type"] from invading your rear.
	<</if>>

	<<if $rightaction is "chestcoverright">><<set $rightaction to 0>>
		<<set $chest to "covered">>
		You cover your chest with your right hand, keeping the $swarm["type"] away from your sensitive bust.
	<</if>>

	<<if $rightaction is "frontpurgeright">><<set $rightaction to 0>>
		<<set _swarmamounts.genital[1] -= 1>><<set _swarmamounts.active[4] += 1>>
		You remove some of the $swarm["type"] that are <<print ($player.vaginaExist ? "penetrating" : "wrapped around")>> your <<if $player.vaginaExist and $player.penisExist>><<pussy>><<else>><<genitals>><</if>>.
		<<if _swarmamounts.genital[1] gte 1>>However, there are still some violating you.<<else>>You think you got them all, for now.<</if>>
	<</if>>

	<<if $rightaction is "frontclearright">><<set $rightaction to 0>>
		<<set _swarmamounts.genital[0] -= 1>><<set _swarmamounts.active[4] += 1>>
		You prevent the encroaching $swarm["type"] from <<print ($player.vaginaExist ? "entering" : "enveloping")>> your <<if $player.vaginaExist and $player.penisExist>><<pussy>><<else>><<genitals>><</if>>.
		<<if _swarmamounts.genital[0] gte 1>>There are so many however, that some make it through your guard.<</if>>
	<</if>>

	<<if $rightaction is "backpurgeright">><<set $rightaction to 0>>
		<<set _swarmamounts.butt[1] -= 1>><<set _swarmamounts.active[4] += 1>>
		You extract some of the $swarm["type"] from your anus.
		<<if _swarmamounts.butt[1] gte 1>>However, there are still some infesting you.<<else>>You think you got them all.<</if>>
	<</if>>

	<<if $rightaction is "backclearright">><<set $rightaction to 0>>
		<<set _swarmamounts.butt[0] -= 1>><<set _swarmamounts.active[4] += 1>>
		You prevent the encroaching $swarm["type"] from burrowing into your anus.
		<<if _swarmamounts.butt[0] gte 1>>There are so many however, that some make it through your guard.<</if>>
	<</if>>

	<<if $rightaction is "chestclearright">><<set $rightaction to 0>>
		<<set _swarmamounts.chest -= 1>><<set _swarmamounts.active[4] += 1>>
		You clear away some of the $swarm["type"] around your sensitive nipples.
		<<if _swarmamounts.chest gte 1>>Many more remain however.<</if>>
	<</if>>

	<<if $rightaction is "swim">><<set $rightaction to 0>>
		<<set $swimdistance -= 1>>
		You paddle towards safety with your right arm.
	<</if>>

	<<if $rightaction is "swarmrest">><<set $rightaction to 0>>
		You rest your right arm.
	<</if>>

	/* -------- Legs -------- */
	<<set $feetactiondefault to $feetaction>>
	<<if $feetaction is "feetswarm">><<set $feetaction to 0>><<set $feetactiondefault to "feetswarm">>
		<<set $swarm.amount.active[2] -= 1>><<set $swarm.amount.active[3] += 1>>
		You $swarm["steady"] one of the <<swarmName>> with your feet.
	<</if>>

	<<if $feetaction is "swim">><<set $feetaction to 0>><<set $feetactiondefault to "swim">><<set $swimdistance -= 1>>
		You paddle towards safety with your legs.
	<</if>>

	<<if $feetaction is "swarmrest">><<set $feetaction to 0>>
		You rest your legs.
	<</if>>

<</widget>>

repo_name: Area/degrees

license: mit


code:
:: Widgets Swarm [widget]
<<widget "swarminit">>

	/* Example call	<<swarminit "fish" "container" "shaking" "shatter" "steady" 4 6>> */
	/* <<swarminit type name move spill steady amountactive amountstored>> */

	/*
		Define Data to make each swarmer type unique
		Milk: Sets of the swarm type is attracted to PC's chest when lactating
	*/
	<<set _swarmdats to {
		"fish":{"milk":1},
		"eels":{"milk":1},
		"snakes":{"milk":1},
		"spiders":{"milk":0},
		"slimes":{"milk":1},
		"pale slimes":{"milk":1},
		"maggots":{"milk":0},
		"worms":{"milk":0}
	}>>

	/* This contains the persistent data we will use for the encounter. */
	<<set $swarm to {
		"data": _swarmdats[$args[0]],
		"type":$args[0],
		"name":$args[1],
		"move":$args[2],
		"spill":$args[3],
		"steady":$args[4],
		"amount":{
			"active":[$args[5],$args[6],0,0,$args[5]],
			"chest":0,
			"genital":[0,0],
			"butt":[0,0]
		}
	}>>

<</widget>>

<<widget "swarm">>

<<set $position to "doggy">>
<<set _swarmnote to {
	"activate":0,

	"chestintro":0,
	"chestcovered":0,
	"chestintroclothed":0,
	"chestclothed":0,
	"chestmolest":0,
	"chestmilk":0,

	"buttintro":0,
	"buttcovered":0,
	"buttlowerclothed":0,
	"buttlowerintroclothed":0,
	"buttunderclothed":0,
	"buttunderintroclothed":0,
	"buttmolest":0,
	"buttchasity":0,
	"buttinsideintro":0,

	"genitalintro":0,
	"genitalcovered":0,
	"genitallowerclothed":0,
	"genitallowerintroclothed":0,
	"genitalunderclothed":0,
	"genitalunderintroclothed":0,
	"genitalmolest":0,
	"genitalchasity":0,
	"genitalinsideintro":0,
}>>

<<set _swarmamounts to $swarm.amount>>
<<set _swarmcreature to $swarm.type>>

<<set _swarmactive to _swarmamounts.active[0]>>

/* Swarm Targeting priorities */
<<set _swarmchance to {"chest":30,"butt":30,"genital":30}>>
<<if $analdisable is not "f">>
	<<set _swarmchance["butt"] to 0>><<set _swarmchance["chest"] += 10>><<set _swarmchance["genital"] += 20>>
<</if>>

/* Chest related activities */
<<if _swarmamounts.chest gt 0>>
	/* Swarms didn't do much after going to the chest before */

	<<if $lactating gte 1 and $breastfeedingdisable is "f">>
		<<if $milk_amount gte 1>>/*Milky, Maybe milk attracts swarmers to the breasts*/
			<<set _swarmnote.chestmilk to 1>>
			<<breastfeed>>
			<<if $swarm.data["milk"] gt 0 >>
				<<set _swarmchance["chest"] += 15>>/*Increase chest roll ratio since the swarm is attracted to milk*/
			<</if>>
		<</if>>
	<</if>>

<</if>>

/* Butt related activities */
<<if _swarmamounts.butt[1] gt 0>> /* Inside Activities */ <</if>>
<<if _swarmamounts.butt[0] gt 0>>
	<<set _swarmnote.buttinsideintro += _swarmamounts.butt[0]>>
	<<set _swarmamounts.butt[1] += _swarmamounts.butt[0]>><<set _swarmamounts.butt[0] to 0>>
<</if>>

/* Genital related activities */
<<if _swarmamounts.genital[1] gt 0>> /* Inside Activities */ <</if>>
<<if _swarmamounts.genital[0] gt 0>>
	<<set _swarmnote.genitalinsideintro += _swarmamounts.genital[0]>>
	<<set _swarmamounts.genital[1] += _swarmamounts.genital[0]>><<set _swarmamounts.genital[0] to 0>>
<</if>>

/* Handle the active swarm and give them targets to go after */
<<for _i to 0; _i lt _swarmamounts.active[4]; _i++>>
	<<set $rng to random(1, 100)>>
	<<if $rng lte _swarmactive * 20>>
		<<set $rng to random(1, _swarmchance["chest"]+_swarmchance["butt"]+_swarmchance["genital"])>>
		<<if $rng lte _swarmchance["chest"]>>
			<<if $chest is "covered">>
				<<set _swarmnote.chestcovered += 1>>
				<<arousal 10>>
			<<else>>
				<<set $rng to random(1, 100)>>
				<<if $rng lte _swarmactive * 20>>
					<<if $worn.upper.type.includes("naked") and $worn.over_upper.type.includes("naked")>>
						<<set _swarmamounts.chest += 1>><<set _swarmamounts.active[4] -= 1>>
						<<set _swarmnote.chestintro += 1>>
						<<neutral 3>>
					<<else>>
						<<set $rng to random(1, 100)>>
						<<if $rng gte 81>> /* Maybe smaller swarmers are more likely to get under cloths */
							<<set _swarmamounts.chest += 1>><<set _swarmamounts.active[4] -= 1>>
							<<set _swarmnote.chestintroclothed += 1>>
							<<neutral 3>>
						<<else>>
							<<set _swarmnote.chestclothed += 1>>
							<<if !$worn.over_upper.type.includes("naked")>>
								<<set $worn.over_upper.integrity -= 2>>
							<</if>>
							<<if !$worn.upper.type.includes("naked")>>
								<<set $worn.upper.integrity -= 2>>
							<</if>>
							<<neutral 1>>
						<</if>>
					<</if>>
				<<else>>
					<<set _swarmnote.chestmolest += 1>>
					<<if !$worn.over_upper.type.includes("naked")>>
						<<set $worn.over_upper.integrity -= 2>>
					<</if>>
					<<if !$worn.upper.type.includes("naked")>>
						<<set $worn.upper.integrity -= 2>>
					<</if>>
					<<neutral 1>>
				<</if>>
			<</if>>
		<<elseif $rng gt _swarmchance["chest"] and $rng lte _swarmchance["chest"]+_swarmchance["butt"]>> /* Butt */
			<<if $back is "covered">>
				<<set _swarmnote.buttcovered += 1>>
				<<arousal 10>>
			<<else>>
				<<set $rng to random(1, 100)>>
				<<if $rng lte _swarmactive * 20>>
					<<set $rng to random(1, 100)>>
					<<if $rng gte 81>> /*Chance swarm bypass clothing*/
							<<neutral 4>>
							<<set _swarmamounts.butt[0] += 1>><<set _swarmamounts.active[4] -= 1>>
							<<if $worn.under_lower.type.includes("naked") and !($worn.genitals.type.includes("hidden") and $worn.genitals.anal_shield is 1)>>
								<<if (!$worn.over_lower.type.includes("naked") and setup.clothes.over_lower[clothesIndex('over_lower', $worn.over_lower)].skirt is 0) or (!$worn.lower.type.includes("naked") and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 0)>>
									<<set _swarmnote.buttlowerintroclothed += 1>>
								<<else>>
									<<set _swarmnote.buttintro += 1>>
								<</if>>
							<<elseif $worn.genitals.type.includes("hidden") and $worn.genitals.anal_shield is 1>>
								<<set _swarmnote.buttchasity += 1>>
							<<else>>
								<<set _swarmnote.buttunderintroclothed += 1>>
							<</if>>
					<<else>>
						<<if (!$worn.over_lower.type.includes("naked") and setup.clothes.over_lower[clothesIndex('over_lower', $worn.over_lower)].skirt is 0) or (!$worn.lower.type.includes("naked") and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 0)>>
							<<set _swarmnote.buttlowerclothed += 1>>
							<<if !$worn.over_lower.type.includes("naked")>>
								<<set $worn.over_lower.integrity -= 2>>
							<</if>>
							<<if !$worn.lower.type.includes("naked")>>
								<<set $worn.lower.integrity -= 2>>
							<</if>>
							<<neutral 1>>
						<<elseif !$worn.under_lower.type.includes("naked")>>
							<<set _swarmnote.buttunderclothed+= 1>>
							<<set $worn.under_lower.integrity -= 2>>
							<<neutral 1>>
						<<elseif $worn.genitals.type.includes("hidden") and $worn.genitals.anal_shield is 1>>
							<<set _swarmamounts.butt[0] += 1>><<set _swarmamounts.active[4] -= 1>>
							<<set _swarmnote.buttchasity += 1>>
							<<neutral 4>>
						<<else>>
							<<set _swarmamounts.butt[0] += 1>><<set _swarmamounts.active[4] -= 1>>
							<<set _swarmnote.buttintro += 1>>
							<<neutral 4>>
						<</if>>
					<</if>>
				<<else>>
					<<set _swarmnote.buttmolest += 1>>
					<<set $worn.lower.integrity -= 2>>
					<<if $worn.lower.type.includes("naked")>>
						<<set $worn.under_lower.integrity -= 2>>
					<</if>>
					<<neutral 1>>
				<</if>>
			<</if>>
		<<elseif $rng gt _swarmchance["chest"]+_swarmchance["butt"]>> /* Genitals */
			<<if $front is "covered">>
				<<set _swarmnote.genitalcovered += 1>>
				<<arousal 10>>
			<<else>>
				<<set $rng to random(1, 100)>>
				<<if $rng lte _swarmactive * 20>>
					<<set $rng to random(1, 100)>>
					<<if $rng gte 81>>
						<<set _swarmamounts.genital[0] += 1>><<set _swarmamounts.active[4] -= 1>>
						<<neutral 4>>
						<<if $worn.under_lower.type.includes("naked") and !$worn.genitals.type.includes("hidden")>>
							<<if (!$worn.over_lower.type.includes("naked") and setup.clothes.over_lower[clothesIndex('over_lower', $worn.over_lower)].skirt is 0) or (!$worn.lower.type.includes("naked") and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 0)>>
								<<set _swarmnote.genitallowerintroclothed += 1>>
							<<else>>
								<<set _swarmnote.genitalintro += 1>>
							<</if>>
						<<elseif $worn.genitals.type.includes("hidden")>>
							<<set _swarmnote.genitalchasity += 1>>
						<<else>>
							<<set _swarmnote.genitalunderintroclothed += 1>>
						<</if>>
					<<else>>
						<<if (!$worn.over_lower.type.includes("naked") and setup.clothes.over_lower[clothesIndex('over_lower', $worn.over_lower)].skirt is 0) or (!$worn.lower.type.includes("naked") and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 0)>>
							<<set _swarmnote.genitallowerclothed+= 1>>
							<<if !$worn.over_lower.type.includes("naked")>>
								<<set $worn.over_lower.integrity -= 2>>
							<</if>>
							<<if !$worn.lower.type.includes("naked")>>
								<<set $worn.lower.integrity -= 2>>
							<</if>>
							<<neutral 1>>
						<<elseif !$worn.under_lower.type.includes("naked")>>
							<<set _swarmnote.genitalunderclothed += 1>>
							<<set $worn.under_lower.integrity -= 2>>
							<<neutral 1>>
						<<elseif $worn.genitals.type.includes("hidden")>>
							<<set _swarmamounts.genital[0] += 1>><<set _swarmamounts.active[4] -= 1>>
							<<set _swarmnote.genitalchasity += 1>>
							<<neutral 4>>
						<<else>>
							<<set _swarmamounts.genital[0] += 1>><<set _swarmamounts.active[4] -= 1>>
							<<set _swarmnote.genitalintro += 1>>
							<<neutral 4>>
						<</if>>
					<</if>>
				<<else>>
					<<set _swarmnote.genitalmolest += 1>>
					<<set $worn.lower.integrity -= 2>>
					<<if $worn.lower.type.includes("naked")>>
						<<set $worn.under_lower.integrity -= 2>>
					<</if>>
					<<neutral 1>>
				<</if>>
			<</if>>
		<</if>>
	<<else>>
	<<arousal 10>>
	<</if>>
<</for>>

/* pending -> active */
<<if _swarmamounts.active[2] gt 0>>
	<<set _swarmamounts.active[0] += _swarmamounts.active[2]>>
	<<set _swarmamounts.active[4] += _swarmamounts.active[2]>>
	<<set _swarmamounts.active[2] to 0>>
	<<set _swarmnote.activate to 1>>
<</if>>

/* 0:active, 1:contained, 2:pending, 3:steadied 4:idle*/
<<if _swarmamounts.active[1] gt 0>>/* contained -> pending */
	<<for _i to 0; _i lt _swarmamounts.active[1]; _i++>>
		<<set $rng to random(1, 100)>>
		<<if $rng gte 51>> /* Maybe this number can be augmented by something? */
			<<set _swarmamounts.active[1] -= 1>>
			<<set _swarmamounts.active[2] += 1>>
		<</if>>
	<</for>>
<</if>>

/* steadied -> contained */
<<set _swarmamounts.active[1] += _swarmamounts.active[3]>>
<<set _swarmamounts.active[3] to 0>>

/* --------- Text Notifications ---------*/

<<if _swarmnote.activate gte 1>>
	<<set _swarmnote.activate to 0>>
	The <<swarmName>> $swarm.spill, surrounding you with more $swarm.type.
<</if>>

<<if _swarmamounts.active[2] gte 1>>
	<<set $_remainingSwarms to _swarmamounts.active[1] + _swarmamounts.active[2]>>
	There <<if $_remainingSwarms gt 1>>are<<else>>is<</if>> <<number $_remainingSwarms>> <<swarmName $_remainingSwarms>> and <<if _swarmamounts.active[1] + _swarmamounts.active[2] is 1>>it<<else>><<number _swarmamounts.active[2]>> of them<</if>> <<if _swarmamounts.active[2] gte 2>>are<<else>>is<</if>> $swarm.move.
<</if>>

<<if _swarmactive lte 0>>
<<elseif _swarmactive lte 1>>
	The _swarmcreature are squirming over you.
<<elseif _swarmactive lte 2>>
	The _swarmcreature are swarming over you.
<<elseif _swarmactive lte 3>>
	The _swarmcreature teem around you.
<<elseif _swarmactive lte 4>>
	You're practically swimming in _swarmcreature.
<<elseif _swarmactive lte 9>>
	The _swarmcreature completely surround you.
<<elseif _swarmactive gte 10>>
	The _swarmcreature completely surround you, as if you are in a living pit.<<if $orgasmdown gte 1>> Not an inch of skin is spared the torment.<</if>>
<</if>>

<<set $rng to random(1, 100)>>
<<if $rng gte 91 and $leftarm is 0 and $rightarm is 0>>
	<<if $rng gte 96>>
		<<set $leftarm to "swarmgrappled">><<set $lefttarget to "swarm">>
		The $swarm["type"] swarm over your left arm, restraining it.
	<<else>>
		<<set $rightarm to "swarmgrappled">><<set $righttarget to "swarm">>
		The $swarm["type"] swarm over your right arm, restraining it.
	<</if>>
<</if>>

/* -------- Chest -------- */

<<if _swarmnote.chestcovered gte 1>>
	<<set _swarmnote.chestcovered to 0>>
	You manage to keep them away from your chest.
<</if>>

<<if _swarmnote.chestmolest gte 1>>
	<<set _swarmnote.chestmolest to 0>>
	They writhe over your <<print either("chest", "stomach", "back", "neck", "arms")>>.
<</if>>

<<if _swarmnote.chestclothed gte 1>>
	<<set _swarmnote.chestclothed to 0>>
	Some of them assault and damage your
	<<if !$worn.over_upper.type.includes("naked")>>
		$worn.upper.name<<if !$worn.upper.type.includes("naked")>> and<<else>>,<</if>>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
		$worn.upper.name,
	<</if>>
	trying to get to the skin beneath.
<</if>>

<<if _swarmnote.chestintro gte 1>>
	<<set _swarmnote.chestintro to 0>>
	<<if _swarmamounts.chest gte 1>>
		More $swarm["type"] gather around your <<breasts>>.
	<<else>>
		A number of them take a liking to your <<breasts>>.
	<</if>>
<</if>>

<<if _swarmnote.chestintroclothed gte 1>>
	<<set _swarmnote.chestintroclothed to 0>>
	Some of them wriggle their way into your
	<<if !$worn.over_upper.type.includes("naked")>>
		$worn.upper.name<<if !$worn.upper.type.includes("naked")>> and<<else>>,<</if>>
	<</if>>
	<<if !$worn.upper.type.includes("naked")>>
		$worn.upper.name,
	<</if>>
	where they take a liking to your <<breasts>>.
<</if>>

<<if _swarmamounts.chest gte 1>>
	<<playWithBreasts _swarmamounts.chest>>
	<<arousal `_swarmamounts.chest * 20`>>
	<<neutral 5>>
	<<if _swarmnote.chestmilk gte 1>>
		<<set _swarmnote.chestmilk to 0>>
		They twist and tease your <<nipples>>, causing milk to leak out of the tips.
		/*Maybe put a notification here, about swarmers that are attracted to milk?*/
	<<else>>
		They twist and tease your <<nipples>>, keeping them firm.
	<</if>>
<</if>>

/* -------- Butts --------*/

<<if _swarmnote.buttcovered gte 1>>
	<<set _swarmnote.buttcovered to 0>>
	You manage to keep them away from your butt.
<</if>>

<<if _swarmnote.buttmolest gte 1>>
	<<set _swarmnote.buttmolest to 0>>
	They writhe over your <<print either("butt", "thighs", "legs")>>.
<</if>>

<<if _swarmnote.buttlowerclothed gte 1>>
	<<set _swarmnote.buttlowerclothed to 0>>
	<<if $worn.over_lower.name is "naked" and $worn.lower.name is "naked">>
		Some tear apart the ruined scraps of your clothing.
	<<else>>
		Some of them burrow into your
		<<if !$worn.over_lower.type.includes("naked")>>
			$worn.over_lower.name<<if !$worn.lower.type.includes("naked")>> and<<else>>,<</if>>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			$worn.lower.name,
		<</if>>
		damaging the fabric.
	<</if>>
<</if>>

<<if _swarmnote.buttunderclothed gte 1>>
	<<set _swarmnote.buttunderclothed to 0>>
	Some of them assail your $worn.under_lower.name, tearing the fabric.
<</if>>

<<if _swarmnote.buttlowerintroclothed gte 1>>
	<<set _swarmnote.buttlowerintroclothed to 0>>
	Some of them wriggle their way into your
	<<if !$worn.over_lower.type.includes("naked")>>
		$worn.over_lower.name<<if !$worn.lower.type.includes("naked")>> and<<else>>,<</if>>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
		$worn.lower.name,
	<</if>>
	you feel them moving toward your anus.
<</if>>

<<if _swarmnote.buttunderintroclothed gte 1>>
	<<set _swarmnote.buttunderintroclothed to 0>>
	Some of them wriggle their way into your $worn.under_lower.name, you feel them moving toward your anus.
<</if>>

<<if _swarmnote.buttchasity gte 1>>
	<<set _swarmnote.buttchasity to 0>>
	Some of them wriggle their way into your $worn.genitals.name, you feel them moving toward your <<genitals>>. With your $worn.genitals.name anal shield in the way, you won't be able to get them out!
	<<if $parasitedisable is "f">>
		<<set $analchastityparasite to $swarm["type"]>>
	<</if>>
<</if>>

<<if _swarmnote.buttintro gte 1>>
	<<set _swarmnote.buttintro to 0>>
	They swarm around your butt, you feel them move toward your anus.
<</if>>

<<if _swarmnote.buttinsideintro gte 1>>
	<<set _swarmnote.buttinsideintro to 0>>
	They start squirming their way into your <<bottom>>.
<</if>>

<<if _swarmamounts.butt[1] gte 1>>
	<<neutral 10>><<impregnate $swarm["type"] _swarmamounts.butt[1]>>
	They writhe inside your lower intestine<<if $player.penisExist>>, blindly teasing your prostate<</if>><<if _impreg is true>>, and attempt to move further inside you<</if>>.
	<<set _impreg to false>>
	<<arousal `_swarmamounts.butt[1] * 20`>>
<</if>>

/* -------- Genital -------- */

<<if _swarmnote.genitalcovered gte 1>>
	<<set _swarmnote.genitalcovered to 0>>
	You manage to keep them away from your <<genitals>>.
<</if>>

<<if _swarmnote.genitalmolest gte 1>>
	<<set _swarmnote.genitalmolest to 0>>
		You feel them writhing over your <<if !$worn.lower.type.includes("naked") and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt isnot 1>><<genitals>> through your
		<<if !$worn.over_lower.type.includes("naked")>>
			$worn.over_lower.name<<if !$worn.lower.type.includes("naked")>> and<<else>>.<</if>>
		<</if>>
		<<if !$worn.lower.type.includes("naked")>>
			$worn.lower.name.
		<</if>>
	<<elseif !$worn.under_lower.type.includes("naked")>>
		<<genitals>> through your $worn.under_lower.name.<<else>>unprotected <<genitals>>.
		<</if>>
<</if>>

<<if _swarmnote.genitallowerclothed gte 1>>
	<<set _swarmnote.genitallowerclothed to 0>>
	Some of them start tearing into your
	<<if !$worn.over_lower.type.includes("naked")>>
		$worn.over_lower.name<<if !$worn.lower.type.includes("naked")>> and<<else>>.<</if>>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
		$worn.lower.name.
	<</if>>
<</if>>

<<if _swarmnote.genitalunderclothed gte 1>>
	<<set _swarmnote.genitalunderclothed to 0>>
	Some of them try to breach your $worn.under_lower.name, trying to get to the skin beneath.
<</if>>

<<if _swarmnote.genitallowerintroclothed gte 1>>
	<<set _swarmnote.genitallowerintroclothe to 0>>
	Some of them wriggle their way into your
	<<if !$worn.over_lower.type.includes("naked")>>
		$worn.over_lower.name<<if !$worn.lower.type.includes("naked")>> and<<else>>,<</if>>
	<</if>>
	<<if !$worn.lower.type.includes("naked")>>
		$worn.lower.name,
	<</if>>
	you feel them moving toward your <<genitals>>.
<</if>>

<<if _swarmnote.genitalunderintroclothed gte 1>>
	<<set _swarmnote.genitalunderintroclothed to 0>>
	Some of them wriggle their way into your $worn.under_lower.name, you feel them moving toward your <<genitals>>.
<</if>>

<<if _swarmnote.genitalchasity gte 1>>
	<<set _swarmnote.genitalchasity to 0>>
	Some of them wriggle their way into your $worn.genitals.name, you feel them moving toward your <<genitals>>. With your $worn.genitals.name in the way, you won't be able to get them out!
	<<if $parasitedisable is "f">>
		<<if $player.vaginaExist>>
			<<set $vaginalchastityparasite to $swarm["type"]>>
		<<elseif $player.penisExist>>
			<<set $penilechastityparasite to $swarm["type"]>>
		<</if>>
	<</if>>
<</if>>

<<if _swarmnote.genitalintro gte 1>>
	<<set _swarmnote.genitalintro to 0>>
	They swarm around your groin, you feel them move toward your <<genitals>>.
<</if>>

<<if _swarmnote.genitalinsideintro gte 1>>
	<<set _swarmnote.genitalinsideintro to 0>>
	<<if $player.vaginaExist>>
		They start squirming their way into your pussy!
	<<elseif $player.penisExist>>
		They start enveloping your penis!
	<</if>>
<</if>>

<<if _swarmamounts.genital[1] gte 1>>
	<<if $player.vaginaExist>>
		They writhe and squirm inside your vagina, probing and teasing without mercy.
		<<arousal `_swarmamounts.genital[1] * 20 * $genitalsensitivity`>>
		<<neutral 10>>
	<<elseif $player.penisExist>>
		They writhe and squirm over your penis, rubbing and teasing the entire length.
		<<arousal `_swarmamounts.genital[1] * 20 * $genitalsensitivity`>>
		<<neutral 10>>
	<</if>>
<</if>>

<<if $panicattacks gte 1 and $panicviolence is 0 and $panicparalysis is 0 and $controlled is 0 and _panicchecked isnot true>>
	<<set $rng to random(1, 100)>>
	<<if $rng is 100>>
		<<set $panicparalysis to 5>>
	<</if>>
	<<set _panicchecked to true>>
<</if>>
<<if $panicattacks gte 2 and $panicviolence is 0 and $panicparalysis is 0 and $controlled is 0 and _paniccheckedviolence isnot true>>
	<<set $rng to random(1, 100)>>
	<<if $rng is 100>>
		<<set $panicviolence to 3>>
	<</if>>
	<<set _paniccheckedviolence to true>>
<</if>>
<<if $arousal gte $arousalmax and $orgasmdown lte 0>>
	<<orgasm>>
<</if>>

<</widget>>

<<widget "swarmName">>
	<<if $args[0] is undefined or $args[0] gt 1>>
		<<if $swarm.name.endsWith(" mass")>>
			<<set _swarmname to $swarm.name + "es">>
		<<else>>
			<<set _swarmname to $swarm.name + "s">>
		<</if>>
	<<else>>
		<<set _swarmname to $swarm.name>>
	<</if>>
	_swarmname
<</widget>>


code:
:: Widgets Abomination [widget]

/* Turn NPC into Abomination. Only works if only one NPC generated for now. Can be used mid-combat. */
<<widget "makeAbomination">>
<<if $enemyno isnot 1>>
	ERROR: Only one NPC may be present to turn into an Abomination.
<<else>>
	<<set $abomination to 1>>
	<<set _tentacleNumber to ($args[0] ? $args[0] : random(2,8))>>
	<<set _tentacleHealth to ($args[1] ? $args[1] : 15)>>
	<<set _tentacleType to ($args[2] ? $args[2] : undefined)>>
	<<set _tentacleVariant to ($args[3] ? $args[3] : undefined)>>
	<<set _tentacleVarDesc to ($args[4] ? $args[4] : undefined)>>
	<<tentaclestart _tentacleNumber _tentacleHealth _tentacleType _tentacleVariant _tentacleVarDesc>>
	<<for _i to 0; _i lt $tentacles.active; _i++>>
		<<set $enemyhealthmax += $tentacles[_i].tentaclehealth>>
		<<set $enemyhealth += $tentacles[_i].tentaclehealth>>
		<<set $enemyarousalmax += $tentacles[_i].tentaclehealth>>
	<</for>>
<</if>>
<</widget>>

<<widget "generateProwler">>
<<if $args[0] is undefined>>
	<<set _w to 1>>
<<else>>
	<<set _w to $args[0]>>
<</if>>
<<set _n to (_w -1)>>
<<if !$per_npc.prowler>>
	<<set _strapIgnore to true>>
	<<beastNEWinit 1 prowler>>
	<<set $NPCList[_n].health to 600>>
	<<set $NPCList[_n].pronoun to "i">>
	<<generatePronouns $NPCList[_n]>>
	<<saveNPC _n "prowler">>
<<else>>
	<<loadNPC _n "prowler">>
<</if>>
<<personselect _n>>
<</widget>>

<<widget "effectsabomination">>
<<effectsman>>

<<for _i to 0; _i lt $tentacles.max; _i++>>
	<<if $tentacles[_i] isnot undefined>>
		<<set _tentacle to $tentacles[_i]>>
		<<effectstentacleadv _tentacle>>
	<</if>>
<</for>>

<</widget>>

<<widget "abomination">>
<<if !$enemytype or ["man","plant","doppel"].includes($enemytype)>>
	<<man>>
<<else>>
	<<beast $enemyno>>
<</if>>
<<for _i to 0; _i lt $tentacles.max; _i++>>
	<<set _tentacle to $tentacles[_i]>>
	<<if _tentacle isnot undefined>>
		<<tentacleadv _tentacle>>
		<<set _tentacle.tentaclehealth -= 0.2>>
		<<set $enemyarousal += 2>>
	<</if>>
<</for>>
<</widget>>

<<widget "stateabomination">>
<<statetentacles>>
<<stateman>>
<</widget>>

<<widget "actionsabomination">>

<<exposure>>
<<set $face to 0>>

<<if $enemyno gte 2>>
	<<set $pronoun to "n">>
<<else>>
	<<if $NPCList[0].pronoun is "m">>
		<<set $pronoun to "m">>
	<</if>>
	<<if $NPCList[0].pronoun is "f">>
		<<set $pronoun to "f">>
	<</if>>
	<<if $NPCList[0].pronoun is "i">>
		<<set $pronoun to "i">>
	<</if>>
	<<if $NPCList[0].pronoun is "n">>
		<<set $pronoun to "n">>
	<</if>>
	<<if $NPCList[0].pronoun is "t">>
		<<set $pronoun to "t">>
	<</if>>
<</if>>

<<if $images is 1>>
	<<if $position isnot "stalk">>
		<<timed 100ms>>
		<<combatimg>>

		<</timed>>
	<</if>>
<</if>>

<<if $traumafocus gte 1 and $traumafocusintro isnot 1>>
	<<set $traumafocusintro to 1>>
	As you gain focus, you become more and more likely to escape your helpless state of dissociation.

<</if>>

<<if $traumafocus gt random(1, 1000) and $dissociation gte 2 and $combat is 1>>
	<<set $traumafocus to 0>><<set $trauma -= 1000>><<set $dissociation to 1>>
	Your lucidity returns.
	<<ltrauma>>

	The weight of reality crashes down on you.

<</if>>

<<oxygen 50>>

<<willpowerpain>>
<<willpowerorgasm>>
<<actioncarry>>
<<actioncarrydrop>>

<<combatstate>>
<<carryblock>>

<<if $trance lte 0 and $panicparalysis is 0 and ($panicviolence is 0 or $position is "stalk")>>
	<<if $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined) and $dissociation lte 1>>
		<<if $images is 1 and $consensual is 1 and $position_lock isnot 1>>
			<<if $position is "doggy">>
				| Roll over <<radiobutton "$bodyaction" "missionary">>
			<<elseif $position is "missionary">>
				| Roll over <<radiobutton "$bodyaction" "doggy">>
			<</if>>
			<<if $position isnot "stalk">>
				| Rest <<radiobutton "$bodyaction" "rest" checked>>

			<</if>>
		<</if>>
	<</if>>

	<<if $combatControls isnot "disabled">>
		<<generateActionsAbomination>>
	<</if>>

<</if>>

<<set $face to 0>>

/*Due to how combat is setup, this is the best location for it*/
<<setupMidOrgasm>>
<<if $debug is 1>>
	__Debug__

	<<for _i to 0; _i lt $enemynomax; _i++>>
		<<print _i>> $NPCList[_i].fullDescription: Head Location: $NPCList[_i].location.head --- Genitals Location: $NPCList[_i].location.genitals

		Penis: $NPCList[_i].penis --- Vagina: $NPCList[_i].vagina --- Mouth: $NPCList[_i].mouth --- Anus: $NPCList[_i].anus

	<</for>>
<</if>>

<</widget>>

<<widget "generateActionsAbomination">>
<<set $combat to 1>>
<<if _targetlist is undefined>>
	<<getTargetList>>
<</if>>

		<<if $lefttarget is "self">>
			<<leftActionInitSelf>>
		<<elseif $lefttarget is "tentacles" and Object.values(_targetlistarms).includes("tentacles")>>
			<<leftActionInitTentacle>>
		<<else>>
			<<leftActionInit>>
		<</if>>

		<<if $righttarget is "self">>
			<<rightActionInitSelf>>
		<<elseif $righttarget is "tentacles" and Object.values(_targetlistarms).includes("tentacles")>>
			<<rightActionInitTentacle>>
		<<else>>
			<<rightActionInit>>
		<</if>>

		<<if $feettarget is "self">>
			<<feetActionInitSelf>>
		<<elseif $feettarget is "tentacles" and Object.values(_targetlistall).includes("tentacles")>>
			<<feetActionInitTentacle>>
		<<else>>
			<<feetActionInit>>
		<</if>>

		<<if $mouthtarget is "tentacles" and Object.values(_targetlistall).includes("tentacles")>>
			<<mouthActionInitTentacle>>
		<<else>>
			<<mouthActionInit>>
		<</if>>

	<<if $player.penisExist>>

			<<if $penistarget is "tentacles" and Object.values(_targetlistall).includes("tentacles")>>
				<<penisActionInitTentacle>>
			<<else>>
				<<penisActionInit>>
			<</if>>

	<</if>>

	<<if $player.vaginaExist>>

			<<if $vaginatarget is "tentacles" and Object.values(_targetlistall).includes("tentacles")>>
				<<vaginaActionInitTentacle>>
			<<else>>
				<<vaginaActionInit>>
			<</if>>

	<</if>>

		<<if $anustarget is "tentacles" and Object.values(_targetlistall).includes("tentacles")>>
			<<anusActionInitTentacle>>
		<<else>>
			<<anusActionInit>>
		<</if>>

	<<if $chestuse is "tentaclerub">>

			<<chestActionInitTentacle>>

	<<elseif $chestuse is "penis">>

			<<chestActionInit>>

	<</if>>

	<<if $thighuse isnot 0>>

			<<thighActionInit>>

	<</if>>

<</widget>>


code:
:: Widgets Combat Tentacle Test [widget]
<<widget "tentacleact">>

<<if $tentacles[$tentacleindex].health lte 0 and $tentacles[$tentacleindex].shaft isnot "finished">>
	Worn out, the $tentacles[$tentacleindex].name tentacle retracts from you.
	<<tentacledisable>>
	<<set $tentacles[$tentacleindex].shaft to "finished">>
	<<set $tentacles[$tentacleindex].head to "finished">>
<</if>>

<<if $tentacles[$tentacleindex].shaft is "tummy">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your tummy,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "thighs">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> between your thighs,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "breasts">>
	The $tentacles[$tentacleindex].name tentacle squeezes your breasts together,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "chest">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your chest,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "waist">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your waist,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "neck">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your neck,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "shoulders">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your shoulders,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "leftleg">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your left leg,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "rightleg">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your right leg,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "leftarm">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your left arm,
<</if>>

<<if $tentacles[$tentacleindex].shaft is "rightarm">>
	The $tentacles[$tentacleindex].name tentacle <<slithers>> around your right arm,
<</if>>

<<if $tentacles[$tentacleindex].head is "leftarm">>
	The $tentacles[$tentacleindex].name tentacle writhes in your left hand.
	<<neutral 5>>
<</if>>

<<if $tentacles[$tentacleindex].head is "rightarm">>
	The $tentacles[$tentacleindex].name tentacle writhes in your right hand.
	<<neutral 5>>
<</if>>

<<if $tentacles[$tentacleindex].head is "feet">>
	The $tentacles[$tentacleindex].name tentacle writhes between your feet.
	<<neutral 5>>
<</if>>

<<if $tentacles[$tentacleindex].head is "leftnipplesuck">>
	and up to your <<breasts>>, where it suckles your left nipple.
	<<neutralbreast 3>><<playWithBreasts>>
<</if>>

<<if $tentacles[$tentacleindex].head is "rightnipplesuck">>
	and up to your <<breasts>>, where it suckles your right nipple.
	<<neutralbreast 3>><<playWithBreasts>>
<</if>>

<<if $tentacles[$tentacleindex].head is "leftnipple">>
	and continues teasing your left nipple. The tip of the tentacle opens up, latches on, then begins sucking.
	<<neutralbreast 3>><<set $tentacles[$tentacleindex].head to "leftnipplesuck">><<set $leftnipple to "tentaclesuck">><<playWithBreasts>>
<</if>>

<<if $tentacles[$tentacleindex].head is "rightnipple">>
	and continues teasing your right nipple. The tip of the tentacle opens up, latches on, then begins sucking.
	<<neutralbreast 3>><<set $tentacles[$tentacleindex].head to "rightnipplesuck">><<set $rightnipple to "tentaclesuck">><<playWithBreasts>>
<</if>>

<<if $parasite.nipples.name isnot undefined>>
	The suction drives the attached $parasite.nipples.name into a frenzy.
<</if>>

<<if $tentacles[$tentacleindex].head is "chest">>
	<<if $chestuse is 0>>
		moves away from your <<breasts>>
		<<set $tentacles[$tentacleindex].head to 0>>
	<<else>>
		then up between your <<breasts>>, rubbing itself between them.
		<<neutralbreast 2>>
	<</if>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouthdeep">>
	and up into your mouth where it spurts a sweet fluid down your throat at the apex of each thrust.
	<<purity -1>><<internalejac>><<sex 5>><<drugs 3>><<set $player.bodyliquid.mouth.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>>
	<<if $tentacles[$tentacleindex].desc.includes("pale")>>
		<<set $hallucinogen += 3>>
	<</if>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouth">>
	and continues thrusting into your mouth. The tip opens and begins oozing a sweet liquid.
	<<purity -1>><<internalejac>><<set $mouthstate to "tentacledeep">><<set $tentacles[$tentacleindex].head to "mouthdeep">><<sex 5>><<oralejacstat>><<ejacstat>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouthimminent">>
	<<if $player.virginity.oral is true>>
		 and thrusts between your lips, penetrating your mouth for the first time.
		<<takeVirginity $tentacles[$tentacleindex].fullDesc "oral">><<violence 5>>
	<<else>>
		 and thrusts between your lips.
	<</if>>
	<<set $mouthstate to "tentacle">><<set $tentacles[$tentacleindex].head to "mouth">><<sex 5>><<raped>><<oralstat>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouthentrance">>
	 and presses against your lips.
	<<set $mouthstate to "tentacleimminent">><<set $tentacles[$tentacleindex].head to "mouthimminent">><<neutral 4>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vaginadeep">>
	and <<slithers>> into your <<pussy>> where it pumps a viscous fluid at the apex of each thrust.
	<<purity -1>><<internalejac>><<sex 5>><<drugs 3>><<set $player.bodyliquid.vagina.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>>
	<<if $tentacles[$tentacleindex].desc.includes("pale")>>
		<<set $hallucinogen += 3>>
	<</if>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vagina">>
	and continues thrusting into your <<pussy>>. The tip opens and begins oozing a viscous liquid.
	<<purity -1>><<internalejac>><<set $vaginastate to "tentacledeep">><<set $tentacles[$tentacleindex].head to "vaginadeep">><<sex 5>><<vaginalejacstat>><<ejacstat>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vaginaimminent">>
	<<if $player.virginity.vaginal is true>>
		 and thrusts into your <<pussy>>,
		<<if $sexStats.vagina.pregnancy.totalBirthEvents gt 0>>
			despite your lack of a hymen, you feel something inside you change as your virginity and purity are taken.
			<<violence 10>>
		<<else>>
			tearing your hymen and forever robbing you of your purity.
			<<violence 100>>
		<</if>>
	<<else>>
		 and thrusts into your <<pussy>>.
	<</if>>
	<<takeVirginity $tentacles[$tentacleindex].fullDesc "vaginal">>
	<<set $vaginastate to "tentacle">><<set $tentacles[$tentacleindex].head to "vagina">><<sex 5>><<raped>><<vaginaraped>><<vaginalstat>><<violence 1>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vaginaentrance">>
	<<if !$worn.genitals.type.includes("chastity")>>
		<<if $vaginaWetness gte ($tentacles[$tentacleindex].size * 20) + random(1, 40) or random(1, 2) is 2>>
			and presses against your <<pussy>>. <<vagina_lube_text>> the tip presses into you, a thrust away from penetrating.
			<<set $vaginastate to "tentacleimminent">><<set $tentacles[$tentacleindex].head to "vaginaimminent">><<sex 10>>
		<<else>>
			and presses against your <<pussy>>, but fails to gain purchase.
			<<sex 5>>
			<<if random(1, 3) gte 3>>
				Slimy fluid squirts from the tip, lubricating you.
				<<set $player.bodyliquid.vaginaoutside.goo += 1>>
			<</if>>
		<</if>>
	<<else>>
		and tries to find a way inside. Failing, it lashes at the metal.
		<<set $worn.genitals.integrity -= 10>><<violence 1>>
	<</if>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penisdeep">>
	and continues thrusting against your <<penis>>, caressing and kneading your length.
	<<sex 5>><<set $tentacles[$tentacleindex].health -= 1>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penis">>
	and continues thrusting against your <<penis>>. It sucks and kneads your length, trying to milk you of your cum.
	<<set $penisstate to "tentacledeep">><<set $tentacles[$tentacleindex].head to "penisdeep">><<sex 5>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penisimminent">>
	<<if $player.virginity.penile is true>>
		 and thrusts against your <<penis>>, swallowing you to the base and  tearing the membrane between your glans and foreskin, forever robbing you of your purity.
		<<violence 100>>
	<<else>>
		 and thrusts against your <<penis>>, swallowing you to the base.
	<</if>>
	<<takeVirginity $tentacles[$tentacleindex].fullDesc "penile">>
	<<set $penisstate to "tentacle">><<set $tentacles[$tentacleindex].head to "penis">><<sex 5>><<raped>><<penisraped>><<penilestat>><<violence 1>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penisentrance">>
	<<if !$worn.genitals.type.includes("chastity")>>
		<<if $penisWetness + ($tentacles[$tentacleindex].size * 10) gte ($penissize * 15) + random(1, 40) or random(1, 2) is 2>>
			and <<slithers>> over to your <<penis>>. <<penis_lube_text>> the tip opens and presses against your glans, a thrust away from enveloping.
			<<set $penisstate to "tentacleimminent">><<set $tentacles[$tentacleindex].head to "penisimminent">><<neutralgenitals 4>>
		<<else>>
			and <<slithers>> over to your <<penis>>. The tip opens presses against your glans, but it fails to gain purchase.
			<<sex 5>>
			<<if random(1, 3) gte 3>>
				Slimy fluid squirts from the tip, lubricating you.
				<<set $player.bodyliquid.penis.goo += 1>>
			<</if>>
		<</if>>
	<<else>>
		and tries to find a way inside. Failing, it lashes at the metal.
		<<set $worn.genitals.integrity -= 10>><<violence 1>>
	<</if>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anusdeep">>
	and <<slithers>> into your <<bottom>> where it pumps a viscous fluid at the apex of each thrust.
	<<purity -1>><<internalejac>><<sex 5>><<drugs 3>><<set $player.bodyliquid.anus.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>>
	<<if $tentacles[$tentacleindex].desc.includes("pale")>>
		<<set $hallucinogen += 3>>
	<</if>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anus">>
	and continues thrusting into your <<bottom>>. The tip opens and begins oozing a viscous liquid.
	<<purity -1>><<internalejac>><<set $anusstate to "tentacledeep">><<set $tentacles[$tentacleindex].head to "anusdeep">><<sex 5>><<analejacstat>><<ejacstat>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anusimminent">>
	<<if $player.virginity.anal is true>>
		 and thrusts into your <<bottom>>, violating you in a way you hadn't conceived of.
		<<takeVirginity $tentacles[$tentacleindex].fullDesc "anal">><<violence 100>>
	<<else>>
		 and thrusts into your <<bottom>>.
	<</if>>
	<<set $anusstate to "tentacle">><<set $tentacles[$tentacleindex].head to "anus">><<sex 5>><<raped>><<anusraped>><<analstat>><<violence 1>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anusentrance">>
	<<if $worn.genitals.anal_shield isnot 1>>
		<<if $anusWetness gte ($tentacles[$tentacleindex].size * 20) + random(1, 40) or random(1, 2) is 2>>
			and presses against your <<bottom>>. <<anus_lube_text>> the tip presses into you, a thrust away from penetrating.
			<<set $anusstate to "tentacleimminent">><<set $tentacles[$tentacleindex].head to "anusimminent">><<neutral 4>>
		<<else>>
			and presses against your <<bottom>>. It fails to gain purchase.
			<<sex 5>>
			<<if random(1, 3) gte 3>>
				Slimy fluid squirts from the tip, lubricating you.
				<<set $player.bodyliquid.bottom.goo += 1>>
			<</if>>
		<</if>>
	<<else>>
		and tries to find a way inside. Failing, it lashes at the device.
		<<set $worn.genitals.integrity -= 10>><<violence 1>>
	<</if>>
<</if>>
<<set $rng to random(1, 100)>>
<<if $tentacles[$tentacleindex].head is "vaginarub">>
	<<if $rng gte 21>>
		<<if $tentacles[$tentacleindex].shaft is "thighs">>
			and against your <<pussy>>, pressing into your clit.
		<<else>>
			and between your thighs where it <<slithers>> against your <<pussy>>, pressing against your clit.
		<</if>>
		<<sex 3>>
	<<else>>
		<<if $tentacles[$tentacleindex].shaft is "thighs">>
			where it <<slithers>> toward your <<pussy>>.
		<<else>>
			and between your thighs where it <<slithers>> toward your <<pussy>>.
		<</if>>
		<<neutralgenitals 3>><<set $vaginause to "tentacle">><<set $vaginastate to "tentacleentrance">><<set $tentacles[$tentacleindex].head to "vaginaentrance">><<set $thighuse to 0>><<set $vaginatarget to "tentacles">>
	<</if>>
<</if>>
<<set $rng to random(1, 100)>>
<<if $tentacles[$tentacleindex].head is "penisrub">>
	<<if $rng gte 21>>
		<<if $tentacles[$tentacleindex].shaft is "thighs">>
			where it <<slithers>> against your <<penis>>, coiling around it.
		<<else>>
			and between your thighs where it <<slithers>> against your <<penis>>, coiling around it.
		<</if>>
		<<sex 3>>
	<<else>>
		<<if $tentacles[$tentacleindex].shaft is "thighs">>
			where the tip opens as it <<slithers>> toward your <<penis>>.
		<<else>>
			and between your thighs, where the tip opens as it <<slithers>> toward your <<penis>>.
		<</if>>
		<<neutralgenitals 3>><<set $penisuse to "tentacle">><<set $penisstate to "tentacleentrance">><<set $tentacles[$tentacleindex].head to "penisentrance">><<set $thighuse to 0>><<set $penistarget to "tentacles">><<set $tentaclePenis to _tentacle.fullDesc>>
	<</if>>
<</if>>
<<set $rng to random(1, 100)>>
<<if $tentacles[$tentacleindex].head is "anusrub">>
	<<if $rng gte 21>>
		and between your <<bottom>> cheeks where it <<slithers>> against your back.
		<<sex 3>>
	<<else>>
		and between your <<bottom>> cheeks,  toward your anus.
		<<neutral 3>><<set $anususe to "tentacle">><<set $anusstate to "tentacleentrance">><<set $tentacles[$tentacleindex].head to "anusentrance">><<set $anustarget to "tentacles">>
	<</if>>
<</if>>
<<set $rng to random(1, 100)>>
<<if $tentacles[$tentacleindex].head is 0 and $tentacles[$tentacleindex].shaft isnot 0>>

	<<if $rng lte 10>>
		<<if $chestuse is "squeezed">>
			<<upperslither>>and up between your squeezed <<breasts>>.
			<<set $tentacles[$tentacleindex].head to "chest">><<neutralbreast 2>><<set $chestuse to "tentaclerub">><<cheststat>><<set $chesttarget to "tentacles">>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 20>>
		<<if $leftnipple is 0>>
			<<upperslither>> <<playWithBreasts>>and teases your left nipple.
			<<neutralbreast 2>><<set $tentacles[$tentacleindex].head to "leftnipple">><<set $leftnipple to "tentacle">>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 30>>
		<<if $rightnipple is 0>>
			<<upperslither>> <<playWithBreasts>>and teases your right nipple.
			<<neutralbreast 2>><<set $tentacles[$tentacleindex].head to "rightnipple">><<set $rightnipple to "tentacle">>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 40>>
		<<if $mouthuse is 0>>
			<<upperslither>> and up toward your mouth.
			<<neutral 2>><<set $mouthuse to "tentacle">><<set $mouthstate to "tentacleentrance">><<set $tentacles[$tentacleindex].head to "mouthentrance">><<set $mouthtarget to "tentacles">>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 50>>
		<<if $anususe is 0 and $analdisable is "f">>
			<<underslither>> and <<slithers>> toward your <<bottom>>.
			<<neutral 2>><<set $anususe to "tentacle">><<set $anusstate to "tentacleentrance">><<set $tentacles[$tentacleindex].head to "anusentrance">><<set $anustarget to "tentacles">>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 60>>
		<<if $player.vaginaExist and $vaginause is 0>>
			<<underslither>> and <<slithers>> toward your <<pussy>>.
			<<neutralgenitals 2>><<set $vaginause to "tentacle">><<set $vaginastate to "tentacleentrance">><<set $tentacles[$tentacleindex].head to "vaginaentrance">><<set $vaginatarget to "tentacles">>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 70>>
		<<if $player.penisExist and $penisuse is 0>>
			<<underslither>> and <<slithers>> toward your <<penis>>.
			<<neutralgenitals 2>><<set $penisuse to "tentacle">><<set $penisstate to "tentacleentrance">><<set $tentacles[$tentacleindex].head to "penisentrance">><<set $penistarget to "tentacles">><<set $tentaclePenis to _tentacle.fullDesc>>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 80>>
		<<if $thighuse is 0>>
			<<if $player.penisExist and $penisuse is 0>>
				<<if $tentacles[$tentacleindex].shaft is "thighs">>
					<<underslither>> where it <<slithers>> against your tummy and <<penis>>.
				<<else>>
					<<underslither>> where it <<slithers>> between your thighs and against your tummy and <<penis>>.
				<</if>>
				<<set $penisuse to "tentaclerub">><<set $thighuse to "tentaclerub">><<set $tentacles[$tentacleindex].head to "penisrub">><<sex 3>><<thighstat>><<set $penistarget to "tentacles">><<set $tentaclePenis to _tentacle.fullDesc>>
			<<elseif $player.vaginaExist and $vaginause is 0>>
				<<if $tentacles[$tentacleindex].shaft is "thighs">>
					<<underslither>> where it <<slithers>> against your tummy and <<pussy>>.
				<<else>>
					<<underslither>> where it <<slithers>> between your thighs and against your tummy and <<pussy>>.
				<</if>>
				<<set $vaginause to "tentaclerub">><<set $thighuse to "tentaclerub">><<set $tentacles[$tentacleindex].head to "vaginarub">><<sex 3>><<thighstat>><<set $vaginatarget to "tentacles">>
			<<else>>
				<<tentacledefault>>
			<</if>>
		<<else>>
		<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 90>>
		<<if $anusstate is 0 and $anususe is 0 and $analdisable is "f">>
			<<underslither>> and <<slithers>> between your <<bottom>> cheeks and against your back.
			<<set $anusstate to "tentaclerub">><<set $anususe to "tentaclerub">><<set $tentacles[$tentacleindex].head to "anusrub">><<sex 1>><<bottomstat>><<set $anustarget to "tentacles">>
		<<else>>
			<<tentacledefault>>
		<</if>>
	<<elseif $rng lte 95>>

	<<else>>
		<<tentacledefault>>
	<</if>>
<<elseif $tentacles[$tentacleindex].head is 0 and $tentacles[$tentacleindex].shaft is 0>>

	<<if $rng lte 10>>
		<<if $position isnot "wall">>
			The $tentacles[$tentacleindex].name tentacle winds around your tummy.
			<<neutral 1>><<set $tentacles[$tentacleindex].shaft to "tummy">>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle gently slaps your <<bottom>>.
			<<violence 1>><<hitstat>>
		<</if>>
	<<elseif $rng lte 20>>
		The $tentacles[$tentacleindex].name tentacle <<slithers>> between your thighs.
		<<neutral 1>><<set $tentacles[$tentacleindex].shaft to "thighs">>
	<<elseif $rng lte 30>>
		<<if $position isnot "wall">>
			<<if $breastsize gte 2 and $chestuse is 0>>
				The $tentacles[$tentacleindex].name tentacle <<slithers>> around your <<breasts>>, squeezing them together.
				<<neutralbreast 1>><<set $tentacles[$tentacleindex].shaft to "breasts">><<set $chestuse to "squeezed">>
			<<else>>
				The $tentacles[$tentacleindex].name tentacle gently slaps your <<bottom>>.
				<<violence 1>><<hitstat>>
			<</if>>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle gently slaps your <<bottom>>.
			<<violence 1>><<hitstat>>
		<</if>>
	<<elseif $rng lte 40>>
		<<if $position isnot "wall">>
			The $tentacles[$tentacleindex].name tentacle winds its way around your chest, beneath your <<breasts>>.
			<<neutralbreast 1>><<set $tentacles[$tentacleindex].shaft to "chest">>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle gently slaps your <<bottom>>.
			<<violence 1>><<hitstat>>
		<</if>>
	<<elseif $rng lte 50>>
		The $tentacles[$tentacleindex].name tentacle winds its way around your waist.
		<<neutral 1>><<set $tentacles[$tentacleindex].shaft to "waist">>
	<<elseif $rng lte 60>>
		<<if $position isnot "wall">>
			<<if $head is 0>>
				The $tentacles[$tentacleindex].name tentacle winds its way around your neck, restraining your head.
				<<neutral 1>><<set $tentacles[$tentacleindex].shaft to "neck">><<set $head to "grappled">>
			<<else>>
				The $tentacles[$tentacleindex].name tentacle winds its way around your shoulders.
				<<neutral 1>><<set $tentacles[$tentacleindex].shaft to "shoulders">>
			<</if>>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle gently slaps your <<bottom>>.
			<<violence 1>><<hitstat>>
		<</if>>
	<<elseif $rng lte 70>>
		The $tentacles[$tentacleindex].name tentacle gently slaps your <<bottom>>.
		<<violence 1>><<hitstat>>
	<<elseif $rng lte 80>>
		<<if $leftleg is 0>>
			The $tentacles[$tentacleindex].name tentacle winds its way around your left leg, restraining it.
			<<neutral 1>><<feettentacledisable>><<set $tentacles[$tentacleindex].shaft to "leftleg">><<set $leftleg to "grappled">><<set $feettarget to "tentacles">>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle tickles your feet.
			<<neutral 1>>
		<</if>>
	<<elseif $rng lte 85>>
		<<if $rightleg is 0>>
			The $tentacles[$tentacleindex].name tentacle winds its way around your right leg, restraining it.
			<<neutral 1>><<feettentacledisable>><<set $tentacles[$tentacleindex].shaft to "rightleg">><<set $rightleg to "grappled">><<set $feettarget to "tentacles">>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle tickles your feet.
			<<neutral 1>>
		<</if>>
	<<elseif $rng lte 90>>
		<<if $leftarm is 0>>
			The $tentacles[$tentacleindex].name tentacle winds its way around your left arm, restraining it.
			<<neutral 1>><<leftarmtentacledisable>><<set $tentacles[$tentacleindex].shaft to "leftarm">><<set $leftarm to "tentgrappled">><<set $leftarmstate to 0>><<set $lefttarget to "tentacles">>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle tickles your armpit.
			<<neutral 1>>
		<</if>>
	<<elseif $rng lte 95>>
		<<if $rightarm is 0>>
			The $tentacles[$tentacleindex].name tentacle winds its way around your right arm, restraining it.
			<<rightarmtentacledisable>><<neutral 1>><<set $tentacles[$tentacleindex].shaft to "rightarm">><<set $rightarm to "tentgrappled">><<set $rightarmstate to 0>><<set $righttarget to "tentacles">>
		<<else>>
			The $tentacles[$tentacleindex].name tentacle tickles your armpit.
			<<neutral 1>>
		<</if>>
	<<elseif $rng lte 100>>
		The $tentacles[$tentacleindex].name tentacle <<slithers>> against your <<bottom>>.
		<<neutral 1>>
	<</if>>
<</if>>
<</widget>>

<<widget "tentacledefault">>
	<<set $rng to random(1, 100)>>
	<<if $rng gte 90>>
		then squirts a warm fluid over your neck.
		<<neutral 1>><<set $player.bodyliquid.neck.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<neckejacstat>><<ejacstat>>
	<<elseif $rng gte 80>>
		then squirts a warm fluid over your right arm.
		<<neutral 1>><<set $player.bodyliquid.rightarm.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<handejacstat>><<ejacstat>>
	<<elseif $rng gte 70>>
		then squirts a warm fluid over your left arm.
		<<neutral 1>><<set $player.bodyliquid.leftarm.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<handejacstat>><<ejacstat>>
	<<elseif $rng gte 60>>
		then squirts a warm fluid over your thighs.
		<<neutral 1>><<set $player.bodyliquid.thigh.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<thighejacstat>><<ejacstat>>
	<<elseif $rng gte 50>>
		then squirts a warm fluid over your <<bottom>>.
		<<neutral 1>><<set $player.bodyliquid.bottom.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<bottomejacstat>><<ejacstat>>
	<<elseif $rng gte 40>>
		then squirts a warm fluid over your tummy.
		<<neutral 1>><<set $player.bodyliquid.tummy.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<tummyejacstat>><<ejacstat>>
	<<elseif $rng gte 30>>
		then squirts a warm fluid over your chest.
		<<neutralbreast 1>><<set $player.bodyliquid.chest.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<chestejacstat>><<ejacstat>>
	<<elseif $rng gte 20>>
		then squirts a warm fluid over your face.
		<<neutral 1>><<set $player.bodyliquid.face.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<faceejacstat>><<ejacstat>>
	<<elseif $rng gte 10>>
		then squirts a warm fluid over your hair.
		<<neutral 1>><<set $player.bodyliquid.hair.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<hairejacstat>><<ejacstat>>
	<<else>>
		then squirts a warm fluid over your feet.
		<<neutral 1>><<set $player.bodyliquid.feet.goo += 1>><<set $tentacles[$tentacleindex].health -= 1>><<feetejacstat>><<ejacstat>>
	<</if>>
<</widget>>

<<widget "tentacledisable">>

<<if $tentacles[$tentacleindex].head is "feet">>
	<<set $leftleg to 0>>
	<<set $rightleg to 0>>
	<<set $feetstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "leftarm">>
	<<set $leftarm to 0>>
	<<set $leftarmstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "rightarm">>
	<<set $rightarm to 0>>
	<<set $rightarmstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "leftnipplesuck">>
	<<set $leftnipple to 0>>
<</if>>
<<if $tentacles[$tentacleindex].head is "rightnipplesuck">>
	<<set $rightnipple to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "leftnipple">>
	<<set $leftnipple to 0>>
<</if>>
<<if $tentacles[$tentacleindex].head is "rightnipple">>
	<<set $rightnipple to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouthentrance">>
	<<set $mouthuse to 0>>
	<<set $mouthstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouthimminent">>
	<<set $mouthuse to 0>>
	<<set $mouthstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouth">>
	<<set $mouthuse to 0>>
	<<set $mouthstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "mouthdeep">>
	<<set $mouthuse to 0>>
	<<set $mouthstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anusentrance">>
	<<set $anususe to 0>>
	<<set $anusstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anusimminent">>
	<<set $anususe to 0>>
	<<set $anusstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anus">>
	<<set $anususe to 0>>
	<<set $anusstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anusdeep">>
	<<set $anususe to 0>>
	<<set $anusstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vaginaentrance">>
	<<set $vaginause to 0>>
	<<set $vaginastate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vaginaimminent">>
	<<set $vaginause to 0>>
	<<set $vaginastate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vagina">>
	<<set $vaginause to 0>>
	<<set $vaginastate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vaginadeep">>
	<<set $vaginause to 0>>
	<<set $vaginastate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penisentrance">>
	<<set $penisuse to 0>>
	<<set $penisstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penisimminent">>
	<<set $penisuse to 0>>
	<<set $penisstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penis">>
	<<set $penisuse to 0>>
	<<set $penisstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penisdeep">>
	<<set $penisuse to 0>>
	<<set $penisstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "vaginarub">>
	<<set $vaginause to 0>>
	<<set $thighuse to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "penisrub">>
	<<set $penisuse to 0>>
	<<set $thighuse to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "anusrub">>
	<<set $anususe to 0>>
	<<set $anusstate to 0>>
<</if>>

<<if $tentacles[$tentacleindex].head is "chest">>
	<<set $chestuse to "squeezed">>
<</if>>

<<if $tentacles[$tentacleindex].shaft is "breasts">>
	<<set $chestuse to 0>>
<</if>>

<<if $tentacles[$tentacleindex].shaft is "neck" and $head isnot "bound">>
	<<set $head to 0>>
<</if>>

<<if $tentacles[$tentacleindex].shaft is "leftleg" and $leftleg isnot "bound">>
	<<set $leftleg to 0>>
<</if>>

<<if $tentacles[$tentacleindex].shaft is "rightleg" and $rightleg isnot "bound">>
<<set $rightleg to 0>>
<</if>>

<<if $tentacles[$tentacleindex].shaft is "leftarm" and $leftarm isnot "bound">>
	<<set $leftarm to 0>>
<</if>>

<<if $tentacles[$tentacleindex].shaft is "rightarm" and $rightarm isnot "bound">>
	<<set $rightarm to 0>>
<</if>>

<<set $tentacles[$tentacleindex].shaft to 0>>
<<set $tentacles[$tentacleindex].head to 0>>

<</widget>>