code:
:: Widgets Struggle [widget]
<<widget "struggle_init">>
	<<set $enemytype to "struggle">>
	<<set $struggle to {
		timer: 0,
		creature: "lurker",
		number: 1,
		warded: 0,
		satisfied: 0,
		done: 0,
		enemy: {}
	}>>
	<<set $feetaction to "evade">>
<</widget>>

<<widget "struggle_creatures">>
	<<set $struggle.number to $args[0]>>
	<<set $struggle.descriptions to ["twisting", "slimy", "chittering", "slippery", "darting", "mesmerising", "big", "small", "colourful", "dull", "jittering", "shuddering", "pulsating", "wide", "thin", "thick", "buzzing", "glistening"]>>
	<<for _i to 0; _i lt $struggle.number; _i++>>
		<<generate_struggle_creature _i $args[1]>>
	<</for>>
	<<for _part range ["mouth", "vagina", "penis", "anus", "chest"]>>
		<<struggle_part_init _part>>
	<</for>>
<</widget>>

<<widget "struggle_add">>
	<<set _i to $struggle_number>>
	<<set $struggle_number += $args[0]>>
	<<for _i to _i; _i lt $struggle.number; _i++>>
		<<generate_struggle_creature _i $args[1]>>
	<</for>>
<</widget>>

<<widget "generate_struggle_creature">>
	<<set	_slot = $args[0];
			_health = $args[1];
			_type = $args[2] ? $args[2] : $struggle.creature
	>>
	<<set $struggle.enemy[_slot] to {
		location: "lurking",
		health: _health,
		name: _type,
		description: $struggle.descriptions.pluck(),
		motion: {wasp: "flying", bee: "flying", squid: "swimming"}[_type] || "jumping",
		legs: {wasp: "legs", bee: "legs", squid: "tentacles"}[_type] || "none"
	}>>
<</widget>>

<<widget "struggle_part_init">>
	<<if ["mouth", "vagina", "penis", "anus", "chest"].includes($args[0])>>
		<<set $_part to $args[0]>>
	<<else>>
		struggle_part_init error: invalid arguments: $args
	<</if>>

	<<set $struggle[$_part] to {
		grip: 0,
		creature: 0,
		progress: 0,
		success: 0,
		action: 0,
		action_default: 0,
		damage: 0
	}>>
	<<if !$struggle_start>>

		<<for _i to 0; _i lt $struggle.number; _i++>>
			<<if $struggle.enemy[_i].location is $_part>>
				<<set $struggle.enemy[_i].location to "fleeing">>
				<<set $struggle.enemy[_i].health -= 1>>
			<</if>>
		<</for>>

		<<set $_actions to [$_part + '_strengthen', $_part + '_pull', $_part + '_spray', $_part + '_grasp', $_part + '_stroke']>>
		<<if $_actions.includes($leftactiondefault)>>
			<<if $carryblock>>
				<<set $leftactioncarry to "rest">>
			<<else>>
				<<set $leftactiondefault to "rest">>
			<</if>>
			<<set $leftarmstate to 0>>
			<<set $leftarm to 0>>
		<</if>>
		<<if $_actions.includes($rightactiondefault)>>
			<<if $carryblock>>
				<<set $rightactioncarry to "rest">>
			<<else>>
				<<set $rightactiondefault to "rest">>
			<</if>>
			<<set $rightarmstate to 0>>
			<<set $rightarm to 0>>
		<</if>>
	<</if>>
<</widget>>

<<widget "struggle_name">><<silently>>

	<<set $_loc to $args[0]>>
	<<if $_loc lt $struggle.number>>

		<<set _fulldesc to $struggle.enemy[$_loc].description + ' ' + $struggle.enemy[$_loc].name>>
	<<elseif ["mouth", "vagina", "penis", "anus", "chest"].includes($_loc)>>

		<<if $struggle[$_loc].description>>

			<<set _fulldesc to $struggle[$_loc].description + ' ' + $struggle[$_loc].creature>>
		<<elseif $struggle[$_loc].creature>>
			<<for _i to 0; _i lt $struggle.number; _i++>>
				<<if $struggle.enemy[_i].location is $_loc>>
					<<set _fulldesc to $struggle.enemy[_i].description + ' ' + $struggle.enemy[_i].name>>
					<<set $struggle[$_loc].description to $struggle.enemy[_i].description>>
				<</if>>
			<</for>>
		<</if>>
	<</if>>
	<</silently>><<print _fulldesc>>
<</widget>>

<<widget "struggle">>
	<<struggle_effects>>
	<<struggle_enemy>>
	<<struggle_state>>
	<<struggle_actions>>
<</widget>>

<<widget "struggle_state">>
	<<for $_part range ["mouth", "vagina", "penis", "anus", "chest"]>>
		<<if $struggle[$_part].creature>>
			You have
			<<switch $struggle[$_part].grip>>
				<<case 0>> no
				<<case 1>> fragile
				<<case 2>> weak
				<<case 3>> tentative
				<<case 4>> decent
				<<case 5>> strong
				<<default>> iron
			<</switch>>
			grip on the <<print $struggle[$_part].creature>> clutching your
			<<switch $_part>>
				<<case "mouth">> mouth.
				<<case "vagina">> pelvis.
				<<case "penis">> tummy.
				<<case "anus">> bottom.
				<<case "chest">> chest.
			<</switch>>

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

	<<if $arousal gte $arousalmax and $orgasmdown lte 0>>
		<<orgasm>>
	<</if>>
	<<set $struggle.timer += 1>>
	<<sexcheck>>
<</widget>>

<<widget "struggle_end">>
	<<unset $struggle>>
<</widget>>

<<widget "generateActionsStruggle">>
<<set $combat to 1>>
<<if _targetlist is undefined>>
	<<getTargetList>>
<</if>>
<<for _i to 0; _i lt $struggle.number; _i++>>
	<<if $struggle.enemy[_i].location is "fleeing" or $struggle.enemy[_i].location is "lurking">>
		The <<struggle_name _i>> keeps at a distance.

		<<if $farm_stage gte 10 and $lurkers_held lt 1>>
			<<set _lurker_net_possible to true>>
		<</if>>
	<</if>>
<</for>>

		<<leftActionInitStruggle>>

		<<rightActionInitStruggle>>

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

			<<feetActionInitStruggle>>

	<</if>>

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

			<<mouthActionInitStruggle>>

<</if>>

<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<if $vaginastate isnot 0 and $player.vaginaExist>>

				<<vaginaActionInitStruggle>>

	<</if>>

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

				<<penisActionInitStruggle>>

	<</if>>

	<<if $anusstate isnot 0>>

				<<anusActionInitStruggle>>

	<</if>>

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

				<<chestActionInitStruggle>>

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

<<widget "leftActionInitStruggle">>
<<set $lefttarget to "struggle">>
<<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>>
	<<if $combatControls is "radio">>
<</if>>
<<case "struggle">>
	<<if $orgasmdown gte 1>>
		<<set _leftOptions to "orgasm">>
		You hold a $struggle.creature with your left arm, but you can't stop the spasms.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _leftOptions to "bound">>
		You hold a $struggle.creature with your left arm, but it hurts to move.
	<<elseif $dissociation gte 2>>
		<<set _leftOptions to "bound">>
		You hold a $struggle.creature with your left arm, but it doesn't feel real.
	<<else>>
		<<set _leftOptions to "struggle">>
		<<switch $leftarmstate>>
		<<case "mouth_struggle">>
			Your left arm grips the $struggle.mouth.creature over your mouth.
		<<case "penis_struggle">>
			Your left arm grips the $struggle.penis.creature over your <<penis>>.
		<<case "vagina_struggle">>
			Your left arm grips the $struggle.vagina.creature over your <<pussy>>.
		<<case "anus_struggle">>
			Your left arm grips the $struggle.anus.creature over your <<bottom>>.
		<<case "chest_struggle">>
			Your left arm grips the $struggle.chest.creature over your chest.
		<</switch>>
	<</if>>
	<<if $combatControls is "radio">>
<</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>>
	<<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 "swarmgrappled">>
	<<set $_changetype to true>><<leftActionInitSwarm>>
<<case "mechgrappled">>
	<<set $_changetype to true>><<leftActionInitMachine>>
<<default>>
	<<set $_changetype to true>><<leftActionInitTentacle>>
<</switch>>
<<if $_changetype isnot true>>
	<<leftActionsStruggle>>
	<<if Object.keys(_leftaction).length gt 0>>
		<<if Object.values(_leftaction).includes($leftactiondefault)>>
			<<set $leftaction to $leftactiondefault>>
		<</if>>
		<<set _textColor to combatListColor('leftaction', (Object.values(_leftaction).includes($leftaction) ? $leftaction : Object.values(_leftaction)[0]), "Struggle")>>
		<<generateCombatActionOthers _leftaction "leftaction" _textColor $leftaction "Struggle">>
		<<if $combatControls.includes("ists")>>

				<<leftactionDifficulty>>

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

<<widget "leftactionDifficultyStruggle">>/* Don't mind the blank widget. */
<</widget>>

<<widget "leftActionsStruggle">>
<<set _leftaction to {}>>
<<switch _leftOptions>>
<<case "free" "struggle">>
	<<set _leftaction["Keep left arm still"] to "rest">>
	<<if _lurker_net_possible is true>>
		<<set _leftaction["Hurl net"] to "capture">>
	<</if>>
	<<if $combatControls isnot "radio">>
		<<for $_part range ["mouth", "vagina", "penis", "anus", "chest"]>>
			<<if V[$_part + 'use'] is "struggle" and $struggle[$_part].creature>>
				<<set $_desc to ($leftactiondefault.includes($_part) ? '' : ' (' + $_part + ')')>>
				<<if $leftactiondefault.includes($_part) and $struggle[$_part].grip gte 1>>

					<<if $struggle[$_part].success lt 100>>
						<<set _leftaction["Strengthen your grip"] to $_part + '_strengthen'>>
					<</if>>
					<<set _leftaction["Pull"] to $_part + '_pull'>>
				<<elseif $struggle[$_part].success lt 100>>
					<<set _leftaction['Grasp' + $_desc] to $_part + '_grasp'>>
				<</if>>
				<<if $spray gte 1 and $consensual isnot 1>>
					<<set _leftaction['Spray' + $_desc] to $_part + '_spray'>>
				<</if>>
				<<set _leftaction['Stroke' + $_desc] to $_part + '_stroke'>>
			<</if>>
		<</for>>
	<</if>>
<<case "bound">>
<<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 "rightActionInitStruggle">>
<<set $righttarget to "struggle">>
<<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>>
	<<if $combatControls is "radio">>
<</if>>
<<case "struggle">>
	<<if $orgasmdown gte 1>>
		<<set _rightOptions to "orgasm">>
		You hold a $struggle.creature with your right arm, but you can't stop the spasms.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _rightOptions to "bound">>
		You hold a $struggle.creature with your right arm, but it hurts to move.
	<<elseif $dissociation gte 2>>
		<<set _rightOptions to "bound">>
		You hold a $struggle.creature with your right arm, but it doesn't feel real.
	<<else>>
		<<set _rightOptions to "struggle">>
		<<switch $rightarmstate>>
		<<case "mouth_struggle">>
			Your right arm grips the $struggle.mouth.creature over your mouth.
		<<case "penis_struggle">>
			Your right arm grips the $struggle.penis.creature over your <<penis>>.
		<<case "vagina_struggle">>
			Your right arm grips the $struggle.vagina.creature over your <<pussy>>.
		<<case "anus_struggle">>
			Your right arm grips the $struggle.anus.creature over your <<bottom>>.
		<<case "chest_struggle">>
			Your right arm grips the $struggle.chest.creature over your chest.
		<</switch>>
	<</if>>
	<<if $combatControls is "radio">>
<</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>>
	<<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 "swarmgrappled">>
	<<set $_changetype to true>><<rightActionInitSwarm>>
<<case "mechgrappled">>
	<<set $_changetype to true>><<rightActionInitMachine>>
<<default>>
	<<set $_changetype to true>><<rightActionInitTentacle>>
<</switch>>
<<if $_changetype isnot true>>
	<<rightActionsStruggle>>
	<<if Object.keys(_rightaction).length gt 0>>
		<<if Object.values(_rightaction).includes($rightactiondefault)>>
			<<set $rightaction to $rightactiondefault>>
		<</if>>
		<<set _textColor to combatListColor('rightaction', (Object.values(_rightaction).includes($rightaction) ? $rightaction : Object.values(_rightaction)[0]), "Struggle")>>
		<<generateCombatActionOthers _rightaction "rightaction" _textColor $rightaction "Struggle">>
		<<if $combatControls.includes("ists")>>

				<<rightactionDifficulty>>

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

<<widget "rightactionDifficultyStruggle">>/* It's a necessary evil. */

<</widget>>

<<widget "rightActionsStruggle">>
<<set _rightaction to {}>>
<<switch _rightOptions>>
<<case "free" "struggle">>
	<<set _rightaction["Keep right arm still"] to "rest">>
	<<if _lurker_net_possible is true>>
		<<set _rightaction["Hurl net"] to "capture">>
	<</if>>
	<<if $combatControls isnot "radio">>
		<<for $_part range ["mouth", "vagina", "penis", "anus", "chest"]>>
			<<if V[$_part + 'use'] is "struggle" and $struggle[$_part].creature>>
				<<set $_desc to ($rightactiondefault.includes($_part) ? '' : ' (' + $_part + ')')>>
				<<if $rightactiondefault.includes($_part) and $struggle[$_part].grip gt 0>>

					<<if $struggle[$_part].success lt 100>>
						<<set _rightaction["Strengthen your grip"] to $_part + '_strengthen'>>
					<</if>>
					<<set _rightaction["Pull"] to $_part + '_pull'>>
				<<elseif $struggle[$_part].success lt 100>>
					<<set _rightaction['Grasp' + $_desc] to $_part + '_grasp'>>
				<</if>>
				<<if $spray gte 1 and $consensual isnot 1>>
					<<set _rightaction['Spray' + $_desc] to $_part + '_spray'>>
				<</if>>
				<<set _rightaction['Stroke' + $_desc] to $_part + '_stroke'>>
			<</if>>
		<</for>>
	<</if>>
<<case "bound">>
<<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 "feetActionInitStruggle">>
	<<set $feettarget to "struggle">>
	<<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>>
		<<if $combatControls is "radio">>
<</if>>
	<<case "penis" "othervagina" "bound" "walk" "run" "none">>
		<<set $_changetype to true>><<feetActionInit>>
	<<case "mechgrappled">>
		<<set $_changetype to true>><<feetActionInitMachine>>
	<<default>>
		<<set $_changetype to true>><<feetActionInitTentacle>>
	<</switch>>
	<<if $_changetype isnot true>>
		<<feetActionsStruggle>>
		<<if Object.keys(_feetaction).length gt 0>>
			<<if !(Object.values(_feetaction).includes($feetactiondefault))>>
				<<set $feetactiondefault to "rest">>
			<</if>>
			<<set $feetaction to $feetactiondefault>>
			<<set _textColor to combatListColor('feetaction', (Object.values(_feetaction).includes($feetaction) ? $feetaction : Object.values(_feetaction)[0]), "Struggle")>>
			<<generateCombatActionOthers _feetaction "feetaction" _textColor $feetaction "Struggle">>
			<<if $combatControls.includes("ists")>>

					<<feetactionDifficulty>>

			<</if>>
		<</if>>
		<<set $lastOptions.feet to clone(_feetOptions)>>
	<</if>>
<</widget>>

<<widget "feetactionDifficultyStruggle">>/* "How so", you ask? */
<</widget>>

<<widget "feetActionsStruggle">>
<<set _feetaction to {}>>
<<set _feetaction["Keep still"] to "rest">>
<<set _feetaction["Dodge"] to "evade">>
<<set _feetaction["Plant"] to "plant">>
<</widget>>

<<widget "mouthActionInitStruggle">>
<<if $orgasmdown gte 1>>
	<<mouthActionInit>>
<<elseif $pain gte 100 and $willpowerpain is 0>>
	<<mouthActionInit>>
<<elseif $dissociation gte 2>>
	<<mouthActionInit>>
<<else>>
	<<set $mouthtarget to "struggle">>
	<<switch $mouthuse>>
	<<case "struggle">>
		A <<print $struggle.mouth.creature>> clings to your face.
		<<if $leftarmstate is "mouth_struggle" and $rightarmstate is "mouth_struggle">>
			You clutch it with both hands.
		<<elseif $leftarmstate is "mouth_struggle">>
			You clutch it with your left hand.
		<<elseif $rightarmstate is "mouth_struggle">>
			You clutch it with your right hand.
		<</if>>
		<<if $combatControls is "radio">>
<</if>>
	<<case "tentacle">>
		<<set $_changetype to true>><<mouthActionInitTentacle>>
	<<default>>
		<<set $_changetype to true>><<mouthActionInit>>
	<</switch>>
	<<if $_changetype isnot true>>
		<<set _mouthaction to {}>>
		<<if $mouthstate is "struggle">>
			<<set _mouthaction["Keep closed"] to "rest">>
			<<set _mouthaction["Open"] to "open">>
		<<elseif $mouthstate is "struggle_pen">>
			<<set _mouthaction["Rest"] to "rest">>
			<<set _mouthaction["Suck"] to "suck">>
			<<if $consensual isnot 1>>
				<<set _mouthaction["Bite"] to "bite">>
			<</if>>
		<</if>>
		<<if Object.keys(_mouthaction).length gt 0>>
			<<if !(Object.values(_mouthaction).includes($mouthactiondefault))>>
				<<if !["open", "suck", "bite"].includes($mouthactiondefault)>>
					<<set $mouthactiondefault to "rest">>
				<</if>>
			<</if>>
			<<set $mouthaction to $mouthactiondefault>>
			<<set _textColor to combatListColor('mouthaction', (Object.values(_mouthaction).includes($mouthaction) ? $mouthaction : Object.values(_mouthaction)[0]), "Struggle")>>
			<<if $combatControls is "radio">> Mouth:<</if>>
			<<generateCombatActionOthers _mouthaction "mouthaction" _textColor $mouthaction "Struggle">>
			<<if $combatControls.includes("ists")>>

					<<mouthactionDifficulty>>

			<</if>>
		<</if>>
		<<if $combatControls is "radio">>
			<<handsActionsStruggleRadio "mouth">>
		<</if>>
		<<set $lastOptions.mouth to clone(_mouthOptions)>>
	<</if>>
<</if>>
<</widget>>

<<widget "mouthactionDifficultyStruggle">>/* Simply put, there's a JavaScript macro that needs it. */
<</widget>>

<<widget "penisActionInitStruggle">>
<<set $penistarget to "struggle">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<switch $penisstate>>
	<<case "struggle" "struggle_pen">>
		A <<print $struggle.penis.creature>> clings to your tummy, where it threatens your penis.
		<<if $leftarmstate is "penis_struggle" and $rightarmstate is "penis_struggle">>
			You clutch it with both hands.
		<<elseif $leftarmstate is "penis_struggle">>
			You clutch it with your left hand.
		<<elseif $rightarmstate is "penis_struggle">>
			You clutch it with your right hand.
		<</if>>
	<<case "tentacleentrance" "tentacleimminent" "tentacle" "tentacledeep" "tentaclerub">>
		<<set $_changetype to true>><<penisActionInitTentacle>>
	<<default>>
		<<set $_changetype to true>><<penisActionInit>>
	<</switch>>
	<<if $_changetype isnot true and $combatControls is "radio">>
		<<handsActionsStruggleRadio penis>>
	<</if>>
<</if>>
<</widget>>

<<widget "vaginaActionInitStruggle">>
	<<set $vaginatarget to "struggle">>
	<<switch $vaginastate>>
	<<case "struggle" "struggle_pen">>
		A <<print $struggle.vagina.creature>> clings to your pelvis, where it threatens your pussy.
		<<if $leftarmstate is "vagina_struggle" and $rightarmstate is "vagina_struggle">>
			You clutch it with both hands.
		<<elseif $leftarmstate is "vagina_struggle">>
			You clutch it with your left hand.
		<<elseif $rightarmstate is "vagina_struggle">>
			You clutch it with your right hand.
		<</if>>
	<<case "tentacleentrance" "tentacleimminent" "tentacle" "tentacledeep" "tentaclerub">>
		<<set $_changetype to true>><<vaginaActionInitTentacle>>
	<<default>>
		<<set $_changetype to true>><<vaginaActionInit>>
	<</switch>>
	<<if $_changetype isnot true and $combatControls is "radio">>
		<<handsActionsStruggleRadio "vagina">>
	<</if>>
<</widget>>

<<widget "anusActionInitStruggle">>
	<<set $anustarget to "struggle">>
	<<if $bottomuse is "mouth" or $bottomuse is "penis">>
		<<set $_changetype to true>><<anusActionInit>>
	<<else>>
		<<switch $anusstate>>
		<<case "struggle" "struggle_pen">>
			A <<print $struggle.anus.creature>> clings to your bottom.
			<<if $leftarmstate is "anus_struggle" and $rightarmstate is "anus_struggle">>
				You clutch it with both hands.
			<<elseif $leftarmstate is "anus_struggle">>
				You clutch it with your left hand.
			<<elseif $rightarmstate is "anus_struggle">>
				You clutch it with your right hand.
			<</if>>
		<<case "tentacleentrance" "tentacleimminent" "tentacle" "tentacledeep" "tentaclerub">>
			<<set $_changetype to true>><<anusActionInitTentacle>>
		<<default>>
			<<set $_changetype to true>><<anusActionInit>>
		<</switch>>
	<</if>>
	<<if $_changetype isnot true and $combatControls is "radio">>
		<<handsActionsStruggleRadio "anus">>
	<</if>>
<</widget>>

<<widget "chestActionInitStruggle">>
	<<switch $chestuse>>
	<<case "struggle">>
		A <<print $struggle.chest.creature>> clings to your chest.
		<<if $leftarmstate is "chest_struggle" and $rightarmstate is "chest_struggle">>
			You clutch it with both hands.
		<<elseif $leftarmstate is "chest_struggle">>
			You clutch it with your left hand.
		<<elseif $rightarmstate is "chest_struggle">>
			You clutch it with your right hand.
		<</if>>
	<<case "tentaclerub">>
		<<set $_changetype to true>><<chestActionInitTentacle>>
	<<case "penis">>
		<<set $_changetype to true>><<chestActionInit>>
	<</switch>>
	<<if $_changetype isnot true and $combatControls is "radio">>
		<<handsActionsStruggleRadio "chest">>
	<</if>>
<</widget>>

<<widget "struggle_actions">>
<<if !($struggle.mouth.progress gte 6 and $struggle.mouth.progress lte 14) and !$underwater>>
	<<oxygen 50>>
<</if>>

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

<<combatstate>>
<<carryblock>>

<<if $trance lte 0 and $panicparalysis is 0 and $panicviolence is 0 and $combatControls isnot "radio_old">>
	<<struggle_difficulty_set>>
	<<if $combatControls is "radio">>
		<<set $leftaction to $leftactiondefault>>
		<<set $rightaction to $rightactiondefault>>
	<</if>>
	<<generateActionsStruggle>>
<</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 "radio_old">>
	<<struggle_difficulty_set>>

	<<if $leftarm is "bound" and $rightarm is "bound">>
		Your arms are helplessly bound, leaving you defenceless.
	<<elseif $leftarm is "grappled" and $rightarm is "grappled">>
		Your arms are grappled, leaving you defenceless.
	<<elseif $leftarm is "grappled" or $leftarm is "bound">>
		Your left arm is grappled.
	<<elseif $rightarm is "grappled" or $rightarm is "bound">>
		Your right arm is grappled.
	<<else>>
		Your arms are free.
	<</if>>

	<<set $leftaction to $leftactiondefault>>
	<<if $leftarm isnot "grappled" and $leftarm isnot "bound">>
		Keep left arm still <<radiobutton "$leftaction" "rest" autocheck>>
		<<set _pipe to 1>>
	<</if>>
	<<set $rightaction to $rightactiondefault>>
	<<if $rightarm isnot "grappled" and $rightarm isnot "bound">>
		<<if _pipe>>| <</if>>Keep right arm still <<radiobutton "$rightaction" "rest" autocheck>>
	<</if>>
	<<set _pipe to 0>>

	<<set $feetaction to $feetactiondefault>>
	<<if $feetuse is 0>>
		Your feet are free.
		<<set $feetaction to $feetactiondefault>>
		  Keep still <<radiobutton "$feetaction" "rest" autocheck>>
		| Dodge <<radiobutton "$feetaction" "evade" autocheck>>
		| Plant <<radiobutton "$feetaction" "plant" autocheck>>
	<</if>>

	<<if $mouthuse is "struggle" and $struggle.mouth.creature>>
		The <<struggle_name "mouth">> clings to your face.

		Mouth:
		<<if $mouthstate is "struggle">>
			<<set $mouthaction to ($mouthactiondefault is "open" ? "open" : "rest")>>
			Keep closed <<radiobutton "$mouthaction" "rest" autocheck>>
			| Open <<radiobutton "$mouthaction" "open" autocheck>>
		<<elseif $mouthstate is "struggle_pen">>
			<<if $mouthactiondefault is "suck" or ($consensual isnot 1 and $mouthactiondefault is "bite")>>

			<<else>>
				<<set $mouthactiondefault to "rest">>
			<</if>>
			<<set $mouthaction to $mouthactiondefault>>
			Rest <<radiobutton "$mouthaction" "rest" autocheck>>
			| Suck <<radiobutton "$mouthaction" "suck" autocheck>>
			<<if $consensual isnot 1>>
				| Bite <<radiobutton "$mouthaction" "bite" autocheck>>
			<</if>>
		<</if>>

		<<handsActionsStruggleRadio "mouth">>

	<</if>>

	<<for _part range ["vagina", "penis", "anus", "chest"]>>
		<<if V[_part + 'use'] is "struggle">>
			The <<struggle_name _part>> clings to your <<struggle_region _part>><<if ["vagina", "penis"].includes(_part)>>, where it threatens your <<struggle_bodypart _part>><</if>>.

			<<handsActionsStruggleRadio _part>>

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

	<<set _dlurkers to []>>
	<<for _i to 0; _i lt $struggle.number; _i++>>
		<<if $struggle.enemy[_i].location is "fleeing" or $struggle.enemy[_i].location is "lurking">>
			<<set _dlurkers.push(_i)>>
		<</if>>
	<</for>>
	<<if _dlurkers.length gt 0>>
		The
		<<for _i to _dlurkers.length - 1; _i gte 0; _i-->>
			<<struggle_name _dlurkers[_i]>><<if _i gte 2>>, the<<elseif _i is 1>> and the<</if>>
		<</for>>
		keep<<if _dlurkers.length is 1>>s<</if>> at a distance.
		<<if $farm_stage gte 10 and $lurkers_held lt 1>>
			<<if $leftarm isnot "grappled" and $leftarm isnot "bound">>

				Left arm: Hurl net <<radiobutton "$leftaction" "capture" autocheck>>
			<</if>>
			<<if $rightarm isnot "grappled" and $rightarm isnot "bound">>

				Right arm: Hurl net <<radiobutton "$rightaction" "capture" autocheck>>
			<</if>>
		<</if>>

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

<<setupMidOrgasm>>

<</widget>>

<<widget "handsActionsStruggleRadio">>
	<<set _hpart to $args[0]>>
	<<set V[_hpart + 'target'] to "struggle">>
	<<if V[_hpart + 'use'] is "struggle">>

		<<for _hhand range ["left", "right"]>>
			<<if ["free", "struggle"].includes(_leftOptions)>>
				<<print (_hhand is "left" ? "Left" : "Right")>> arm:
				<<if V[_hhand + 'actiondefault'].includes(_hpart) and $struggle[_hpart].grip gte 1>>

					<<if $struggle[_hpart].success lt 100>>
						<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_strengthen'` autocheck>> Strengthen your grip |
					<</if>>
					<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_pull'` autocheck>> Pull |
				<<elseif $struggle[_hpart].success lt 100>>
					<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_grasp'` autocheck>> Grasp |
				<</if>>
				<<if $spray gte 1 and !$consensual>>
					<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_spray'` autocheck>> Spray |
				<</if>>
				<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_stroke'` autocheck>> Stroke it |
			<</if>>

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

<<widget "handsActionsStruggleRadiobkp">>
	<<set _hpart to $args[0]>>
	<<set V[_hpart + 'target'] to "struggle">>
	<<if V[_hpart + 'use'] is "struggle">>

		<<for _hhand range ["left", "right"]>>
			<<if V[_hhand + 'arm'] isnot "bound" and !(V[_hhand + 'arm'] and V[_hhand + 'arm'].includes("grappled"))>>
				<<print (_hhand is "left" ? "Left" : "Right")>> arm:
				<<if $struggle[_hpart].success lt 100>>
					<<if !V[_hhand + 'armstate'].includes(_hpart)>>
						<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_grasp'` autocheck>> Grasp |
					<<else>>
						<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_strengthen'` autocheck>> Strengthen your grip |
					<</if>>
				<</if>>
				<<if $struggle[_hpart].grip gte 1>>
					<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_pull'` autocheck>> Pull |
				<</if>>
				<<if $spray gte 1 and !$consensual>>
					<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_spray'` autocheck>> Spray |
				<</if>>
				<<radiobutton `'$' + _hhand + 'action'` `_hpart + '_stroke'` autocheck>> Stroke it |
			<</if>>

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

<<widget "struggle_effects">>
	<<set $pain -= 1>>

	<<if $trance gte 1 or $dissociation gte 2>>
		<<if $position is "stalk">>
			You wander in a daze, unaware of your surroundings.
		<<else>>
			You stare straight ahead, your body passive and compliant.
		<</if>>
	<</if>>

	<<if $underwater is 1>>
		<<set $underwatertime += 1>>
		<<if $underwatertime lte 5>>
			You are underwater, and cannot speak.
		<<elseif $underwatertime lte 10>>
			You are underwater, and cannot breathe.
			<<gstress>><<stress 1>>
		<<elseif $underwatertime lte 15>>
			You are underwater, and cannot breathe.
			<<gstress>><<stress 2>>
		<<elseif $underwatertime lte 20>>
			You are underwater, and running out of breath.
			<<gtrauma>><<gstress>><<stress 4>><<trauma 2>>
		<<else>>
			You are suffocating beneath the water.
			<<set $pain += 20>><<gtrauma>><<gstress>><<stress 6>><<trauma 4>>

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

	<<effectspain>>
	<<effectsorgasm>>
	<<effectsdissociation>>

	<<if $mouthaction is "rest">>

	<<elseif $mouthaction is "open" and $mouthstate is "struggle">>
		<<set $mouthactiondefault to "suck">>
		You open your mouth wide allowing it to enter.
		<<set _mouthOpen to true>>
		<<if $struggle.mouth.progress gte 1 and $struggle.mouth.progress lte 3>>
			<<set $struggle.mouth.progress to 4>><<submission 1>>
		<</if>>
	<<elseif $mouthaction is "suck" and $mouthstate is "struggle_pen">>
		You suck on <<struggle_name mouth>>'s <<struggle_appendage mouth>><<if $struggle.mouth.progress gte 8>>, forcing it to release more sweet fluid down your throat<</if>>.
		<<neutral 5>><<struggle_fluid mouth>><<purity -1>><<internalejac>><<set $player.bodyliquid.mouth.goo += 1>><<submission 2>>
		<<if $struggle.mouth.progress gt 7 and $struggle.mouth.progress lt 13>>
			<<set $struggle.mouth.progress += 1>>
		<</if>>
	<<elseif $mouthaction is "bite" and $mouthstate is "struggle_pen">>
		<<if $wolfgirl gte 2 or $cat gte 2>>
			You bite its <<struggle_appendage mouth>> with your fangs. It leaps off your face.
			<<set $mouthuse to 0>>
			<<set $mouthstate to 0>>
			<<struggle_part_init "mouth">>
			<<set $struggle.warded += 1>>
			<<defiance 2>> <<control 5>>
			<<struggleClearActions "mouth_">>

		<<else>>
			No matter how hard you try to bite on its <<struggle_appendage mouth>>, it doesn't react.
			<<defiance 1>>
		<</if>>
	<</if>>
	<<if !$carryblock>>
		<<set $mouthactiondefault to ($mouthaction is "bite" ? "rest" : $mouthaction)>>
		<<set $mouthaction to 0>>
	<</if>>

	<<set _grip_strength to $physique / 20 + $handskill>>
	<<if $feetaction is "rest">>
		<<unset $dodging>>
		You rest your legs.
	<<elseif $feetaction is "evade">>
		<<set $dodging to 1>>
		You remain light on your feet, ready to dodge incoming attacks.
	<<elseif $feetaction is "plant">>
		<<unset $dodging>>
		<<set _grip_strength += $feetskill>>
		You plant your feet, helping you get a firm grip.
		<<feetskilluse>>
	<</if>>
	<<if !$carryblock>>
		<<set $feetactiondefault to ($feetaction ? $feetaction : "rest")>>
		<<set $feetaction to 0>>
	<</if>>

	<<for _hand range ["left", "right"]>>

		<<set _handaction to V[_hand + 'action']>>
		<<if _handaction>>
			<<if _handaction.includes("_stroke")>>
				<<set _action to "stroke">>
			<<elseif _handaction.includes("strengthen")>>
				<<set _action to "strengthen">>
			<<elseif _handaction.includes("pull")>>
				<<set _action to "pull">>
			<<elseif _handaction.includes("grasp")>>
				<<set _action to "grasp">>
			<<elseif _handaction.includes("spray")>>
				<<set _action to "spray">>
			<<else>>
				<<set _action to _handaction>>
			<</if>>
			<<if _handaction.includes("mouth_")>>
				<<set _actionpart to "mouth">>
			<<elseif _handaction.includes("vagina_")>>
				<<set _actionpart to "vagina">>
			<<elseif _handaction.includes("penis_")>>
				<<set _actionpart to "penis">>
			<<elseif _handaction.includes("anus_")>>
				<<set _actionpart to "anus">>
			<<elseif _handaction.includes("chest_")>>
				<<set _actionpart to "chest">>
			<</if>>
		<</if>>
		<<switch _action>>
			<<case "rest">>
				/* nothing to do */
			<<case "stroke">>
				<<if _actionpart is "mouth">>
					You stroke the <<struggle_name _actionpart>>, hoping to put it at ease.
				<<else>>
					You stroke the <<struggle_name _actionpart>>'s <<struggle_appendage _actionpart>>, hoping to excite it.
					<<if $struggle[_actionpart].progress gt 7 and $struggle[_actionpart].progress lt (_actionpart is "chest" ? 12 : 13)>>
						<<set $struggle[_actionpart].progress++>>
						<<set $player.bodyliquid[_actionpart].goo++>>
						<<if ["vagina", "anus"].includes(_actionpart)>>
							<<struggle_fluid _actionpart>>
							<<purity -1>>
							<<internalejac>>
						<</if>>
					<</if>>
				<</if>>

				<<neutral 5>><<submission 2>>

				<<set V[_hand + 'arm'] to "struggle">>
				<<set V[_hand + 'armstate'] to _actionpart + '_struggle'>>
				<<if $leftaction is $rightaction>>
					<<set $rightarmstate to _actionpart + '_struggle'>>
					<<set $rightarm to "struggle">>
					<<submission 2>>
					<<break>>
				<</if>>
			<<case "grasp">>
				You raise your <<if $leftaction is $rightaction>>hands<<else>>_hand hand<</if>> to the <<print $struggle[_actionpart].creature>> clinging to your <<struggle_region _actionpart>>, though it's hard to find purchase.
				<<set V[_hand + 'arm'] to "struggle">>
				<<set V[_hand + 'armstate'] to _actionpart + '_struggle'>>
				<<set $struggle[_actionpart].grip++>>

				<<if $leftaction is $rightaction>>
					<<set $rightaction to _actionpart + '_strengthen'>>
					<<set $rightarm to "struggle">>
					<<set $rightarmstate to _actionpart + '_struggle'>>
					<<set $struggle[_actionpart].grip++>>
					<<break>>
				<<else>>

					<<set V[_hand + 'action'] to _actionpart + '_strengthen'>>
				<</if>>
			<<case "strengthen">>
				You tighten your grip on the <<print $struggle[_actionpart].creature>> clinging to your <<struggle_region _actionpart>><<if $leftaction is $rightaction>> with both hands<</if>>.
				<<set V[_hand + 'arm'] to "struggle">>
				<<set V[_hand + 'armstate'] to _actionpart + '_struggle'>>
				<<set _rng2000 to random(2000)>>

				<<if _grip_strength gte _rng2000>>
					Your grasp is much better.
					<<set $struggle[_actionpart].grip += 2>>
				<<else>>
					Your grasp is a bit better.
					<<set $struggle[_actionpart].grip += 1>>
				<</if>>

				<<handskilluse>>

				<<if $leftaction is $rightaction>>
					<<set $struggle[_actionpart].grip += (_grip_strength gte _rng2000 ? 2 : 1)>>
					<<set $rightarm to "struggle">>
					<<set $rightarmstate to _actionpart + '_struggle'>>
					<<break>>
				<</if>>
			<<case "pull">>

				You dig your nails in and try to wrench the <<print $struggle[_actionpart].creature>> off your <<struggle_region _actionpart>>.
				<<struggle_difficulty_set>>
				<<if $struggle[_actionpart].success gte random (1, 100)>>
					You hurl it away from you.
					<<set V[_actionpart + 'use'] to 0>>
					<<set V[_actionpart + 'state'] to 0>>
					<<struggle_part_init _actionpart>>
					<<set $struggle.warded++>>
					<<struggleClearActions `_actionpart + '_'`>>
				<<else>>

					You can't maintain your grip, and your fingers pull away without the creature.
					<<set $struggle[_actionpart].grip to 0>>
					<<set V[_hand + 'action'] to _actionpart + '_grasp'>>
				<</if>>

				<<if $leftaction is $rightaction>>
					<<break>>
				<</if>>

			<<case "spray">>
				<<if $spray gte 1>>
					You spray the <<print $struggle[_actionpart].creature>>. It leaps off your <<struggle_region _actionpart>>.
					<<set $spraystat++>><<spray -1>>
					<<set V[_actionpart + 'use'] to 0>>
					<<set V[_actionpart + 'state'] to 0>>
					<<struggle_part_init _actionpart>>
					<<set $struggle.warded++>>
					<<struggleClearActions _actionpart>>
				<<else>>
					You try to spray the <<print $struggle[_actionpart].creature>> clinging to your <<struggle_region _actionpart>>, but your spray is empty!
				<</if>>

				<<if $leftaction is $rightaction>>
					<<break>>
				<</if>>
		<</switch>>
	<</for>>

	/* lose grasp on the lurkers that you have no contact with */
	<<if !$carryblock>>
		<<for _part range ["mouth", "vagina", "penis", "anus", "chest"]>>
			<<if $struggle[_part].grip gt 0 and (!$leftaction or !$leftaction.includes(_part)) and (!$rightaction or !$rightaction.includes(_part))>>
				Switching all attention away from it, you lose all grasp on the <<print $struggle[_part].creature>> clutching your <<struggle_region _part>>.
				<<set $struggle[_part].grip to 0>>

				<<if $leftarmstate.toString().includes(_part)>>
					<<set $leftarmstate to 0>>
					<<set $leftarm to 0>>
				<</if>>
				<<if $rightarmstate.toString().includes(_part)>>
					<<set $rightarmstate to 0>>
					<<set $rightarm to 0>>
				<</if>>

				<<if $rightactioncarry is (_part + '_strengthen')>>
					<<set $rightactioncarry to (_part + '_grasp')>>
				<</if>>
				<<if $leftactioncarry is (_part + '_strengthen')>>
					<<set $leftactioncarry to (_part + '_grasp')>>
				<</if>>
			<</if>>
		<</for>>
	<</if>>

	/* capture calculations should go independently */
	<<if $leftaction is "capture" or $rightaction is "capture">>
		<<set _capture_chance to (!!($leftaction is "capture") + !!($rightaction is "capture")) * 30>>

		<<for _i to 0; _i lt $struggle.number; _i++>>
			<<if $struggle.enemy[_i].location is "fleeing">>
				<<set _capture_chance *= 2>>
				<<set _capture_creature to _i>>
				<<break>>
			<<elseif $struggle.enemy[_i].location is "lurking">>
				<<set _capture_creature to _i>>
			<</if>>
		<</for>>
		<<if _capture_creature isnot undefined>>

			You cast your net at the <<if $struggle.enemy[_capture_creature] is "fleeing">>recoiling <</if>><<print $struggle.enemy[_capture_creature].name>><<if $leftaction is $rightaction>> with both hands<</if>>.
			<<if $prof.net / 20 + _capture_chance gte random(100)>>
				<<set _succ to true>>
			<</if>>
		<<else>>
			You prepare to cast your net at a <<print $struggle.creature>>, but they're too close. You'll have to drive one back first.
		<</if>>
		<<if _succ>>
			The net lands true. You pull the creature into your possession.
			<<if $struggle.enemy[_capture_creature].name is "lurker">>
				<<set $lurkers_held += 1>>
				<<set $stat_lurkers_captured += 1>>
			<</if>>
			<<set $struggle.done += 1>>
			<<set $struggle.enemy[_capture_creature].location to "fled">>
			<<set $leftaction to "rest">>
		<<else>>
			The creature squirms aside.<<gnet>><<prof net 1>>
		<</if>>
	<</if>>
	<<if !$carryblock>>
		<<set $leftactiondefault to ($leftaction ? $leftaction : "rest"); $leftaction to 0>>
		<<set $rightactiondefault to ($rightaction ? $rightaction : "rest"); $rightaction to 0>>
	<</if>>

<</widget>>

<<widget "struggle_enemy">>
	<<if $struggle.mouth.creature>>
		<<switch $struggle.mouth.progress>>
			<<case 0>>
				<<if $struggle.mouth.legs is "tentacles">>
					The <<print $struggle.mouth.creature>>'s tentacles wrap around your neck.<<neutral 2>>
				<<else>>
					The <<print $struggle.mouth.creature>>'s <<struggle_appendage mouth>> rubs against your face.<<neutral 1>>
				<</if>>
			<<case 1>>
				The <<print $struggle.mouth.creature>> plays with your lips, searching for a way in.<<neutral 2>>
			<<case 2>>
				The <<print $struggle.mouth.creature>>'s <<struggle_appendage mouth>> pushes against your lips.<<neutral 4>>
			<<case 3>>
				The tip of the <<print $struggle.mouth.creature>>'s <<struggle_appendage mouth>> begins to part your lips. It's about to penetrate fully.<<neutral 5>>
			<<case 4>>
				<<if $player.virginity.oral isnot true>>
					The <<print $struggle.mouth.creature>> <<print (_mouthOpen ?'slides':'forces')>> its <<struggle_appendage mouth>> into your mouth. It becomes girthier as more enters.
					<<oralstat>>
				<<else>>
					The <<print $struggle.mouth.creature>> <<print (_mouthOpen ?'slides':'forces')>> its <<struggle_appendage mouth>> into your mouth. It tastes strange.
					<<takeVirginity $struggle.mouth.creature "oral">><<oralstat>>
				<</if>>
				<<if $consensual isnot 1>><<bruise face>><<violence 1>><<raped>><</if>>
				<<neutral 5>><<set $mouthstate to "struggle_pen">><<set $mouthaction to 0>>
			<<case 5>>
				The <<print $struggle.mouth.creature>> pushes itself deeper into your mouth.<<neutral 5>>
			<<case 6>>
				The <<print $struggle.mouth.creature>>'s <<struggle_appendage mouth>> pushes down your throat. <<if $underwater isnot 1>>You can't breathe!<</if>><<neutral 5>>
			<<case 7>>
				The <<print $struggle.mouth.creature>> shudders as it begins to pump a sweet fluid down your throat.<<neutral 5>><<struggle_fluid mouth>><<purity -1>><<internalejac>><<set $player.bodyliquid.mouth.goo += 1>><<oralejacstat>><<ejacstat>>
			<<case 13>>
				<<if $struggle.creature is "lurker">>
					<<impregnate "Lurker" 400>><<fertilise>>
					<<if _impreg is true>>
						The <<print $struggle.mouth.creature>>'s <<struggle_appendage mouth>> expands again, but the extra pressure disappears quickly. It feels like it left something behind. <<neutral 5>><<struggle_fluid mouth>><<purity -1>><<internalejac>><<set $player.bodyliquid.mouth.goo += 1>>
					<<else>>
						<<set _failedImpreg to true>>
					<</if>>
					<<set _impreg to false>>
				<<else>>
					<<set _failedImpreg to true>>
				<</if>>
				<<if _failedImpreg>>
					The <<print $struggle.mouth.creature>> pumps a sweet fluid down your throat.<<neutral 5>><<struggle_fluid mouth>><<purity -1>><<internalejac>><<set $player.bodyliquid.mouth.goo += 1>>
				<</if>>
			<<case 14>>
				The <<print $struggle.mouth.creature>> shudders, and withdraws its <<struggle_appendage mouth>> from your throat. It leaps from your face.<<neutral 5>><<struggle_fluid mouth>>
				<<set $mouthuse to 0>>
				<<set $mouthstate to 0>>
				<<struggle_part_init "mouth">>

				<<set $struggle.satisfied += 1>>
			<<default>>
				The <<print $struggle.mouth.creature>> pumps a sweet fluid down your throat.<<neutral 5>><<struggle_fluid mouth>><<purity -1>><<internalejac>><<set $player.bodyliquid.mouth.goo += 1>>
		<</switch>>
		<<if $struggle.mouth.progress gte 6 and $struggle.mouth.progress lte 14>>
			<<if $underwater isnot 1>>
				<<oxygen -150>>
			<</if>>
			<<if $oxygen gte 900>>

			<<elseif $oxygen gte 600>>
			<<elseif $oxygen gte 300>>
			<<elseif $oxygen gte 1>>
			<<else>>
				<<violence 15>>
			<</if>>
		<</if>>
		<<set $struggle.mouth.progress += 1>>

	<</if>>

	<<if $struggle.vagina.creature>>
		<<switch $struggle.vagina.progress>>
			<<case 0>>
				<<if $struggle.vagina.legs is "tentacles">>
					The <<print $struggle.vagina.creature>>'s tentacles grope and cling to your pelvis.<<neutral 2>>
				<<else>>
					The <<print $struggle.vagina.creature>>'s <<struggle_appendage vagina>> prods your pelvis, as if searching for something.<<neutral 1>>
				<</if>>
			<<case 1>>
				The <<print $struggle.vagina.creature>> slides over your labia, searching for a way in.<<neutral 2>>
			<<case 2>>
				<<struggle_clothes vagina>>
			<<case 3>>
				The tip of the <<print $struggle.vagina.creature>>'s <<struggle_appendage vagina>> pushes against your <<pussy>>. It's about to penetrate fully.<<neutral 5>>
			<<case 4>>
				<<set _pain to $vaginalPain>>
				<<if $player.virginity.vaginal isnot true>>
					The <<print $struggle.vagina.creature>> forces its <<struggle_appendage vagina>> into your <<pussy>>. It becomes girthier as more enters.
					<<set $vaginastate to "struggle_pen">><<vaginalstat>><<vaginaraped>>
					<<sex 30>><<pain _pain>>
				<<else>>
					The <<print $struggle.vagina.creature>> forces its <<struggle_appendage vagina>> 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.
					<<else>>
						breaking your hymen and forever robbing you of your purity.
					<</if>>
					<<set $vaginastate to "struggle_pen">><<vaginalstat>><<vaginaraped>>
					<<sex 30>><<pain _pain>>
				<</if>>
				<<takeVirginity $struggle.vagina.creature "vaginal">>
				<<if $consensual isnot 1>><<bruise vagina>><<violence 2>><<raped>><<vaginaraped>><</if>>
				<<neutral 5>>
			<<case 5>>
				The <<print $struggle.vagina.creature>> pushes itself deeper into your <<pussy>>.<<neutral 5>>
			<<case 6>>
				The <<print $struggle.vagina.creature>>'s <<struggle_appendage vagina>> begins to thrust into your <<pussy>>.<<neutral 5>>
			<<case 7>>
				The <<print $struggle.vagina.creature>> shudders and pumps a warm fluid into your <<pussy>>.<<neutral 5>><<struggle_fluid vagina>><<purity -1>><<internalejac>><<set $player.bodyliquid.vagina.goo += 1>><<vaginalejacstat>><<ejacstat>>
			<<case 14>>
				The <<print $struggle.vagina.creature>> shudders, and withdraws its <<struggle_appendage vagina>> from your <<pussy>>. It leaps from your pelvis.<<neutral 5>><<struggle_fluid vagina>>
				<<set $vaginause to 0>>
				<<set $vaginastate to 0>>
				<<struggle_part_init "vagina">>

				<<set $struggle.satisfied += 1>>
			<<default>>
				The <<print $struggle.vagina.creature>> pumps a warm fluid into your <<pussy>>.<<neutral 5>><<struggle_fluid vagina>><<purity -1>><<internalejac>><<set $player.bodyliquid.vagina.goo += 1>>
			<</switch>>
		<<set $struggle.vagina.progress += 1>>

	<</if>>

	<<if $struggle.penis.creature>>
		<<switch $struggle.penis.progress>>
			<<case 0>>
				<<if $struggle.penis.legs is "tentacles">>
					The <<print $struggle.penis.creature>> lowers itself towards your <<penis>> as its tentacles slide and grope.<<neutral 2>>
				<<else>>
					The <<print $struggle.penis.creature>> lowers itself towards your <<penis>>.<<neutral 1>>
				<</if>>
			<<case 1>>
				The <<print $struggle.penis.creature>> presses against your <<penis>>, trying to envelop.<<neutral 2>>
			<<case 2>>
				<<struggle_clothes penis>>
			<<case 3>>
				The <<print $struggle.penis.creature>> pushes against your <<penis>>. It's about to envelop you fully.<<neutral 5>>
			<<case 4>>
				<<set _pain to $penisPain>>
				<<if $player.virginity.penile isnot true>>
					The <<print $struggle.penis.creature>> forces your <<penis>> inside its body. It becomes tighter as more enters.
					<<set $penisstate to "struggle_pen">><<penilestat>><<penisraped>>
					<<sex 30>><<pain _pain>>
				<<else>>
					The <<print $struggle.penis.creature>> forces your <<penis>> into its body, separating your foreskin from your glans and forever robbing you of your purity.
					<<set $penisstate to "struggle_pen">><<penilestat>><<penisraped>>
					<<sex 30>><<pain _pain>>
				<</if>>
				<<takeVirginity $struggle.penis.creature "penile">>
				<<if $consensual isnot 1>><<bruise penis>><<violence 2>><<raped>><<penisraped>><</if>>
				<<neutral 5>>
			<<case 5>>
				The <<print $struggle.penis.creature>> takes your <<penis>> deeper inside.<<neutral 5>>
			<<case 6>>
				The <<print $struggle.penis.creature>> begins to thrust against your <<penis>>.<<neutral 5>>
			<<case 7>>
				The <<print $struggle.penis.creature>> shudders as your <<penis>> thrusts against its core.<<neutral 5>><<set $player.bodyliquid.penis.goo += 1>>
			<<case 14>>
				The <<print $struggle.penis.creature>> shudders, and releases your <<penis>>. It leaps from your tummy.<<neutral 5>>
				<<set $penisuse to 0>>
				<<set $penisstate to 0>>
				<<struggle_part_init "penis">>

				<<set $struggle.satisfied += 1>>
			<<default>>
				The <<print $struggle.penis.creature>> thrusts against your <<penis>>.<<neutral 5>><<set $player.bodyliquid.penis.goo += 1>>
		<</switch>>
		<<set $struggle.penis.progress += 1>>

	<</if>>

	<<if $struggle.anus.creature>>
		<<switch $struggle.anus.progress>>
		<<case 0>>
			<<if $struggle.anus.legs is "tentacles">>
				The <<print $struggle.anus.creature>>'s tentacles slide and grope over your <<bottom>>.<<neutral 2>>
			<<else>>
				The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> slides over your <<bottom>>.<<neutral 1>>
			<</if>>
		<<case 1>>
			The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> gropes your <<bottom>>, trying to find an entrance.<<neutral 2>>
		<<case 2>>
			<<struggle_clothes anus>>
		<<case 3>>
			The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> pushes against your <<bottom>>, about to penetrate you fully.<<neutral 5>>
		<<case 4>>
			<<set _pain to $analPain>>
			<<if $player.virginity.anal isnot true>>
				The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> thrusts into your <<bottom>>. It becomes girthier as more enters.
				<<set $anusstate to "struggle_pen">><<analstat>><<anusraped>>
				<<sex 30>><<pain _pain>>
			<<else>>
				The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> thrusts into your <<bottom>>, violating you in a way you hadn't conceived of.
				<<takeVirginity $struggle.anus.creature "anal">><<set $anusstate to "struggle_pen">><<analstat>><<anusraped>>
				<<sex 30>><<pain _pain>>
			<</if>>
			<<if $consensual isnot 1>><<bruise anus>><<violence 2>><<raped>><<anusraped>><</if>>
			<<neutral 5>>
		<<case 5>>
			The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> pushes deeper into your <<bottom>>.<<neutral 5>>
		<<case 6>>
			The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> begins to thrust into your <<bottom>>.<<neutral 5>>
		<<case 7>>
			The <<print $struggle.anus.creature>> shudders as it pumps a warm fluid into your <<bottom>>.<<neutral 5>><<struggle_fluid anus>><<purity -1>><<internalejac>><<set $player.bodyliquid.anus.goo += 1>><<analejacstat>><<ejacstat>>
		<<case 13>>
			<<impregnate $struggle.anus.creature 50>>
			<<if _impreg is true>>
				The <<print $struggle.anus.creature>>'s <<struggle_appendage mouth>> expands again, but the extra pressure disappears quickly. It feels like it left something behind.<<neutral 5>><<set $player.bodyliquid.anus.goo += 1>><<struggle_fluid anus>><<purity -1>><<internalejac>><<set $player.bodyliquid.anus.goo += 1>>
				<<set _impreg to false>>
			<<else>>
				The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> thrusts into your <<bottom>>.<<neutral 5>><<set $player.bodyliquid.anus.goo += 1>><<struggle_fluid anus>><<purity -1>><<internalejac>><<set $player.bodyliquid.anus.goo += 1>>
			<</if>>
		<<case 14>>
			The <<print $struggle.anus.creature>> shudders and withdraws its <<struggle_appendage anus>>, leaping from your <<bottom>><<neutral 5>><<struggle_fluid anus>>
			<<set $anususe to 0>>
			<<set $anusstate to 0>>
			<<struggle_part_init "anus">>

			<<set $struggle.satisfied += 1>>
		<<default>>
			The <<print $struggle.anus.creature>>'s <<struggle_appendage anus>> thrusts into your <<bottom>>.<<neutral 5>><<set $player.bodyliquid.anus.goo += 1>><<struggle_fluid anus>><<purity -1>><<internalejac>><<set $player.bodyliquid.anus.goo += 1>>
		<</switch>>
		<<set $struggle.anus.progress += 1>>

	<</if>>

	<<if $struggle.chest.creature>>
		<<switch $struggle.chest.progress>>
			<<case 0>>
				<<neutral 2>>
				<<if $struggle.chest.legs is "tentacles">>
					The <<print $struggle.chest.creature>>'s tentacles grope your <<breasts>>,
					<<if $breastsize gte 3>>
						squeezing them together as a phallic <<struggle_appendage chest>> rubs against them.
					<<else>>
						teasing them as a phallic <<struggle_appendage chest>> rubs between them.
					<</if>>
				<<elseif $struggle.chest.legs is "legs">>
					The <<print $struggle.chest.creature>>'s legs grope your
					<<if $breastsize gte 3>>
						<<breasts>>. A phallic <<struggle_appendage chest>> emerges from the creature, and rubs against them.
					<<else>>
						<<breasts>>, teasing them as a phallic <<struggle_appendage chest>> emerges from the creature, and joins the flurry.
					<</if>>
				<<else>>
					The <<print $struggle.chest.creature>>'s body slides over your <<breasts>>.
					<<if $breastsize gte 3>>
						A phallic <<struggle_appendage chest>> emerges from the creature and rubs against them.
					<<else>>
						It teases them as a phallic <<struggle_appendage chest>> emerges from the creature.
					<</if>>
				<</if>>
			<<case 1>>
				<<struggle_clothes chest>>
			<<case 2>>
				<<if $breastsize gte 3>>
					<<if $struggle.chest.legs is "tentacles">>
						The <<print $struggle.chest.creature>>'s tentacles wrap around your breasts.<<neutral 5>>
					<<else>>
						The <<print $struggle.chest.creature>> squeezes your <<breasts>> together, and pushes its <<struggle_appendage chest>> between them.<<neutral 3>>
					<</if>>
				<<else>>
					<<if $struggle.chest.legs is "tentacles">>
						The <<print $struggle.chest.creature>>'s tentacles grope and flick your <<breasts>>.<<neutral 5>>
					<<else>>
						The <<print $struggle.chest.creature>> gropes and teases your <<breasts>>.<<neutral 3>>
					<</if>>
				<</if>>
				<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
					You feel milk leak from your buds.
					<<breastfeed>>
					<<milkvolume 1>>
				<<else>>
					<<milkvolume 1>>
				<</if>>
			<<case 3>>
				<<if $breastsize gte 3>>
					<<if $struggle.chest.legs is "tentacles">>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s tentacles squeeze milk from your <<breasts>>.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s tentacles squeeze your <<breasts>>, while others flick your nipples.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>>
					<<else>>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>> thrusts its <<struggle_appendage chest>> between your <<breasts>> as milk leaks from your buds.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>> thrusts its <<struggle_appendage chest>> between your <<breasts>>.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>>
					<</if>>
				<<else>>
					<<struggle_flat_chest>>
				<</if>>
			<<case 4>>
				<<if $breastsize gte 3>>
					<<if $struggle.chest.legs is "tentacles">>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s appendage presses against your <<breasts>> as the tentacles continue to squeeze milk from your buds.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s appendage presses against your <<breasts>> as the tentacles continue to squeeze.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>>
					<<else>>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>> fucks your <<breasts>> as milk leaks from your buds. The creature shudders as a warm fluid erupts from its <<struggle_appendage chest>>.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s <<struggle_appendage chest>> fucks your <<breasts>>. The creature shudders as a warm fluid erupts from its <<struggle_appendage chest>>.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>><<set $player.bodyliquid.chest.goo += 1>>
					<</if>>
				<<else>>
					<<struggle_flat_chest>>
				<</if>>
			<<case 5>>
				<<if $breastsize gte 3>>
					<<if $struggle.chest.legs is "tentacles">>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s appendage thrusts between your <<breasts>> as the tentacles continue to squeeze milk from your buds.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s appendage thrusts between your <<breasts>> as the tentacles continue to squeeze.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>>
					<<else>>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s <<struggle_appendage chest>> fucks your <<breasts>>, pumping warm fluid with each thrust as milk leaks from your buds.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s <<struggle_appendage chest>> keeps thrusting between your <<breasts>>, pumping out a warm fluid.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>><<set $player.bodyliquid.chest.goo += 1>>
					<</if>>
				<<else>>
					<<struggle_flat_chest>>
				<</if>>
			<<case 6>>
				<<if $breastsize gte 3>>
					<<if $struggle.chest.legs is "tentacles">>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s appendage fucks your <<breasts>> as the tentacles continue to squeeze milk from your buds. The creature shudders as a warm fluid erupts from its <<struggle_appendage chest>>.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s appendage fucks your <<breasts>> as the tentacles continue to squeeze. The creature shudders as a warm fluid erupts from its <<struggle_appendage chest>>.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>><<set $player.bodyliquid.chest.goo += 1>>
					<<else>>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s <<struggle_appendage chest>> fucks your <<breasts>>, pumping warm fluid with each thrust as milk leaks from your buds.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s <<struggle_appendage chest>> keeps thrusting between your <<breasts>>, pumping out a warm fluid.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>><<set $player.bodyliquid.chest.goo += 1>>
					<</if>>
				<<else>>
					<<struggle_flat_chest>>
				<</if>>
			<<case 12>>
				<<if $breastsize gte 3>>
					The <<print $struggle.chest.creature>> shudders and withdraws its <<struggle_appendage chest>>, leaping from your <<breasts>><<set $player.bodyliquid.chest.goo += 1>>
				<<else>>
					The <<print $struggle.chest.creature>> leaps from your <<breasts>>.
				<</if>>
				<<set $chestuse to 0>>
				<<set $cheststate to 0>>
				<<struggle_part_init "chest">>

				<<set $struggle.satisfied += 1>>
			<<default>>
				<<if $breastsize gte 3>>
					<<if $struggle.chest.legs is "tentacles">>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s appendage keeps thrusting between your <<breasts>>, pumping a warm fluid as the tentacles continue to squeeze milk from your buds.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s appendage keeps thrusting between your <<breasts>>, pumping out a warm fluid.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>><<set $player.bodyliquid.chest.goo += 1>>
					<<else>>
						<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
							The <<print $struggle.chest.creature>>'s <<struggle_appendage chest>> fucks your <<breasts>>, pumping warm fluid with each thrust as milk leaks from your buds.
							<<breastfeed>>
						<<else>>
							The <<print $struggle.chest.creature>>'s <<struggle_appendage chest>> keeps thrusting between your <<breasts>>, pumping out a warm fluid.
							<<milkvolume 1>>
						<</if>>
						<<sex 5>><<set $player.bodyliquid.chest.goo += 1>>
					<</if>>
				<<else>>
					<<struggle_flat_chest>>
				<</if>>
		<</switch>>
		<<set $struggle.chest.progress += 1>>

	<</if>>

	<<set _targets to []>>
	<<if $mouthuse is 0>><<set _targets.push("mouth")>><</if>>
	<<if $vaginause is 0 and $player.vaginaExist>><<set _targets.push("vagina")>><</if>>
	<<if $penisuse is 0 and $player.penisExist>><<set _targets.push("penis")>><</if>>
	<<if $anususe is 0 and $analdisable is "f">><<set _targets.push("anus")>><</if>>
	<<if $chestuse is 0>><<set _targets.push("chest")>><</if>>

	<<for _i to 0; _i lt $struggle.number; _i++>>
		<<if $struggle.enemy[_i].location is "fleeing">>
			The <<print $struggle.enemy[_i].description>> <<print $struggle.enemy[_i].name>>
			<<if $struggle.enemy[_i].health gte 1 and $struggle.enemy[_i].satisfied lt 1>>
				<<if $underwater is 1>>
					swims around you,
				<<elseif $struggle.enemy[_i].motion is "flying">>
					flies around you,
				<<else>>
					lands nearby,
				<</if>>
				preparing to attack.
				<<set $struggle.enemy[_i].location to "lurking">>
			<<else>>
				<<if $underwater is 1>>
					swims into the murk.
				<<elseif $struggle.enemy[_i].motion is "flying">>
					flies away.
				<<else>>
					leaps away.
				<</if>>
				It won't return.
				<<set $struggle.done += 1>>
				<<set $struggle.enemy[_i].location to "fled">>
			<</if>>

		<<elseif $struggle.enemy[_i].location is "lurking" and _targets.length gt 0>>

			<<set $rng to random(1, 100)>>
			<<if $dodging gte 1>>
				<<set _doge_chance to (($feetskill / 3) + ($danceskill / 3) - $drunk - (!!$worn.feet.type.includes("heels") * 200))>>
				<<feetskilluse>>
			<</if>>
			<<set _hit_chance to random(1, 1000)>>
			<<if _doge_chance gte _hit_chance>>
				<<struggle_bide_the>> <<print $struggle.enemy[_i].description>> <<print $struggle.enemy[_i].name>>
				<<if $underwater is 1>>
					swims towards you,
				<<elseif $struggle.enemy[_i].motion is "flying">>
					flies towards you,
				<<else>>
					leaps towards you,
				<</if>>
				<<set $dodging -= 1>>
				<<if $drunk gte 60>>
					but you drunkenly stagger out of the way<<if !random(100)>> like a drunk master you are<</if>>,
				<<elseif $feetskill gte 800 or $danceskill gte 400>>
					but you dance aside,
				<<elseif $feetskill gte 200>>
					but you step aside,
				<<else>>
					but you stumble aside,
				<</if>>
				<<if _doge_chance - _hit_chance gte 200>>
					dodging it.
				<<else>>
					narrowly dodging it.
					<<for $_slot range ["over_upper", "over_lower", "upper", "lower", "under_upper", "under_lower"]>>
						<<if $worn[$_slot].name isnot "naked">>
							<<set $worn[$_slot].integrity -= random(10, 15)>>
							<<set _clothesdamaged to true>>
							It tears your $worn[$_slot].name as it passes
							<<break>>
						<</if>>
					<</for>>
					<<if !_clothesdamaged>>
						It whips you as it passes. <<pain 2>>
					<</if>>
					<<neutral 2>>
				<</if>>
			<<elseif $rng lte 66 and _targets.length gt 0>>
				<<set _target to _targets.pluck()>>
				<<struggle_bide_the>> <<print $struggle.enemy[_i].description>> <<print $struggle.enemy[_i].name>>
				<<if $underwater is 1>>
					swims towards you,
				<<elseif $struggle.enemy[_i].motion is "flying">>
					flies towards you,
				<<else>>
					leaps towards you,
				<</if>>
				landing on your <<struggle_region _target>>.
				<<struggle_attach _target>>
				<<set V[_target + 'use'] to "struggle">>
				<<set V[_target + 'state'] to "struggle">>
				<<set V[_target + 'target'] to "struggle">>
			<<else>>
				The <<print $struggle.enemy[_i].description>> <<print $struggle.enemy[_i].name>> waits for an opening.
				<<set $struggle.enemy[_i].bide to true>>
			<</if>>

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

	<<if $oxygen lt $oxygenmax and $underwater isnot 1 and _strangle is 1>>
		<<unset _strangle>>

Air: <<oxygencaption>>
	<</if>>

	<<turnend>>
<</widget>>

<<widget "struggle_difficulty">>/*Unused for now*/

	<<set $_chance to $struggle[$args[0]].success>>
	<<struggle_difficulty_set>>

	| Success Chance :
	<<if $_chance gte 100>>
		<<print $_chance>>%
	<<elseif $_chance gte 80>>
		<<print $_chance>>%
	<<elseif $_chance gte 60>>
		<<print $_chance>>%
	<<elseif $_chance gte 40>>
		<<print $_chance>>%
	<<elseif $_chance gte 20>>
		<<print $_chance>>%
	<<elseif $_chance gte 1>>
		<<print $_chance>>%
	<<else>>
		<<print $_chance>>%
	<</if>>
<</widget>>

<<widget "struggle_difficulty_set">>
	<<for $_part range ["mouth", "vagina", "penis", "anus", "chest"]>>
		<<set $struggle[$_part].success to Math.trunc(($struggle[$_part].grip * 17) + ($physique / 600))>>
		<<if $struggle[$_part].success gte 100>>

			<<if $leftactiondefault is $_part + '_strengthen'>>
				<<set $leftactiondefault to $_part + '_pull'>>
			<</if>>
			<<if $rightactiondefault is $_part + '_strengthen'>>
				<<set $rightactiondefault to $_part + '_pull'>>
			<</if>>
		<</if>>
	<</for>>
<</widget>>

<<widget "struggle_bide_the">>
	<<if $struggle.enemy[_i].bide is true>>
		<<set $struggle.enemy[_i].bide to false>>
		Seeing an opening, the
	<<else>>
		The
	<</if>>
<</widget>>

<<widget "struggle_fluid">>
	<<if ["mouth", "vagina", "anus"].includes($args[0])>>
		<<if $struggle[$args[0]].creature is "lurker" or $struggle.mouth.creature is "slime">>
			<<drugs 25>>
		<<elseif $struggle[$args[0]].creature is "pale slime">>
			<<drugs 50>>
			<<set $hallucinogen += 40>>
		<</if>>
	<</if>>
<</widget>>

<<widget "struggle_clothes">>

<<if $args[0] is "vagina" or $args[0] is "penis">>
	<<if $worn.over_lower.vagina_exposed is 0 or (setup.clothes.over_lower[clothesIndex('over_lower', $worn.over_lower)].skirt is 1 and $worn.over_lower.skirt_down is 1)>>
		<<set _struggle_exposed to "over">>
	<<elseif $worn.lower.vagina_exposed is 0 or (setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1 and $worn.lower.skirt_down is 1)>>
		<<set _struggle_exposed to "main">>
	<<elseif $worn.under_lower.vagina_exposed is 0 or (setup.clothes.under_lower[clothesIndex('under_lower', $worn.under_lower)].skirt is 1 and $worn.under_lower.skirt_down is 1)>>
		<<set _struggle_exposed to "under">>
	<<elseif $worn.genitals.type.includes("chastity")>>
		<<set _struggle_exposed to "genitals">>
	<<else>>
		<<set _struggle_exposed to "naked">>
	<</if>>
<<elseif $args[0] is "anus">>
	<<if (setup.clothes.over_lower[clothesIndex('over_lower', $worn.over_lower)].skirt is 1 and $worn.over_lower.skirt_down is 1) or $worn.over_lower.anus_exposed is 0>>
		<<set _struggle_exposed to "over">>
	<<elseif $worn.lower.anus_exposed is 0 or (setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1 and $worn.lower.skirt_down is 1)>>
		<<set _struggle_exposed to "main">>
	<<elseif $worn.under_lower.anus_exposed is 0 or (setup.clothes.under_lower[clothesIndex('under_lower', $worn.under_lower)].skirt is 1 and $worn.under_lower.skirt_down is 1)>>
		<<set _struggle_exposed to "under">>
	<<elseif $worn.genitals.anal_shield is 1>>
		<<set _struggle_exposed to "genitals">>
	<<else>>
		<<set _struggle_exposed to "naked">>
	<</if>>
<<elseif $args[0] is "chest">>
	<<if !$worn.over_upper.type.includes("naked") and $worn.over_upper.exposed lt 2>>
		<<set _struggle_exposed to "over_top">>
	<<elseif !$worn.upper.type.includes("naked") and $worn.upper.exposed lt 2>>
		<<set _struggle_exposed to "main_top">>
	<<elseif !$worn.under_upper.type.includes("naked") and $worn.under_upper.exposed is 0>>
		<<set _struggle_exposed to "under_top">>
	<<else>>
		<<set _struggle_exposed to "naked">>
	<</if>>
<</if>>

<<if _struggle_exposed is "over_top">>
	<<set $struggle[$args[0]].progress -= 1>>
	<<if $struggle[$args[0]].legs is "tentacles">>
		The <<print $struggle[$args[0]].creature>>'s tentacles tear your $worn.over_upper.name as they search for a way in.<<neutral 2>><<set $worn.over_upper.integrity -= 10>>
	<<else>>
		The <<print $struggle[$args[0]].creature>>'s appendage prods your <<struggle_bodypart $args[0]>> through your $worn.over_upper.name.<<neutral 1>>
	<</if>>
	<<set $worn.over_upper.integrity -= 10>>
	<<if $struggle[$args[0]].creature is "slime">>
		The fabric hisses as it dissolves in the slime.<<set $worn.over_upper.integrity -= 30>>
	<<elseif $struggle[$args[0]].creature is "pale slime">>
		The fabric violently hisses as it dissolves in the pale slime.<<set $worn.over_upper.integrity -= 50>>
	<</if>>
	<<if $worn.over_upper.integrity lte 0>>
		<<integritycheck no_text>><<exposure>>
		<<if $struggle[$args[0]].legs is "tentacles">>
			The tentacles wrap around the fabric, and tear it off your body with a flick, exposing your <<top>>.
		<<else>>
			Its appendage pierces the fabric, and tears it off your body with a flick, exposing your <<top>>.
		<</if>>
	<</if>>
<<elseif _struggle_exposed is "main_top">>
	<<set $struggle[$args[0]].progress -= 1>>
	<<if $struggle[$args[0]].legs is "tentacles">>
		The <<print $struggle[$args[0]].creature>>'s tentacles tear your $worn.upper.name as they search for a way in.<<neutral 2>><<set $worn.upper.integrity -= 10>>
	<<else>>
		The <<print $struggle[$args[0]].creature>>'s appendage prods your <<struggle_bodypart $args[0]>> through your $worn.upper.name.<<neutral 1>>
	<</if>>
	<<set $worn.upper.integrity -= 10>>
	<<if $struggle[$args[0]].creature is "slime">>
		The fabric hisses as it dissolves in the slime.<<set $worn.upper.integrity -= 30>>
	<<elseif $struggle[$args[0]].creature is "pale slime">>
		The fabric violently hisses as it dissolves in the pale slime.<<set $worn.upper.integrity -= 50>>
	<</if>>
	<<if $worn.upper.integrity lte 0>>
		<<integritycheck no_text>><<exposure>>
		<<if $struggle[$args[0]].legs is "tentacles">>
			The tentacles wrap around the fabric, and tear it off your body with a flick, exposing your <<undertop>>.
		<<else>>
			Its appendage pierces the fabric, and tears it off your body with a flick, exposing your <<undertop>>.
		<</if>>
	<</if>>
<<elseif _struggle_exposed is "under_top">>
	<<set $struggle[$args[0]].progress -= 1>>
	<<if $struggle[$args[0]].legs is "tentacles">>
		The <<print $struggle[$args[0]].creature>>'s tentacles tear your $worn.under_upper.name as they search for a way in.<<neutral 3>><<set $worn.under_upper.integrity -= 10>>
	<<else>>
		The <<print $struggle[$args[0]].creature>>'s appendage prods your $worn.under_upper.name.
	<</if>>
	<<set $worn.under_upper.integrity -= 10>>
	<<if $struggle[$args[0]].creature is "slime">>
		The fabric hisses as it dissolves in the slime.<<set $worn.under_upper.integrity -= 30>>
	<<elseif $struggle[$args[0]].creature is "pale slime">>
		The fabric violently hisses as it dissolves in the pale slime.<<set $worn.under_upper.integrity -= 50>>
	<</if>>
	<<if $worn.under_upper.integrity lte 0>>
		<<integritycheck no_text>><<exposure>>
		<<if $struggle[$args[0]].legs is "tentacles">>
			The tentacles wrap around the fabric, and tear it off your body with a flick, exposing your <<breasts>>.
		<<else>>
			Its appendage pierces the fabric, and tears it off your body with a flick, exposing your <<breasts>>.
		<</if>>
	<</if>>
<<elseif _struggle_exposed is "over">>
	<<set $struggle[$args[0]].progress -= 1>>
	<<if $struggle[$args[0]].legs is "tentacles">>
		The <<print $struggle[$args[0]].creature>>'s tentacles tear at your $worn.over_lower.name, trying to reach the <<struggle_bodypart $args[0]>> beneath.<<neutral 2>><<set $worn.over_lower.integrity -= 10>>
	<<else>>
		The <<print $struggle[$args[0]].creature>> tears at your $worn.over_lower.name, trying to reach the <<struggle_bodypart $args[0]>> beneath.<<neutral 1>>
	<</if>>
	<<set $worn.over_lower.integrity -= 10>>
	<<if $struggle[$args[0]].creature is "slime">>
		The fabric hisses as it dissolves in the slime.<<set $worn.over_lower.integrity -= 30>>
	<<elseif $struggle[$args[0]].creature is "pale slime">>
		The fabric violently hisses as it dissolves in the pale slime.<<set $worn.over_lower.integrity -= 50>>
	<</if>>
	<<if $worn.over_lower.integrity lte 0>>
		<<integritycheck no_text>><<exposure>>
		<<if $struggle[$args[0]].legs is "tentacles">>
			Its tentacles wrap around the fabric, and tear it off your body with a flick, exposing your <<crotch>>.
		<<else>>
			Its appendage pierces the fabric, and tears it off your body with a flick, exposing your <<crotch>>.
		<</if>>
	<</if>>
<<elseif _struggle_exposed is "main">>
	<<set $struggle[$args[0]].progress -= 1>>
	<<if $struggle[$args[0]].legs is "tentacles">>
		The <<print $struggle[$args[0]].creature>>'s tentacles tear at your $worn.lower.name, trying to reach the <<struggle_bodypart $args[0]>> beneath.<<neutral 2>><<set $worn.lower.integrity -= 10>>
	<<else>>
		The <<print $struggle[$args[0]].creature>> tears at your $worn.lower.name, trying to reach the <<struggle_bodypart $args[0]>> beneath.<<neutral 1>>
	<</if>>
	<<set $worn.lower.integrity -= 10>>
	<<if $struggle[$args[0]].creature is "slime">>
		The fabric hisses as it dissolves in the slime.<<set $worn.lower.integrity -= 30>>
	<<elseif $struggle[$args[0]].creature is "pale slime">>
		The fabric violently hisses as it dissolves in the pale slime.<<set $worn.lower.integrity -= 50>>
	<</if>>
	<<if $worn.lower.integrity lte 0>>
		<<integritycheck no_text>><<exposure>>
		<<if $struggle[$args[0]].legs is "tentacles">>
			Its tentacles wrap around the fabric, and tear it off your body with a flick, exposing your <<undies>>.
		<<else>>
			Its appendage pierces the fabric, and tears it off your body with a flick, exposing your <<undies>>.
		<</if>>
	<</if>>
<<elseif _struggle_exposed is "under">>
	<<set $struggle[$args[0]].progress -= 1>>
	<<if $struggle[$args[0]].legs is "tentacles">>
		The <<print $struggle[$args[0]].creature>>'s tentacles worm their way inside your $worn.under_lower.name, trying to get to the <<struggle_bodypart $args[0]>> beneath.<<neutral 2>><<set $worn.under_lower.integrity -= 10>>
	<<else>>
		The <<print $struggle[$args[0]].creature>> tears at your $worn.under_lower.name, trying to get to the <<struggle_bodypart $args[0]>> beneath.<<neutral 1>>
	<</if>>
	<<set $worn.under_lower.integrity -= 10>>
	<<if $struggle[$args[0]].creature is "slime">>
		The fabric hisses as it dissolves in the slime.<<set $worn.under_lower.integrity -= 30>>
	<<elseif $struggle[$args[0]].creature is "pale slime">>
		The fabric violently hisses as it dissolves in the pale slime.<<set $worn.under_lower.integrity -= 50>>
	<</if>>
	<<if $worn.under_lower.integrity lte 0>>
		<<integritycheck no_text>><<exposure>>
		<<if $struggle[$args[0]].legs is "tentacles">>
			Its tentacles worm their way into the fabric, and tear it off your body with a flick, exposing your <<genitals>>.
		<<else>>
			Its appendage pierces the fabric, and tears it off your body with a flick, exposing your <<genitals>>.
		<</if>>
	<</if>>
<<elseif _struggle_exposed is "genitals">>
	<<set $struggle[$args[0]].progress -= 1>>
	<<if $struggle[$args[0]].legs is "tentacles">>
		The <<print $struggle[$args[0]].creature>>'s tentacles worm behind your $worn.genitals.name, brushing against your <<struggle_bodypart $args[0]>> as they search for a way in.<<neutral 2>><<set $worn.genitals.integrity -= 10>>
	<<else>>
		The <<print $struggle[$args[0]].creature>> tears at your $worn.genitals.name, trying to get to your <<struggle_bodypart $args[0]>> beneath.<<neutral 1>><<set $worn.genitals.integrity -= 10>>
	<</if>>
	<<if $struggle[$args[0]].creature is "slime">>
		The material hisses as it dissolves in the slime.<<set $worn.genitals.integrity -= 30>>
	<<elseif $struggle[$args[0]].creature is "pale slime">>
		The material violently hisses as it dissolves in the pale slime.<<set $worn.genitals.integrity -= 50>>
	<</if>>
	<<if $worn.genitals.integrity lte 0>>
		<<integritycheck no_text>><<exposure>>
		<<if $struggle[$args[0]].legs is "tentacles">>
			Its tentacles wrap around the material, and pull. The material groans as the <<print $struggle[$args[0]].creature>> tears it off your body with a flick, exposing your <<genitals>>.
		<<else>>
			Its appendage pierces the material, and pulls. The material groans as the <<print $struggle[$args[0]].creature>> tears it off your body with a flick, exposing your <<genitals>>.
		<</if>>
	<<else>>
		<<if $struggle[$args[0]].damage gte 10>>
			It hurts itself against the material, and leaps away.
			<<if $args[0] is "vagina">>
				<<set $vaginause to 0>>
				<<set $vaginastate to 0>>
				<<struggle_part_init "vagina">>
				<<set $struggle.warded += 1>>
				<<struggleClearActions "vagina_">>
			<<elseif $args[0] is "penis">>
				<<set $penisuse to 0>>
				<<set $penisstate to 0>>
				<<struggle_part_init "penis">>
				<<set $struggle.warded += 1>>
				<<struggleClearActions "penis_">>
			<<else>>
				<<set $anususe to 0>>
				<<set $anusstate to 0>>
				<<struggle_part_init "anus">>
				<<set $struggle.warded += 1>>
				<<struggleClearActions "anus_">>
			<</if>>
		<<else>>
			It hurts itself against the material.
			<<set $struggle[$args[0]].damage += 1>>
		<</if>>
	<</if>>
<<elseif _struggle_exposed is "naked">>
	<<if $args[0] is "vagina">>
		The <<print $struggle[$args].creature>>'s appendage presses against your <<pussy>>.<<neutral 4>>
	<<elseif $args[0] is "penis">>
		The <<print $struggle[$args].creature>> presses an aperture against your <<penis>>.<<neutral 4>>
	<<elseif $args[0] is "anus">>
		The <<print $struggle[$args].creature>>'s appendage presses against your <<bottom>>.<<neutral 4>>
	<<elseif $args[0] is "chest">>
		The <<print $struggle[$args].creature>>'s appendage presses against your <<breasts>>.<<neutral 4>>
	<</if>>
<</if>>

<</widget>>

<<widget "struggle_bodypart">><<silently>>
	<<switch $args[0]>>
		<<case "vagina">>
			<<pussy>>
		<<case "penis">>
			<<penis>>
		<<case "anus">>
			<<bottom>>
		<<case "chest">>
			<<breasts>>
	<</switch>>
<</silently>><<print _text_output>>
<</widget>>

<<widget "struggle_appendage">><<silently>>
	<<switch $struggle[$args[0]].creature>>
		<<case "wasp" "bee">>
			<<set $_text_output to "stinger">>
		<<case "squid">>
			<<set $_text_output to "tentacle">>
		<<default>>
			<<set $_text_output to "appendage">>
	<</switch>>
	<</silently>><<print $_text_output>>
<</widget>>

<<widget "struggle_flat_chest">>
	<<if $struggle.chest.legs is "tentacles">>
		<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
			The <<print $struggle.chest.creature>>'s tentacles flick your <<breasts>> as milk leaks from your buds.
		<<else>>
			The <<print $struggle.chest.creature>>'s tentacles flick and tease your <<breasts>>.
		<</if>>
		<<sex 5>>
	<<else>>
		<<if $lactating is 1 and $breastfeedingdisable is "f" and $milk_amount gte 1>>
			The <<print $struggle.chest.creature>> suckles your <<breasts>> as milk leaks from your buds.
			<<breastfeed>><<sex 3>>
		<<else>>
			The <<print $struggle.chest.creature>> sucks on your <<breasts>> as its <<struggle_appendage chest>> rubs against your abdomen.
			<<milkvolume 1>><<sex 5>>
		<</if>>
		<<sex 3>>
	<</if>>
<</widget>>

<<widget "struggle_attach">>
	<<set $struggle[$args[0]].creature to $struggle.enemy[_i].name>>
	<<set $struggle[$args[0]].description to $struggle.enemy[_i].description>>
	<<set $struggle[$args[0]].legs to $struggle.enemy[_i].legs>>
	<<set $struggle.enemy[_i].location to $args[0]>>

	<<set T['gold_' + $args[0]] to true>>
<</widget>>

<<widget "struggleClearActions">>
	<<if $args[0]>>
		<<if ($mouthaction).toString().includes($args[0])>>
			<<set $mouthactiondefault to $mouthaction>><<set $mouthaction to 0>>
		<</if>>
		<<if ($leftaction).toString().includes($args[0])>>
			<<set $leftactiondefault to $leftaction>><<set $leftaction to 0>>
		<</if>>
		<<if ($rightaction).toString().includes($args[0])>>
			<<set $rightactiondefault to $rightaction>><<set $rightaction to 0>>
		<</if>>
		<<if ($leftarmstate).toString().includes($args[0])>>
			<<set $leftarm to 0>><<set $leftarmstate to 0>>
		<</if>>
		<<if ($rightarmstate).toString().includes($args[0])>>
			<<set $rightarm to 0>><<set $rightarmstate to 0>>
		<</if>>
	<</if>>
<</widget>>

<<widget "struggle_region">><<silently>>
	<<if ["mouth","vagina","penis","anus","chest"].includes($args[0])>>
		<<switch $args[0]>>
			<<case "mouth">><<set _text_output to "head">>
			<<case "vagina">><<set _text_output to "pelvis">>
			<<case "penis">><<set _text_output to "tummy">>
			<<case "anus">><<set _text_output to "bottom">>
			<<case "chest">><<set _text_output to "chest">>
		<</switch>>
	<</if>>
	<</silently>><<print _text_output>>
<</widget>>