code:
:: Widgets Tentacle Actions Generation [widget]

/*Sends the required variables to the chosen display type*/
<<widget "generateCombatActionTentacle">>
<<switch $combatControls>>
	<<case "radio">>
		<<generateCombatActionTentacleRadio $args[0] $args[1] $args[3]>>
	<<case "lists" "limitedLists">>
		<<generateCombatActionTentacleList $args[0] $args[1] $args[2] $args[4]>>
<</switch>>
<</widget>>

/*Generated each set of actions in the form of a set of radio buttons*/
<<widget "generateCombatActionTentacleRadio">>
<<for _labelC, _valueC range $args[0]>>

		<<print '<<radiobutton "$'+$args[1]+'" "'+_valueC+'" ' + (_valueC is $args[2] ? "checked" : "") + '>>'>>
		<<print _labelC>>
		<<print '<<'+$args[1]+'DifficultyTentacle "'+_valueC+'">>'>> |

<</for>>
<</widget>>

/*Generated each set of actions in the form of a list*/
<<widget "generateCombatActionTentacleList">>
<<if $args[0]>>
	<<set _options to $args[0]>>
	<<set _name to $args[1]>>
	<<capture _var _options _name>>

			<<listbox `"$"+_name` autoselect>>
				<<optionsfrom _options>>
			<</listbox>>

		/*Changes the color of the list border when the option is changed*/
		<<combatButtonAdjustments _name "Tentacle">>
	<</capture>>
<</if>>
<</widget>>

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

		<<leftActionInitTentacle>>

		<<rightActionInitTentacle>>

		<<feetActionInitTentacle>>

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

			<<mouthActionInitTentacle>>

	<</if>>

	<<if $penisstate isnot 0 and $player.penisExist>>

			<<penisActionInitTentacle>>

	<</if>>

	<<if $vaginastate isnot 0 and $player.vaginaExist>>

			<<vaginaActionInitTentacle>>

	<</if>>

	<<if $anusstate isnot 0>>

			<<anusActionInitTentacle>>

	<</if>>

	<<if $chestuse isnot 0 and $chestuse isnot "squeezed">>

			<<chestActionInitTentacle>>

	<</if>>

<</widget>>

<<widget "leftActionInitTentacle">>
<<set $lefttarget to "tentacles">>
<<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 $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 "tentgrappled">>
	<<if $orgasmdown gte 1>>
		<<set _leftOptions to "bound">>
		Your left arm jerks against the grip.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _leftOptions to "bound">>
		Your left arm is held in a painful grip.
	<<elseif $dissociation gte 2>>
		<<set _leftOptions to "bound">>
		Your left arm lies limp in the grip.
	<<else>>
		<<set _leftOptions to "grappled">>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i].shaft is "leftarm">>
				The $tentacles[_i].fullDesc entangles your left arm.
				<<set $_tentgrab to 1>>
				<<if $angel gte 4 and $angelBanish gte 1 and !$banishDisable>>
					<<set _banishTarget to $tentacles[_i]>>
				<</if>>
				<<break>>
			<</if>>
		<</for>>
		<<if !$_tentgrab>>
			Your left arm is being held down.
		<</if>>
	<</if>>
<<case "bound">>
	<<set _leftOptions to "bound">>
	<<if $orgasmdown gte 1>>
		Your left arm jerks against its bonds.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		Your left arm is held in a painful bind.
	<<elseif $dissociation gte 2>>
		Your left arm lies limp in its bonds.
	<<else>>
		Your left arm is bound.
	<</if>>
<<case "grappled" "penis" "othervagina" "vagina" "coverpenis" "anus" "behind">>
	<<set $_changetype to true>><<leftActionInit>>
<<case "trapped">>
	<<set $_changetype to true>><<leftActionInitVore>>
<<case "struggle">>
	<<set $_changetype to true>><<leftActionInitStruggle>>
<<case "swarmgrappled">>
	<<set $_changetype to true>><<leftActionInitSwarm>>
<<case "mechgrappled">>
	<<set $_changetype to true>><<leftActionInitMachine>>
<<default>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<if $leftarm is $tentacles[_i].id>>
			<<set _leftOptions to "tentacle">>
			<<set _tentacleLeftOption to $tentacles[_i].id>>
			You hold the $tentacles[_i].fullDesc in your left hand.
			<<break>>
		<</if>>
	<</for>>
<</switch>>
<<if $_changetype isnot true>>
	<<leftActionsTentacle>>
	<<if Object.keys(_leftaction).length gt 0>>
		<<if Object.values(_leftaction).includes($leftactiondefault) is false or $args[0] is true or ["rest","leftgrabtentacle"].includes($leftactiondefault)>>
			<<set _defaultsCombatAction to "leftaction">>
			<<set _actionsSet = DefaultActions.get($defaultsCombatType, "Tentacles", _defaultsCombatAction)>>
			<<set _pass to false>>
			<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
				<<if ["leftgrabtentacle"].includes(_actionsSet[_set]) and $leftactionTarget isnot undefined>>
					<<for _i to 0; _i lt $tentacles.max; _i++>>
						<<if $tentacles[_i].shaft isnot "finished">>
							<<if $regrab and $tentacles[_i].head is 0>>
								<<set $leftactiondefault to clone(_actionsSet[_set])>>
								<<set $leftactionTarget to $tentacles[_i].id>>
								<<set _pass to true>>
								<<break>>
							<<elseif $tentacles[_i].head is 0>>
								<<set $leftactiondefault to clone(_actionsSet[_set])>>
								<<set _pass to true>>
							<</if>>
							<<if $regrab is false>>
								<<break>>
							<</if>>
						<</if>>
					<</for>>
				<<elseif ["leftrub","showpenis","showvagina","showbottom"].includes(_actionsSet[_set]) and _tentacleLeftOption isnot undefined>>
					<<if Object.values(_leftaction).includes(_actionsSet[_set] + _tentacleLeftOption)>>
						<<set $leftactiondefault to clone(_actionsSet[_set] + _tentacleLeftOption)>>
						<<set _pass to true>>
						<<break>>
					<</if>>
				<<elseif Object.values(_leftaction).includes(_actionsSet[_set])>>
					<<set $leftactiondefault to clone(_actionsSet[_set])>>
					<<set _pass to true>>
					<<break>>
				<</if>>
			<</for>>
			<<if _pass is false>>
				<<set $leftactiondefault to Object.values(_leftaction)[0]>>
			<</if>>
		<</if>>
		<<set $leftaction to $leftactiondefault>>
		<<set _textColor to combatListColor('leftaction', (Object.values(_leftaction).includes($leftaction) ? $leftaction : Object.values(_leftaction)[0]), "Tentacle")>>

			<<if $combatControls isnot "radio" and _leftOptions is "free">>
				<<set _reducedWidths to true>>
			<<else>>
				<<set _reducedWidths to false>>
			<</if>>
			<<generateCombatActionTentacle _leftaction "leftaction" _textColor $leftaction _reducedWidths>>
			<<if _leftOptions is "free" and $tentacles.active gt 0>>
				<<leftactionSetupTentacle>>
			<<elseif _leftOptions is "grappled" and $angel gte 4 and $angelBanish gte 1 and !$banishDisable and _banishTarget>>
				<<leftactionBoundBanish>>
			<</if>>

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

				<<leftactionDifficultyTentacle>>

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

<<widget "leftactionSetupTentacle">>
<<if $combatControls is "radio">>

	<<set _first to true>>
	<<if $regrab>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i] isnot undefined>>
				<<if $tentacles[_i].shaft isnot "finished" and $tentacles[_i].id is $leftactionTarget>>
					<<set _first to false>>
					<<set $_found to $tentacles[_i].id>>
					<<break>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<if $tentacles[_i] isnot undefined>>
			<<if $tentacles[_i].shaft isnot "finished">>

					<<print '<<radiobutton "$leftactionTarget" "'+$tentacles[_i].id+'" ' + (_first is true or $tentacles[_i].id is $_found ? "checked" : "") + '>>'>>
					$tentacles[_i].fullDesc
				 |
				<<set _first to false>>
			<</if>>
		<</if>>
	<</for>>
<<else>>
	<<if _availableTargets is undefined>>
		<<if $controls is "radio">>

		<</if>>
		<<set _availableTargets to {}>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i] isnot undefined>>
				<<if $tentacles[_i].shaft isnot "finished">>
					<<set _availableTargets[$tentacles[_i].fullDesc] to $tentacles[_i].id>>
					<<set _tentacle_targets_available to true>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<if _tentacle_targets_available>>

			<<listbox "$leftactionTarget" autoselect>>
				<<optionsfrom _availableTargets>>
			<</listbox>>

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

<<widget "leftactionBoundBanish">>
<<if $combatControls is "radio">>

		<<print '<<radiobutton "$leftactionTarget" "'+_banishTarget.id+'">>'>>
		$tentacles[_i].fullDesc
	 |
<<else>>
	<<set _availableTargets to {}>>
	<<set _availableTargets[_banishTarget.fullDesc] to _banishTarget.id>>

		<<listbox "$leftactionTarget" autoselect>>
			<<optionsfrom _availableTargets>>
		<</listbox>>

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

<<widget "leftactionDifficultyTentacle">>
<<if $args[0] is undefined>>
	<<set _diffAction to $leftaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>
	<<case "showbottomtentacle" "showthighstentacle" "showmouthtentacle" "showpenistentacle" "showvaginatentacle">><<deviant5>>
<</switch>>
<</widget>>

<<widget "leftActionsTentacle">>
/*Generate Actions*/
<<set _leftaction to {}>>
<<if !(["orgasm", "pain", "unreal"].includes(_leftOptions))>>
	<<set _leftaction["Rest"] to "rest">>
<</if>>
<<switch _leftOptions>>
<<case "free">>
	<<if $tentacles.active gt 0>>
		<<if $consensual is 0>>
			<<set _leftaction["Strike the"] to "lefthittentacle">>
			<<if $angel gte 4 and $angelBanish gte 1 and !$banishDisable>>
				<<set _leftaction["($angelBanish / $angelBanishMax) Banish the"] to "leftbanish">>
			<</if>>
		<</if>>
		<<set _leftaction["Grab the"] to "leftgrabtentacle">>
	<</if>>
<<case "grappled">>
	<<if $angel gte 4 and $angelBanish gte 1 and !$banishDisable>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i].shaft is "leftarm">>
				<<set _leftaction["($angelBanish / $angelBanishMax) Banish the"] to "leftbanish">>
				<<break>>
			<</if>>
		<</for>>
	<</if>>
<<case "bound">>
<<case "tentacle">>
	<<set _leftaction["Milk it"] to "leftrub"+_tentacleLeftOption>>
	<<set _leftaction["Let go"] to "leftstop"+_tentacleLeftOption>>
	<<if $deviancy gte 75>>
		<<if $player.penisExist and $penisuse is 0 and $nopenile is 0>>
			<<set _leftaction["Guide to your penis"] to "showpenis"+_tentacleLeftOption>>
		<</if>>
		<<if $player.vaginaExist and $vaginause is 0 and $novaginal is 0>>
			<<set _leftaction["Guide to your pussy"] to "showvagina"+_tentacleLeftOption>>
		<</if>>
		<<if $anususe is 0 and $analdisable is "f" and $noanal is 0>>
			<<set _leftaction["Guide to your ass"] to "showbottom"+_tentacleLeftOption>>
		<</if>>
		/* Old Control
		<<if ($player.vaginaExist and $vaginause is 0) or ($player.penisExist and $penisuse is 0)>>
			<<set _leftaction["Guide to your thighs"] to "showthighs"+_tentacleLeftOption>>
		<</if>>*/
		<<if $mouthuse is 0>>
			<<set _leftaction["Guide to your mouth"] to "showmouth"+_tentacleLeftOption>>
		<</if>>
	<</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 "rightActionInitTentacle">>
<<set $righttarget to "tentacles">>
<<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 _targetnumber is 1>>
			<<set $righttarget to _firsttarget>>
		<</if>>
	<</if>>
<<case "tentgrappled">>
	<<if $orgasmdown gte 1>>
		<<set _rightOptions to "bound">>
		Your right arm jerks against the grip.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _rightOptions to "bound">>
		Your right arm is held in a painful grip.
	<<elseif $dissociation gte 2>>
		<<set _rightOptions to "bound">>
		Your right arm lies limp in the grip.
	<<else>>
		<<set _rightOptions to "grappled">>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i].shaft is "rightarm">>
				The $tentacles[_i].fullDesc entangles your right arm.
				<<set $_tentgrab to 1>>
				<<if $angel gte 4 and $angelBanish gte 1 and !$banishDisable>>
					<<set _banishTarget to $tentacles[_i]>>
				<</if>>
				<<break>>
			<</if>>
		<</for>>
		<<if !$_tentgrab>>
			Your right arm is being held down.
		<</if>>
	<</if>>
<<case "bound">>
	<<set _rightOptions to "bound">>
	<<if $orgasmdown gte 1>>
		Your right arm jerks against its bonds.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		Your right arm is held in a painful bind.
	<<elseif $dissociation gte 2>>
		Your right arm lies limp in its bonds.
	<<else>>
		Your right arm is bound.
	<</if>>
<<case "grappled" "penis" "othervagina" "vagina" "coverpenis" "anus" "behind">>
	<<set $_changetype to true>><<rightActionInit>>
<<case "trapped">>
	<<set $_changetype to true>><<rightActionInitVore>>
<<case "struggle">>
	<<set $_changetype to true>><<rightActionInitStruggle>>
<<case "swarmgrappled">>
	<<set $_changetype to true>><<rightActionInitSwarm>>
<<case "mechgrappled">>
	<<set $_changetype to true>><<rightActionInitMachine>>
<<default>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<if $rightarm is $tentacles[_i].id>>
			<<set _rightOptions to "tentacle">>
			<<set _tentaclerightOption to $tentacles[_i].id>>
			You hold the $tentacles[_i].fullDesc in your right hand.
			<<break>>
		<</if>>
	<</for>>
<</switch>>
<<if $_changetype isnot true>>
	<<rightActionsTentacle>>
	<<if Object.keys(_rightaction).length gt 0>>
		<<if Object.values(_rightaction).includes($rightactiondefault) is false or $args[0] is true or ["rest","rightgrabtentacle"].includes($rightactiondefault)>>
			<<set _defaultsCombatAction to "rightaction">>
			<<set _actionsSet = DefaultActions.get($defaultsCombatType, "Tentacles", _defaultsCombatAction)>>
			<<set _pass to false>>
			<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
				<<if ["rightgrabtentacle"].includes(_actionsSet[_set]) and $rightactionTarget isnot undefined>>
					<<for _i to 0; _i lt $tentacles.max; _i++>>
						<<if $tentacles[_i].shaft isnot "finished">>
							<<if $regrab and $tentacles[_i].head is 0>>
								<<set $rightactiondefault to clone(_actionsSet[_set])>>
								<<set $rightactionTarget to $tentacles[_i].id>>
								<<set _pass to true>>
								<<break>>
							<<elseif $tentacles[_i].head is 0>>
								<<set $rightactiondefault to clone(_actionsSet[_set])>>
								<<set _pass to true>>
							<</if>>
							<<if $regrab is false>>
								<<break>>
							<</if>>
						<</if>>
					<</for>>
				<<elseif ["rightrub","showpenis","showvagina","showbottom"].includes(_actionsSet[_set]) and _tentaclerightOption isnot undefined>>
					<<if Object.values(_rightaction).includes(_actionsSet[_set] + _tentaclerightOption)>>
						<<set $rightactiondefault to clone(_actionsSet[_set] + _tentaclerightOption)>>
						<<set _pass to true>>
						<<break>>
					<</if>>
				<<elseif Object.values(_rightaction).includes(_actionsSet[_set])>>
					<<set $rightactiondefault to clone(_actionsSet[_set])>>
					<<set _pass to true>>
					<<break>>
				<</if>>
			<</for>>
			<<if _pass is false>>
				<<set $rightactiondefault to Object.values(_rightaction)[0]>>
			<</if>>
		<</if>>
		<<set $rightaction to $rightactiondefault>>
		<<set _textColor to combatListColor('rightaction', (Object.values(_rightaction).includes($rightaction) ? $rightaction : Object.values(_rightaction)[0]), "Tentacle")>>

			<<if $combatControls isnot "radio" and _rightOptions is "free">>
				<<set _reducedWidths to true>>
			<<else>>
				<<set _reducedWidths to false>>
			<</if>>
			<<generateCombatActionTentacle _rightaction "rightaction" _textColor $rightaction _reducedWidths>>
			<<if _rightOptions is "free" and $tentacles.active gt 0>>
				<<rightactionSetupTentacle>>
			<<elseif _rightOptions is "grappled" and $angel gte 4 and $angelBanish gte 1 and !$banishDisable and _banishTarget>>
				<<rightactionBoundBanish>>
			<</if>>

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

				<<rightactionDifficultyTentacle>>

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

<<widget "rightactionSetupTentacle">>
<<if $combatControls is "radio">>

	<<set _first to true>>
	<<if $regrab>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i] isnot undefined>>
				<<if $tentacles[_i].shaft isnot "finished" and $tentacles[_i].id is $rightactionTarget>>
					<<set _first to false>>
					<<set $_found to $tentacles[_i].id>>
					<<break>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<if $tentacles[_i] isnot undefined>>
			<<if $tentacles[_i].shaft isnot "finished">>

					<<print '<<radiobutton "$rightactionTarget" "'+$tentacles[_i].id+'" ' + (_first is true or $tentacles[_i].id is $_found ? "checked" : "") + '>>'>>
					$tentacles[_i].fullDesc
				 |
				<<set _first to false>>
			<</if>>
		<</if>>
	<</for>>
<<else>>
	<<if _availableTargets is undefined>>
		<<if $controls is "radio">>

		<</if>>
		<<set _availableTargets to {}>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i] isnot undefined>>
				<<if $tentacles[_i].shaft isnot "finished">>
					<<set _availableTargets[$tentacles[_i].fullDesc] to $tentacles[_i].id>>
					<<set _tentacle_targets_available to true>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<if _tentacle_targets_available>>

			<<listbox "$rightactionTarget" autoselect>>
				<<optionsfrom _availableTargets>>
			<</listbox>>

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

<<widget "rightactionBoundBanish">>
<<if $combatControls is "radio">>

		<<print '<<radiobutton "$rightactionTarget" "'+_banishTarget.id+'">>'>>
		$tentacles[_i].fullDesc
	 |
<<else>>
	<<set _availableTargets to {}>>
	<<set _availableTargets[_banishTarget.fullDesc] to _banishTarget.id>>

		<<listbox "$rightactionTarget" autoselect>>
			<<optionsfrom _availableTargets>>
		<</listbox>>

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

<<widget "rightactionDifficultyTentacle">>
<<if $args[0] is undefined>>
	<<set _diffAction to $rightaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>
	<<case "showbottomtentacle" "showthighstentacle" "showmouthtentacle" "showpenistentacle" "showvaginatentacle">><<deviant5>>
<</switch>>
<</widget>>

<<widget "rightActionsTentacle">>
/*Generate Actions*/
<<set _rightaction to {}>>
<<if !(["orgasm", "pain", "unreal"].includes(_rightOptions))>>
	<<set _rightaction["Rest"] to "rest">>
<</if>>
<<switch _rightOptions>>
<<case "free">>
	<<if $tentacles.active gt 0>>
		<<if $consensual is 0>>
			<<set _rightaction["Strike the"] to "righthittentacle">>
			<<if $angel gte 4 and $angelBanish gte 1 and !$banishDisable>>
				<<set _rightaction["($angelBanish / $angelBanishMax) Banish the"] to "rightbanish">>
			<</if>>
		<</if>>
		<<set _rightaction["Grab the"] to "rightgrabtentacle">>
	<</if>>
<<case "grappled">>
	<<if $angel gte 4 and $angelBanish gte 1 and !$banishDisable>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i].shaft is "rightarm">>
				<<set _rightaction["($angelBanish / $angelBanishMax) Banish the"] to "rightbanish">>
				<<break>>
			<</if>>
		<</for>>
	<</if>>
<<case "bound">>
<<case "tentacle">>
	<<set _rightaction["Milk it"] to "rightrub"+_tentaclerightOption>>
	<<set _rightaction["Let go"] to "rightstop"+_tentaclerightOption>>
	<<if $deviancy gte 75>>
		<<if $player.penisExist and $penisuse is 0>>
			<<set _rightaction["Guide to your penis"] to "showpenis"+_tentaclerightOption>>
		<</if>>
		<<if $player.vaginaExist and $vaginause is 0>>
			<<set _rightaction["Guide to your pussy"] to "showvagina"+_tentaclerightOption>>
		<</if>>
		<<if $anususe is 0 and $analdisable is "f">>
			<<set _rightaction["Guide to your ass"] to "showbottom"+_tentaclerightOption>>
		<</if>>
		/* Old controls
		<<if ($player.vaginaExist and $vaginause is 0) or ($player.penisExist and $penisuse is 0)>>
			<<set _rightaction["Guide to your thighs"] to "showthighs"+_tentaclerightOption>>
		<</if>>*/
		<<if $mouthuse is 0>>
			<<set _rightaction["Guide to your mouth"] to "showmouth"+_tentaclerightOption>>
		<</if>>
	<</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 "feetActionInitTentacle">>
<<set $feettarget to "tentacles">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<switch $feetuse>>
	<<case "penis" "othervagina" "bound" "walk" "run" "none">>
		<<set $_changetype to true>><<feetActionInit>>
	<<case "mechgrappled">>
		<<set $_changetype to true>><<feetActionInitMachine>>
	<<default>>
		<<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"))>>
				Target:
				<<listbox "$feettarget" autoselect>>
					<<optionsfrom _targetlistall>>
				<</listbox>>

			<</if>>
		<</if>>
		<<if $leftleg is 0 and $rightleg is 0>>
			<<set _feetOptions to "free">>
			Your legs 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 _feetOptions to "grappled">>
			Your legs are entangled and forced apart, leaving you less able to protect your <<genitals>>.
		<<elseif $leftleg is "bound" and $rightleg is "bound">>
			<<set _feetOptions to "bound">>
			Your legs are bound and forced apart, leaving you less able to protect your <<genitals>>.
		<<else>>
			<<for _i to 0; _i lt $tentacles.max; _i++>>
				<<if $leftleg is $tentacles[_i].id>>
					<<set _feetOptions to "tentacle">>
					<<set _tentacleFeetOption to $tentacles[_i].id>>
					You hold the $tentacles[_i].fullDesc between your feet.
					<<break>>
				<</if>>
			<</for>>
		<</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>>
	<</switch>>
	<<if $_changetype isnot true>>
		<<feetActionsTentacle>>
		<<if Object.keys(_feetaction).length gt 0>>
			<<if Object.values(_feetaction).includes($feetactiondefault) is false or $args[0] is true or ["rest","feetgrab"].includes($feetactiondefault)>>
				<<set _defaultsCombatAction to "feetaction">>
				<<set _actionsSet = DefaultActions.get($defaultsCombatType, "Tentacles", _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if ["feetgrab"].includes(_actionsSet[_set]) and $feetactionTarget isnot undefined>>
						<<for _i to 0; _i lt $tentacles.max; _i++>>
							<<if $tentacles[_i].shaft isnot "finished">>
								<<if $regrab and $tentacles[_i].head is 0>>
									<<set $feetactiondefault to clone(_actionsSet[_set])>>
									<<set $feetactionTarget to $tentacles[_i].id>>
									<<set _pass to true>>
									<<break>>
								<<elseif $tentacles[_i].head is 0>>
									<<set $feetactiondefault to clone(_actionsSet[_set])>>
									<<set _pass to true>>
								<</if>>
								<<if $regrab is false>>
									<<break>>
								<</if>>
							<</if>>
						<</for>>
					<<elseif ["feetrub","showpenis","showvagina","showbottom"].includes(_actionsSet[_set]) and _tentacleFeetOption isnot undefined>>
						<<if Object.values(_feetaction).includes(_actionsSet[_set] + _tentacleFeetOption)>>
							<<set $feetactiondefault to clone(_actionsSet[_set] + _tentacleFeetOption)>>
							<<set _pass to true>>
							<<break>>
						<</if>>
					<<elseif Object.values(_feetaction).includes(_actionsSet[_set])>>
						<<set $feetactiondefault to clone(_actionsSet[_set])>>
						<<set _pass to true>>
						<<break>>
					<</if>>
				<</for>>
				<<if _pass is false>>
					<<set $feetactiondefault to Object.values(_feetaction)[0]>>
				<</if>>
			<</if>>
			<<set $feetaction to $feetactiondefault>>
			<<set _textColor to combatListColor('feetaction', (Object.values(_feetaction).includes($feetaction) ? $feetaction : Object.values(_feetaction)[0]), "Tentacle")>>

				<<set _availableContext to ["free","leftFree","rightFree"]>>
				<<if $combatControls isnot "radio" and _availableContext.includes(_feetOptions)>>
					<<set _reducedWidths to true>>
				<<else>>
					<<set _reducedWidths to false>>
				<</if>>
				<<generateCombatActionTentacle _feetaction "feetaction" _textColor $feetaction _reducedWidths>>
				<<if _availableContext.includes(_feetOptions) and $tentacles.active gt 0>>
					<<feetactionSetupTentacle>>
				<</if>>

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

					<<feetactionDifficultyTentacle>>

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

<<widget "feetactionSetupTentacle">>
<<if $combatControls is "radio">>

	<<set _first to true>>
	<<if $regrab>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i] isnot undefined>>
				<<if $tentacles[_i].shaft isnot "finished" and $tentacles[_i].id is $feetactionTarget>>
					<<set _first to false>>
					<<set $_found to $tentacles[_i].id>>
					<<break>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<if $tentacles[_i] isnot undefined>>
			<<if $tentacles[_i].shaft isnot "finished">>

					<<print '<<radiobutton "$feetactionTarget" "'+$tentacles[_i].id+'" ' + (_first is true or $tentacles[_i].id is $_found ? "checked" : "") + '>>'>>
					$tentacles[_i].fullDesc
				 |
				<<set _first to false>>
			<</if>>
		<</if>>
	<</for>>
<<else>>
	<<if _availableTargets is undefined>>
		<<if $controls is "radio">>

		<</if>>
		<<set _availableTargets to {}>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<if $tentacles[_i] isnot undefined>>
				<<if $tentacles[_i].shaft isnot "finished">>
					<<set _availableTargets[$tentacles[_i].fullDesc] to $tentacles[_i].id>>
					<<set _tentacle_targets_available to true>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>
	<<if _tentacle_targets_available>>

			<<listbox "$feetactionTarget" autoselect>>
				<<optionsfrom _availableTargets>>
			<</listbox>>

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

<<widget "feetactionDifficultyTentacle">>
<<if $args[0] is undefined>>
	<<set _diffAction to $feetaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>
	<<case "showbottomtentacle" "showthighstentacle" "showpenistentacle" "showvaginatentacle">><<deviant5>>
<</switch>>
<</widget>>

<<widget "feetActionsTentacle">>
/*Generate Actions*/
<<set _feetaction to {}>>
<<set _feetaction["Rest"] to "rest">>
<<switch _feetOptions>>
<<case "free">>
	<<if $tentacles.active gt 0>>
		<<if $consensual is 0>>
			<<set _feetaction["Kick the"] to "feethit">>
		<</if>>
		<<set _feetaction["Grab the"] to "feetgrab">>
	<</if>>
<<case "leftFree" "rightFree">>
	<<if $tentacles.active gt 0>>
		<<if $consensual is 0>>
			<<set _feetaction["Kick the"] to "feethit">>
		<</if>>
	<</if>>
<<case "tentacle">>
	<<set _feetaction["Milk it"] to "feetrub"+_tentacleFeetOption>>
	<<set _feetaction["Let go"] to "feetstop"+_tentacleFeetOption>>
	<<if $deviancy gte 75>>
		<<if $player.penisExist and $penisuse is 0>>
			<<set _feetaction["Guide to your penis"] to "showpenis"+_tentacleFeetOption>>
		<</if>>
		<<if $player.vaginaExist and $vaginause is 0>>
			<<set _feetaction["Guide to your pussy"] to "showvagina"+_tentacleFeetOption>>
		<</if>>
		<<if $anususe is 0 and $analdisable is "f">>
			<<set _feetaction["Guide to your ass"] to "showbottom"+_tentacleFeetOption>>
		<</if>>
		/* Old control
		<<if ($player.vaginaExist and $vaginause is 0) or ($player.penisExist and $penisuse is 0)>>
			<<set _feetaction["Guide to your thighs"] to "showthighs"+_tentacleFeetOption>>
		<</if>>*/
	<</if>>
<</switch>>
<</widget>>

<<widget "mouthActionInitTentacle">>
<<if $orgasmdown gte 1>>
	<<mouthActionInit>>
<<elseif $pain gte 100 and $willpowerpain is 0>>
	<<mouthActionInit>>
<<elseif $dissociation gte 2>>
	<<mouthActionInit>>
<<else>>
	<<set $mouthtarget to "tentacles">>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<switch $mouthstate>>
		<<case "tentacleentrance">>
			<<if $tentacles[_i].head is "mouthentrance">>
				<<set _mouthOptions to "entrance">>
				<<set _tentacleMouthOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc threatens your mouth.
				<<break>>
			<</if>>
		<<case "tentacleimminent">>
			<<if $tentacles[_i].head is "mouthimminent">>
				<<set _mouthOptions to "imminent">>
				<<set _tentacleMouthOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc presses against your mouth.
				<<break>>
			<</if>>
		<<case "tentacle">>
			<<if $tentacles[_i].head is "mouth">>
				<<set _mouthOptions to "penetrated">>
				<<set _tentacleMouthOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc thrusts into your mouth.
				<<break>>
			<</if>>
		<<case "tentacledeep">>
			<<if $tentacles[_i].head is "mouthdeep">>
				<<set _mouthOptions to "penetrated">>
				<<set _tentacleMouthOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc thrusts into your mouth, ejaculating down your throat.
				<<break>>
			<</if>>
		<<case "struggle" "struggle_pen">>
			<<set $_changetype to true>><<mouthActionInitStruggle>>
			<<break>>
		<<default>>
			<<set $_changetype to true>><<mouthActionInit>>
			<<break>>
		<</switch>>
	<</for>>
	<<if $_changetype isnot true>>
		<<mouthActionsTentacle>>
		<<if Object.keys(_mouthaction).length gt 0>>
			<<if Object.values(_mouthaction).includes($mouthactiondefault) is false or $args[0] is true or $mouthactiondefault is "rest">>
				<<set _defaultsCombatAction to "mouthaction">>
				<<set _actionsSet = DefaultActions.get($defaultsCombatType, "Tentacles", _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if ["mouthlick","mouthpullaway","mouthkiss","mouthcooperate","mouthbite"].includes(_actionsSet[_set]) and _tentacleMouthOption isnot undefined>>
						<<if Object.values(_mouthaction).includes(_actionsSet[_set] + _tentacleMouthOption)>>
							<<set $mouthactiondefault to clone(_actionsSet[_set] + _tentacleMouthOption)>>
							<<set _pass to true>>
							<<break>>
						<</if>>
					<<elseif Object.values(_mouthaction).includes(_actionsSet[_set])>>
						<<set $mouthactiondefault to clone(_actionsSet[_set])>>
						<<set _pass to true>>
						<<break>>
					<</if>>
				<</for>>
				<<if _pass is false>>
					<<set $mouthactiondefault to Object.values(_mouthaction)[0]>>
				<</if>>
			<</if>>
			<<set $mouthaction to $mouthactiondefault>>
			<<set _textColor to combatListColor('mouthaction', (Object.values(_mouthaction).includes($mouthaction) ? $mouthaction : Object.values(_mouthaction)[0]), "Tentacle")>>

				<<generateCombatActionTentacle _mouthaction "mouthaction" _textColor $mouthaction>>

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

					<<mouthactionDifficultyTentacle>>

			<</if>>
		<</if>>
		<<set $lastOptions.mouth to clone(_mouthOptions)>>
	<</if>>
<</if>>
<</widget>>

<<widget "mouthactionDifficultyTentacle">>
/*
<<if $args[0] is undefined>>
	<<set _diffAction to $mouthaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>

<</switch>>
*/
<</widget>>

<<widget "mouthActionsTentacle">>
/*Generate Actions*/
<<set _mouthaction to {}>>
<<switch _mouthOptions>>
	<<case "entrance">>
		<<set _mouthaction["Rest"] to "rest">>
		<<set _mouthaction["Lick it"] to "mouthlick"+_tentacleMouthOption>>
		<<if $head isnot "grappled">>
			<<set _mouthaction["Pull away"] to "mouthpullaway"+_tentacleMouthOption>>
		<</if>>
	<<case "imminent">>
		<<set _mouthaction["Rest"] to "rest">>
		<<set _mouthaction["Kiss it"] to "mouthkiss"+_tentacleMouthOption>>
		<<if $head isnot "grappled">>
			<<set _mouthaction["Pull away"] to "mouthpullaway"+_tentacleMouthOption>>
		<</if>>
	<<case "penetrated">>
		<<set _mouthaction["Take it"] to "take">>
		<<set _mouthaction["Cooperate"] to "mouthcooperate"+_tentacleMouthOption>>
		<<if $consensual is 0>>
			<<set _mouthaction["Bite"] to "mouthbite"+_tentacleMouthOption>>
		<</if>>
<</switch>>
<</widget>>

<<widget "penisActionInitTentacle">>
<<set $penistarget to "tentacles">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<switch $penisstate>>
		<<case "tentacleentrance">>
			<<if $tentacles[_i].head is "penisentrance">>
				<<set _penisOptions to "entrance">>
				<<set _tentaclepenisOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc threatens your <<penis>>.
				<<break>>
			<</if>>
		<<case "tentacleimminent">>
			<<if $tentacles[_i].head is "penisimminent">>
				<<set _penisOptions to "imminent">>
				<<set _tentaclepenisOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc presses against your <<penis>>, about to engulf.
				<<break>>
			<</if>>
		<<case "tentacle">>
			<<if $tentacles[_i].head is "penis">>
				<<set _penisOptions to "penetrated">>
				<<set _tentaclepenisOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc envelops and pounds your <<penis>>.
				<<break>>
			<</if>>
		<<case "tentacledeep">>
			<<if $tentacles[_i].head is "penisdeep">>
				<<set _penisOptions to "penetrated">>
				<<set _tentaclepenisOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc envelops and pounds your <<penis>>.
				<<break>>
			<</if>>
		<<case "tentaclerub">>
			<<if $tentacles[_i].head is "penisrub">>
				<<set _penisOptions to "penisrub">>
				<<set _tentaclepenisOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc runs between your thighs, coiling around your <<penis>> and pressing against your tummy.
				<<break>>
			<</if>>
		<<case "struggle" "struggle_pen">>
			<<set $_changetype to true>><<penisActionInitStruggle>>
			<<break>>
		<<default>>
			<<set $_changetype to true>><<penisActionInit>>
			<<break>>
		<</switch>>
	<</for>>
	<<if $_changetype isnot true>>
		<<penisActionsTentacle>>
		<<if Object.keys(_penisaction).length gt 0>>
			<<if Object.values(_penisaction).includes($penisactiondefault) is false or $args[0] is true or $penisactiondefault is "rest">>
				<<set _defaultsCombatAction to "penisaction">>
				<<set _actionsSet = DefaultActions.get($defaultsCombatType, "Tentacles", _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if ["penisrub","penispullaway","peniscooperate"].includes(_actionsSet[_set]) and _tentaclepenisOption isnot undefined>>
						<<if Object.values(_penisaction).includes(_actionsSet[_set] + _tentaclepenisOption)>>
							<<set $penisactiondefault to clone(_actionsSet[_set] + _tentaclepenisOption)>>
							<<set _pass to true>>
							<<break>>
						<</if>>
					<<elseif Object.values(_penisaction).includes(_actionsSet[_set])>>
						<<set $penisactiondefault to clone(_actionsSet[_set])>>
						<<set _pass to true>>
						<<break>>
					<</if>>
				<</for>>
				<<if _pass is false>>
					<<set $penisactiondefault to Object.values(_penisaction)[0]>>
				<</if>>
			<</if>>
			<<set $penisaction to $penisactiondefault>>
			<<set _textColor to combatListColor('penisaction', (Object.values(_penisaction).includes($penisaction) ? $penisaction : Object.values(_penisaction)[0]), "Tentacle")>>

				<<generateCombatActionTentacle _penisaction "penisaction" _textColor $penisaction>>

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

					<<penisactionDifficultyTentacle>>

			<</if>>
		<</if>>
		<<set $lastOptions.penis to clone(_penisOptions)>>
	<</if>>
<<else>>
	<<timed 100ms>>
		<<run jQuery("#penisaction").remove();>>
	<</timed>>
<</if>>
<</widget>>

<<widget "penisactionDifficultyTentacle">>
/*
<<if $args[0] is undefined>>
	<<set _diffAction to $penisaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>

<</switch>>
*/
<</widget>>

<<widget "penisActionsTentacle">>
/*Generate Actions*/
<<set _penisaction to {}>>
<<switch _penisOptions>>
	<<case "entrance" "imminent">>
		<<set _penisaction["Rest"] to "rest">>
		<<set _penisaction["Rub"] to "penisrub"+_tentaclepenisOption>>
		<<if $leftleg isnot "grappled" or $rightleg isnot "grappled">>
			<<set _penisaction["Pull away"] to "penispullaway"+_tentaclepenisOption>>
		<</if>>
	<<case "penetrated">>
		<<set _penisaction["Take it"] to "take">>
		<<set _penisaction["Cooperate"] to "peniscooperate"+_tentaclepenisOption>>
	<<case "penisrub">>
		<<set _penisaction["Rest"] to "rest">>
		<<set _penisaction["Rub"] to "penisrub"+_tentaclepenisOption>>
<</switch>>
<</widget>>

<<widget "vaginaActionInitTentacle">>
<<set $vaginatarget to "tentacles">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<switch $vaginastate>>
		<<case "tentacleentrance">>
			<<if $tentacles[_i].head is "vaginaentrance">>
				<<set _vaginaOptions to "entrance">>
				<<set _tentaclevaginaOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc threatens your <<pussy>>.
				<<break>>
			<</if>>
		<<case "tentacleimminent">>
			<<if $tentacles[_i].head is "vaginaimminent">>
				<<set _vaginaOptions to "imminent">>
				<<set _tentaclevaginaOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc presses against your <<pussy>>, about to penetrate.
				<<break>>
			<</if>>
		<<case "tentacle">>
			<<if $tentacles[_i].head is "vagina">>
				<<set _vaginaOptions to "penetrated">>
				<<set _tentaclevaginaOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc thrusts into your <<pussy>>.
				<<break>>
			<</if>>
		<<case "tentacledeep">>
			<<if $tentacles[_i].head is "vaginadeep">>
				<<set _vaginaOptions to "penetrated">>
				<<set _tentaclevaginaOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc thrusts into your <<pussy>>, ejaculating deep into your womb.
				<<break>>
			<</if>>
		<<case "tentaclerub">>
			<<if $tentacles[_i].head is "tentaclerub">>
				<<set _vaginaOptions to "vaginarub">>
				<<set _tentaclevaginaOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc runs between your thighs, pressing against your labia and continuing to your tummy.
				<<break>>
			<</if>>
		<<case "struggle" "struggle_pen">>
			<<set $_changetype to true>><<vaginaActionInitStruggle>>
			<<break>>
		<<default>>
			<<set $_changetype to true>><<vaginaActionInit>>
			<<break>>
		<</switch>>
	<</for>>
	<<if $_changetype isnot true>>
		<<vaginaActionsTentacle>>
		<<if Object.keys(_vaginaaction).length gt 0>>
			<<if Object.values(_vaginaaction).includes($vaginaactiondefault) is false or $args[0] is true or $vaginaactiondefault is "rest">>
				<<set _defaultsCombatAction to "vaginaaction">>
				<<set _actionsSet = DefaultActions.get($defaultsCombatType, "Tentacles", _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if ["vaginarub","vaginapullaway","vaginacooperate"].includes(_actionsSet[_set]) and _tentaclevaginaOption isnot undefined>>
						<<if Object.values(_vaginaaction).includes(_actionsSet[_set] + _tentaclevaginaOption)>>
							<<set $vaginaactiondefault to clone(_actionsSet[_set] + _tentaclevaginaOption)>>
							<<set _pass to true>>
							<<break>>
						<</if>>
					<<elseif Object.values(_vaginaaction).includes(_actionsSet[_set])>>
						<<set $vaginaactiondefault to clone(_actionsSet[_set])>>
						<<set _pass to true>>
						<<break>>
					<</if>>
				<</for>>
				<<if _pass is false>>
					<<set $vaginaactiondefault to Object.values(_vaginaaction)[0]>>
				<</if>>
			<</if>>
			<<set $vaginaaction to $vaginaactiondefault>>
			<<set _textColor to combatListColor('vaginaaction', (Object.values(_vaginaaction).includes($vaginaaction) ? $vaginaaction : Object.values(_vaginaaction)[0]), "Tentacle")>>

				<<generateCombatActionTentacle _vaginaaction "vaginaaction" _textColor $vaginaaction>>

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

					<<vaginaactionDifficultyTentacle>>

			<</if>>
		<</if>>
		<<set $lastOptions.vagina to clone(_vaginaOptions)>>
	<</if>>
<<else>>
	<<timed 100ms>>
		<<run jQuery("#vaginaaction").remove();>>
	<</timed>>
<</if>>
<</widget>>

<<widget "vaginaactionDifficultyTentacle">>
/*
<<if $args[0] is undefined>>
	<<set _diffAction to $vaginaaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>

<</switch>>
*/
<</widget>>

<<widget "vaginaActionsTentacle">>
/*Generate Actions*/
<<set _vaginaaction to {}>>
<<switch _vaginaOptions>>
	<<case "entrance" "imminent">>
		<<set _vaginaaction["Rest"] to "rest">>
		<<set _vaginaaction["Rub"] to "vaginarub"+_tentaclevaginaOption>>
		<<if $leftleg isnot "grappled" or $rightleg isnot "grappled">>
			<<set _vaginaaction["Pull away"] to "vaginapullaway"+_tentaclevaginaOption>>
		<</if>>
	<<case "penetrated">>
		<<set _vaginaaction["Take it"] to "take">>
		<<set _vaginaaction["Cooperate"] to "vaginacooperate"+_tentaclevaginaOption>>
	<<case "vaginarub">>
		<<set _vaginaaction["Rest"] to "rest">>
		<<set _vaginaaction["Rub"] to "vaginarub"+_tentaclevaginaOption>>
<</switch>>
<</widget>>

<<widget "anusActionInitTentacle">>
<<set $anustarget to "tentacles">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<if $bottomuse is "mouth" or $bottomuse is "penis">>
		<<set $_changetype to true>><<anusActionInit>>
	<<else>>
		<<for _i to 0; _i lt $tentacles.max; _i++>>
			<<switch $anusstate>>
			<<case "tentacleentrance">>
				<<if $tentacles[_i].head is "anusentrance">>
					<<set _anusOptions to "entrance">>
					<<set _tentacleanusOption to $tentacles[_i].id>>
					The $tentacles[_i].fullDesc threatens your <<bottom>>.
					<<break>>
				<</if>>
			<<case "tentacleimminent">>
				<<if $tentacles[_i].head is "anusimminent">>
					<<set _anusOptions to "imminent">>
					<<set _tentacleanusOption to $tentacles[_i].id>>
					The $tentacles[_i].fullDesc presses against your <<bottom>>, about to penetrate.
					<<break>>
				<</if>>
			<<case "tentacle">>
				<<if $tentacles[_i].head is "anus">>
					<<set _anusOptions to "penetrated">>
					<<set _tentacleanusOption to $tentacles[_i].id>>
					The $tentacles[_i].fullDesc thrusts into your <<bottom>>.
					<<break>>
				<</if>>
			<<case "tentacledeep">>
				<<if $tentacles[_i].head is "anusdeep">>
					<<set _anusOptions to "penetrated">>
					<<set _tentacleanusOption to $tentacles[_i].id>>
					The $tentacles[_i].fullDesc thrusts into your <<bottom>>, ejaculating deep into your bowels.
					<<break>>
				<</if>>
			<<case "tentaclerub">>
				<<if $tentacles[_i].head is "anusrub">>
					<<set _anusOptions to "anusrub">>
					<<set _tentacleanusOption to $tentacles[_i].id>>
					The $tentacles[_i].fullDesc rubs itself between your butt cheeks.
					<<break>>
				<</if>>
			<<case "struggle" "struggle_pen">>
				<<set $_changetype to true>><<anusActionInitStruggle>>
				<<break>>
			<<default>>
				<<set $_changetype to true>><<anusActionInit>>
				<<break>>
			<</switch>>
		<</for>>
	<</if>>
	<<if $_changetype isnot true>>
		<<anusActionsTentacle>>
		<<if Object.keys(_anusaction).length gt 0>>
			<<if Object.values(_anusaction).includes($anusactiondefault) is false or $args[0] is true or $anusactiondefault is "rest">>
				<<set _defaultsCombatAction to "anusaction">>
				<<set _actionsSet = DefaultActions.get($defaultsCombatType, "Tentacles", _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if ["anusrub","anuspullaway","anuscooperate"].includes(_actionsSet[_set]) and _tentacleanusOption isnot undefined>>
						<<if Object.values(_anusaction).includes(_actionsSet[_set] + _tentacleanusOption)>>
							<<set $anusactiondefault to clone(_actionsSet[_set] + _tentacleanusOption)>>
							<<set _pass to true>>
							<<break>>
						<</if>>
					<<elseif Object.values(_anusaction).includes(_actionsSet[_set])>>
						<<set $anusactiondefault to clone(_actionsSet[_set])>>
						<<set _pass to true>>
						<<break>>
					<</if>>
				<</for>>
				<<if _pass is false>>
					<<set $anusactiondefault to Object.values(_anusaction)[0]>>
				<</if>>
			<</if>>
			<<set $anusaction to $anusactiondefault>>
			<<set _textColor to combatListColor('anusaction', (Object.values(_anusaction).includes($anusaction) ? $anusaction : Object.values(_anusaction)[0]), "Tentacle")>>

				<<generateCombatActionTentacle _anusaction "anusaction" _textColor $anusaction>>

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

					<<anusactionDifficultyTentacle>>

			<</if>>
		<</if>>
		<<set $lastOptions.anus to clone(_anusOptions)>>
	<</if>>
<<else>>
	<<timed 100ms>>
		<<run jQuery("#vaginaaction").remove();>>
	<</timed>>
<</if>>
<</widget>>

<<widget "anusactionDifficultyTentacle">>
/*
<<if $args[0] is undefined>>
	<<set _diffAction to $anusaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>

<</switch>>
*/
<</widget>>

<<widget "anusActionsTentacle">>
/*Generate Actions*/
<<set _anusaction to {}>>
<<switch _anusOptions>>
	<<case "entrance" "imminent">>
		<<set _anusaction["Rest"] to "rest">>
		<<set _anusaction["Rub"] to "anusrub"+_tentacleanusOption>>
		<<if $leftleg isnot "grappled" or $rightleg isnot "grappled">>
			<<set _anusaction["Pull away"] to "anuspullaway"+_tentacleanusOption>>
		<</if>>
	<<case "penetrated">>
		<<set _anusaction["Take it"] to "take">>
		<<set _anusaction["Cooperate"] to "anuscooperate"+_tentacleanusOption>>
	<<case "anusrub">>
		<<set _anusaction["Rest"] to "rest">>
		<<set _anusaction["Rub"] to "anusrub"+_tentacleanusOption>>
<</switch>>
<</widget>>

<<widget "chestActionInitTentacle">>
<<set $chesttarget to "tentacles">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<for _i to 0; _i lt $tentacles.max; _i++>>
		<<switch $chestuse>>
		<<case "tentaclerub">>
			<<if $tentacles[_i].head is "chestrub">>
				<<set _chestOptions to "entrance">>
				<<set _tentaclechestOption to $tentacles[_i].id>>
				The $tentacles[_i].fullDesc rubs itself between your chest.
				<<break>>
			<</if>>
		<<case "penis">>
			<<set $_changetype to true>><<chestActionInit>>
			<<break>>
		<<case "struggle">>
		<</switch>>
	<</for>>
	<<if $_changetype isnot true>>
		<<chestActionsTentacle>>
		<<if Object.keys(_chestaction).length gt 0>>
			<<if $chestactiondefault is 0 or Object.values(_chestaction).includes($chestactiondefault) is false>>
				<<set $chestactiondefault to Object.values(_chestaction)[0]>>
			<</if>>
			<<set $chestaction to $chestactiondefault>>
			<<set _textColor to combatListColor('chestaction', (Object.values(_chestaction).includes($chestaction) ? $chestaction : Object.values(_chestaction)[0]), "Tentacle")>>

				<<generateCombatActionTentacle _chestaction "chestaction" _textColor $chestaction>>

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

					<<chestactionDifficultyTentacle>>

			<</if>>
		<</if>>
		<<set $lastOptions.chest to clone(_chestOptions)>>
	<</if>>
<<else>>
	<<timed 100ms>>
		<<run jQuery("#chestaction").remove();>>
	<</timed>>
<</if>>
<</widget>>

<<widget "chestactionDifficultyTentacle">>
/*
<<if $args[0] is undefined>>
	<<set _diffAction to $chestaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch (""+_diffAction).replace(/\d+/g,'')>>

<</switch>>
*/
<</widget>>

<<widget "chestActionsTentacle">>
/*Generate Actions*/
<<set _chestaction to {}>>
<<switch _chestOptions>>
	<<case "chestrub">>
		<<set _chestaction["Rest"] to "rest">>
		<<set _chestaction["Rub"] to "chestrub"+_tentaclechestOption>>
<</switch>>
<</widget>>

<<widget "actionsvorentacles">>
<<if $images is 1>>
	<<timed 100ms>>
	<<combatimg>>

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

<<combatstate>>
<<carryblock>>

<<if $trance lte 0 and $panicparalysis is 0 and $panicviolence is 0>>
	<<generateActionsVorentacles>>
<</if>>

<</widget>>

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

		<<if $lefttarget is "vore">>
			<<leftActionInitVore>>
		<<else>>
			<<leftActionInitTentacle>>
		<</if>>

		<<if $righttarget is "vore">>
			<<rightActionInitVore>>
		<<else>>
			<<rightActionInitTentacle>>
		<</if>>

		<<feetActionInitTentacle>>

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

			<<mouthActionInitTentacle>>

	<</if>>

	<<if $penisstate isnot 0 and $player.penisExist>>

			<<penisActionInitTentacle>>

	<</if>>

	<<if $vaginastate isnot 0 and $player.vaginaExist>>

			<<vaginaActionInitTentacle>>

	<</if>>

	<<if $anusstate isnot 0>>

			<<anusActionInitTentacle>>

	<</if>>

	<<if $chestuse isnot 0 and $chestuse isnot "squeezed">>

			<<chestActionInitTentacle>>

	<</if>>

<</widget>>


code:
:: Widgets Tentacles [widget]
<<widget "tentaclestart">>
<<if $abomination isnot 1>>
	<<set $enemyarousalmax to 10000>>
<</if>>

<<set $tentacles to {
	"max": $args[0],
	"active": $args[0],
}>>

<<if $args[0]>>

	<<if $args[2]>>
		<<set _tentacleType to $args[2]>>
	<<else>>
		<<set _tentacleType to "tentacle">>
	<</if>>
	<<if ["root","shoot"].includes(_tentacleType)>>
		<<set _babyType to "vine">>
	<<elseif _tentacleType is "tendril">>
		<<set _babyType to "tentacle">>
	<<elseif $args[3] is "swimmer's">>
		<<set _babyType to "swimmer">>
	<<elseif $args[3] is "crawler's">>
		<<set _babyType to "crawler">>
	<<elseif $args[3] is "fleshy">>
		<<set _babyType to 0>>
	<<else>>
		<<set _babyType to _tentacleType>>
	<</if>>
	<<if ["root","shoot","vine","metal"].includes(_tentacleType) or $args[3] is "metal">>
		<<set $banishDisable to true>>
	<</if>>

	/* Deciding if tentacle templates should be defined somewhere else still */
	/* Argument 0 is the number of tentacles.
	* Argument 1 is health.
	* Argument 2 is tentacle type, which can be replaced with "vines", "machines" etc later on. Optional, unless also using Argument 3.
	* Argument 3 is variant, and will give different offspring as well as allowing different batches of descriptions.
	* Argument 4 is whether or not the variant impacts the full description and offspring. If Argument 4 is used, Argument 3 will only impact which description batches are part of _tentacledescs. If Argument 4 is "desc", Argument 3 will impact description batches and variant, but not offspring.*/
	<<set _tentacledescs to [
		{"desc":"slimy","baby":0,"size":2},
		{"desc":"sticky","baby":0,"size":2},
		{"desc":"thick","baby":_babyType,"size":3},
		{"desc":"throbbing","baby":0,"size":2},
		{"desc":"slick","baby":0,"size":2},
		{"desc":"moist","baby":0,"size":2},
		{"desc":"quivering","baby":0,"size":2},
		{"desc":"sodden","baby":0,"size":2},
		{"desc":"shivering","baby":0,"size":2},
		{"desc":"shuddering","baby":0,"size":2},
		{"desc":"convulsing","baby":0,"size":2},
		{"desc":"undulating","baby":0,"size":2},
		{"desc":"damp","baby":0,"size":2},
		{"desc":"bulbous","baby":0,"size":3},
		{"desc":"gyrating","baby":0,"size":2},
		{"desc":"large","baby":_babyType,"size":3},
		{"desc":"bumpy","baby":0,"size":2},
		{"desc":"thin","baby":0,"size":1},
		{"desc":"narrow","baby":0,"size":1},
		{"desc":"squishy","baby":0,"size":2},
	]>>

	<<if $args[3]>>
		<<if $args[3] is "pale">>
			<<set _tentacledescs.push(
				{"desc":"ghostly","baby":_babyType,"size":2},
				{"desc":"translucent","baby":0,"size":1},
				{"desc":"twitching","baby":0,"size":2},
				{"desc":"manic","baby":0,"size":3},
				{"desc":"cloudy","baby":_babyType,"size":3},
				{"desc":"ethereal","baby":0,"size":1},
				{"desc":"incandescent","baby":0,"size":3},
				{"desc":"iridescent","baby":_babyType,"size":2},
			)>>
		<<elseif $args[3] is "vine">>
			<<set _tentacledescs.push(
				{"desc":"flowering","baby":_babyType,"size":3},
				{"desc":"blossoming","baby":0,"size":3},
				{"desc":"wooden","baby":0,"size":2},
				{"desc":"blooming","baby":_babyType,"size":2},
				{"desc":"climbing","baby":0,"size":2},
				{"desc":"mossy","baby":0,"size":2},
				{"desc":"grassy","baby":0,"size":2},
				{"desc":"pistil","baby":_babyType,"size":1},
				{"desc":"leafy","baby":0,"size":1},
				{"desc":"sprouting","baby":0,"size":1},
				{"desc":"sapling","baby":0,"size":1},
			)>>
		<<elseif $args[3] is "metal">>
			<<set _tentacledescs.push(
				{"desc":"jerking","baby":0,"size":3},
				{"desc":"plated","baby":0,"size":3},
				{"desc":"sparking","baby":0,"size":2},
				{"desc":"shiny","baby":0,"size":2},
				{"desc":"labelled","baby":_babyType,"size":2},
				{"desc":"jolting","baby":0,"size":2},
				{"desc":"rusted","baby":0,"size":2},
				{"desc":"wired","baby":0,"size":1},
				{"desc":"stainless","baby":0,"size":1},
			)>>
		<<elseif $args[3] is "fleshy">>
			<<set _tentacledescs.push(
				{"desc":"phallic","baby":0,"size":3},
				{"desc":"musuclar","baby":0,"size":3},
				{"desc":"meaty","baby":0,"size":3},
				{"desc":"boney","baby":0,"size":2},
				{"desc":"hairy","baby":0,"size":2},
				{"desc":"skin-covered","baby":0,"size":2},
				{"desc":"fibrous","baby":0,"size":1},
				{"desc":"sweaty","baby":0,"size":1},
				{"desc":"leathery","baby":0,"size":1},
				{"desc":"sinuous","baby":0,"size":1},
			)>>
		<</if>>
	<</if>>

	<<set _tentacledescs to _tentacledescs.shuffle()>>

	<<for _i to 0; _i lt $args[0]; _i++>>
		<<set _tentacledata to _tentacledescs[_i]>>

		<<set _tentacle to {
			"desc": ($args[3] and (!$args[4] or $args[4] is "desc") ? $args[3] + " " : "" ) + _tentacledata.desc,
			"fullDesc": ($args[3] and (!$args[4] or $args[4] is "desc") ? $args[3] + " " : "" ) + _tentacledata.desc +  " " + _tentacleType,
			"type": _tentacleType,
			"tentaclehealth": $args[1],
			"tentaclehealthstart": $args[1],
			"shaft": 0,
			"head": 0,
			"id": "tentacle"+_i,
			"baby": ($args[3] and (!$args[4] or $args[4] is "baby") and _tentacledata.baby isnot 0 ? $args[3] + " " + _tentacledata.baby : _tentacledata.baby ),
			"babychance": 400,
			"size": _tentacledata.size
		}>>

		<<set $tentacles[_i] to clone(_tentacle)>>
	<</for>>

<</if>>
<<set $combat to 1>>

<<if $rng gte 51>>
<<set $position to "missionary">>
<<else>>
<<set $position to "doggy">>
<</if>>
<<wetnessCalculate>>
<<resetLastOptions>>
<<getCombatDefaultsType>>

<<if !$tentacleColour>>
	<<if $tentacles[0].fullDesc.includes("pale")>>
		<<set $tentacleColour to "tentacles-wraith">>
	<<elseif $tentacles[0].fullDesc.includes("metal")>>
		<<set $tentacleColour to "tentacles-red">>
	<<elseif $tentacles[0].fullDesc.includes("swimmer")>>
		<<set $tentacleColour to "tentacles-blue">>
	<<elseif $tentacles[0].fullDesc.includes("crawler")>>
		<<set $tentacleColour to "tentacles-peach">>
	<<elseif $tentacles[0].type>>
		<<switch $tentacles[0].type>>
			<<case "vine" "shoot">>
				<<set $tentacleColour to "tentacles-vines">>
			<<case "root">>
				<<set $tentacleColour to "tentacles-roots">>
			<<default>>
				<<set $tentacleColour to "tentacles-purple">>
		<</switch>>
	<<else>>
		<<set $tentacleColour to "tentacles-purple">>
	<</if>>
<</if>>
<</widget>>

<<widget "tentacles">>

<<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>>
	<</if>>
<</for>>

<<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 "effectstentacles">>
<<effectspain>>
<<effectsorgasm>>
<<effectsdissociation>>

<<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 "actionstentacles">>

<<set $enemyarousal to $arousal>>
<<if $vorecreature is 0 and _swarmcreature is undefined>>
	<<if $images is 1>><<timed 100ms>>
		<<combatimg>>

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

<<combatstate>>
<<carryblock>>

<<if $trance lte 0 and $panicparalysis is 0 and $panicviolence is 0>>
	<<generateActionsTentacle>>
<</if>>

<</widget>>

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

<</widget>>

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

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

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

<<widget "upperslither">>
	<<if $worn.over_upper.name isnot "naked">>
		then <<slithers>> beneath your $worn.over_upper.name<<if $worn.upper.name isnot "naked">> and $worn.upper.name<</if>>
	<<elseif $worn.upper.name isnot "naked">>
		then <<slithers>> beneath your $worn.upper.name
	<<else>>
		then <<slithers>> across your bare skin
	<</if>>
<</widget>>

<<widget "lowerslither">>
	<<if $worn.over_lower.name isnot "naked">>
		then <<slithers>> beneath your $worn.over_lower.name<<if $worn.lower.name isnot "naked">> and $worn.lower.name<</if>>
	<<elseif $worn.lower.name isnot "naked">>
		then <<slithers>> beneath your $worn.lower.name
	<<else>>
		then <<slithers>> across your bare skin
	<</if>>
<</widget>>

<<widget "underslither">>
	<<if $worn.lower.name isnot "naked">>
		<<if !$worn.under_lower.type.includes("naked")>>
			then <<slithers>> beneath your $worn.lower.name and $worn.under_lower.name
		<<elseif $worn.genitals.type.includes("chastity")>>
			then <<slithers>> beneath your $worn.lower.name against your chastity belt
		<<else>>
		<</if>>
	<<else>>
		<<if !$worn.under_lower.type.includes("naked")>>
			then <<slithers>> beneath your $worn.under_lower.name
			<<if $worn.genitals.type.includes("chastity")>>
				against your chastity belt.
			<</if>>
		<<elseif $worn.under_lower.type.includes("naked") and $worn.genitals.type.includes("chastity")>>
			then <<slithers>> against your chastity belt
		<<else>>
			then <<slithers>> across your bare skin
		<</if>>
	<</if>>
<</widget>>

<<widget "statetentacles">>
	<<for _j to 0; _j lt $tentacles.max; _j++>>
		<<if $tentacles[_j] isnot undefined>>
			<<if $tentacles[_j].shaft is "finished" and $tentacles[_j].name isnot "finished">>
				<<set $tentacles.active -= 1>>
				<<set $tentacles[_j].name to "finished">>
			<</if>>
		<</if>>
	<</for>>
<<sexcheck>>
<<if $ejaculating isnot 1>>
	You count <<number $tentacles.active>> <<print $tentacles[0].type>><<if $tentacles.active isnot 1>>s<</if>> surrounding you.

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

<<widget "leftarmtentacledisable">>
	<<for _j to 0; _j lt $tentacles.max; _j++>>
		<<if $tentacles[_j] isnot undefined>>
			<<if $tentacles[_j].id is $leftarm>>
				<<set $tentacles[_j].head to 0>>
			<</if>>
		<</if>>
	<</for>>
<</widget>>

<<widget "rightarmtentacledisable">>
	<<for _j to 0; _j lt $tentacles.max; _j++>>
		<<if $tentacles[_j] isnot undefined>>
			<<if $tentacles[_j].id is $rightarm>>
				<<set $tentacles[_j].head to 0>>
			<</if>>
		<</if>>
	<</for>>
<</widget>>

<<widget "feettentacledisable">>
	<<for _j to 0; _j lt $tentacles.max; _j++>>
		<<if $tentacles[_j] isnot undefined>>
			<<if $tentacles[_j].id is $feetuse>>
				<<set $tentacles[_j].head to 0>>
			<</if>>
		<</if>>
	<</for>>
<</widget>>

repo_name: Area/degrees

license: mit


code:
:: Tutorial

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<enable_rescue>>
	<<maninit>>
	<<set $NPCList[0].chest to "none">>
	<<He>> reaches toward you.
	<<set $NPCList[0].fullDescription to "Tutorial " + ($NPCList[0].pronoun is "m"?"man":"woman")>>
<</if>>
<<effects>>
<<effectsman>><<man>>
<<stateman>>

__Combat Tutorial__

<<if $gamemode is "soft">>
	Your character will be quite passive at first. More actions will become available as you become more promiscuous and comfortable being assertive.

	Assertive and meek actions will arouse your partner, bringing them closer to orgasm. They'll also make them trust you more.

	Bratty acts will irritate your partner. Use them too frequently and they will become rougher and less trusting.

	Some actions have only a chance of working, based on your skill with the bodypart being used and how trusting your partner is.

	Each part of your body can perform one action per turn. Choose your actions, then click next or press enter to continue.

<<else>>
	There are three common ways to escape an attacker; fight them off, sexually satisfy them, or be rescued.
	Defiant acts will hurt them. Hurt them enough and you'll escape. However, defiant acts will anger them, making them more violent.

	They'll be happy to use you as a passive toy, but submissive acts will make them cum faster. Once spent, they'll usually leave you alone. Some submissive acts will occupy their genitals, so they can't use them in more dangerous ways.

	Meek acts will endear you to them without being directly sexual. Meek acts will make them trust you more, and often have effects which may help you.

	Bratty acts protect you in ways that defies your attacker's will without hurting them. Bratty acts will reduce trust and increase anger.

	Finally, you could scream for help. Whether it will help or make things worse depends on who's around to hear. Screaming at night or in the wilderness will only anger your attacker. You won't be able to scream (or speak) if your attacker has you gagged.
	For this encounter, screaming will get you rescued. Each part of your body can perform one action per turn. Choose your actions, then click next or press enter to continue.

<</if>>

<<actionsman>>
<<if $alarm is 1 and $rescue is 1>>
	<<link [[Next|Tutorial Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Tutorial Finish]]>><</link>><<nexttext>>
<<elseif $enemyhealth lte 0>>
	<<link [[Next|Tutorial Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Tutorial]]>><</link>><<nexttext>>
<</if>>

:: Tutorial Finish

<<effects>><<set $eventskip to 1>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	<<if $enemyanger gte 60>>
		"That's what you get, slut." <<He>> leaves you lying on the ground.

	<<else>>
		"Good <<girl>>. Here's a little something for the trouble." <<He>> leaves you lying on the ground.

		<<tearful>> you climb to your knees. You've gained £5.

		<<set $money += 500>>
	<</if>>

	<<clotheson>>
	<<endcombat>>
	<<if $gamemode is "soft">>
		<<generate1>><<person1>>A <<person>> rushes over to you. "Are you okay?" <<He>> offers an arm to help you up.

	<<else>>
		<<generate1>><<person1>>A <<person>> rushes over to you. "I saw what that fiend did. Are you okay?" <<He>> offers an arm to help you up.

	<</if>>
	Being attacked will damage your sense of control. You will become more vulnerable to trauma as your control fails.
	Actions marked as "promiscuity", "exhibitionism" or "deviancy" will lower stress and trauma. They will also restore your sense of control. Committing these actions with enough frequency will unlock lewder actions of the same type, but make weaker actions lose effectiveness. If you're not careful, you'll be unable to reach the controlled state without shameless and outrageous acts.

	<<link [[Flirt|Tutorial Flirt]]>><<set $spraymax++>><<spray 5>><</link>><<promiscuous1>>

	<<link [[Thank them|Tutorial Thank]]>><<set $spraymax++>><<spray 5>><</link>>

<<elseif $enemyhealth lte 0>>
	The <<person>> recoils in pain. "You're fucking nuts," <<he>> says, limping away. <<tearful>> you climb to your knees.

	<<clotheson>>
	<<endcombat>>
	<<if $gamemode is "soft">>
		<<generate1>><<person1>>A <<person>> rushes over to you. "Are you okay?" <<He>> offers an arm to help you up.

	<<else>>
		<<generate1>><<person1>>A <<person>> rushes over to you. "I saw what that fiend did. Are you okay?" <<He>> offers an arm to help you up.

	<</if>>
	Being attacked will damage your sense of control. You will become more vulnerable to trauma as your control fails.
	Actions marked as "promiscuity", "exhibitionism", or "deviancy" will lower stress and trauma. They will also restore your sense of control. Committing these actions with enough frequency will unlock lewder actions of the same type, but make weaker actions lose effectiveness. If you're not careful, you'll be unable to reach the controlled state without shameless and outrageous acts.

	<<link [[Flirt|Tutorial Flirt]]>><<set $spraymax++>><<spray 5>><</link>><<promiscuous1>>

	<<link [[Thank them|Tutorial Thank]]>><<set $spraymax++>><<spray 5>><</link>>

<<elseif $rescue is 1 and $alarm is 1>>
	<<set $rescued += 1>>
	<<He>> notices several heads turning in response to your cry, and relents in <<his>> assault before making a hurried escape.

	<<tearful>> you climb to your knees.

	<<clotheson>>
	<<endcombat>>
	<<if $gamemode is "soft">>
		<<generate1>><<person1>>A <<person>> rushes over to you. "Are you okay?" <<He>> offers an arm to help you up.

	<<else>>
		<<generate1>><<person1>>A <<person>> rushes over to you. "I saw what that fiend did. Are you okay?" <<He>> offers an arm to help you up.

	<</if>>
	Being attacked will damage your sense of control. You will become more vulnerable to trauma as your control fails.
	Actions marked as "promiscuity", "exhibitionism", or "deviancy" will lower stress and trauma. They will also restore your sense of control. Committing these actions with enough frequency will unlock lewder actions of the same type, but make weaker actions lose effectiveness. If you're not careful, you'll be unable to reach the controlled state without shameless and outrageous acts.

	<<link [[Flirt|Tutorial Flirt]]>><<set $spraymax++>><<spray 5>><</link>><<promiscuous1>>

	<<link [[Thank them|Tutorial Thank]]>><<set $spraymax++>><<spray 5>><</link>>

<</if>>

:: Tutorial Flirt
<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "domus">>
<<if $tutorialExit is undefined>><<set $tutorialExit to "Domus Street">><</if>>
You take <<his>> arm and hoist yourself up and against <<him>>, forcing <<him>> to catch you in an embrace to stop you falling. You look <<him>> in the eyes. "I feel safe now," you say.
<<promiscuity1>>

<<He>> blushes. "I-I'm glad you're alright," <<he>> says as <<he>> slowly withdraws <<his>> arms from you, making sure you're steady. <<He>> glances around. "Here," <<he>> hands you a small cylinder. "Be discreet. It's not legal, and there's only enough for one use."
<<gspraymax>>

<<if $tutorialExit isnot "Domus Street">>
	"You better get back to your friend, <<nnpc_he "Robin">>'s the one that called me over. <<nnpc_He "Robin">> was pale as a ghost and could hardly form the words. I need to get going. You be careful."
<<else>>
	"I need to get going. You be careful."
<</if>>

<<link [[Next|$tutorialExit]]>><<endevent>><<set $eventskip to 1>><<unset $tutorialExit>><<set $tutorial to 1>><</link>>

:: Tutorial Thank
<<set $outside to 1>><<set $location to "town">><<effects>><<set $bus to "domus">>
<<if $tutorialExit is undefined>><<set $tutorialExit to "Domus Street">><</if>>
You take <<his>> arm and <<he>> helps lift you to your feet. "Thank you," you say. "I'll be okay now."

<<He>> glances around. "Here," <<he>> hands you a small cylinder. "Be discreet. It's not legal, and there's only enough for one use."
<<gspraymax>>

<<if $tutorialExit isnot "Domus Street">>
	"You better get back to your friend, <<nnpc_he "Robin">>'s the one that called me over. <<nnpc_He "Robin">> was pale as a ghost and could hardly form the words. I need to get going. You be careful."
<<else>>
	"I need to get going. You be careful."
<</if>>

<<link [[Next|$tutorialExit]]>><<endevent>><<set $eventskip to 1>><<unset $tutorialExit>><<set $tutorial to 1>><</link>>