code:
:: Widgets Actions Generation [widget]

/*Please read dev comments before making changes*/
/*Be careful with changing names around, they are intentional as can get re-used when the user uses the controls, leading to errors if incorrect*/

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

/*Generated each set of actions in the form of a set of radio buttons*/
<<widget "generateCombatActionRadio">>

<<for _labelC, _valueC range $args[0]>>

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

<</for>>

<</widget>>

/*Generated each set of actions in the form of a list*/
<<widget "generateCombatActionList">>
<<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 colour of the list border when the option is changed*/
		<<combatButtonAdjustments _name "">>
	<</capture>>
<</if>>
<</widget>>

/*Generates the required divs and calls each type of action*/
<<widget "generateActionsMan">>

<<if $defaultsType is undefined>>
	<<getCombatDefaultsType>>
<</if>>
<<if $position isnot "stalk">>

		<<replaceActionLink>>

	<<if _targetlist is undefined>>
		<<getTargetList>>
	<</if>>
<</if>>
<<if !$stalk_end>>

			<<leftActionInit>>

			<<rightActionInit>>

			<<feetActionInit>>

			<<mouthActionInit>>

		<<if $player.penisExist>>

				<<penisActionInit>>

		<</if>>

		<<if $player.vaginaExist>>

				<<vaginaActionInit>>

		<</if>>

			<<anusActionInit>>

		<<if $chestuse isnot 0>>

				<<chestActionInit>>

		<</if>>

		<<if $thighuse isnot 0>>

				<<thighActionInit>>

		<</if>>

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

/*Generates the required values for defaults to be setup based on the situation*/
<<widget "getCombatDefaultsType">>
<<if $consensual == 1>>
	<<set $defaultsCombatType = "consensual">>
<<else>>
	<<set $defaultsCombatType = "rape">>
<</if>>
<<switch $enemytype>>
	<<case "man">>
		<<if $NPCNameList.includes($NPCList[0].fullDescription)>>
			<<if $actionDefaults[$NPCList[0].fullDescription] isnot undefined>>
				<<set $defaultsType to $NPCList[0].fullDescription>>
			<<else>>
				<<set $defaultsType to "Acquaintances">>
			<</if>>
		<<else>>
			<<set $defaultsType to "Strangers">>
		<</if>>
	<<case "beast">><<set $defaultsType to "Animals">>
	<<case "tentacles" "vore">>
		<<set $defaultsType to "Tentacles">>
		<<set $regrab = DefaultActions.get($defaultsCombatType, 'Tentacles', 'regrab', $actionDefaults, 0)[0]>>
	<<default>><<set $defaultsType to "Everyone">>
<</switch>>
<</widget>>

<<widget "getCombatDefaultsTypeClear">>
<<unset $defaultsType>>
<<unset $defaultsCombatType>>
<<unset $replaceAction>>
<<unset $regrab>>
<</widget>>

<<widget "replaceActionLink">>
<<if $replaceAction isnot "Alternative">>
	Switch to Alternative Actions
	|
<</if>>
<<if $replaceAction isnot "Submissive">>
	Switch to Submissive Actions
	|
<</if>>
<<if $replaceAction isnot "Defiant">>
	Switch to Defiant Actions
	|
<</if>>
<<if $replaceAction isnot undefined>>
	Switch to Normal Actions
	|
<</if>>

<</widget>>

<<widget "replaceAction">>
<<switch $args[0]>>
	<<case "Alternative">>
		<<if $actionDefaults?.rape?.Alternative === undefined
			|| $actionDefaults?.consensual?.Alternative === undefined>>
			<<setupDefaults>>
		<</if>>
		<<set $defaultsType to "Alternative">>
		<<set $replaceAction to "Alternative">>
	<<case "Submissive">>
		<<if $actionDefaults?.rape?.Submissive === undefined
			|| $actionDefaults?.consensual?.Submissive === undefined>>
			<<setupDefaults>>
		<</if>>
		<<set $defaultsType to "Submissive">>
		<<set $replaceAction to "Submissive">>
	<<case "Defiant">>
		<<if $actionDefaults?.rape?.Defiant === undefined
			|| $actionDefaults?.consensual?.Defiant === undefined>>
			<<setupDefaults>>
		<</if>>
		<<set $defaultsType to "Defiant">>
		<<set $replaceAction to "Defiant">>
	<<case "Normal">>
		<<getCombatDefaultsType>>
		<<unset $replaceAction>>
<</switch>>

<<replace #replaceAction>><<replaceActionLink _replace>><</replace>>
<<replace #leftaction>><<leftActionInit true>><</replace>>
<<replace #rightaction>><<rightActionInit true>><</replace>>
<<replace #feetaction>><<feetActionInit true>><</replace>>
<<replace #mouthaction>><<mouthActionInit true>><</replace>>
<<if $player.penisExist>>
	<<replace #penisaction>><<penisActionInit true>><</replace>>
<</if>>
<<if $player.vaginaExist>>
	<<replace #vaginaaction>><<vaginaActionInit true>><</replace>>
<</if>>
<<replace #anusaction>><<anusActionInit true>><</replace>>
<<if $chestuse isnot 0>>
	<<replace #chestaction>><<chestActionInit true>><</replace>>
<</if>>
<<if $thighuse isnot 0>>
	<<replace #thighaction>><<thighActionInit true>><</replace>>
<</if>>
<</widget>>

/*Each set of actions are based on the same set of rules*/
/*Setup by getting the situation that the player is in. i.e Their left hand is hold onto a penis*/

/*This is then followed up in getting the options that are available to the player, this would be from <<leftActions>>*/
/*in the case for the left hand. An object will be provide that contain moves in the form of {"actionName":"actionValue"}*/
/*actionName will be shown to the player, actionValue will be used to do the action*/

/*After the list of actions is setup, as long as there is more than one provide it will continue on to setting up the defaults*/
/*This will use the object setup in "base-system\attitudes.twee"*/

/*To provide extra imformation to the player, widgets such as `<<leftactionDifficulty>> can be used to display extra*/
/*information to the player such as "<<handdifficulty>>"" or "<<skulduggerydifficulty>><<combatcrime>>"*/
/*This will use the previous "actionValue"*/

/*Move colors will be provided through "combatListColor" found in "03-JavaScript\ingame.js"*/
/*These again use the "actionValue"*/

<<widget "leftActionInit">>
<<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 and $stealstateleft is undefined>>
			Target:
			<<listbox "$lefttarget" autoselect>>
				<<optionsfrom _targetlistarms>>
			<</listbox>>

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

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

		<</if>>
		<<if _targetnumber is 1>>
			<<set $lefttarget to _firsttarget>>
		<</if>>
	<</if>>
<<case "penis">>
	<<set _leftOptions to "penis">>
	<<selectNpcWithPartInPosition "penis" "leftarm">><<set $lefttarget to _j>>Your left hand is <<if $NPCList[_j].chastity.penis.includes("chastity")>>teasing<<else>>holding<</if>> <<combatpersons>> $NPCList[_j].penisdesc<<if $NPCList[_j].chastity.penis.includes("chastity")>> through <<his>> $NPCList[_j].chastity.penis<</if>>.
<<case "grappled">>
	<<if $orgasmdown gte 1>>
		<<set _leftOptions to "bothBound">>
		Your left arm jerks against their grip.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _leftOptions to "bothBound">>
		Your left arm is held in a painful grip.
	<<elseif $dissociation gte 2>>
		<<set _leftOptions to "bothBound">>
		Your left arm lies limp in their grip.
	<<else>>
		<<set _leftOptions to "grappled">>
		Your left arm is being held down.
	<</if>>
<<case "bound">>
	<<set _leftOptions to "bothBound">>
	<<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 arms are helplessly bound.
	<</if>>
<<case "othervagina">>
	<<set _leftOptions to "pussy">>
	<<selectNpcWithPartInPosition "vagina" "leftarm">><<set $lefttarget to _j>>Your left hand is <<if $NPCList[_j].chastity.vagina.includes("chastity")>>teasing<<else>>stroking<</if>> <<combatpersons>> pussy<<if $NPCList[_j].chastity.vagina.includes("chastity")>> through <<his>> $NPCList[_j].chastity.vagina<</if>>.
<<case "vagina">>
	<<set _leftOptions to "coverVagina">>
	Your left hand is protecting your <<pussy>>.
<<case "coverpenis">>
	<<set _leftOptions to "coverPenis">>
	Your left hand is protecting your <<penis>>.
<<case "anus">>
	<<set _leftOptions to "coverAss">>
	Your left hand is protecting your <<bottom>>.
<<case "behind">>
	<<set _leftOptions to "behind">>
	Your left hand is behind your back.
<<case "struggle">>
	<<set $_changetype to true>><<leftActionInitStruggle>>
<<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>>
	<<if $lastOptions.left isnot _leftOptions>>
		<<set _leftGold to true>>
	<</if>>
	<<leftActions>>
	<<if Object.keys(_leftaction).length gt 0>>
		<<if Object.values(_leftaction).includes($leftactiondefault) is false or $args[0] is true or $leftactiondefault is "rest">>
			<<set _defaultsCombatAction to "leftaction">>
			<<set _actionsSet = DefaultActions.get($defaultsCombatType, $defaultsType, _defaultsCombatAction)>>
			<<set _pass to false>>
			<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
				<<if 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]), "")>>
		<<generateCombatAction _leftaction "leftaction" _textColor $leftaction>>

		/*Checks/Difficulty*/
		<<if $combatControls.includes("ists")>>

				<<leftactionDifficulty>>

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

<<widget "leftactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $leftaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "leftwork" "leftclit">><<handdifficulty>>
	<<case "leftplay" "leftgrab">><<handdifficulty>> <<combatpromiscuous3>>
	<<case "steal">><<skulduggerydifficulty>><<combatcrime>>
	<<case "spray">>Remaining: $spray / $spraymax
	<<case "leftUndressOther">> <<handdifficulty>><<combatpromiscuous2>>
<</switch>>
<</widget>>

<<widget "leftActions">>
/*Generate Actions*/
<<set _leftaction to {}>>
<<if $position is "stalk">>
	<<set _leftaction["Clench"] to "clench">>
	<<set _leftaction["Fold"] to "fold">>
	<<leftFixAndCoverActions>>
	<<leftcoverface>>
	<<left_pursuit_grab>>
<<else>>
	<<switch _leftOptions>>
		<<case "free">>
			<<set _leftaction["Rest"] to "rest">>
			<<leftdefault>>
			<<leftgrabnew>>
			<<leftplaynew>>
			<<leftclothesnew>>
			<<leftspraynew>>
			<<leftstealnew>>
			<<leftpenwhacknew>>
			<<leftFixAndCoverActions>>
			<<leftchoke>>
			<<leftCondom>>
			<<leftshacklewhack>>
			<<handsstrugglefreebodypart "left">>
			<<leftUndressOther>>
		<<case "penis">>
			<<if $NPCList[$lefttarget].chastity.penis.includes("chastity")>>
				<<set _leftaction["Tease " + $NPCList[$lefttarget].pronouns.him] to "leftwork">>
			<<else>>
				<<set _leftaction["Work " + $NPCList[$lefttarget].pronouns.his + " shaft"] to "leftwork">>
			<</if>>
			<<set _leftaction["Stop"] to "leftstoppenis">>
		<<case "grappled">>
			<<set _leftaction["Rest"] to "rest">>
			<<set _leftaction["Struggle"] to "leftstruggle">>
		<<case "bothBound">>
		<<case "pussy">>
			<<if $NPCList[$lefttarget].chastity.vagina.includes("chastity")>>
				<<set _leftaction["Tease " + $NPCList[$lefttarget].pronouns.him] to "leftclit">>
			<<else>>
				<<set _leftaction["Rub " + $NPCList[$lefttarget].pronouns.his + " clit"] to "leftclit">>
			<</if>>
			<<set _leftaction["Stop"] to "leftothervaginastop">>
		<<case "coverVagina">>
			<<set _leftaction["Keep covering"] to "leftcovervagina">>
			<<set _leftaction["Stop"] to "leftstopvagina">>
		<<case "coverPenis">>
			<<set _leftaction["Keep covering"] to "leftcoverpenis">>
			<<set _leftaction["Stop"] to "leftstopcoverpenis">>
		<<case "coverAss">>
			<<set _leftaction["Keep covering"] to "leftcoveranus">>
			<<set _leftaction["Stop"] to "leftstopanus">>
		<<case "behind">>
			<<set _leftaction["Keep behind"] to "behind">>
			<<set _leftaction["Stop"] to "stopbehind">>
		<<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>>
<</if>>
<</widget>>

<<widget "rightActionInit">>
<<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 and $stealstateright is undefined>>
			Target:
			<<listbox "$righttarget" autoselect>>
				<<optionsfrom _targetlistarms>>
			<</listbox>>

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

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

		<</if>>
		<<if _targetnumber is 1>>
			<<set $righttarget to _firsttarget>>
		<</if>>
	<</if>>
<<case "penis">>
	<<set _rightOptions to "penis">>
	<<selectNpcWithPartInPosition "penis" "rightarm">><<set $righttarget to _j>>Your right hand is <<if $NPCList[_j].chastity.penis.includes("chastity")>>teasing<<else>>holding<</if>> <<combatpersons>> $NPCList[_j].penisdesc<<if $NPCList[_j].chastity.penis.includes("chastity")>> through <<his>> $NPCList[_j].chastity.penis<</if>>.
<<case "grappled">>
	<<if $orgasmdown gte 1>>
		<<set _rightOptions to "bothBound">>
		Your right arm jerks against their grip.
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		<<set _rightOptions to "bothBound">>
		Your right arm is held in a painful grip.
	<<elseif $dissociation gte 2>>
		<<set _rightOptions to "bothBound">>
		Your right arm lies limp in their grip.
	<<else>>
		<<set _rightOptions to "grappled">>
		Your right arm is being held down.
	<</if>>
<<case "bound">>
	<<set _rightOptions to "bothBound">>
	<<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 arms are helplessly bound.
	<</if>>
<<case "othervagina">>
	<<set _rightOptions to "pussy">>
	<<selectNpcWithPartInPosition "vagina" "rightarm">><<set $righttarget to _j>>Your right hand is <<if $NPCList[_j].chastity.vagina.includes("chastity")>>teasing<<else>>stroking<</if>> <<combatpersons>> pussy<<if $NPCList[_j].chastity.vagina.includes("chastity")>> through <<his>> $NPCList[_j].chastity.vagina<</if>>.
<<case "vagina">>
	<<set _rightOptions to "coverVagina">>
	Your right hand is protecting your <<pussy>>.
<<case "coverpenis">>
	<<set _rightOptions to "coverPenis">>
	Your right hand is protecting your <<penis>>.
<<case "anus">>
	<<set _rightOptions to "coverAss">>
	Your right hand is protecting your <<bottom>>.
<<case "behind">>
	<<set _rightOptions to "behind">>
	Your right hand is behind your back.
<<case "struggle">>
	<<set $_changetype to true>><<rightActionInitStruggle>>
<<case "swarmgrappled">>
	<<set $_changetype to true>><<rightActionInitSwarm>>
<<case "mechgrappled">>
	<<set $_changetype to true>><<rightActionInitMachine>>
<<default>>
	<<set $_changetype to true>><<rightActionInitTentacle>>
<</switch>>
	<<if $lastOptions.right isnot _rightOptions>>
		<<set _rightGold to true>>
	<</if>>
<<if $_changetype isnot true>>
	<<rightActions>>
	<<if Object.keys(_rightaction).length gt 0>>
		<<if Object.values(_rightaction).includes($rightactiondefault) is false or $args[0] is true or $rightactiondefault is "rest">>
			<<set _defaultsCombatAction to "rightaction">>
			<<set _actionsSet = DefaultActions.get($defaultsCombatType, $defaultsType, _defaultsCombatAction)>>
			<<set _pass to false>>
			<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
				<<if 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]), "")>>
		<<generateCombatAction _rightaction "rightaction" _textColor $rightaction>>

		/*Checks/Difficulty*/
		<<if $combatControls.includes("ists")>>

				<<rightactionDifficulty>>

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

<<widget "rightactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $rightaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "rightwork" "rightclit">><<handdifficulty>>
	<<case "rightplay" "rightgrab">><<handdifficulty>> <<combatpromiscuous3>>
	<<case "steal">><<skulduggerydifficulty>><<combatcrime>>
	<<case "spray">>Remaining: $spray / $spraymax
	<<case "rightUndressOther">> <<handdifficulty>><<combatpromiscuous2>>
<</switch>>
<</widget>>

<<widget "rightActions">>
/*Generate Actions*/
<<set _rightaction to {}>>
<<if $position is "stalk">>
	<<set _rightaction["Clench"] to "clench">>
	<<set _rightaction["Fold"] to "fold">>
	<<rightFixAndCoverActions>>
	<<rightcoverface>>
	<<right_pursuit_grab>>
<<else>>
	<<switch _rightOptions>>
		<<case "free">>
			<<set _rightaction["Rest"] to "rest">>
			<<rightdefault>>
			<<rightgrabnew>>
			<<rightplaynew>>
			<<rightclothesnew>>
			<<rightspraynew>>
			<<rightstealnew>>
			<<rightpenwhacknew>>
			<<rightFixAndCoverActions>>
			<<rightchoke>>
			<<rightCondom>>
			<<rightshacklewhack>>
			<<handsstrugglefreebodypart "right">>
			<<rightUndressOther>>
		<<case "penis">>
			<<if $NPCList[$righttarget].chastity.penis.includes("chastity")>>
				<<set _rightaction["Tease " + $NPCList[$righttarget].pronouns.him] to "rightwork">>
			<<else>>
				<<set _rightaction["Work " + $NPCList[$righttarget].pronouns.his + " shaft"] to "rightwork">>
			<</if>>
			<<set _rightaction["Stop"] to "rightstoppenis">>
		<<case "grappled">>
			<<set _rightaction["Rest"] to "rest">>
			<<set _rightaction["Struggle"] to "rightstruggle">>
		<<case "bothBound">>
		<<case "pussy">>
			<<if $NPCList[$righttarget].chastity.vagina.includes("chastity")>>
				<<set _rightaction["Tease " + $NPCList[$righttarget].pronouns.him] to "rightclit">>
			<<else>>
				<<set _rightaction["Rub " + $NPCList[$righttarget].pronouns.his + " clit"] to "rightclit">>
			<</if>>
			<<set _rightaction["Stop"] to "rightothervaginastop">>
		<<case "coverVagina">>
			<<set _rightaction["Keep covering"] to "rightcovervagina">>
			<<set _rightaction["Stop"] to "rightstopvagina">>
		<<case "coverPenis">>
			<<set _rightaction["Keep covering"] to "rightcoverpenis">>
			<<set _rightaction["Stop"] to "rightstopcoverpenis">>
		<<case "coverAss">>
			<<set _rightaction["Keep covering"] to "rightcoveranus">>
			<<set _rightaction["Stop"] to "rightstopanus">>
		<<case "behind">>
			<<set _rightaction["Keep behind"] to "behind">>
			<<set _rightaction["Stop"] to "stopbehind">>
		<<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>>
<</if>>
<</widget>>

<<widget "feetActionInit">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<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"))>>
				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>>
			<<set _feetOptions to "free">>
			Your feet are free.
		<</if>>
		<<if $combatControls is "radio" and _targetnumber gt 1 and _feetOptions.toLowerCase().includes("free")>>

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

		<</if>>
		<<if _targetnumber is 1>>
			<<set $feettarget to _firsttarget>>
		<</if>>
	<<case "penis">>
		<<set _feetOptions to "penis">>
		<<selectNpcWithPartInPosition "penis" "feet">><<set $feettarget to _j>>Your feet are <<if $NPCList[_j].chastity.penis.includes("chastity")>>pressed against<<else>>holding<</if>> <<combatpersons>> <<npcPenis _j>>.
	<<case "othervagina">>
		<<set _feetOptions to "othervagina">>
		<<selectNpcWithPartInPosition "vagina" "feet">><<set $feettarget to _j>>Your feet are <<if $NPCList[_j].chastity.vagina.includes("chastity")>>pressed against<<else>>holding back<</if>> <<combatpersons>> <<npcVagina _j>>.
	<<case "bound">>
		<<set _feetOptions to "bound">>
		Your legs are bound.
	<<case "walk">>
		<<set _feetOptions to "walk">>
		You are walking.
	<<case "run">>
		<<set _feetOptions to "run">>
		You are running.
	<<case "none">>
		<<set _feetOptions to "unusable">>
		Your feet are free but unusable in this position.
	<<case "mechgrappled">>
		<<set $_changetype to true>><<feetActionInitMachine>>
	<<default>>
		<<set $_changetype to true>><<feetActionInitTentacle>>
	<</switch>>
	<<if $lastOptions.feet isnot _feetOptions>>
		<<set _feetGold to true>>
	<</if>>
	<<if $_changetype isnot true>>
		<<feetActions>>
		<<if Object.keys(_feetaction).length gt 0>>
			<<if Object.values(_feetaction).includes($feetactiondefault) is false or $args[0] is true or $feetactiondefault is "rest">>
				<<set _defaultsCombatAction to "feetaction">>
				<<set _actionsSet = DefaultActions.get($defaultsCombatType, $defaultsType, _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if 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]), "")>>
			<<generateCombatAction _feetaction "feetaction" _textColor $feetaction>>

			/*Checks/Difficulty*/
			<<if $combatControls.includes("ists")>>

					<<feetactionDifficulty>>

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

<<widget "feetactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $feetaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "grab" "vaginagrab">><<feetdifficulty>><<combatpromiscuous3>>
	<<case "run">><<if $NPCList[0].legs is "run">><<stalk_athletics_difficulty>><</if>>
	<<case "hide">><<if $NPCList[0].state is "stalk">><<stalk_skulduggery_difficulty>><</if>>
<</switch>>
<</widget>>

<<widget "feetActions">>
/*Generate Actions*/
<<set _feetaction to {}>>
<<if $position is "stalk">>
	<<feet_walk>>
	<<feet_run>>
	<<feet_hobble>>
	<<feet_stand>>
	<<feet_hide>>
	<<feet_confront>>
<<else>>
	<<set _feetaction["Rest"] to "rest">>
	<<switch _feetOptions>>
	<<case "free">>
		<<feetgrabnew>>
		<<feetKick>>
		<<feetshoes>>
		<<feetsocks>>
	<<case "leftfree" "rightFree">>
		<<feetgrabnew>>
		<<feetKick>>
	<<case "penis">>
		<<feetGrabRub>>
	<<case "othervagina">>
		<<feetOthervagina>>
	<</switch>>
<</if>>
<</widget>>

<<widget "mouthActionInit">>
<<if $orgasmdown gte 1>>
	<<if $mouthuse is 0>>
		<<set _mouthOptions to "orgasm">>
		Your mouth is free, but involuntary moans and cries prevent speaking.
	<<else>>
		<<timed 100ms>>
			<<run jQuery("#mouthaction").remove();>>
		<</timed>>
	<</if>>
<<elseif $pain gte 100 and $willpowerpain is 0>>
	<<if $mouthuse is 0>>
		<<set _mouthOptions to "pain">>
		Your mouth is free, but involuntary sobs and cries prevent speaking.
	<<else>>
		<<timed 100ms>>
			<<run jQuery("#mouthaction").remove();>>
		<</timed>>
	<</if>>
<<elseif $dissociation gte 2>>
	<<if $mouthuse is 0>>
		<<set _mouthOptions to "unreal">>
		Your mouth is free, but you don't know why.
	<<else>>
		<<timed 100ms>>
			<<run jQuery("#mouthaction").remove();>>
		<</timed>>
	<</if>>
<<else>>
	<<switch $mouthuse>>
	<<case 0>>
		<<if $combatControls isnot "radio" and _targetnumber gt 1>>
			Target:
			<<listbox "$mouthtarget" autoselect>>
				<<optionsfrom _targetlist>>
			<</listbox>>

		<</if>>
		<<set _mouthOptions to "free">>
		Your mouth is free.
		<<if $combatControls is "radio" and _targetnumber gt 1>>

			Target:
			<<listbox "$mouthtarget" autoselect>>
				<<optionsfrom _targetlist>>
			<</listbox>>

		<</if>>
		<<if _targetnumber is 1>>
			<<set $mouthtarget to _firsttarget>>
		<</if>>
	<<case "othervagina">>
		<<set _mouthOptions to "othervagina">><<selectNpcWithPartInPosition "vagina" "mouth">><<set $mouthtarget to _j>>
		<<combatPerson>>'s pussy presses against your lips.
	<<case "kiss">>
		<<set _mouthOptions to "kiss">>
		<<switch $mouthstate>>
			<<case "kissentrance">>
				<<selectNpcWithPartInPosition "mouth" "kissentrance">><<set $mouthtarget to _j>>
				Your mouth is about to be pressed by <<combatpersons>>.
				<<if $player.virginity.kiss is true>>Your first kiss is about to be taken.<</if>>
			<<case "kissimminent">>
				<<selectNpcWithPartInPosition "mouth" "kissimminent">><<set $mouthtarget to _j>>
				Your mouth is pressed by <<combatpersons>>.
			<<case "kiss">>
				<<selectNpcWithPartInPosition "mouth" "kiss">><<set $mouthtarget to _j>>
				Your mouth is engulfed by <<combatpersons>>.
		<</switch>>
	<<case "facesit">>
		<<switch $mouthstate>>
		<<case "vagina">>
			<<set _mouthOptions to "facesit">><<selectNpcWithPartInPosition "vagina" "facesit">>
		<<case "anal">>
			<<set _mouthOptions to "otheranus">><<selectNpcWithPartInPosition "vagina" "facesitanal">>
		<</switch>><<set $mouthtarget to _j>>
		<<facesitFlavorText>>
	<<case "gagged">>
		<<set _mouthOptions to "gagged">>
		Your mouth is helplessly gagged.
	<<case "tentacle">>
		<<set $_changetype to true>><<mouthActionInitTentacle>>
	<<case "struggle">>
		<<set $_changetype to true>><<mouthActionInitStruggle>>
	<<default>>
		<<switch $mouthstate>>
		<<case "entrance">>
			<<set _mouthOptions to "penisEntrance">>
			<<selectNpcWithPartInPosition "penis" "mouthentrance">><<set $mouthtarget to _j>><<combatPerson>>'s <<npcPenis _j>> hovers in front of your mouth.
		<<case "imminent">>
			<<set _mouthOptions to "penisImminent">>
			<<selectNpcWithPartInPosition "penis" "mouthimminent">><<set $mouthtarget to _j>><<combatPerson>>'s <<npcPenis _j>> presses against your lips.
		<<case "penetrated">>
			<<set _mouthOptions to "penisPenetrated">>
			<<selectNpcWithPartInPosition "penis" "mouth">><<set $mouthtarget to _j>><<combatPerson>>'s <<npcPenis _j>> penetrates your mouth.
		<<case "gagged">>
			<<set _mouthOptions to "gagged">>
			Your mouth is helplessly gagged.
		<<case "breasts">>
			<<set _mouthOptions to "breasts">>
			<<breastFlavorText>><<set $mouthtarget to _j>>
		<<case "nipple">>
			<<set _mouthOptions to "nipple">>
			<<nippleFlavorText>><<set $mouthtarget to _j>>
		<<case "otheranus">>
			<<set _mouthOptions to "otheranus">><<selectNpcWithPartInPosition "penis" "mouthotheranus">><<set $mouthtarget to _j>>
			<<combatPerson>>'s ass presses against your lips.
		<<default>>
			<<if $mouthuse is "righthand" or $mouthuse is "lefthand">>
				<<set _mouthOptions to $mouthuse>>
				<<if $mouthuse is "righthand">>
					<<selectNpcWithPartInPosition "righthand" "mouth">>
				<<else>>
					<<selectNpcWithPartInPosition "lefthand" "mouth">>
				<</if>><<set $mouthtarget to _j>>
				Your mouth is blocked by <<combatpersons>> hand, muffling any noise you make.
			<<else>>
				<<set _mouthOptions to "blocked">>
				Your mouth is blocked, muffling any noise you make.
			<</if>>
		<</switch>>
	<</switch>>
<</if>>
<<if $lastOptions.mouth isnot _mouthOptions>>
	<<set _mouthGold to true>>
<</if>>
<<if $_changetype isnot true>>
	<<mouthActions>>
	<<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, $defaultsType, _defaultsCombatAction)>>
			<<set _pass to false>>
			<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
				<<if 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]), "")>>
		<<generateCombatAction _mouthaction "mouthaction" _textColor $mouthaction>>

		/*Checks/Difficulty*/
		<<if $combatControls.includes("ists")>>

				<<mouthactionDifficulty>>

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

<<widget "mouthactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $mouthaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "mouth" "othervagina">><<oraldifficulty>> <<combatpromiscuous4>>
	<<case "movetochest">><<oraldifficulty>> <<combatpromiscuous3>>
	<<case "swallow">><<oralvirginitywarning>> <<combatpromiscuous5>>
	<<case "grasp">><<chestdifficulty>> <<combatpromiscuous3>>
	<<case "pullaway" "pullawaykiss">><<oraldifficulty>>
	<<case "finish">><<if !$gloryhole and $gamemode isnot "soft">><<seductiondifficulty>><</if>>
	<<case "novaginal">><<if !$gloryhole and $gamemode isnot "soft">><<seductiondifficulty>><</if>>
	<<case "nopenile">><<if !$gloryhole and $gamemode isnot "soft">><<seductiondifficulty>><</if>>
	<<case "noanal">><<if !$gloryhole and $gamemode isnot "soft">><<seductiondifficulty>><</if>>
	<<case "noupper">><<if !$gloryhole and $gamemode isnot "soft">><<seductiondifficulty>><</if>>
	<<case "mock">>
		<<listbox "$mockaction">>
			<<option "ethics" "ethics" `$mockaction is "ethics" ? "selected" : ""`>>
			<<option "looks" "looks" `$mockaction is "looks" ? "selected" : ""`>>
			<<option "strength" "weak" `$mockaction is "weak" ? "selected" : ""`>>
			<<option "skill" "skill" `$mockaction is "skill" ? "selected" : ""`>>
			<<option "penis" "penis" `$mockaction is "penis" ? "selected" : ""`>>
			<<option "pussy" "vagina" `$mockaction is "vagina" ? "selected" : ""`>>
		<</listbox>>
		<<run $(() => { $('#listbox-mockaction').on('change', () => $('#listbox-mockaction').parent().click()) })>>
	<<case "ask">>
		<<switch $askAction>>
			<<case "askchoke" "condoms" "damagedCondoms" "noCondoms">>
				<<set $_label to "subList">>
			<<default>>
				<<set $_label to "bratList">>
		<</switch>>

			<<listbox "$askAction" autoselect>>
				<<optionsfrom _askActions>>
			<</listbox>>

		<<if _runOnce isnot true>><<updateAskColour>><<set _runOnce to true>><</if>>
		<<run $(() => { $('#askDifficulty select').on('change', () => $('#askDifficulty').click()) })>>
<</switch>>
<</widget>>

<<widget "mouthActions">>
/*Generate Actions*/
<<set _mouthaction to {}>>
<<if !(["orgasm", "pain", "unreal"].includes(_mouthOptions))>>
	<<set _mouthaction["Rest"] to "rest">>
<</if>>
<<if $position is "stalk">>
	<<head_turn>>
	<<head_down>>
	<<head_up>>
<<else>>
	<<switch _mouthOptions>>
		<<case "free">>
			<<if $head isnot "grappled" and $head isnot "bound">>
				<<if $chestuse is "penis">>
					<<set _mouthaction["Kiss"] to "peniskiss">>
				<<else>>
					<<set _mouthaction["Kiss"] to "kiss">>
				<</if>>
			<</if>>
			<<oralnew>>
			<<speak>>
			<<combatApologise>>
		<<case "othervagina" "facesit">>
			<<combatOthervagina>>
		<<case "otheranus">>
			<<combatMouthOtherAnus>>
		<<case "kiss">>
			<<set _mouthaction["Kiss"] to "kissback">>
			<<set _mouthaction["Pull away"] to "pullawaykiss">>
			<<if $consensual isnot 1>>
				<<set _mouthaction["Headbutt"] to "headbutt">>
			<</if>>
			<<if $mouthstate isnot "kiss" and $mouthstate isnot "kissimminent">>
				<<speak>>
			<</if>>
		<<case "gagged">>
		<<case "penisEntrance">>
			<<combatPenisEntrance>>
		<<case "penisImminent">>
			<<combatPenisImminent>>
		<<case "penisPenetrated">>
			<<combatPenisPenetrated>>
		<<case "breasts">>
			<<combatBreast>>
		<<case "nipple">>
			<<combatNipple>>
		<<case "lefthand">>
			<<set _mouthaction["Bite"] to "handbite">>
		<<case "righthand">>
			<<set _mouthaction["Bite"] to "handbite">>
		<<case "orgasm">>
			<<set _mouthaction["Stifle"] to "stifleorgasm">>
			<<set _mouthaction["Let it out"] to "letoutorgasm">>
		<<case "pain">>
			<<set _mouthaction["Stifle"] to "stifle">>
			<<set _mouthaction["Let it out"] to "letout">>
		<<case "unreal">>
			<<set _mouthaction["Try to speak"] to "speak">>
			<<set _mouthaction["Make soft noises"] to "noises">>
	<</switch>>
<</if>>
<</widget>>

<<widget "penisActionInit">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<switch $penisstate>>
	<<case 0>>
		<<if $combatControls isnot "radio" and _targetnumber gt 1>>
			Target:
			<<listbox "$penistarget" autoselect>>
				<<optionsfrom _targetlist>>
			<</listbox>>

		<</if>>
		<<set _penisOptions to "free">>
		Your <<penis>> is free.
		<<if $combatControls is "radio" and _targetnumber gt 1>>

			Target:
			<<listbox "$penistarget" autoselect>>
				<<optionsfrom _targetlist>>
			<</listbox>>

		<</if>>
		<<if _targetnumber is 1>>
			<<set $penistarget to _firsttarget>>
		<</if>>
	<<case "othermouthentrance">>
		<<set _penisOptions to "mouthEntrance">><<selectNpcWithPartInPosition "mouth" "penisentrance">><<set $penistarget to _j>>
		You feel breath on your <<penis>>.
	<<case "othermouthimminent">>
		<<set _penisOptions to "mouthImminent">><<selectNpcWithPartInPosition "mouth" "penisimminent">><<set $penistarget to _j>>
		<<combatPerson>>'s lips press against the tip of your <<penis>>.
	<<case "othermouth">>
		<<set _penisOptions to "mouthPenetration">><<selectNpcWithPartInPosition "mouth" "penis">><<set $penistarget to _j>>
		<<combatPerson>>'s mouth envelops your <<penis>>.
	<<case "entrance">>
		<<set _penisOptions to "pussyEntrance">>
		<<selectNpcWithPartInPosition "vagina" "penisentrance">><<set $penistarget to _j>><<combatPerson>>'s <<npcVagina _j>> hovers near your <<penis>>.
	<<case "imminent">>
		<<set _penisOptions to "pussyImminent">>
		<<selectNpcWithPartInPosition "vagina" "penisimminent">><<set $penistarget to _j>><<combatPerson>>'s <<npcVagina _j>> presses against your <<penis>>.
	<<case "penetrated">>
		<<set _penisOptions to "pussyPenetration">><<selectNpcWithPartInPosition "vagina" "penis">><<set $penistarget to _j>>
		<<combatPerson>>'s vagina envelops your <<penis>>.
	<<case "otheranusentrance">>
		<<set _penisOptions to "anusEntrance">>
		<<selectNpcWithPartInPositionAnus "otheranusentrance">><<set $penistarget to _j>><<combatPerson>>'s <<npcAnus _j>> hovers near your <<penis>>.
	<<case "otheranusimminent">>
		<<set _penisOptions to "anusImminent">>
		<<selectNpcWithPartInPositionAnus "otheranusimminent">><<set $penistarget to _j>><<combatPerson>>'s <<npcAnus _j>> presses against your <<penis>>.
	<<case "otheranus">>
		<<set _penisOptions to "anusPenetration">><<selectNpcWithPartInPositionAnus "otheranus">><<set $penistarget to _j>>
		<<combatPerson>>'s ass envelops your <<penis>>.
	<<case "otherpenisentrance">>
		<<set _penisOptions to "penisEntrance">>
		<<selectNpcWithPartInPosition "penis" "penisentrance">><<set $penistarget to _j>><<combatPerson>>'s <<npcPenisSimple $penistarget>> hovers near your <<penis>>.
	<<case "otherpenisimminent">>
		<<set _penisOptions to "penisImminent">>
		<<selectNpcWithPartInPosition "penis" "penisimminent">><<set $penistarget to _j>><<combatPerson>>'s <<npcPenisSimple $penistarget>> threatens your <<penis>>.
	<<case "otherpenis">>
		<<set _penisOptions to "penisPenetration">>
		<<selectNpcWithPartInPosition "penis" "penis">><<set $penistarget to _j>><<combatPerson>>'s <<npcPenisSimple $penistarget>> presses against your <<penis>>.
	<<case "tentacleentrance" "tentacleimminent" "tentacle" "tentacledeep" "tentaclerub">>
		<<set $_changetype to true>><<penisActionInitTentacle>>
	<<case "struggle" "struggle_pen">>
		<<set $_changetype to true>><<penisActionInitStruggle>>
	<<default>>
		<<switch $penisuse>>
		<<case "clit">>
			<<set _penisOptions to "penisAgainstClit">><<selectNpcWithPartInPosition "vagina" "frot">><<set $penistarget to _j>>
			You press your <<penis>> against <<his>> <<if $enemytype is "beast">><<beasttype>> pussy<<else>>clit<</if>>.
		<<case "otheranusrub">>
			<<set _penisOptions to "penisAgainstAss">>
			<<selectNpcWithPartInPositionAnus "otheranusfrot">><<set $penistarget to _j>>You hold your <<penis>> between <<his>> ass cheeks<<if $NPCList[_j].chastity.anus.includes("shield")>>, teasing through <<his>> $NPCList[_j].chastity.anus<</if>>.
		<</switch>>
	<</switch>>
	<<if $lastOptions.penis isnot _penisOptions>>
		<<set _penisGold to true>>
	<</if>>
	<<if $_changetype isnot true>>
		<<penisActions>>
		<<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, $defaultsType, _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if 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]), "")>>
			<<generateCombatAction _penisaction "penisaction" _textColor $penisaction>>

			/*Checks/Difficulty*/
			<<if $combatControls.includes("ists")>>

					<<penisactionDifficulty>>

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

<<widget "penisactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $penisaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "penistovagina" "penistoanus">><<peniledifficulty>> <<combatpromiscuous5>>
	<<case "penisvaginafuck" "penisanusfuck">><<combatpromiscuous5>> <<penilevirginitywarning>><<if _diffAction is "penisvaginafuck">><<NPCvirginitywarning $NPCList[_n].fullDescription "vaginal">><<else>><<NPCvirginitywarning $NPCList[_n].fullDescription "anal">><</if>>
	<<case "thighbay">><<thighdifficulty>> <<combatpromiscuous1>>
	<<case "bay">><<peniledifficulty>> <<combatpromiscuous4>>
	<<case "otheranusbay">><<peniledifficulty>> <<combatpromiscuous4>>
	<<case "clitrub" "otheranusrub">><<peniledifficulty>>
	<<case "vaginaEdging" "otheranusEdging">><<combatpromiscuous4>>
	<<case "penistopenis" "penistopenis">><<peniledifficulty>> <<combatpromiscuous5>>
	<<case "penistopenisfuck">><<combatpromiscuous5>>
	<<case "penisthighs">><<thighdifficulty>> <<combatpromiscuous4>>
	<<case "penisanus">><<analdifficulty>>
	<<case "penisanusdouble">><<analdifficulty>><<combatpromiscuous5>><<print "Awareness 4">>

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

<<widget "penisActions">>
/*Generate Actions*/
<<set _penisaction to {}>>
<<if $position is "stalk">>

<<else>>
	<<switch _penisOptions>>
		<<case "free">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenistovaginanew>>
			<<actionspenistoanusnew>>
			<<actionspenistopenis>>
		<<case "mouthEntrance">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenisMouthEntrance>>
		<<case "mouthImminent">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenisMouthImminent>>
		<<case "mouthPenetration">>
			<<actionspenisMouthPenetration>>
		<<case "pussyEntrance">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenisPussyEntrance>>
		<<case "pussyImminent">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenisPussyImminent>>
		<<case "pussyPenetration">>
			<<actionspenisPussyPenetration>>
		<<case "anusEntrance">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenisAnusEntrance>>
		<<case "anusImminent">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenisAnusImminent>>
		<<case "anusPenetration">>
			<<actionspenisAnusPenetration>>
		<<case "penisAgainstClit">>
			<<actionspenisAgainstClit>>
		<<case "penisAgainstAss">>
			<<actionspenisAgainstAss>>
		<<case "penisEntrance">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenistopenisfucknew>>
			<<actionspenisPenisEntrance>>
		<<case "penisImminent">>
			<<set _penisaction["Rest"] to "rest">>
			<<actionspenistopenisfucknew>>
			<<actionspenisPenisImminent>>
		<<case "penisPenetration">>
			<<actionspenisPenisFencing>>
	<</switch>>
<</if>>
<</widget>>

<<widget "vaginaActionInit">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<switch $vaginastate>>
	<<case 0>>
		<<if $combatControls isnot "radio" and _targetnumber gt 1>>
			Target:
			<<listbox "$vaginatarget" autoselect>>
				<<optionsfrom _targetlist>>
			<</listbox>>

		<</if>>
		<<set _vaginaOptions to "free">>
		Your <<pussy>> is free.
		<<if $combatControls is "radio" and _targetnumber gt 1>>

			Target:
			<<listbox "$vaginatarget" autoselect>>
				<<optionsfrom _targetlist>>
			<</listbox>>

		<</if>>
		<<if _targetnumber is 1>>
			<<set $vaginatarget to _firsttarget>>
		<</if>>
	<<case "othermouthentrance">>
		<<set _vaginaOptions to "mouthEntranch">><<selectNpcWithPartInPosition "mouth" "vaginaentrance">><<set $vaginatarget to _j>>
		You feel breath on your <<pussy>>.
	<<case "othermouthimminent">>
		<<set _vaginaOptions to "mouthImminent">><<selectNpcWithPartInPosition "mouth" "vaginaimminent">><<set $vaginatarget to _j>>
		<<combatPerson>>'s lips press against your labia.
	<<case "othermouth">>
		<<set _vaginaOptions to "mouthPenetrated">><<selectNpcWithPartInPosition "mouth" "vagina">><<set $vaginatarget to _j>>
		<<combatPerson>>'s tongue penetrates your <<pussy>>.
	<<case "entrance">>
		<<set _vaginaOptions to "penisEntrance">>
		<<selectNpcWithPartInPosition "penis" "vaginaentrance">><<set $vaginatarget to _j>><<combatPerson>>'s <<npcPenis _j>> hovers near your <<pussy>>.
		<<if $vaginaldoubledisable is "f">>
			<<getDoubleTargetList>>
		<</if>>
		<<if _secondtarget is true>>
			<<if $combatControls is "radio" and _targetnumber gt 1>>
<</if>>
			<<if $vaginadoubletarget is undefined>>
				<<set $vaginadoubletarget to _firstdoubletarget>>
			<</if>>
			Target:
			<<listbox "$vaginadoubletarget" autoselect>>
				<<optionsfrom _doubletargetlist>>
			<</listbox>>

		<</if>>
	<<case "imminent">>
		<<set _vaginaOptions to "penisImminent">>
		<<selectNpcWithPartInPosition "penis" "vaginaimminent">><<set $vaginatarget to _j>><<combatPerson>>'s <<npcPenis _j>> presses against your <<pussy>>.
		<<if $vaginaldoubledisable is "f">>
			<<getDoubleTargetList>>
		<</if>>
		<<if _secondtarget is true>>
			<<if $combatControls is "radio" and _targetnumber gt 1>>
<</if>>
			<<if $vaginadoubletarget is undefined>>
				<<set $vaginadoubletarget to _firstdoubletarget>>
			<</if>>
			Target:
			<<listbox "$vaginadoubletarget" autoselect>>
				<<optionsfrom _doubletargetlist>>
			<</listbox>>

		<</if>>
	<<case "penetrated">>
		<<set _vaginaOptions to "penisPenetrated">>
		<<selectNpcWithPartInPosition "penis" "vagina">><<set $vaginatarget to _j>><<combatPerson>>'s <<npcPenis _j>> penetrates your <<pussy>>.
		<<if $vaginaldoubledisable is "f">>
			<<getDoubleTargetList>>
		<</if>>
		<<if _secondtarget is true>>
			<<if $combatControls is "radio" and _targetnumber gt 1>>
<</if>>
			<<if $vaginadoubletarget is undefined>>
				<<set $vaginadoubletarget to _firstdoubletarget>>
			<</if>>
			Target:
			<<listbox "$vaginadoubletarget" autoselect>>
				<<optionsfrom _doubletargetlist>>
			<</listbox>>

		<</if>>
	<<case "othervaginaentrance">>
		<<set _vaginaOptions to "vaginaEntrance">><<selectNpcWithPartInPosition "vagina" "vaginaentrance">><<set $vaginatarget to _j>>
		<<combatPerson>>'s pussy hovers near yours.
	<<case "othervaginaimminent">>
		<<set _vaginaOptions to "vaginaImminent">><<selectNpcWithPartInPosition "vagina" "vaginaimminent">><<set $vaginatarget to _j>>
		<<combatPerson>>'s pussy threatens yours.
	<<case "othervagina">>
		<<set _vaginaOptions to "vaginaPenetrated">><<selectNpcWithPartInPosition "vagina" "vagina">><<set $vaginatarget to _j>>
		<<combatPerson>>'s pussy presses against yours.
	<<case "doubleentrance">>
		<<set _vaginaOptions to "penisDoubleEntrance">>
		<<set $_npcA to ($NPCList[$vaginatarget].penis is "vaginadoubleentrance" ? $vaginatarget : $vaginadoubletarget)>>
		<<set $_npcB to ($NPCList[$vaginatarget].penis is "vaginadoubleentrance" ? $vaginadoubletarget : $vaginatarget)>>
		<<if $NPCList[$vaginatarget].penis is "vaginadoubleentrance" and $NPCList[$vaginadoubletarget].penis is "vaginadoubleentrance">>
			Their cocks hover near your <<pussy>>.
		<<elseif ($NPCList[$vaginatarget].penis is "vaginadouble" and $NPCList[$vaginadoubletarget].penis is "vaginadoubleentrance") or ($NPCList[$vaginatarget].penis is "vaginadoubleentrance" and $NPCList[$vaginadoubletarget].penis is "vaginadouble")>>

			<<personselect $_npcA>><<combatPerson>>'s <<npcPenisSimple $_npcA>> presses against your <<vulva>> while <<personselect $_npcB>><<combatperson>>'s <<npcPenisSimple $_npcB>> hovers nearby.

		<<else>>
			Their cocks hover near your <<pussy>>.
		<</if>>
	<<case "doubleimminent">>
		<<set _vaginaOptions to "penisDoubleImminent">>
		<<set $_npcA to ($NPCList[$vaginatarget].penis is "vaginadoubleimminent" ? $vaginatarget : $vaginadoubletarget)>>
		<<set $_npcB to ($NPCList[$vaginatarget].penis is "vaginadoubleimminent" ? $vaginadoubletarget : $vaginatarget)>>
		<<if $NPCList[$vaginatarget].penis is "vaginadoubleimminent" and $NPCList[$vaginadoubletarget].penis is "vaginadoubleimminent">>
			Their cocks press against your <<pussy>>.
		<<elseif ($NPCList[$vaginatarget].penis is "vaginadouble" and $NPCList[$vaginadoubletarget].penis is "vaginadoubleimminent") or ($NPCList[$vaginatarget].penis is "vaginadoubleimminent" and $NPCList[$vaginadoubletarget].penis is "vaginadouble")>>

			<<personselect $_npcA>><<combatPerson>>'s <<npcPenisSimple $_npcA>> penetrates your vagina while <<personselect $_npcB>><<combatperson>>'s <<npcPenisSimple $_npcB>> presses against your <<vulva>>.

		<<else>>

			<<personselect $_npcA>><<combatPerson>>'s <<npcPenisSimple $_npcA>> presses against your <<vulva>> while <<personselect $_npcB>><<combatperson>>'s <<npcPenisSimple $_npcB>> hovers nearby.

		<</if>>
	<<case "doublepenetrated">>
		<<set _vaginaOptions to "penisDoublePenetration">>
		<<set $_npcA to ($NPCList[$vaginatarget].penis is "vaginadouble" ? $vaginatarget : $vaginadoubletarget)>>
		<<set $_npcB to ($NPCList[$vaginatarget].penis is "vaginadouble" ? $vaginadoubletarget : $vaginatarget)>>
		<<if $NPCList[$vaginatarget].penis is "vaginadouble" and $NPCList[$vaginadoubletarget].penis is "vaginadouble">>
			Their cocks penetrate your <<pussy>>.
		<<elseif ($NPCList[$vaginatarget].penis is "vaginadouble" and $NPCList[$vaginadoubletarget].penis is "vaginadoubleimminent") or ($NPCList[$vaginatarget].penis is "vaginadoubleimminent" and $NPCList[$vaginadoubletarget].penis is "vaginadouble")>>

			<<personselect $_npcA>><<combatPerson>>'s <<npcPenisSimple $_npcA>> penetrates your vagina while <<personselect $_npcB>><<combatperson>>'s <<npcPenisSimple $_npcB>> presses against your <<vulva>>.

		<<else>>

			<<personselect $_npcA>><<combatPerson>>'s <<npcPenisSimple $_npcA>> penetrates your vagina while the other hovers nearby.

		<</if>>
	<<case "tentacleentrance" "tentacleimminent" "tentacle" "tentacledeep" "tentaclerub">>
		<<set $_changetype to true>><<vaginaActionInitTentacle>>
	<<case "struggle" "struggle_pen">>
		<<set $_changetype to true>><<vaginaActionInitStruggle>>
	<</switch>>
	<<if $lastOptions.vagina isnot _vaginaOptions>>
		<<set _vaginaGold to true>>
	<</if>>
	<<if $_changetype isnot true>>
		<<vaginaActions>>
		<<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, $defaultsType, _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if 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]), "")>>
			<<generateCombatAction _vaginaaction "vaginaaction" _textColor $vaginaaction>>

			/*Checks/Difficulty*/
			<<if $combatControls.includes("ists")>>

					<<vaginaactionDifficulty>>

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

<<widget "vaginaactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $vaginaaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "vaginatopenis" "vaginatopenis">><<vaginaldifficulty>> <<combatpromiscuous5>>
	<<case "vaginatovagina" "vaginatovagina">><<vaginaldifficulty>> <<combatpromiscuous5>>
	<<case "vaginapenisfuck">><<combatpromiscuous5>> <<vaginalvirginitywarning>><<NPCvirginitywarning $NPCList[_n].fullDescription "penile">>
	<<case "vaginatovaginafuck">><<combatpromiscuous5>>
	<<case "thighbay">><<thighdifficulty>> <<combatpromiscuous1>>
	<<case "penisthighs">><<thighdifficulty>> <<combatpromiscuous4>>
	<<case "penisanus">><<analdifficulty>>
	<<case "penisanusdvp">><<analdifficulty>>
	<<case "penisanusdouble">><<analdifficulty>><<combatpromiscuous5>><<print "Awareness 4">>
	<<case "penisDoubleEdging">><<combatpromiscuous5>><<print "Awareness 4">>
	<<case "vaginatopenisdouble">><<vaginaldifficulty>> <<combatpromiscuous5>> <<print "Awareness 4">>
	<<case "vaginapenisdoublefuck">><<vaginaldifficulty>> <<combatpromiscuous5>> <<print "Awareness 4">> <<vaginalvirginitywarning>><<NPCvirginitywarning $NPCList[_n].fullDescription "penile">>
	<<case "penisEdging">><<combatpromiscuous4>>
<</switch>>
<</widget>>

<<widget "vaginaActions">>
/*Generate Actions*/
<<set _vaginaaction to {}>>
<<if $position is "stalk">>

<<else>>
	<<switch _vaginaOptions>>
		<<case "free">>
			<<set _vaginaaction["Rest"] to "rest">>
			<<actionsvaginatopenisnew>>
			<<actionsvaginatovaginanew>>
		<<case "mouthEntranch">>
			<<set _vaginaaction["Rest"] to "rest">>
			<<actionsvaginaMouthEntrance>>
		<<case "mouthImminent">>
			<<set _vaginaaction["Rest"] to "rest">>
			<<actionsvaginaMouthImminent>>
		<<case "mouthPenetrated">>
			<<actionsvaginaMouthPenetrated>>
		<<case "penisEntrance">>
			<<set _vaginaaction["Rest"] to "rest">>
			<<actionsvaginaPenisEntrance>>
		<<case "penisImminent">>
			<<set _vaginaaction["Rest"] to "rest">>
			<<actionsvaginaPenisImminent>>
		<<case "penisPenetrated">>
			<<actionsvaginaPenisPenetrated>>
		<<case "vaginaEntrance">>
			<<actionsTribRest>>
			<<actionsvaginatovaginafucknew>>
			<<actionsvaginaVaginaEntrance>>
		<<case "vaginaImminent">>
			<<actionsTribRest>>
			<<actionsvaginatovaginafucknew>>
			<<actionsvaginaVaginaImminent>>
		<<case "vaginaPenetrated">>
			<<actionsvaginaVagina>>
		<<case "penisDoubleEntrance">>
			<<set _vaginaaction["Rest"] to "rest">>
			<<actionsvaginapenisdoublefuck>>
			<<actionsvaginaPenisDoubleEntrance>>
		<<case "penisDoubleImminent">>
			<<set _vaginaaction["Rest"] to "rest">>
			<<actionsvaginapenisdoublefuck>>
			<<actionsvaginaPenisDoubleImminent>>
		<<case "penisDoublePenetration">>
			<<actionsvaginaPenisDoublePenetrated>>
	<</switch>>
<</if>>
<</widget>>

<<widget "anusActionInit">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<if $bottomuse is "mouth">>
		<<set _anusOptions to "faceAgainstAnus">><<selectNpcWithPartInPosition "mouth" "bottom">><<set $anustarget to _j>>
		You press your <<bottom>> against <<combatpersons>> face.
	<<elseif $bottomuse is "penis">>
		<<set _anusOptions to "penisAgainstAnus">><<selectNpcWithPartInPosition "penis" "cheeks">><<set $anustarget to _j>>
		You hold <<combatpersons>> <<npcPenis _j>> between your buttocks.
	<<else>>
		<<switch $anusstate>>
		<<case 0>>
			<<if $combatControls isnot "radio" and _targetnumber gt 1>>
				Target:
				<<listbox "$anustarget" autoselect>>
					<<optionsfrom _targetlist>>
				<</listbox>>

			<</if>>
			<<set _anusOptions to "free">>
			Your <<bottom>> is free.
			<<if $combatControls is "radio" and _targetnumber gt 1>>

				Target:
				<<listbox "$anustarget" autoselect>>
					<<optionsfrom _targetlist>>
				<</listbox>>

			<</if>>
			<<if _targetnumber is 1>>
				<<set $anustarget to _firsttarget>>
			<</if>>
		<<case "othermouthentrance">>
			<<set _anusOptions to "mouthEntrance">><<selectNpcWithPartInPosition "mouth" "anusentrance">><<set $anustarget to _j>>
			You feel breath on your <<bottom>>.
		<<case "othermouthimminent">>
			<<set _anusOptions to "mouthImminent">><<selectNpcWithPartInPosition "mouth" "anusimminent">><<set $anustarget to _j>>
			<<combatPerson>>'s lips press against your anus.
		<<case "othermouth">>
			<<set _anusOptions to "mouthPenetration">><<selectNpcWithPartInPosition "mouth" "anus">><<set $anustarget to _j>>
			<<combatPerson>>'s tongue penetrates your <<bottom>>.
		<<case "entrance">>
			<<set _anusOptions to "penisEntrance">><<selectNpcWithPartInPosition "penis" "anusentrance">><<set $anustarget to _j>>
			<<combatPerson>>'s <<npcPenis _j>> hovers near your <<bottom>>.
			<<if $analdoubledisable is "f">>
				<<getDoubleTargetList>>
			<</if>>
			<<if _secondtarget is true>>
				<<if $combatControls is "radio" and _targetnumber gt 1>>
<</if>>
				<<if $anusdoubletarget is undefined>>
					<<set $anusdoubletarget to _firstdoubletarget>>
				<</if>>
				Target:
				<<listbox "$anusdoubletarget" autoselect>>
					<<optionsfrom _doubletargetlist>>
				<</listbox>>

			<</if>>
		<<case "imminent">>
			<<set _anusOptions to "penisImminent">><<selectNpcWithPartInPosition "penis" "anusimminent">><<set $anustarget to _j>>
			<<combatPerson>>'s <<npcPenis _j>> presses against your anus.
		<<case "penetrated">>
			<<set _anusOptions to "penisPenetration">><<selectNpcWithPartInPosition "penis" "anus">><<set $anustarget to _j>>
			<<combatPerson>>'s penis penetrates your anus.
			<<if $analdoubledisable is "f">>
				<<getDoubleTargetList>>
			<</if>>
			<<if _secondtarget is true>>
				<<if $combatControls is "radio" and _targetnumber gt 1>>
<</if>>
				<<if $anusdoubletarget is undefined>>
					<<set $anusdoubletarget to _firstdoubletarget>>
				<</if>>
				Target:
				<<listbox "$anusdoubletarget" autoselect>>
					<<optionsfrom _doubletargetlist>>
				<</listbox>>

			<</if>>
		<<case "doubleentrance">>
			<<set _anusOptions to "penisDoubleEntrance">>
			<<if $NPCList[$anustarget].penis is "anusdoubleentrance" and $NPCList[$anusdoubletarget].penis is "anusdoubleentrance">>
				Their cocks hover near your <<bottom>>.
			<<elseif ($NPCList[$anustarget].penis is "anusdouble" and $NPCList[$anusdoubletarget].penis is "anusdoubleentrance") or ($NPCList[$anustarget].penis is "anusdoubleentrance" and $NPCList[$anusdoubletarget].penis is "anusdouble")>>
				<<selectNpcWithPartInPosition "penis" "anusdouble">>
				<<combatPerson>>'s penis penetrates your anus while the other penis hovers nearby.
			<<else>>
				Their cocks hover near your <<bottom>>.
			<</if>>
		<<case "doubleimminent">>
			<<set _anusOptions to "penisDoubleImminent">>
			<<if $NPCList[$anustarget].penis is "anusdoubleimminent" and $NPCList[$anusdoubletarget].penis is "anusdoubleimminent">>
				Their cocks press against your anus.
			<<elseif ($NPCList[$anustarget].penis is "anusdouble" and $NPCList[$anusdoubletarget].penis is "anusdoubleimminent") or ($NPCList[$anustarget].penis is "anusdoubleimminent" and $NPCList[$anusdoubletarget].penis is "anusdouble")>>
				<<selectNpcWithPartInPosition "penis" "anusdouble">>
				<<combatPerson>>'s penis penetrates your anus while the other penis presses against the entrance.
			<<else>>
				Their cocks press against your anus.
			<</if>>
		<<case "doublepenetrated">>
			<<set _anusOptions to "penisDoublePenetration">>
			<<if $NPCList[$anustarget].penis is "anusdouble" and $NPCList[$anusdoubletarget].penis is "anusdouble">>
				Their cocks penetrate your anus.
			<<else>>
				<<selectNpcWithPartInPosition "penis" "anus">>
				<<combatPerson>>'s cock penetrates your anus while the other hovers nearby.
			<</if>>
		<<case "tentacleentrance" "tentacleimminent" "tentacle" "tentacledeep" "tentaclerub">>
			<<set $_changetype to true>><<anusActionInitTentacle>>
		<<case "struggle" "struggle_pen">>
			<<set $_changetype to true>><<anusActionInitStruggle>>
		<</switch>>
	<</if>>
	<<if $lastOptions.anus isnot _anusOptions>>
		<<set _anusGold to true>>
	<</if>>
	<<if $_changetype isnot true>>
		<<anusActions>>
		<<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, $defaultsType, _defaultsCombatAction)>>
				<<set _pass to false>>
				<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
					<<if 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]), "")>>
			<<generateCombatAction _anusaction "anusaction" _textColor $anusaction>>

			/*Checks/Difficulty*/
			<<if $combatControls.includes("ists")>>

					<<anusactionDifficulty>>

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

<<widget "anusactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $anusaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "bottombay">><<bottomdifficulty>> <<combatpromiscuous1>>
	<<case "penischeeks">><<analdifficulty>> <<combatpromiscuous4>>
	<<case "anustopenis">><<analdifficulty>> <<combatpromiscuous5>>
	<<case "anuspenisfuck">><<combatpromiscuous5>> <<analvirginitywarning>><<NPCvirginitywarning $NPCList[_n].fullDescription "penile">>
	<<case "otherAnusRub" "otherMouthAnusRub">> <<analdifficulty>>
	<<case "penisEdging">><<combatpromiscuous4>>
	<<case "penispussy">><<vaginaldifficulty>>
	<<case "penispussydap">><<vaginaldifficulty>><<combatpromiscuous5>><<print "Awareness 4">>
	<<case "penispussydouble">><<vaginaldifficulty>><<combatpromiscuous5>><<print "Awareness 4">>
	<<case "penisDoubleEdging">><<combatpromiscuous5>><<print "Awareness 4">>
	<<case "anustopenisdouble">><<analdifficulty>> <<combatpromiscuous5>><<print "Awareness 4">>
	<<case "anuspenisdoublefuck">><<combatpromiscuous5>><<print "Awareness 4">> <<analvirginitywarning>><<NPCvirginitywarning $NPCList[_n].fullDescription "penile">>
<</switch>>
<</widget>>

<<widget "anusActions">>
/*Generate Actions*/
<<set _anusaction to {}>>
<<if $position is "stalk">>

<<else>>
	<<switch _anusOptions>>
		<<case "free">>
			<<set _anusaction["Rest"] to "rest">>
			<<actionsanustopenisnew>>
		<<case "mouthEntrance">>
			<<set _anusaction["Rest"] to "rest">>
			<<actionsanusMouthEntrance>>
		<<case "mouthImminent">>
			<<set _anusaction["Rest"] to "rest">>
			<<actionsanusMouthImminent>>
		<<case "mouthPenetration">>
			<<actionsanusMouthPenetration>>
		<<case "penisEntrance">>
			<<set _anusaction["Rest"] to "rest">>
			<<actionsanusPenisEntrance>>
		<<case "penisImminent">>
			<<set _anusaction["Rest"] to "rest">>
			<<actionsanusPenisImminent>>
		<<case "penisPenetration">>
			<<actionsanusPenisPenetration>>
		<<case "faceAgainstAnus">>
			<<actionsanusFaceAgainstAnus>>
		<<case "penisAgainstAnus">>
			<<actionsanusPenisAgainstAnus>>
		<<case "penisDoubleEntrance">>
			<<set _anusaction["Rest"] to "rest">>
			<<actionsanusPenisDoubleEntrance>>
		<<case "penisDoubleImminent">>
			<<set _anusaction["Rest"] to "rest">>
			<<actionsanusPenisDoubleImminent>>
		<<case "penisDoublePenetration">>
			<<actionsanusPenisDoublePenetration>>
	<</switch>>
<</if>>
<</widget>>

<<widget "chestActionInit">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<switch $chestuse>>
	<<case "penis">>
		<<set _chestOptions to "penis">><<selectNpcWithPartInPosition "penis" "chest">><<set $chesttarget to _j>>
		<<combatPerson>>'s penis rests <<print ($breastsize is 0 ?"against":"between")>> your <<breasts>>.
	<<case "tentaclerub">>
		<<set $_changetype to true>><<chestActionInitTentacle>>
	<</switch>>
	<<if $_changetype isnot true>>
		<<chestActions>>
		<<if Object.keys(_chestaction).length gt 0>>
			<<if $chestactiondefault is 0>>
				<<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]), "")>>
			<<generateCombatAction _chestaction "chestaction" _textColor $chestaction>>

			/*Checks/Difficulty*/
			<<if $combatControls.includes("ists")>>

					<<chestactionDifficulty>>

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

<<widget "chestactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $chestaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "rub">><<chestdifficulty>>
<</switch>>
<</widget>>

<<widget "chestActions">>
/*Generate Actions*/
<<set _chestaction to {}>>
/*<<set _chestaction["Rest"] to "rest">>*/
<<if $position is "stalk">>

<<else>>
	<<switch _chestOptions>>
		<<case "penis">>
			<<set _chestaction["Rub"] to "rub">>
			<<set _chestaction["Stop"] to "stop">>
	<</switch>>
<</if>>
<</widget>>

<<widget "thighActionInit">>
	<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
		<<switch $thighuse>>
		<<case "mouth">>
			<<set _thighOptions to "mouth">><<selectNpcWithPartInPosition "mouth" "thigh">><<set $thightarget to _j>>
			You press your thigh against <<combatpersons>> mouth.
		<<case "penis">>
			<<set _thighOptions to "penis">><<selectNpcWithPartInPosition "penis" "thighs">><<set $thightarget to _j>>
			You hold <<combatpersons>> penis between your thighs.
		<</switch>>

		<<thighactions>>
		<<if Object.keys(_thighaction).length gt 0>>
			<<if $thighactiondefault is 0>>
				<<set $thighactiondefault to Object.values(_thighaction)[0]>>
			<</if>>
			<<set $thighaction to $thighactiondefault>>
			<<set _textColor to combatListColor('thighaction', (Object.values(_thighaction).includes($thighaction) ? $thighaction : Object.values(_thighaction)[0]), "")>>
			<<generateCombatAction _thighaction "thighaction" _textColor $thighaction>>

			/*Checks/Difficulty*/
			<<if $combatControls.includes("ists")>>

					<<thighactionDifficulty>>

			<</if>>
		<</if>>
		<<set $lastOptions.thigh to clone(_thighOptions)>>
	<<else>>
		<<timed 100ms>>
			<<run jQuery("#thighaction").remove();>>
		<</timed>>
	<</if>>
<</widget>>

<<widget "thighactionDifficulty">>
<<if $args[0] is undefined>>
	<<set _diffAction to $thighaction>>
<<else>>
	<<set _diffAction to $args[0]>>
<</if>>
<<switch _diffAction>>
	<<case "rub" "othermouthrub">><<thighdifficulty>>
<</switch>>
<</widget>>

<<widget "thighactions">>
/*Generate Actions*/
<<set _thighaction to {}>>
/*<<set _thighaction["Rest"] to "rest">>*/
<<if $position is "stalk">>

<<else>>
	<<switch _thighOptions>>
		<<case "mouth">>
			<<set _thighaction["Rub"] to "othermouthrub">>
			<<set _thighaction["Stop"] to "othermouthstop">>
		<<case "penis">>
			<<set _thighaction["Rub"] to "rub">>
			<<set _thighaction["Stop"] to "stop">>
	<</switch>>
<</if>>
<</widget>>

<<widget "resetLastOptions">>
<<set $lastOptions to {
	"left":"",
	"right":"",
	"feet":"",
	"mouth":"",
	"penis":"",
	"vagina":"",
	"anus":"",
	"chest":"",
	"thigh":"",
	"cheek":"",
}>>
<</widget>>

<<widget "getTargetList">><<silently>>
<<unset _firsttarget>>
<<set _targetlist to {}>><<set _targetnumber to 0>>
<<if $NPCList.some( x => Object.values(x).includes("active"))>>
	<<set _repeatcontroller to []>>
	<<for _namecontroller = 0; _namecontroller lt $enemynomax; _namecontroller++>>
		<<if $NPCList[0].type isnot "human" and $NPCList[0].type isnot "plant">>
			<<set _namecontroller to $active_enemy>>
			<<set _targetlist[$NPCList[_namecontroller].type] to _namecontroller>><<set _targetnumber += 1>>
			<<if _firsttarget is undefined>>
				<<set _firsttarget to _namecontroller>>
			<</if>>
			<<if $targetYourself is true>>
				<<set _targetYourself to true>>
			<</if>>
			<<break>>
		<<elseif $NPCList[_namecontroller].active is "active" and  $NPCList[_namecontroller].stance isnot "defeated">>
			<<if $NPCList[_namecontroller].description is "pale figure">>
				<<set _smoltext to $NPCList[_namecontroller].description>>
				<<set $_wraithbreak to true>>
			<<else>>
				<<set _smoltext to $NPCList[_namecontroller].fullDescription>>
			<</if>>
			<<targetrepeatcontroller>>
			<<set _repeatcontroller[_namecontroller] to _smoltext>>
			<<if !($npc.includes($NPCList[_namecontroller].fullDescription))>>
				<<set _smoltext to "the " + _smoltext>>
			<</if>>
			<<set _targetlist[_smoltext] to _namecontroller>><<set _targetnumber += 1>>
			<<if _firsttarget is undefined>>
				<<set _firsttarget to _namecontroller>>
			<</if>>
			<<if $targetYourself is true>>
				<<set _targetYourself to true>>
			<</if>>
			<<if $_wraithbreak is true>>
				<<break>>
			<</if>>
		<</if>>
	<</for>>
<</if>>
<<set _targetlistall to clone(_targetlist)>>
<<if $tentacles.active gte 1>>
	<<set _targetlistall[$tentacles[0].type.toUpperFirst()+"s"] to "tentacles">><<set _targetnumber += 1>>
<</if>>
<<if $swarm.type isnot 0>>
	<<set _targetlistall[$swarm.type.toUpperFirst()] to "swarm">><<set _targetnumber += 1>>
	<<if $targetYourself is true>>
		<<set _targetYourself to true>>
	<</if>>
<</if>>
<<if $struggle isnot undefined>>
	<<if $struggle.done lt $struggle.number>>
		<<set _targetlistall[$struggle.creature.toUpperFirst()+"s"] to "struggle">><<set _targetnumber += 1>>
	<</if>>
<</if>>
<<if $machine isnot undefined>>
	<<set _targetlistall["Machine"] to "machine">><<set _targetnumber += 1>>
<</if>>
<<set _targetlistarms to clone(_targetlistall)>>
<<if $vorecreature isnot 0>>
	<<if $vorestage gt 0>>
		<<set _targetlistarms["the "+ $vorecreature.toUpperFirst()] to "vore">><<set _targetnumber += 1>>
	<</if>>
<</if>>
<</silently>><</widget>>

<<widget "getDoubleTargetList">><<silently>>
<<unset _firstdoubletarget>>
<<if $consensual is 1 and ((($promiscuity gte 75 and $enemytype is "man") or ($deviancy gte 75 and $enemytype isnot "man")) and $awareness gte 300 or ($promiscuityIgnore is 1))>>
	<<set _doubletargetlist to {}>><<set _secondtarget to false>>
	<<set _repeatcontroller to []>>
	<<for _namecontroller = 0; _namecontroller lt $enemynomax; _namecontroller++>>
		<<if $NPCList[_namecontroller].active is "active" and $NPCList[_namecontroller].stance isnot "defeated" and $NPCList[_namecontroller].penis is 0 and !($NPCList[_namecontroller].chastity.penis.includes("chastity"))>>
			<<set _smoltext to $NPCList[_namecontroller].fullDescription>>
			<<targetrepeatcontroller>>
			<<set _repeatcontroller[_namecontroller] to _smoltext>>
			<<if !($npc.includes($NPCList[_namecontroller].fullDescription))>>
				<<set _smoltext to "the " + _smoltext>>
			<</if>>
			<<set _doubletargetlist[_smoltext] to _namecontroller>><<set _secondtarget to true>>
			<<if _firstdoubletarget is undefined>>
				<<set _firstdoubletarget to _namecontroller>>
			<</if>>
		<</if>>
	<</for>>
<</if>>
<</silently>><</widget>>

<<widget "targetrepeatcontroller">>
<<set _smollertext to _smoltext>>
<<for _repeatnamecontroller = 0; _repeatnamecontroller lte _namecontroller; _repeatnamecontroller++>>
	<<if _repeatcontroller[_repeatnamecontroller] is _smollertext>>
		<<if _smollertext.includes("fifth") is true>>
			<<set _smollertext to "last "+_smoltext>>
		<<elseif _smollertext.includes("fourth") is true>>
			<<set _smollertext to "fifth "+_smoltext>>
		<<elseif _smollertext.includes("third") is true>>
			<<set _smollertext to "fourth "+_smoltext>>
		<<elseif _smollertext.includes("second") is true>>
			<<set _smollertext to "third "+_smoltext>>
		<<else>>
			<<set _smollertext to "second "+_smoltext>>
		<</if>>
	<</if>>
<</for>>
<<set _smoltext to _smollertext>>
<</widget>>

<<widget "leftActionInitSelf">>
<<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 hand is free.
		<<if $combatControls is "radio" and _targetnumber gt 1>>

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

		<</if>>
		<<if _targetnumber is 1>>
			<<set $lefttarget to _firsttarget>>
		<</if>>
	<</if>>
<<case "vagina">>
	<<set _leftOptions to "coverVagina">>
	Your left hand is protecting your <<pussy>>.
<<case "coverpenis">>
	<<set _leftOptions to "coverPenis">>
	Your left hand is protecting your <<penis>>.
<<case "anus">>
	<<set _leftOptions to "coverAss">>
	Your left hand is protecting your <<bottom>>.
<<case "behind">>
	<<set _leftOptions to "behind">>
	Your left hand is behind your back.
<</switch>>
<<if $lastOptions.left isnot _leftOptions>>
	<<set _leftGold to true>>
<</if>>
<<leftActionsSelf>>
<<if Object.keys(_leftaction).length gt 0>><<if $combatControls is "radio">>
<</if>>
	<<if Object.values(_leftaction).includes($leftactiondefault) is false or $args[0] is true or $leftactiondefault is "rest">>
		<<set _defaultsCombatAction to "leftaction">>
		<<set _actionsSet = DefaultActions.get($defaultsCombatType, $defaultsType, _defaultsCombatAction)>>
		<<set _pass to false>>
		<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
			<<if 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]), "Self")>>
	<<generateCombatActionOthers _leftaction "leftaction" _textColor $leftaction "Self">>

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

			<<leftactionDifficulty>>

	<</if>><<if $combatControls is "radio">>
<</if>>/* Seems to render no effect..? */
<</if>>
<<set $lastOptions.left to clone(_leftOptions)>>
<</widget>>

<<widget "leftactionDifficultySelf">>/* Here we go again. */
<</widget>>

<<widget "leftActionsSelf">>
<<set _leftaction to {}>>
<<switch _leftOptions>>
<<case "free">>
	<<set _leftaction["Rest"] to "rest">>
	<<if $rightarm is "swarmgrappled">>
		<<set _leftaction["Free your right arm"] to "leftfree">>
	<</if>>
	<<if Object.values(_targetlistarms).includes("swarm")>>
		<<if _swarmamounts.genital[0] lte 0 and _swarmamounts.genital[1] lte 0>>
			<<genitals>>
			<<set _leftaction["Cover your " + _text_output] to "frontcoverleft">>
		<</if>>
		<<if _swarmamounts.butt[0] lte 0 and _swarmamounts.butt[1] lte 0>>
			<<set _leftaction["Cover your butt"] to "frontcoverleft">>
		<</if>>
		<<if _swarmamounts.chest lte 0>>
			<<set _leftaction["Cover your chest"] to "frontcoverleft">>
		<</if>>
		<<if $water is 1 and $vorecreature is 0 and ($consensual isnot 1 or $gamemode is "soft")>>
			<<set _leftaction["Swim to safety"] to "swim">>
		<</if>>
	<</if>>
	<<if Object.values(_targetlistarms).includes(0) or Object.values(_targetlistarms).includes(1) or Object.values(_targetlistarms).includes(2) or Object.values(_targetlistarms).includes(3) or Object.values(_targetlistarms).includes(4) or Object.values(_targetlistarms).includes(5)>>/* placeholder for the future */
		<<leftdefault>>
		<<leftclothesnew>>
		<<leftFixAndCoverActions>>
		<<leftCondom>>
	<</if>>
<<case "coverVagina">>
	<<set _leftaction["Keep covering"] to "leftcovervagina">>
	<<set _leftaction["Stop"] to "leftstopvagina">>
<<case "coverPenis">>
	<<set _leftaction["Keep covering"] to "leftcoverpenis">>
	<<set _leftaction["Stop"] to "leftstopcoverpenis">>
<<case "coverAss">>
	<<set _leftaction["Keep covering"] to "leftcoveranus">>
	<<set _leftaction["Stop"] to "leftstopanus">>
<<case "behind">>
	<<set _leftaction["Keep behind"] to "behind">>
	<<set _leftaction["Stop"] to "stopbehind">>
<<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 "rightActionInitSelf">>
<<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 hand 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 "vagina">>
	<<set _rightOptions to "coverVagina">>
	Your right hand is protecting your <<pussy>>.
<<case "coverpenis">>
	<<set _rightOptions to "coverPenis">>
	Your right hand is protecting your <<penis>>.
<<case "anus">>
	<<set _rightOptions to "coverAss">>
	Your right hand is protecting your <<bottom>>.
<<case "behind">>
	<<set _rightOptions to "behind">>
	Your right hand is behind your back.
<</switch>>
<<if $lastOptions.right isnot _rightOptions>>
	<<set _rightGold to true>>
<</if>>
<<rightActionsSelf>>
<<if Object.keys(_rightaction).length gt 0>><<if $combatControls is "radio">>
<</if>>
	<<if Object.values(_rightaction).includes($rightactiondefault) is false or $args[0] is true or $rightactiondefault is "rest">>
		<<set _defaultsCombatAction to "rightaction">>
		<<set _actionsSet = DefaultActions.get($defaultsCombatType, $defaultsType, _defaultsCombatAction)>>
		<<set _pass to false>>
		<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
			<<if 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]), "Self")>>
	<<generateCombatActionOthers _rightaction "rightaction" _textColor $rightaction "Self">>

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

			<<rightactionDifficulty>>

	<</if>><<if $combatControls is "radio">>
<</if>>/* Seems to render no effect..? */
<</if>>
<<set $lastOptions.right to clone(_rightOptions)>>
<</widget>>

<<widget "rightactionDifficultySelf">>/* This was unexpected. */
<</widget>>

<<widget "rightActionsSelf">>
<<set _rightaction to {}>>
<<switch _rightOptions>>
<<case "free">>
	<<set _rightaction["Rest"] to "rest">>
	<<if $leftarm is "swarmgrappled">>
		<<set _rightaction["Free your right arm"] to "rightfree">>
	<</if>>
	<<if Object.values(_targetlistarms).includes("swarm")>>
		<<if _swarmamounts.genital[0] lte 0 and _swarmamounts.genital[1] lte 0>>
			<<genitals>>
			<<set _rightaction["Cover your " + _text_output] to "frontcoverright">>
		<</if>>
		<<if _swarmamounts.butt[0] lte 0 and _swarmamounts.butt[1] lte 0>>
			<<set _rightaction["Cover your butt"] to "frontcoverright">>
		<</if>>
		<<if _swarmamounts.chest lte 0>>
			<<set _rightaction["Cover your chest"] to "frontcoverright">>
		<</if>>
		<<if $water is 1 and $vorecreature is 0 and ($consensual isnot 1 or $gamemode is "soft")>>
			<<set _rightaction["Swim to safety"] to "swim">>
		<</if>>
	<</if>>
	<<if Object.values(_targetlistarms).includes(0) or Object.values(_targetlistarms).includes(1) or Object.values(_targetlistarms).includes(2) or Object.values(_targetlistarms).includes(3) or Object.values(_targetlistarms).includes(4) or Object.values(_targetlistarms).includes(5)>>/* placeholder for the future */
		<<rightdefault>>
		<<rightclothesnew>>
		<<rightFixAndCoverActions>>
		<<rightCondom>>
	<</if>>
<<case "coverVagina">>
	<<set _rightaction["Keep covering"] to "rightcovervagina">>
	<<set _rightaction["Stop"] to "rightstopvagina">>
<<case "coverPenis">>
	<<set _rightaction["Keep covering"] to "rightcoverpenis">>
	<<set _rightaction["Stop"] to "rightstopcoverpenis">>
<<case "coverAss">>
	<<set _rightaction["Keep covering"] to "rightcoveranus">>
	<<set _rightaction["Stop"] to "rightstopanus">>
<<case "behind">>
	<<set _rightaction["Keep behind"] to "behind">>
	<<set _rightaction["Stop"] to "stopbehind">>
<<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 "feetActionInitSelf">>
<<if $dissociation lte 1 and $orgasmdown lte 0 and ($pain lt 100 or $willpowerpain is undefined)>>
	<<if $feetuse is 0>>
		<<if _targetYourself is true and _targetnumber gt 1>>
			<<set _targetlistall["Yourself"] to "self">>
		<</if>>
		<<if $combatControls isnot "radio" and _targetnumber gt 1>>
			Target:
			<<listbox "$feettarget" autoselect>>
				<<optionsfrom _targetlistall>>
			<</listbox>>

		<</if>>
		<<set _feetOptions to "free">>
		Your feet are free.
		<<if $combatControls is "radio" and _targetnumber gt 1 and _feetOptions is "free">>

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

		<</if>>
		<<if _targetnumber is 1>>
			<<set $feettarget to _firsttarget>>
		<</if>>
	<</if>>
	<<if $lastOptions.feet isnot _feetOptions>>
		<<set _feetGold to true>>
	<</if>>
	<<feetActionsSelf>>
	<<if Object.keys(_feetaction).length gt 0>><<if $combatControls is "radio">>
<</if>>
		<<if Object.values(_feetaction).includes($feetactiondefault) is false or $args[0] is true or $feetactiondefault is "rest">>
			<<set _defaultsCombatAction to "feetaction">>
			<<set _actionsSet = DefaultActions.get($defaultsCombatType, $defaultsType, _defaultsCombatAction)>>
			<<set _pass to false>>
			<<for _set to 0; _set lt $maxDefaultActionSets; _set++>>
				<<if 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]), "Self")>>
		<<generateCombatActionOthers _feetaction "feetaction" _textColor $feetaction "Self">>

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

				<<feetactionDifficulty>>

		<</if>><<if $combatControls is "radio">>
<</if>>/* Seems to render no effect..? */
	<</if>>
	<<set $lastOptions.feet to clone(_feetOptions)>>
<<else>>
	<<timed 100ms>>
		<<run jQuery("#feetaction").remove();>>
	<</timed>>
<</if>>
<</widget>>

<<widget "feetactionDifficultySelf">> /* Good thing I caught it before anyone else. */
<</widget>>

<<widget "feetActionsSelf">>
<<set _feetaction to {}>>
<<set _feetaction["Rest"] to "rest">>
<<if Object.values(_targetlistarms).includes("swarm")>>
	<<if $water is 1 and $vorecreature is 0 and $swimmingskill gt 700 and $consensual isnot 1>>
		<<set _feetaction["Swim to safety"] to "swim">>
	<</if>>
<</if>>
<<if Object.values(_targetlistarms).includes("struggle")>>
	<<set _feetaction["Dodge"] to "evade">>
	<<set _feetaction["Plant"] to "plant">>
<</if>>
<<if $water isnot 1>>
	<<feetshoes>>
	<<feetsocks>>
<</if>>
<</widget>>

<<widget "generateCombatActionOthers">>
<<switch $combatControls>>
	<<case "radio">>
		<<generateCombatActionOthersRadio $args[0] $args[1] $args[3] $args[4]>>
	<<case "lists" "limitedLists">>
		<<generateCombatActionOthersList $args[0] $args[1] $args[2] $args[4]>>
<</switch>>
<</widget>>

<<widget "generateCombatActionOthersRadio">>
<<for _labelC, _valueC range $args[0]>>

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

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

<<widget "generateCombatActionOthersList">>
<<if $args[0]>>
	<<set _options to $args[0]>>
	<<set _name to $args[1]>>
	<<capture _var _options _name>>

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

		<<combatButtonAdjustments _name $args[3]>>
	<</capture>>
<</if>>
<</widget>>

/* To be used as an example of how to merge all combats in 1 */
<<widget "actionsOmni">>
<<exposure>>

<<if $pregnancyTesting is undefined>>
	<<set $condomUse to false>>
<</if>>

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

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

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

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

<</if>>

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

	The weight of reality crashes down on you.

<</if>>

<<if $underwater isnot 1>>
	<<oxygen 50>>
<</if>>

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

<<combatstate>>
<<carryblock>>

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

			<</if>>
		<</if>>
	<</if>>
	<<if $swarm and $swarm.name>>
		<<set _swarmsteady to $swarm["steady"].toUpperFirst()>>
		<<set _swarmamounts to $swarm.amount>>
	<</if>>

	<<generateActionsOmni>>

<</if>>

<<setupMidOrgasm>>

<</widget>>

/* To be used as an example of how to merge all combats in 1 */
<<widget "generateActionsOmni">>
<<set $combat to 1>>
<<if _targetlist is undefined>>
	<<getTargetList>>
<</if>>
<<if _targetnumber gte 1>>

			<<switch $lefttarget>>
			<<case "self">>
				<<leftActionInitSelf>>
			<<case "tentacles">>
				<<leftActionInitTentacle>>
			<<case "vore">>
				<<leftActionInitVore>>
			<<case "swarm">>
				<<leftActionInitSwarm>>
			<<case "struggle">>
				<<leftActionInitStruggle>>
			<<case "machine">>
				<<leftActionInitMachine>>
			<<default>>
				<<if Object.values(_targetlistarms)[0] is "tentacles">>
					<<leftActionInitTentacle>>
				<<elseif Object.values(_targetlistarms)[0] is "vore">>
					<<leftActionInitVore>>
				<<elseif Object.values(_targetlistarms)[0] is "swarm">>
					<<leftActionInitSwarm>>
				<<elseif Object.values(_targetlistarms)[0] is "struggle">>
					<<leftActionInitStruggle>>
				<<elseif Object.values(_targetlistarms)[0] is "machine">>
					<<leftActionInitMachine>>
				<<else>>
					<<leftActionInit>>
				<</if>>
			<</switch>>

			<<switch $righttarget>>
			<<case "self">>
				<<rightActionInitSelf>>
			<<case "tentacles">>
				<<rightActionInitTentacle>>
			<<case "vore">>
				<<rightActionInitVore>>
			<<case "swarm">>
				<<rightActionInitSwarm>>
			<<case "struggle">>
				<<rightActionInitStruggle>>
			<<case "machine">>
				<<rightActionInitMachine>>
			<<default>>
				<<if Object.values(_targetlistarms)[0] is "tentacles">>
					<<rightActionInitTentacle>>
				<<elseif Object.values(_targetlistarms)[0] is "vore">>
					<<rightActionInitVore>>
				<<elseif Object.values(_targetlistarms)[0] is "swarm">>
					<<rightActionInitSwarm>>
				<<elseif Object.values(_targetlistarms)[0] is "struggle">>
					<<rightActionInitStruggle>>
				<<elseif Object.values(_targetlistarms)[0] is "machine">>
					<<rightActionInitMachine>>
				<<else>>
					<<rightActionInit>>
				<</if>>
			<</switch>>

		<<if Object.values(_targetlistall).length gte 1>>

				<<switch $feettarget>>
				<<case "self">>
					<<feetActionInitSelf>>
				<<case "tentacles">>
					<<feetActionInitTentacle>>
				<<case "swarm">>
					<<feetActionInitSwarm>>
				<<case "struggle">>
					<<feetActionInitStruggle>>
				<<case "machine">>
					<<feetActionInitMachine>>
				<<default>>
					<<if Object.values(_targetlistall)[0] is "tentacles">>
						<<feetActionInitTentacle>>
					<<elseif Object.values(_targetlistall)[0] is "swarm">>
						<<feetActionInitSwarm>>
					<<elseif Object.values(_targetlistall)[0] is "struggle">>
						<<feetActionInitStruggle>>
					<<elseif Object.values(_targetlistall)[0] is "machine">>
						<<feetActionInitMachine>>
					<<else>>
						<<feetActionInit>>
					<</if>>
				<</switch>>

		<</if>>

		<<if Object.values(_targetlist).length gte 1>>
			<<switch $mouthtarget>>
			<<case "tentacles">>

					<<mouthActionInitTentacle>>

			<<case "struggle">>

					<<mouthActionInitStruggle>>

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

						<<mouthActionInit>>

				<<elseif Object.values(_targetlist)[0] isnot "tentacles" and Object.values(_targetlist)[0] isnot "struggle">>

						<<mouthActionInit>>

				<<else>>
					<<if $mouthuse is "struggle" and $struggle.mouth.creature>>

							<<mouthActionInitStruggle>>

					<<elseif $mouthstate isnot 0>>

							<<mouthActionInitTentacle>>

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

			<<if $player.penisExist>>
				<<switch $penistarget>>
				<<case "tentacles">>

						<<penisActionInitTentacle>>

				<<case "struggle">>

						<<penisActionInitStruggle>>

				<<default>>
					<<if Object.values(_targetlist)[0] isnot "tentacles" and Object.values(_targetlist)[0] isnot "struggle">>

							<<penisActionInit>>

					<<else>>
						<<if $penisuse is "struggle">>

								<<penisActionInitStruggle>>

						<<elseif $penisstate isnot 0>>

								<<penisActionInitTentacle>>

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

			<<if $player.vaginaExist>>
				<<switch $vaginatarget>>
				<<case "tentacles">>

						<<vaginaActionInitTentacle>>

				<<case "struggle">>

						<<vaginaActionInitStruggle>>

				<<default>>
					<<if Object.values(_targetlist)[0] isnot "tentacles" and Object.values(_targetlist)[0] isnot "struggle">>

							<<vaginaActionInit>>

					<<else>>
						<<if $vaginause is "struggle">>

								<<vaginaActionInitStruggle>>

						<<elseif $vaginastate isnot 0>>

								<<vaginaActionInitTentacle>>

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

			<<switch $anustarget>>
			<<case "tentacles">>

					<<anusActionInitTentacle>>

			<<case "struggle">>

					<<anusActionInitStruggle>>

			<<default>>
				<<if Object.values(_targetlist)[0] isnot "tentacles" and Object.values(_targetlist)[0] isnot "struggle">>

						<<anusActionInit>>

				<<else>>
					<<if $anususe is "struggle">>

							<<anusActionInitStruggle>>

					<<elseif $anusstate isnot 0>>

							<<anusActionInitTentacle>>

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

			<<if $chestuse isnot "struggle">>

					<<chestActionInitStruggle>>

			<<elseif $chestuse is "tentaclerub">>

					<<chestActionInitTentacle>>

			<<elseif $chestuse is "penis">>

					<<chestActionInit>>

			<</if>>

			<<if $thighuse isnot 0>>

					<<thighActionInit>>

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

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