code:
:: battleWidgets [widget nobr]

<<widget "calcSFStatistics">>
	<<if $slaveRebellion != 1 || $citizenRebellion != 1>>
		/* atk, def */
		<<set _upgradesSum = $securityForceInfantryPower + $securityForceStimulantPower + $securityForceAircraftPower + $securityForceAircraftPower>>
		<<if !isInt(_upgradesSum)>>
			<<set _upgradesSum = random(10,15)>>
		<</if>>
		<<set $SFatk = Math.trunc(0.65 * _upgradesSum)>>
		<<set $SFdef = Math.trunc(0.40 * _upgradesSum)>>
		/* hp */
		<<set $carriableSoldiers = 125 * ($securityForceAC130 + $securityForceVehiclePower)>>
		<<if !isInt($carriableSoldiers)>>
			<<set $carriableSoldiers = $securityForcePersonnel / 10>>
		<</if>>
		<<if $securityForcePersonnel > $carriableSoldiers>>
			<<set $SFhp = $carriableSoldiers * $SFBaseHp>>
		<<else>>
			<<set $carriableSoldiers = $securityForcePersonnel>>
			<<set $SFhp = $carriableSoldiers * $SFBaseHp>>
		<</if>>
	<<else>>
		/* atk, def */
		<<set _upgradesSum = $securityForceInfantryPower + $securityForceStimulantPower + $securityForceAircraftPower + $securityForceAircraftPower>>
		<<if !isInt(_upgradesSum)>>
			<<set _upgradesSum = random(10,15)>>
		<</if>>
		<<set $SFatk = Math.trunc(0.75 * _upgradesSum)>>
		<<set $SFdef = Math.trunc(0.50 * _upgradesSum)>>
		/* hp */
		<<set $SFhp = $securityForcePersonnel * $SFBaseHp>>
	<</if>>
<</widget>>

<<widget "removeUnits">>
	/* args[0] is the array of IDs of units to be eliminated */

	<<set _newMilitia = []>>
	<<set _newSlave = []>>
	<<set _newMerc = []>>

	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<if !($args[0].includes($militiaUnits[_i].ID))>>
			<<set _newMilitia.push($militiaUnits[_i])>>
		<</if>>
	<</for>>
	<<set $militiaUnits = _newMilitia>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<if !($args[0].includes($slaveUnits[_i].ID))>>
			<<set _newSlave.push($slaveUnits[_i])>>
		<</if>>
	<</for>>
	<<set $slaveUnits = _newSlave>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<if !($args[0].includes($mercUnits[_i].ID))>>
			<<set _newMerc.push($mercUnits[_i])>>
		<</if>>
	<</for>>
	<<set $mercUnits = _newMerc>>
<</widget>>

<<widget "calcTroopCount">>
	<<set _troops = 0>>
	<<if $attackThisWeek == 1>>
		<<if $deployingBots == 1>>
			<<set _troops += $secBots.troops>>
		<</if>>
		<<for _i = 0; _i < $militiaUnits.length; _i++>>
			<<if $militiaUnits[_i].isDeployed == 1>>
				<<set _troops += $militiaUnits[_i].troops>>
			<</if>>
		<</for>>
		<<for _i = 0; _i < $slaveUnits.length; _i++>>
			<<if $slaveUnits[_i].isDeployed == 1>>
				<<set _troops += $slaveUnits[_i].troops>>
			<</if>>
		<</for>>
		<<for _i = 0; _i < $mercUnits.length; _i++>>
			<<if $mercUnits[_i].isDeployed == 1>>
				<<set _troops += $mercUnits[_i].troops>>
			<</if>>
		<</for>>
		<<if $SFIntervention == 1>>
			<<set _troops += $carriableSoldiers>>
		<</if>>
		<<set $troopCount = _troops>>

	<<elseif $slaveRebellion == 1 || $citizenRebellion == 1>>

		<<if $irregulars > 0>>
			<<set _troops += $irregulars>>
		<</if>>
		<<if $secBots.active == 1>>
			<<set _troops += $secBots.troops>>
		<</if>>
		<<for _i = 0; _i < $militiaUnits.length; _i++>>
			<<if $militiaUnits[_i].active == 1 && $loyalID.includes($militiaUnits[_i].ID)>>
				<<set _troops += $militiaUnits[_i].troops>>
			<</if>>
		<</for>>
		<<for _i = 0; _i < $slaveUnits.length; _i++>>
			<<if $slaveUnits[_i].active == 1 && $loyalID.includes($slaveUnits[_i].ID)>>
				<<set _troops += $slaveUnits[_i].troops>>
			<</if>>
		<</for>>
		<<for _i = 0; _i < $mercUnits.length; _i++>>
			<<if $mercUnits[_i].active == 1 && $loyalID.includes($mercUnits[_i].ID)>>
				<<set _troops += $mercUnits[_i].troops>>
			<</if>>
		<</for>>
		<<if $securityForceCreate == 1>>
			<<set _troops += $carriableSoldiers>>
		<</if>>
		<<set $troopCount = _troops>>

	<<else>>
		<br>@@.red;Error: widget called outside battle@@
	<</if>>
<</widget>>

<<widget "calcBribe">>
	<<if $week <= 30>>
		<<set $bribeCost = 5000 + $baseBribePerAttacker * $attackTroops>>
	<<elseif $week <= 30>>
		<<set $bribeCost = 10000 + $baseBribePerAttacker * $attackTroops>>
	<<elseif $week <= 30>>
		<<set $bribeCost = 15000 + $baseBribePerAttacker * $attackTroops>>
	<<elseif $week <= 30>>
		<<set $bribeCost = 20000 + $baseBribePerAttacker * $attackTroops>>
	<<elseif $week <= 30>>
		<<set $bribeCost = 25000 + $baseBribePerAttacker * $attackTroops>>
	<</if>>
	<<if $majorBattle == 1>>
		<<set $bribeCost *= 3>>
	<</if>>
	<<set $bribeCost = Math.trunc(Math.clamp($bribeCost,0,1000000))>>
<</widget>>


code:
:: miscSecExpWidgets [widget nobr]

<<widget "calcInitialTrade">>
	<<set _initialTrade = random(20,30)>>
	<<if $terrain == "urban">>
		<<set _initialTrade += random(10)>>
	<</if>>
	<<if $terrain == "ravine">>
		<<set _initialTrade -= random(5)>>
	<</if>>
	<<if $PC.career == "wealth" || $PC.career == "capitalist" || $PC.career == "celebrity" || $PC.career == "BlackHat">>
		<<set _initialTrade += random(5)>>
	<<elseif $PC.career == "escort" || $PC.career == "servant" || $PC.career == "gang">>
		<<set _initialTrade -= random(5)>>
	<</if>>
	<<set $trade = _initialTrade>>
<</widget>>

<<widget "recalcManpower">>
	<<if $wasToggledBefore == 0>>
		<<if $mercenaries == 1>>
			<<set $mercFreeManpower = random(5,20)>>
		<<elseif $mercenaries > 1>>
			<<set $mercFreeManpower = random(10,30)>>
		<</if>>
	<</if>>

	<<set _correctEmployedMP = 0>>
	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<set _correctEmployedMP += $slaveUnits[_i].troops>>
	<</for>>

	<<if $slavesEmployedManpower != _correctEmployedMP>>
		<<set $slavesEmployedManpower = _correctEmployedMP>>
	<</if>>

	<<set _correctEmployedMP = 0>>
	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<set _correctEmployedMP += $militiaUnits[_i].troops>>
	<</for>>

	<<if $militiaEmployedManpower != _correctEmployedMP>>
		<<set $militiaEmployedManpower = _correctEmployedMP>>
	<</if>>

	<<set _correctEmployedMP = 0>>
	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<set _correctEmployedMP += $mercUnits[_i].troops>>
	<</for>>

	<<if $mercEmployedManpower != _correctEmployedMP>>
		<<set $mercEmployedManpower = _correctEmployedMP>>
	<</if>>

	<<set $militiaTotalManpower = $militiaEmployedManpower + $militiaFreeManpower>>
	<<set $mercTotalManpower = $mercEmployedManpower + $mercFreeManpower>>
<</widget>>

<<widget "recalcSecRestPoint">>
	<<set _newRest = 0>>
	<<set _baseRest = 30>>
	<<if $secUpgrades.nanoCams == 1>>
		<<set _newRest += 15>>
	<</if>>
	<<if $secUpgrades.cyberBots == 1>>
		<<set _newRest += 15>>
	<</if>>
	<<if $secUpgrades.eyeScan == 1>>
		<<set _newRest += 20>>
	<</if>>
	<<if $secUpgrades.cryptoAnalyzer == 1>>
		<<set _newRest += 20>>
	<</if>>
	<<set _newRest += _baseRest>>
	<<set $secRestPoint = _newRest>>
<</widget>>

<<widget "recalcCrimeCap">>
	<<set _baseCap = 100>>
	<<set _newCap = _baseCap>>
	<<if $crimeUpgrades.autoTrial == 1>>
		<<set _newCap -= 10>>
	<</if>>
	<<if $crimeUpgrades.autoArchive == 1>>
		<<set _newCap -= 10>>
	<</if>>
	<<if $crimeUpgrades.worldProfiler == 1>>
		<<set _newCap -= 15>>
	<</if>>
	<<if $crimeUpgrades.advForensic == 1>>
		<<set _newCap -= 15>>
	<</if>>
	<<set $crimeCap = _newCap>>
<</widget>>

<<widget "recalcReqHelots">>
	<<set _newReq = 0>>
	<<set _baseReq = 20>>
	<<if $secUpgrades.nanoCams == 1>>
		<<set _newReq += 5>>
	<</if>>
	<<if $secUpgrades.cyberBots == 1>>
		<<set _newReq += 5>>
	<</if>>
	<<if $secUpgrades.eyeScan == 1>>
		<<set _newReq += 10>>
	<</if>>
	<<if $secUpgrades.cryptoAnalyzer == 1>>
		<<set _newReq += 10>>
	<</if>>
	<<if $crimeUpgrades.autoTrial == 1>>
		<<set _newReq += 5>>
	<</if>>
	<<if $crimeUpgrades.autoArchive == 1>>
		<<set _newReq += 5>>
	<</if>>
	<<if $crimeUpgrades.worldProfiler == 1>>
		<<set _newReq += 10>>
	<</if>>
	<<if $crimeUpgrades.advForensic == 1>>
		<<set _newReq += 10>>
	<</if>>
	<<if $intelUpgrades.sensors == 1>>
		<<set _newReq += 5>>
	<</if>>
	<<if $intelUpgrades.signalIntercept == 1>>
		<<set _newReq += 5>>
	<</if>>
	<<if $intelUpgrades.radar == 1>>
		<<set _newReq += 10>>
	<</if>>
	<<if $readinessUpgrades.rapidVehicles == 1>>
		<<set _newReq += 5>>
	<</if>>
	<<if $readinessUpgrades.rapidPlatforms == 1>>
		<<set _newReq += 10>>
	<</if>>
	<<if $readinessUpgrades.earlyWarn == 1>>
		<<set _newReq += 10>>
	<</if>>
	<<if $SFSupportLevel >= 1>>
		<<set _newReq -= 5 * $SFSupportLevel>>
	<</if>>
	<<if $secUpgrades.coldstorage >= 1>>
		<<set _newReq -= 10 * $secUpgrades.coldstorage>>
	<</if>>
	<<set _newReq += _baseReq>>
	<<set $reqHelots = _newReq>>
<</widget>>

<<widget "recalcEdictsUpkeep">>
	/* authority cost */
	<<set _newAuthUpkeep = 0>>

	<<if $sellData == 1>>
		<<set _newAuthUpkeep += 10>>
	<</if>>

	<<if $slaveSoldierPrivilege == 1>>
		<<set _newAuthUpkeep += 10>>
	<</if>>

	<<if $weaponsLaw == 0>>
		<<set _newAuthUpkeep += 30>>
	<<elseif $weaponsLaw == 2>>
		<<set _newAuthUpkeep += 10>>
	<<elseif $weaponsLaw == 1>>
		<<set _newAuthUpkeep += 20>>
	<</if>>

	<<if $slavesOfficers == 1>>
		<<set _newAuthUpkeep += 10>>
	<</if>>

	/* cash cost */
	<<set _newUpkeep = 0>>

	<<if $slaveWatch == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $subsidyChurch == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $martialSchool == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $legionTradition == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $pharaonTradition == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $eagleWarriors == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $ronin == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $mamluks == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $sunTzu == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<if $tradeLegalAid == 1>>
		<<set _newUpkeep += 1000>>
	<</if>>

	<<set $edictsUpkeep = _newUpkeep>>
	<<set $edictsAuthUpkeep = _newAuthUpkeep>>
<</widget>>

<<widget "recalcUnits">>
	<<set $maxUnits = 6 + $secBarracksUpgrades.size * 2>>
	<<set $activeUnits = $militiaUnits.length + $slaveUnits.length + $mercUnits.length>>
<</widget>>

<<widget "fixBrokenUnits">>
	<<if ndef $secBots.ID>>
		<<set $secBots.ID = -1>>
	<</if>>
	<<if $secBots.maxTroops < 30>>

Fixed security bots wrong max troop count.
		<<set $secBots.maxTroops = 30>>
	<</if>>
	<<if !isInt($secBots.troops)>>

Fixed security bots wrong max troop count.
		<<set $secBots.troops = $secBots.maxTroops>>
	<</if>>
	<<if $secBots.troops > 0 && $secBots.active != 1>>

Fixed security bots wrong "active" flag.
		<<set $secBots.active = 1>>
	<</if>>

	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<if ndef $militiaUnits[_i].SF>>

Set militia missing flag
			<<set $militiaUnits[_i].SF = 0>>
		<</if>>
		<<if ndef $militiaUnits[_i].ID>>

Set militia missing ID
			<<generateUnitID $militiaUnits[_i]>>
		<</if>>
		<<if ndef $militiaUnits[_i].cyber>>

Set militia missing flag
			<<set $militiaUnits[_i].cyber = 0>>
		<</if>>
		<<if ndef $militiaUnits[_i].commissars>>

Set militia missing flag
			<<set $militiaUnits[_i].commissars = 0>>
		<</if>>
		<<if $militiaUnits[_i].maxTroops < 30>>

Fixed militia unit wrong max troop count.
			<<set $militiaUnits[_i].maxTroops = 30>>
		<</if>>
		<<if !isInt($militiaUnits[_i].troops)>>
			<<set $militiaUnits[_i].troops = $militiaUnits[_i].maxTroops>>

Fixed militia unit wrong troop count.
		<</if>>
		<<if $militiaUnits[_i].troops > 0 && $militiaUnits[_i].active != 1>>

Fixed militia unit wrong "active" flag.
			<<set $militiaUnits[_i].active = 1>>
		<</if>>
	<</for>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<if ndef $slaveUnits[_i].SF>>

Set slave missing flag
			<<set $slaveUnits[_i].SF = 0>>
		<</if>>
		<<if ndef $slaveUnits[_i].ID>>

Set slave missing ID
			<<generateUnitID $slaveUnits[_i]>>
		<</if>>
		<<if ndef $slaveUnits[_i].cyber>>

Set slave missing flag
			<<set $slaveUnits[_i].cyber = 0>>
		<</if>>
		<<if ndef $slaveUnits[_i].commissars>>

Set slave missing flag
			<<set $slaveUnits[_i].commissars = 0>>
		<</if>>
		<<if $slaveUnits[_i].maxTroops < 30>>

Fixed slave unit wrong max troop count.
			<<set $slaveUnits[_i].maxTroops = 30>>
		<</if>>
		<<if !isInt($slaveUnits[_i].troops)>>
			<<set $slaveUnits[_i].troops = $slaveUnits[_i].maxTroops>>

Fixed slave unit wrong troop count.
		<</if>>
		<<if $slaveUnits[_i].troops > 0 && $slaveUnits[_i].active != 1>>

Fixed slave unit wrong "active" flag.
			<<set $slaveUnits[_i].active = 1>>
		<</if>>
	<</for>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<if ndef $mercUnits[_i].SF>>

Set merc missing flag
			<<set $mercUnits[_i].SF = 0>>
		<</if>>
		<<if ndef $mercUnits[_i].ID>>

Set merc missing ID
			<<generateUnitID $mercUnits[_i]>>
		<</if>>
		<<if ndef $mercUnits[_i].cyber>>

Set merc missing flag
			<<set $mercUnits[_i].cyber = 0>>
		<</if>>
		<<if ndef $mercUnits[_i].commissars>>

Set merc missing flag
			<<set $mercUnits[_i].commissars = 0>>
		<</if>>
		<<if $mercUnits[_i].maxTroops < 30>>

Fixed merc unit wrong max troop count.
			<<set $mercUnits[_i].maxTroops = 30>>
		<</if>>
		<<if !isInt($mercUnits[_i].troops)>>
			<<set $mercUnits[_i].troops = $mercUnits[_i].maxTroops>>

Fixed merc unit wrong troop count.
		<</if>>
		<<if $mercUnits[_i].troops > 0 && $mercUnits[_i].active != 1>>

Fixed merc unit wrong "active" flag.
			<<set $mercUnits[_i].active = 1>>
		<</if>>
	<</for>>
<</widget>>

<<widget "fixBrokenStats">>
	<<if !isInt($totalKills)>>
		<<set $totalKills = 0>>
	<</if>>
	<<if !isInt($mercTotalCasualties)>>
		<<set $mercTotalCasualties = 0>>
	<</if>>
	<<if !isInt($mercEmployedManpower)>>
		<<set $mercEmployedManpower = 0>>
	<</if>>
	<<if !isInt($mercTotalManpower)>>
		<<set $mercTotalManpower = 0>>
	<</if>>
	<<if !isInt($slavesTotalCasualties)>>
		<<set $slavesTotalCasualties = 0>>
	<</if>>
	<<if !isInt($slavesEmployedManpower)>>
		<<set $slavesEmployedManpower = 0>>
	<</if>>
	<<if !isInt($militiaTotalCasualties)>>
		<<set $militiaTotalCasualties = 0>>
	<</if>>
	<<if !isInt($militiaEmployedManpower)>>
		<<set $militiaEmployedManpower = 0>>
	<</if>>
	<<if !isInt($militiaFreeManpower)>>
		<<set $militiaFreeManpower = 0>>
	<</if>>
	<<if !isInt($militiaTotalManpower)>>
		<<set $militiaTotalManpower = 0>>
	<</if>>
	<<if !isInt($battlesCount)>>
		<<set $battlesCount = 0>>
	<</if>>
<</widget>>

<<widget "fixBrokenFS">>
	<<if $arcologies[0].FSSubjugationist !== "unset" && !Number.isFinite($arcologies[0].FSSubjugationist)>>
		<<set $arcologies[0].FSSubjugationist = 10>>

Fixed NaN FS value for FSSubjugationist
	<</if>>
	<<if $arcologies[0].FSGenderRadicalist !== "unset" && !Number.isFinite($arcologies[0].FSGenderRadicalist)>>
		<<set $arcologies[0].FSGenderRadicalist = 10>>

Fixed NaN FS value for FSGenderRadicalist
	<</if>>
	<<if $arcologies[0].FSRestart !== "unset" && !Number.isFinite($arcologies[0].FSRestart)>>
		<<set $arcologies[0].FSRestart = 10>>

Fixed NaN FS value for FSRestart
	<</if>>
	<<if $arcologies[0].FSRepopulationFocus !== "unset" && !Number.isFinite($arcologies[0].FSRepopulationFocus)>>
		<<set $arcologies[0].FSRepopulationFocus = 10>>

Fixed NaN FS value for FSRepopulationFocus
	<</if>>
	<<if $arcologies[0].FSSupremacist !== "unset" && !Number.isFinite($arcologies[0].FSSupremacist)>>
		<<set $arcologies[0].FSSupremacist = 10>>

Fixed NaN FS value for FSSupremacist
	<</if>>
	<<if $arcologies[0].FSBodyPurist !== "unset" && !Number.isFinite($arcologies[0].FSBodyPurist)>>
		<<set $arcologies[0].FSBodyPurist = 10>>

Fixed NaN FS value for FSBodyPurist
	<</if>>
	<<if $arcologies[0].FSPaternalist !== "unset" && !Number.isFinite($arcologies[0].FSPaternalist)>>
		<<set $arcologies[0].FSPaternalist = 10>>

Fixed NaN FS value for FSPaternalist
	<</if>>
	<<if $arcologies[0].FSSlimnessEnthusiast !== "unset" && !Number.isFinite($arcologies[0].FSSlimnessEnthusiast)>>
		<<set $arcologies[0].FSSlimnessEnthusiast = 10>>

Fixed NaN FS value for FSSlimnessEnthusiast
	<</if>>
	<<if $arcologies[0].FSGenderFundamentalist !== "unset" && !Number.isFinite($arcologies[0].FSGenderFundamentalist)>>
		<<set $arcologies[0].FSGenderFundamentalist = 10>>

Fixed NaN FS value for FSGenderFundamentalist
	<</if>>
	<<if $arcologies[0].FSMaturityPreferentialist !== "unset" && !Number.isFinite($arcologies[0].FSMaturityPreferentialist)>>
		<<set $arcologies[0].FSMaturityPreferentialist = 10>>

Fixed NaN FS value for FSMaturityPreferentialist
	<</if>>
	<<if $arcologies[0].FSYouthPreferentialist !== "unset" && !Number.isFinite($arcologies[0].FSYouthPreferentialist)>>
		<<set $arcologies[0].FSYouthPreferentialist = 10>>

Fixed NaN FS value for FSYouthPreferentialist
	<</if>>
	<<if $arcologies[0].FSTransformationFetishist !== "unset" && !Number.isFinite($arcologies[0].FSTransformationFetishist)>>
		<<set $arcologies[0].FSTransformationFetishist = 10>>

Fixed NaN FS value for FSTransformationFetishist
	<</if>>
	<<if $arcologies[0].FSHedonisticDecadence !== "unset" && !Number.isFinite($arcologies[0].FSHedonisticDecadence)>>
		<<set $arcologies[0].FSHedonisticDecadence = 10>>

Fixed NaN FS value for FSHedonisticDecadence
	<</if>>
	<<if $arcologies[0].FSPhysicalIdealist !== "unset" && !Number.isFinite($arcologies[0].FSPhysicalIdealist)>>
		<<set $arcologies[0].FSPhysicalIdealist = 10>>

Fixed NaN FS value for FSPhysicalIdealist
	<</if>>
	<<if $arcologies[0].FSPastoralist !== "unset" && !Number.isFinite($arcologies[0].FSPastoralist)>>
		<<set $arcologies[0].FSPastoralist = 10>>

Fixed NaN FS value for FSPastoralist
	<</if>>
	<<if $arcologies[0].FSAssetExpansionist !== "unset" && !Number.isFinite($arcologies[0].FSAssetExpansionist)>>
		<<set $arcologies[0].FSAssetExpansionist = 10>>

Fixed NaN FS value for FSAssetExpansionist
	<</if>>
	<<if $arcologies[0].FSDegradationist !== "unset" && !Number.isFinite($arcologies[0].FSDegradationist)>>
		<<set $arcologies[0].FSDegradationist = 10>>

Fixed NaN FS value for FSDegradationist
	<</if>>
	<<if $arcologies[0].FSRomanRevivalist !== "unset" && !Number.isFinite($arcologies[0].FSRomanRevivalist)>>
		<<set $arcologies[0].FSRomanRevivalist = 10>>

Fixed NaN FS value for FSRomanRevivalist
	<</if>>
	<<if $arcologies[0].FSChattelReligionist !== "unset" && !Number.isFinite($arcologies[0].FSChattelReligionist)>>
		<<set $arcologies[0].FSChattelReligionist = 10>>

Fixed NaN FS value for FSChattelReligionist
	<</if>>
	<<if $arcologies[0].FSChineseRevivalist !== "unset" && !Number.isFinite($arcologies[0].FSChineseRevivalist)>>
		<<set $arcologies[0].FSChineseRevivalist = 10>>

Fixed NaN FS value for FSChineseRevivalist
	<</if>>
	<<if $arcologies[0].FSArabianRevivalist !== "unset" && !Number.isFinite($arcologies[0].FSArabianRevivalist)>>
		<<set $arcologies[0].FSArabianRevivalist = 10>>

Fixed NaN FS value for FSArabianRevivalist
	<</if>>
	<<if $arcologies[0].FSEdoRevivalist !== "unset" && !Number.isFinite($arcologies[0].FSEdoRevivalist)>>
		<<set $arcologies[0].FSEdoRevivalist = 10>>

Fixed NaN FS value for FSEdoRevivalist
	<</if>>
	<<if $arcologies[0].FSEgyptianRevivalist !== "unset" && !Number.isFinite($arcologies[0].FSEgyptianRevivalist)>>
		<<set $arcologies[0].FSEgyptianRevivalist = 10>>

Fixed NaN FS value for FSEgyptianRevivalist
	<</if>>
	<<if $arcologies[0].FSAztecRevivalist !== "unset" && !Number.isFinite($arcologies[0].FSAztecRevivalist)>>
		<<set $arcologies[0].FSAztecRevivalist = 10>>

Fixed NaN FS value for FSAztecRevivalist
	<</if>>
<</widget>>

<<widget "recalcBaseStats">>
	<<if $secBotsBaseAttack != 7 + $droneUpgrades.attack>>
		<<set $secBotsBaseAttack = 7 + $droneUpgrades.attack>>
	<</if>>
	<<if $secBotsBaseDefense != 3 + $droneUpgrades.defense>>
		<<set $secBotsBaseDefense = 3 + $droneUpgrades.defense>>
	<</if>>
	<<if $secBotsMorale != 200>>
		<<set $secBotsMorale = 200>>
	<</if>>
	<<if $secBotsBaseHp != 3 + $droneUpgrades.hp>>
		<<set $secBotsBaseHp = 3 + $droneUpgrades.hp>>
	<</if>>
	<<if $militiaBaseAttack != 7 + $humanUpgrade.attack>>
		<<set $militiaBaseAttack = 7 + $humanUpgrade.attack>>
	<</if>>
	<<if $militiaBaseDefense != 5 + $humanUpgrade.defense>>
		<<set $militiaBaseDefense = 5 + $humanUpgrade.defense>>
	<</if>>
	<<if $militiaBaseMorale != 140 + $humanUpgrade.morale>>
		<<set $militiaBaseMorale = 140 + $humanUpgrade.morale>>
	<</if>>
	<<if $militiaBaseHp != 3 + $humanUpgrade.hp>>
		<<set $militiaBaseHp = 3 + $humanUpgrade.hp>>
	<</if>>
	<<if $slaveBaseAttack != 8 + $humanUpgrade.attack>>
		<<set $slaveBaseAttack = 8 + $humanUpgrade.attack>>
	<</if>>
	<<if $slaveBaseDefense != 3 + $humanUpgrade.defense>>
		<<set $slaveBaseDefense = 3 + $humanUpgrade.defense>>
	<</if>>
	<<if $slaveBaseMorale != 110 + $humanUpgrade.morale>>
		<<set $slaveBaseMorale = 110 + $humanUpgrade.morale>>
	<</if>>
	<<if $slaveBaseHp != 3 + $humanUpgrade.hp>>
		<<set $slaveBaseHp = 3 + $humanUpgrade.hp>>
	<</if>>
	<<if $mercBaseAttack != 8 + $humanUpgrade.attack>>
		<<set $mercBaseAttack = 8 + $humanUpgrade.attack>>
	<</if>>
	<<if $mercBaseDefense != 4 + $humanUpgrade.defense>>
		<<set $mercBaseDefense = 4 + $humanUpgrade.defense>>
	<</if>>
	<<if $mercBaseMorale != 125 + $humanUpgrade.morale>>
		<<set $mercBaseMorale = 125 + $humanUpgrade.morale>>
	<</if>>
	<<if $mercBaseHp != 4 + $humanUpgrade.hp>>
		<<set $mercBaseHp = 4 + $humanUpgrade.hp>>
	<</if>>
	<<if $SFBaseAttack != 8 + $humanUpgrade.attack>>
		<<set $SFBaseAttack = 8 + $humanUpgrade.attack>>
	<</if>>
	<<if $SFBaseDefense != 4 + $humanUpgrade.defense>>
		<<set $SFBaseDefense = 4 + $humanUpgrade.defense>>
	<</if>>
	<<if $SFBaseMorale != 140 + $humanUpgrade.morale>>
		<<set $SFBaseMorale = 140 + $humanUpgrade.morale>>
	<</if>>
	<<if $SFBaseHp != 4 + $humanUpgrade.hp>>
		<<set $SFBaseHp = 4 + $humanUpgrade.hp>>
	<</if>>
<</widget>>

<<widget "replenishAllUnits">>
	<<set _hasLossesM = 0>>
	<<set _hasLossesS = 0>>
	<<set _hasLossesMe = 0>>

	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<if $militiaUnits[_i].troops < $militiaUnits[_i].maxTroops && $militiaFreeManpower > 0>>
			<<set _hasLossesM = 1>>
			<<break>>
		<</if>>
	<</for>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<if $slaveUnits[_i].troops < $slaveUnits[_i].maxTroops && $helots > 0>>
			<<set _hasLossesS = 1>>
			<<break>>
		<</if>>
	<</for>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<if $mercUnits[_i].troops < $mercUnits[_i].maxTroops && $mercFreeManpower > 0>>
			<<set _hasLossesMe = 1>>
			<<break>>
		<</if>>
	<</for>>

	<<if _hasLossesM == 1 && $militiaFreeManpower > 0 || _hasLossesS == 1 && $helots > 0 || _hasLossesMe == 1 && $mercFreeManpower > 0>>

		<<link "Replenish all units">>

			<<if _hasLossesM == 1>>
				<<for _i = 0; _i < $militiaUnits.length; _i++>>
					<<if $militiaUnits[_i].troops < $militiaUnits[_i].maxTroops && $militiaFreeManpower > 0>>
						<<if $militiaFreeManpower >= $militiaUnits[_i].maxTroops - $militiaUnits[_i].troops>>
							<<set $militiaFreeManpower -= $militiaUnits[_i].maxTroops - $militiaUnits[_i].troops>>
							<<set $militiaEmployedManpower += $militiaUnits[_i].maxTroops - $militiaUnits[_i].troops>>
							<<set _expLoss = ($militiaUnits[_i].maxTroops - $militiaUnits[_i].troops) / $militiaUnits[_i].troops>>
							<<set $militiaUnits[_i].training -= $militiaUnits[_i].training * _expLoss>>
							<<set $militiaUnits[_i].troops = $militiaUnits[_i].maxTroops>>
						<<else>>
							<<set $militiaEmployedManpower += $militiaFreeManpower>>
							<<set _expLoss = $militiaFreeManpower / $militiaUnits[_i].troops>>
							<<set $militiaUnits[_i].training -= $militiaUnits[_i].training * _expLoss>>
							<<set $militiaUnits[_i].troops += $militiaFreeManpower>>
							<<set $militiaFreeManpower = 0>>
						<</if>>
					<</if>>
				<</for>>
			<</if>>

			<<if _hasLossesS == 1>>
				<<for _i = 0; _i < $slaveUnits.length; _i++>>
					<<if $slaveUnits[_i].troops < $slaveUnits[_i].maxTroops && $helots > 0>>
						<<if $helots >= $slaveUnits[_i].maxTroops - $slaveUnits[_i].troops>>
							<<set $helots -= $slaveUnits[_i].maxTroops - $slaveUnits[_i].troops>>
							<<set $slavesEmployedManpower += $slaveUnits[_i].maxTroops - $slaveUnits[_i].troops>>
							<<set _expLoss = ($slaveUnits[_i].maxTroops - $slaveUnits[_i].troops) / $slaveUnits[_i].troops>>
							<<set $slaveUnits[_i].training -= $slaveUnits[_i].training * _expLoss>>
							<<set $slaveUnits[_i].troops = $slaveUnits[_i].maxTroops>>
						<<else>>
							<<set $slavesEmployedManpower += $helots>>
							<<set _expLoss = $helots / $slaveUnits[_i].troops>>
							<<set $slaveUnits[_i].training -= $slaveUnits[_i].training * _expLoss>>
							<<set $slaveUnits[_i].troops += $helots>>
							<<set $helots = 0>>
						<</if>>
					<</if>>
				<</for>>
			<</if>>

			<<if _hasLossesMe == 1>>
				<<for _i = 0; _i < $mercUnits.length; _i++>>
					<<if $mercUnits[_i].troops < $mercUnits[_i].maxTroops && $mercFreeManpower > 0>>
						<<if $mercFreeManpower >= $mercUnits[_i].maxTroops - $mercUnits[_i].troops>>
							<<set $mercFreeManpower -= $mercUnits[_i].maxTroops - $mercUnits[_i].troops>>
							<<set $mercEmployedManpower += $mercUnits[_i].maxTroops - $mercUnits[_i].troops>>
							<<set _expLoss = ($mercUnits[_i].maxTroops - $mercUnits[_i].troops) / $mercUnits[_i].troops>>
							<<set $mercUnits[_i].training -= $mercUnits[_i].training * _expLoss>>
							<<set $mercUnits[_i].troops = $mercUnits[_i].maxTroops>>
						<<else>>
							<<set $mercEmployedManpower += $mercFreeManpower>>
							<<set _expLoss = $mercFreeManpower / $mercUnits[_i].troops>>
							<<set $mercUnits[_i].training -= $mercUnits[_i].training * _expLoss>>
							<<set $mercUnits[_i].troops += $mercFreeManpower>>
							<<set $mercFreeManpower = 0>>
						<</if>>
					<</if>>
				<</for>>
			<</if>>

			<<if $slaveRebellion == 1 || $citizenRebellion == 1>>
				<<goto "rebellionOptions">>
			<<elseif $attackThisWeek == 1>>
				<<goto "attackOptions">>
			<<else>>
				<<goto "secBarracks">>
			<</if>>

		<</link>>

//Will replenish units as long as manpower is available
	<</if>>

<</widget>>

repo_name: lemongrab/fc


code:
:: unitsWidgets [widget nobr]

<<widget "militiaUnitsDescription">>
	<<if $args[0].active == 1>>
		$args[0].platoonName <<if $args[0].battlesFought > 1>> participated in $args[0].battlesFought battles and is ready to face the enemy once more at your command.<<elseif $args[0].battlesFought == 1>>is ready to face the enemy once more at your command.<<else>>is ready to face the enemy in battle.<</if>>
		Its $args[0].troops men and women are all proud citizens of your arcology, willing to put their lives on the line to protect their home.
		<<if $args[0].troops < $args[0].maxTroops>> The unit is not at its full strength of $args[0].maxTroops operatives.<</if>>
		<<if $args[0].equip == 0>>
			They are issued with simple, yet effective equipment: firearms, a few explosives and standard uniforms, nothing more.
		<<elseif $args[0].equip == 1>>
			They are issued with good, modern equipment: firearms, explosives and a few specialized weapons like sniper rifles and machine guns. They also carry simple body armor.
		<<elseif $args[0].equip == 2>>
			They are issued with excellent, high tech equipment: modern firearms, explosives, specialized weaponry and modern body armor. They are also issued with modern instruments like night vision and portable radars.
		<<else>>
			They are equipped with the best the modern world has to offer: modern firearms, explosives, specialized weaponry, experimental railguns, adaptive body armor and high tech recon equipment.
		<</if>>
		<<if $args[0].training <= 33>>
			They lack the experience to be considered consummate professionals, but their eagerness to defend the arcology makes up for it.
		<<elseif $args[0].training <= 66>>
			They have trained <<if $args[0].battlesFought > 0>>and fought<</if>> enough to be considered disciplined, professional soldiers, ready to face the battlefield.
		<<else>>
			They are consummate veterans, with a wealth of experience and perfectly trained. On the battlefield they are a well oiled war machine capable of facing pretty much anything.
		<</if>>
		<<if $args[0].loyalty < 10>>
			The unit is extremely disloyal. Careful monitoring of their activities and relationships should be implemented.
		<<elseif $args[0].loyalty < 33>>
			Their loyalty is low. Careful monitoring of their activities and relationships is advised.
		<<elseif $args[0].loyalty < 66>>
			Their loyalty is not as high as it can be, but they are not actively working against their arcology owner.
		<<elseif $args[0].loyalty < 90>>
			Their loyalty is high and strong. The likelihood of this unit betraying the arcology is low to non-existent.
		<<else>>
			The unit is fanatically loyal. They would prefer death over betrayal.
		<</if>>
		<<if $args[0].cyber == 1>>
			The soldiers of the unit have been enhanced with numerous cyberaugmentations which greatly increase their raw power.
		<</if>>
		<<if $args[0].medics == 1>>
			The unit has a dedicated squad of medics that will follow them in battle.
		<</if>>
		<<if $args[0].SF == 1>>
			The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active.
		<</if>>
	<<else>>
		$args[0].platoonName lost too many operatives in the $args[0].battlesFought it fought and can no longer be considered a unit at all.
	<</if>>
<</widget>>

<<widget "slaveUnitsDescription">>
	<<if $args[0].active == 1>>
		$args[0].platoonName <<if $args[0].battlesFought > 1>> participated in $args[0].battlesFought battles and is ready to face the enemy once more at your command.<<elseif $args[0].battlesFought == 1>>is ready to face the enemy once more at your command.<<else>>is ready to face the enemy in battle.<</if>>
		Its $args[0].troops men and women are slaves in your possession, tasked with the protection of their owner and their arcology.
		<<if $args[0].troops < $args[0].maxTroops>> The unit is not at its full strength of $args[0].maxTroops operatives.<</if>>
		<<if $args[0].equip == 0>>
			They are issued with simple, yet effective equipment: firearms, a few explosives and standard uniforms, nothing more.
		<<elseif $args[0].equip == 1>>
			They are issued with good, modern equipment: firearms, explosives and a few specialized weapons like sniper rifles and machine guns. They also carry simple body armor.
		<<elseif $args[0].equip == 2>>
			They are issued with excellent, high tech equipment: modern firearms, explosives, specialized weaponry and modern body armor. They are also issued with modern instruments like night vision and portable radars.
		<<else>>
			They are equipped with the best the modern world has to offer: modern firearms, explosives, specialized weaponry, experimental railguns, adaptive body armor and high tech recon equipment.
		<</if>>
		<<if $args[0].training <= 33>>
			They lack the experience to be considered professionals, but their eagerness to prove themselves makes up for it.
		<<elseif $args[0].training <= 66>>
			They have trained <<if $args[0].battlesFought > 0>>and fought<</if>> enough to be considered disciplined, professional soldiers, ready to face the battlefield.
		<<else>>
			They are consummate veterans, with a wealth of experience and perfectly trained. On the battlefield they are a well oiled war machine capable of facing pretty much anything.
		<</if>>
		<<if $args[0].loyalty < 10>>
			The unit is extremely disloyal. Careful monitoring of their activities and relationships should be implemented.
		<<elseif $args[0].loyalty < 33>>
			Their loyalty is low. Careful monitoring of their activities and relationships is advised.
		<<elseif $args[0].loyalty < 66>>
			Their loyalty is not as high as it can be, but they are not actively working against their arcology owner.
		<<elseif $args[0].loyalty < 90>>
			Their loyalty is high and strong. The likelihood of this unit betraying the arcology is low to non-existent.
		<<else>>
			The unit is fanatically loyal. They would prefer death over betrayal.
		<</if>>
		<<if $args[0].cyber == 1>>
			The soldiers of the unit have been enhanced with numerous cyberaugmentations which greatly increase their raw power.
		<</if>>
		<<if $args[0].medics == 1>>
			The unit has a dedicated squad of medics that will follow them in battle.
		<</if>>
		<<if $args[0].SF == 1>>
			The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active.
		<</if>>
	<<else>>
		$args[0].platoonName lost too many operatives in the $args[0].battlesFought it fought and can no longer be considered a unit at all.
	<</if>>
<</widget>>

<<widget "mercUnitsDescription">>
	<<if $args[0].active == 1>>
		$args[0].platoonName <<if $args[0].battlesFought > 1>> participated in $args[0].battlesFought battles and is ready to face the enemy once more at your command.<<elseif $args[0].battlesFought == 1>>is ready to face the enemy once more at your command.<<else>>is ready to face the enemy in battle.<</if>>
		Its $args[0].troops men and women are mercenaries contracted to defend the arcology against external threats.
		<<if $args[0].troops < $args[0].maxTroops>> The unit is not at its full strength of $args[0].maxTroops operatives.<</if>>
		<<if $args[0].equip == 0>>
			They are issued with simple, yet effective equipment: firearms, a few explosives and standard uniforms, nothing more.
		<<elseif $args[0].equip == 1>>
			They are issued with good, modern equipment: firearms, explosives and a few specialized weapons like sniper rifles and machine guns. They also carry simple body armor.
		<<elseif $args[0].equip == 2>>
			They are issued with excellent, high tech equipment: modern firearms, explosives, specialized weaponry and modern body armor. They are also issued with modern instruments like night vision and portable radars.
		<<else>>
			They are equipped with the best the modern world has to offer: modern firearms, explosives, specialized weaponry, experimental railguns, adaptive body armor and high tech recon equipment.
		<</if>>
		<<if $args[0].training <= 33>>
			They lack the experience to be considered professionals, but they're trained more than enough to still be an effective unit.
		<<elseif $args[0].training <= 66>>
			They have trained <<if $args[0].battlesFought > 0>>and fought<</if>> enough to be considered disciplined, professional soldiers, ready to face the battlefield.
		<<else>>
			They are consummate veterans, with a wealth of experience and perfectly trained. On the battlefield they are a well oiled war machine capable of facing pretty much anything.
		<</if>>
		<<if $args[0].loyalty < 10>>
			The unit is extremely disloyal. Careful monitoring of their activities and relationships should be implemented.
		<<elseif $args[0].loyalty < 33>>
			Their loyalty is low. Careful monitoring of their activities and relationships is advised.
		<<elseif $args[0].loyalty < 66>>
			Their loyalty is not as high as it can be, but they are not actively working against their arcology owner.
		<<elseif $args[0].loyalty < 90>>
			Their loyalty is high and strong. The likelihood of this unit betraying the arcology is low to non-existent.
		<<else>>
			The unit is fanatically loyal. They would prefer death over betrayal.
		<</if>>
		<<if $args[0].cyber == 1>>
			The soldiers of the unit have been enhanced with numerous cyberaugmentations which greatly increase their raw power.
		<</if>>
		<<if $args[0].medics == 1>>
			The unit has a dedicated squad of medics that will follow them in battle.
		<</if>>
		<<if $args[0].SF == 1>>
			The unit has attached advisors from $securityForceName that will help the squad remain tactically aware and active.
		<</if>>
	<<else>>
		$args[0].platoonName lost too many operatives in the $args[0].battlesFought it fought and can no longer be considered a unit at all.
	<</if>>
<</widget>>

<<widget "secBotsDescription">>
	<<if $secBots.active == 1>>
		The <<print $secBots.troops>> security drones are assembled in an ordered line in front of you, absolutely silent and ready to receive their orders.
		<<if $secBots.troops < $secBots.maxTroops>> The unit is not at its full strength of $secBots.maxTroops drones.<</if>>
		<<if $secBots.equip == 0>>
			They are equipped with light weaponry, mainly anti-riot non lethal weapons. Not particularly effective in battle.
		<<elseif $secBots.equip == 1>>
			They are equipped with light firearms, not an overwhelming amount of firepower, but with their mobility good enough to be effective.
		<<elseif $secBots.equip == 2>>
			They are equipped with powerful, modern firearms and simple armor mounted around their frames. They do not make for a pretty sight, but on the battlefield they are a dangerous weapon.
		<<else>>
			They are equipped with high energy railguns and adaptive armor. They are a formidable force on the battlefield, even for experienced soldiers.
		<</if>>
	<<else>>
		There are too few security drones left to be able to deploy them on the battlefield.
	<</if>>
<</widget>>

<<widget "generateUnitID">>
	<<set _newID = 0>>

	<<for _i = 0; _i < $militiaUnits.length; _i++>>
		<<if $militiaUnits[_i].ID >= _newID>>
			<<set _newID = $militiaUnits[_i].ID + 1>>
		<</if>>
	<</for>>

	<<for _i = 0; _i < $slaveUnits.length; _i++>>
		<<if $slaveUnits[_i].ID >= _newID>>
			<<set _newID = $slaveUnits[_i].ID + 1>>
		<</if>>
	<</for>>

	<<for _i = 0; _i < $mercUnits.length; _i++>>
		<<if $mercUnits[_i].ID >= _newID>>
			<<set _newID = $mercUnits[_i].ID + 1>>
		<</if>>
	<</for>>

	<<set $args[0].ID = _newID>>
<</widget>>


code:
:: art widgets [nobr widget]

/%
Call as <<AssistantArt>>
Displays assistant images. Currently passage-based.
$args[0]: Image size/center.
	3: Large, right. Example: description.
	2: Medium, right. Example: random events.
%/
<<widget "AssistantArt">>

<<if $imageChoice == 0>> /* RENDERED IMAGES BY SHOKUSHU */

<<switch $assistantAppearance>>
<<case "monstergirl">>
	<<set _fileName = "'resources/renders/assistant monstergirl.png' ">>
<<case "shemale">>
	<<set _fileName = "'resources/renders/assistant shemale.png' ">>
<<case "amazon">>
	<<set _fileName = "'resources/renders/assistant amazon.png' ">>
<<case "businesswoman">>
	<<set _fileName = "'resources/renders/assistant businesswoman.png' ">>
<<case "goddess">>
	<<set _fileName = "'resources/renders/assistant goddess.png' ">>
<<case "schoolgirl">>
	<<set _fileName = "'resources/renders/assistant schoolgirl.png' ">>
<<default>>
	<<set _fileName = "'resources/renders/assistant default.png' ">>
<</switch>>
<<if $args[1] == 3>>
	<<print "">>
<<else>>
	<<print "">>
<</if>>

<</if>> /* CLOSES IMAGE CHOICE */

<</widget>>

/%
Call as <<SlaveArt>>
Displays slave images. Currently passage-based.
$args[0]: Slave.
$args[1]: Image size/center.
	3: Large, right. Example: long slave description.
	2: Medium, right. Example: random events.
	1: Small, left. Example: lists.
	0: Tiny, left. Example: facilities
$args[2]: icon UI Display for vector art, 1 for on.
%/
<<widget "SlaveArt">>

<<if ndef $args[0].customImage>><<set $args[0].customImage = 0>><</if>>
<<if $args[0].customImage != 0>>
	<<set _fileFormat = ($args[0].customImageFormat || "png"),
		_fileName = "'resources/" + $args[0].customImage + "." + _fileFormat + "' ",
		_fileTypeStart = (_fileFormat === "webm" ? "video loop autoplay" : "img"),
		_fileTypeEnd = (_fileFormat === "webm" ? "</video>" : "")>>
	<<if $args[1] == 3>>
		<<print "<" + _fileTypeStart + " src=" + _fileName + "style='float:right; border:3px hidden'>" + _fileTypeEnd>>
	<<elseif $args[1] == 2>>
		<<print "<" + _fileTypeStart + " src=" + _fileName + "style='float:right; border:3px hidden' width='300' height='300'>" + _fileTypeEnd>>
	<<elseif $args[1] == 1>>
		<<print "<" + _fileTypeStart + " src=" + _fileName + "style='float:left; border:3px hidden' width='150' height='150'>" + _fileTypeEnd>>
	<<else>>
		<<print "<" + _fileTypeStart + " src=" + _fileName + "style='float:left; border:3px hidden' width='120' height='120'>" + _fileTypeEnd>>
	<</if>>

<<elseif $imageChoice == 1>> /* VECTOR ART BY NOX*/

<<if ndef $seeVectorArtHighlights>>
	<<set $seeVectorArtHighlights = 1>>
<</if>>
<<set _artSlave = $args[0] >>
<<silently>>
/* prepare HTML colour codes for slave display */
/* note: latex clothing is mostly emulated by rubber colour for skin (and shoes) */
/* TODO: consistently use american "color" instead of "colour" for all identifiers */
<<include Art_Vector_Set_Colour_Outfit_>>
<<include Art_Vector_Set_Colour_Skin_>>
<<include Art_Vector_Set_Colour_Hair_>>
<<include Art_Vector_Set_Colour_Shoe_>>
<</silently>>
<<include Art_Vector_Generate_Stylesheet_>>
/*
each passage adds one layer of vector art
vector art added later is drawn over previously added art
(what is listed on the bottom in the code appears on the top of the image)
*/
<<include Art_Vector_Hair_Back_>>
<<include Art_Vector_Arm_>>
<<include Art_Vector_Butt_>>
<<include Art_Vector_Leg_>>
<<include Art_Vector_Feet_>> /* includes shoes and leg outfits*/
<<include Art_Vector_Torso_>>
<<include Art_Vector_Pussy_>>
<<include Art_Vector_Pubic_Hair_>>
<<include Art_Vector_Pussy_Piercings_>>
<<include Art_Vector_Chastity_Belt_>>
<<include Art_Vector_Torso_Outfit_>> /* note: clothing covers chastity belts */
<<include Art_Vector_Balls_>>
<<include Art_Vector_Penis_>> /* for dicks behind boobs */
<<include Art_Vector_Belly_>> /* includes navel piercing and belly-related clothing options */
<<include Art_Vector_Boob_>> /* includes areolae and piercings */
<<include Art_Vector_Penis_>> /* for dicks in front of boobs */
<<include Art_Vector_Boob_Addons_>> /* piercings always appear in front of boobs AND dick */
<<include Art_Vector_Clavicle>>
<<include Art_Vector_Collar_>>
<<include Art_Vector_Head_>> /* includes glasses */
<<include Art_Vector_Hair_Fore_>>

<<widget "AssistantArt">>
<<if $imageChoice == 1>>
	<<switch $assistantAppearance>>
	<<case "amazon">>
		<<set _fileName = "'resources/vector/amazon.png' ">>
	<<case "angel">>
		<<set _fileName = "'resources/vector/angel.png' ">>
	<<case "businesswoman">>
		<<set _fileName = "'resources/vector/businesswoman.png' ">>
	<<case "cherub">>
		<<set _fileName = "'resources/vector/cherub.png' ">>
	<<case "ERROR_1606_APPEARANCE_FILE_CORRUPT">>
		<<set _fileName = "'resources/vector/corrupt.png' ">>
	<<case "fairy">>
		<<set _fileName = "'resources/vector/fairy.png' ">>
	<<case "goddess">>
		<<set _fileName = "'resources/vector/goddess.png' ">>
	<<case "imp">>
		<<set _fileName = "'resources/vector/imp.png' ">>
	<<case "incubus">>
		<<set _fileName = "'resources/vector/incubus.png' ">>
	<<case "monstergirl">>
		<<set _fileName = "'resources/vector/monstergirl.png' ">>
	<<case "pregnant fairy">>
		<<set _fileName = "'resources/vector/pfairy.png' ">>
	<<case "schoolgirl">>
		<<set _fileName = "'resources/vector/schoolgirl.png' ">>
	<<case "shemale">>
		<<set _fileName = "'resources/vector/shemale.png' ">>
	<<case "succubus">>
		<<set _fileName = "'resources/vector/succubus.png' ">>
	<<case "witch">>
		<<set _fileName = "'resources/vector/witch.png' ">>
	<<default>>
		<<set _fileName = "'resources/vector/default.png' ">>
	<</switch>>
	<<if $args[1] == 3>>
		<<print "">>
	<<else>>
		<<print "">>
	<</if>>
<</if>>
<</widget>>

<<elseif $imageChoice == 2>> /* VECTOR ART BY NOX - Pregmod Legacy Version */
<<SVGFilters>>

/* 000-250-006 */
/*
 */
/* 000-250-006 */

<<set _folderLoc = "'resources/vector">>

<<if $args[2] == 1>>
	<<print "">>
<</if>>

/% Set skin colour %/
<<set _skinFilter = "filter: url(#skin-" + _.kebabCase($args[0].skin) + ");">>
/% Set hair colour %/
<<set _hairFilter = "filter: url(#hair-" + _.kebabCase($args[0].hColor) + ");">>
<<set _underArmFilter = "filter: url(#hair-" + _.kebabCase($args[0].underArmHColor) + ");">>
<<set _pubesFilter = "filter: url(#hair-" + _.kebabCase($args[0].pubicHColor) + ");">>
<<set _axillaryFilter = "filter: url(#hair-" + _.kebabCase($args[0].underArmHColor) + ");">>
<<if $args[0].customHairVector>>
	<<set _hairStyle = $args[0].customHairVector>>
<<else>>
	<<set _hairStyle = ["neat", "up", "ponytail", "tails", "bun", "luxurious", "messy", "eary", "dreadlocks", "braided", "afro", "strip", "trimmed", "buzzcut"].includes($args[0].hStyle) ? $args[0].hStyle : "neat">>
<</if>>
<<set _underArmHStyle = $args[0].underArmHStyle>>

<<set _imgSkinLoc = _folderLoc + "/body/white">>

/% Shoulder width and arm or no arm %/
<<if $args[0].amp != 1>>
	<<if $args[0].devotion > 50>>
		<<set _leftArmType = "high">>
		<<set _rightArmType = "high">>
	<<elseif $args[0].trust >= -20>>
		<<if $args[0].devotion < -20>>
			<<set _leftArmType = "rebel">>
			<<set _rightArmType = "low">>
		<<elseif $args[0].devotion <= 20>>
			<<set _leftArmType = "low">>
			<<set _rightArmType = "low">>
		<<else>>
			<<set _leftArmType = "mid">>
			<<set _rightArmType = "high">>
		<</if>>
	<<else>>
		<<set _leftArmType = "mid">>
		<<set _rightArmType = "mid">>
	<</if>>

	<<if $args[0].fuckdoll == 0 && $args[0].clothes != "restrictive latex" && $args[0].clothes != "a latex catsuit">>
		<<print "">>
		<<if $args[0].underArmHStyle == "bushy">>
			<<= "">>
		<</if>>
	<<else>>
		<<if $args[0].fuckdoll != 0>>
			<<set _rightArmType = "mid">>
		<</if>>
		<<print "">>
	<</if>>

<<else>>
	<<if $args[0].fuckdoll == 0 && $args[0].clothes != "restrictive latex" && $args[0].clothes != "a latex catsuit" && $args[0].underArmHStyle == "bushy">>
		<<= "">>
	<</if>>
<</if>>

/% Hair Aft %/
<<if $args[0].hStyle != "shaved" && $args[0].fuckdoll == 0>>
	<<= "">>
<</if>>

/% Tailed Plug %/
<<if $args[0].buttplugAttachment == "tail">>
	<<= "">>
<</if>>

/% Butt %/
<<if $args[0].amp != 1>>
<<if $args[0].butt > 6>>
	<<set _buttSize = 3>>
<<elseif $args[0].butt > 4>>
	<<set _buttSize = 2>>
<<elseif $args[0].butt > 2>>
	<<set _buttSize = 1>>
<<else>>
	<<set _buttSize = 0>>
<</if>>
<<if $args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit">>
	<<set _buttSize = _buttSize + " latex">>
	<<print "">>
<<else>>
	<<print "">>
<</if>>
<</if>>

/% Leg + 1 size up when chubby or fat%/
<<if $args[0].hips < 0>>
	<<if $args[0].weight > 95>>/%Chubby%/
		<<set _legSize = "normal">>
	<<else>>
		<<set _legSize = "narrow">>
	<</if>>
<<elseif $args[0].hips == 0>>
	<<if $args[0].weight > 95>>/%Chubby%/
		<<set _legSize = "wide">>
	<<else>>
		<<set _legSize = "normal">>
	<</if>>
<<elseif $args[0].hips > 0>>
	<<set _legSize = "wide">>
<</if>>
<<if $args[0].amp == 1>>
	<<set _legSize = "stump " + _legSize>>
<</if>>
<<if ($args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit") && $args[0].amp != 1>>
	<<set _legSize = _legSize + " latex">>
	<<print "">>
<<else>>
	<<print "">>
<</if>>

/% Feet %/
<<if $args[0].amp != 1>>
<<if $args[0].shoes == "heels">>
	<<set _shoesType = "heel">>
<<elseif $args[0].shoes == "extreme heels">>
	<<if $args[0].weight > 95>>/%Chubby%/
		<<set _shoesType = "extreme heel wide">>
	<<else>>
		<<set _shoesType = "extreme heel">>
	<</if>>
<<elseif $args[0].shoes == "boots">>
	<<if $args[0].weight > 95>>/%Chubby%/
		<<set _shoesType = "boot wide">>
	<<else>>
		<<set _shoesType = "boot">>
	<</if>>
<<elseif $args[0].shoes == "flats">>
	<<set _shoesType = "flat">>
<<else>>
	<<print "">>
<</if>>
<<if $args[0].shoes == "extreme heels" || $args[0].shoes == "boots">>
	<<if $args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit">>
		<<set _shoesType = _shoesType + " latex">>
	<</if>>
	<<print "">>
<</if>>
<<if $args[0].shoes == "heels" || $args[0].shoes == "flats">>
	<<if $args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit">>
		<<set _shoesType = _shoesType + " latex">>
		<<print "">>
	<<else>>
		<<print "">>
	<</if>>
<</if>>
<</if>>

/% Torso %/
<<if $args[0].waist < -40>>/*Unnatural*/
	<<if $args[0].weight > 30>>/%Chubby%/
		<<set _torsoSize = "hourglass">>
	<<else>>
		<<set _torsoSize = "unnatural">>
	<</if>>
<<elseif $args[0].waist <= 10>>/%Hour glass%/
	<<if $args[0].weight > 30>>/%Chubby%/
		<<set _torsoSize = "normal">>
	<<else>>
		<<set _torsoSize = "hourglass">>
	<</if>>
<<else>>/*Normal*/
	<<set _torsoSize = "normal">>
<</if>>
<<print "">>
<<set _torsoOutfit = false>>
<<if $args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit">>
	<<set _torsoOutfit = " latex">>
<<elseif $args[0].clothes == "uncomfortable straps">>
	<<set _torsoOutfit = " straps">>
<</if>>
<<if _torsoOutfit>>
	<<print "">>
<</if>>

<<if $args[0].amp != 1>>
	<<if $args[0].fuckdoll == 0 && $args[0].clothes != "restrictive latex" && $args[0].clothes != "a latex catsuit">>
		<<if  _leftArmType == "high">>
			<<print "">>
			<<if $args[0].underArmHStyle == "bushy">>
				<<= "">>
			<</if>>
		<<else>>
			<<if $args[0].underArmHStyle == "bushy">>
				<<= "">>
			<</if>>
			<<print "">>
		<</if>>
		<<print "">>
	<<else>>
		<<if $args[0].fuckdoll != 0>>
			<<set _leftArmType = "mid">>
		<</if>>
		<<print "">>
	<</if>>
<<else>>
	<<if $args[0].fuckdoll == 0 && $args[0].clothes != "restrictive latex" && $args[0].clothes != "a latex catsuit" && $args[0].underArmHStyle == "bushy">>
		<<= "">>
	<</if>>
<</if>>

/% Vagina %/
<<if $args[0].vagina >= 0>>
	<<print "">>
	<<if $args[0].clitPiercing == 1>>
		<<print "">>
	<<elseif $args[0].clitPiercing == 2>>
		<<print "">>
	<<elseif $args[0].clitPiercing == 3>>
		<<print "">>
	<</if>>
	<<if $args[0].vaginaPiercing == 1>>
		<<print "">>
	<<elseif $args[0].vaginaPiercing == 2>>
		<<print "">>
	<</if>>
<</if>>

/% Collar %/
<<switch $args[0].collar>>
<<case "bowtie">>
<<case "ancient Egyptian">>
<<case "nice retirement counter" "cruel retirement counter" "leather with cowbell" "pretty jewelry" "heavy gold" "satin choker" "stylish leather" "neck corset" "shock punishment" "tight steel" "uncomfortable leather" "dildo gag">>
	<<print "">>
<</switch>>

/% Head base image %/
<<if $args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit">>
	<<print "">>
<<else>>
	<<print "">>
<</if>>

/% Glasses %/
<<if $args[0].eyewear == "corrective glasses" || $args[0].eyewear == "glasses" || $args[0].eyewear == "blurring glasses">>
	<<print "">>
<</if>>

/% Chastity belt or Pubic hair %/
<<if $args[0].dickAccessory == "chastity" || $args[0].dickAccessory == "anal chastity" || $args[0].dickAccessory == "combined chastity" || $args[0].vaginalAccessory == "chastity belt" || $args[0].vaginalAccessory == "anal chastity" || $args[0].vaginalAccessory == "combined chastity">>
	<<if $args[0].dickAccessory == "chastity" || $args[0].dickAccessory == "combined chastity">>
		<<print "">>
	<</if>>
	<<if $args[0].vaginalAccessory == "chastity belt" || $args[0].vaginalAccessory == "combined chastity">>
		<<print "">>
	<</if>>
	<<print "">>
<<else>>
	<<if $args[0].pubicHStyle != "waxed">>
		<<set _pubicHStyle = ($args[0].pubicHStyle == "in a strip" ? "strip" : $args[0].pubicHStyle)>>
		<<= "">>
	<</if>>
<</if>>

/%if pregnant or has a belly%/
<<if $args[0].belly >= 5000>>
	<<print "">>
	<<if $args[0].navelPiercing >= 1>>/*Navel Piercing*/
		<<print "">>
	<</if>>
	<<if $args[0].navelPiercing == 2>>
		<<print "">>
	<</if>>
<<elseif $args[0].belly <= -100>> /* condition is currently reversed until the vector can be fixed */
	<<print "">>
	/*
	<<if $args[0].navelPiercing >= 1>>/Navel Piercing/
		<<print "">>
	<</if>>
	<<if $args[0].navelPiercing == 2>>
		<<print "">>
	<</if>>
	*/
<<else>>
	/*Navel Piercing*/
	<<if $args[0].navelPiercing >= 1>>
		<<print "">>
	<</if>>
	<<if $args[0].navelPiercing == 2>>
		<<print "">>
	<</if>>
<</if>>

/% Boob %/
<<if $args[0].boobs < 300>>
	<<set _boobSize = 0>>
<<elseif $args[0].boobs < 500>>
	<<set _boobSize = 1>>
<<elseif $args[0].boobs < 800>>
	<<set _boobSize = 2>>
<<elseif $args[0].boobs < 1600>>
	<<set _boobSize = 3>>
<<elseif $args[0].boobs < 3200>>
	<<set _boobSize = 4>>
<<elseif $args[0].boobs < 6400>>
	<<set _boobSize = 5>>
<<elseif $args[0].boobs < 12000>>
	<<set _boobSize = 6>>
<<else>>
	<<set _boobSize = 7>>
<</if>>

/% Scrotum %/
<<if $args[0].scrotum > 0>>
	<<if $args[0].scrotum >= 6>>
		<<set _ballSize = 4>>
	<<elseif $args[0].scrotum >= 4>>
		<<set _ballSize = 3>>
	<<elseif $args[0].scrotum >= 3>>
		<<set _ballSize = 2>>
	<<elseif $args[0].scrotum >= 2>>
		<<set _ballSize = 1>>
	<<else>>
		<<set _ballSize = 0>>
	<</if>>
<</if>>

/% Penis %/
<<if $args[0].dick > 0>>
	<<if $args[0].dick >= 8>>
		<<set _penisSize = 6>>
	<<elseif $args[0].dick >= 7>>
		<<set _penisSize = 5>>
	<<elseif $args[0].dick >= 6>>
		<<set _penisSize = 4>>
	<<elseif $args[0].dick >= 5>>
		<<set _penisSize = 3>>
	<<elseif $args[0].dick >= 4>>
		<<set _penisSize = 2>>
	<<elseif $args[0].dick >= 2>>
		<<set _penisSize = 1>>
	<<else>>
		<<set _penisSize = 0>>
	<</if>>
<</if>>

/% Boob %/
<<set _needBoobs = 1>>
<<if $args[0].dick > 0>>
<<if canAchieveErection($args[0])>>
<<if _boobSize < 6>>
	<<if $args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit">>
		/* normal case: outfit hides boobs */
		<<set _boobOutfit = " latex" >>
	<</if>>
	<<if _boobOutfit >>
		<<print "">>
		<<if $args[0].lactation > 0>>
			<<print "">>
		<</if>>
	<<else>>
		<<print "">>
		<<print "">>
	<</if>>
	/* special case: straps are actually dawn over the boobs */
	<<if $args[0].clothes == "uncomfortable straps">>
		<<set _boobOutfit = " straps" >>
		<<print "">>
	<</if>>
	<<set _needBoobs = 0>>
<</if>>
<</if>>
<</if>>
<<if $args[0].vagina > 0>>
	<<if $args[0].dick > 0>>

		<<if $args[0].scrotum > 0>>
			<<print "">>
		<</if>>
		<<if canAchieveErection($args[0])>>
			<<print "">>
		<<else>>
			<<print "">>
			<<if $args[0].dickAccessory == "chastity" || $args[0].dickAccessory == "combined chastity">>
				<<print "">>
			<</if>>
		<</if>>

	<</if>>
<<else>>
	<<if $args[0].dick > 0>>

		<<if $args[0].scrotum > 0>>
			<<print "">>
		<</if>>
		<<if canAchieveErection($args[0])>>
			<<print "">>
		<<else>>
			<<print "">>
			<<if $args[0].dickAccessory == "chastity" || $args[0].dickAccessory == "combined chastity">>
				<<print "">>
			<</if>>
		<</if>>

	<</if>>
<</if>>
<<if _needBoobs>>
	<<if $args[0].fuckdoll != 0 || $args[0].clothes == "restrictive latex" || $args[0].clothes == "a latex catsuit">>
		<<print "">>
		<<if $args[0].lactation > 0>><<print "">><</if>>
	<<else>>
		<<print "">>
		<<print "">>
	<</if>>
	/* special case: straps are actually dawn over the boobs */
	<<if $args[0].clothes == "uncomfortable straps">>
		<<set _boobOutfit = " straps" >>
		<<print "">>
	<</if>>
<</if>>

/% piercings %/
<<if $args[0].nipplesPiercing == 1>>
	<<print "">>
<<elseif $args[0].nipplesPiercing == 2>>
	<<print "">>
<</if>>
<<if $args[0].areolaePiercing == 1>>
	<<print "">>
<</if>>

/% clavicle %/
<<print "">>

/% Hair Foreground %/
<<if $args[0].hStyle != "shaved" && $args[0].fuckdoll == 0>>
	<<= "">>
<</if>>

<<elseif $imageChoice == 3>> /* VECTOR ART REVAMP*/
	<<include Art_Vector_Revamped_Control_>>
<<else>> /* RENDERED IMAGES BY SHOKUSHU */

<<if $args[0].vagina > -1>>
	<<if $args[0].dick > 0>>
		<<if $args[0].balls > 0>>
			<<set _fileName = "futanari">>
		<<else>>
			<<set _fileName = "herm">>
		<</if>>
	<<else>>
		<<set _fileName = "female">>
	<</if>>
<<else>>
	<<if $args[0].balls > 0>>
		<<set _fileName = "shemale">>
	<<else>>
		<<set _fileName = "gelding">>
	<</if>>
<</if>>
<<if $args[0].belly > 1500>>
	<<set _fileName = "preg " + _fileName>>
<</if>>
<<if $args[0].boobs < 400>>
	<<set _fileName = _fileName + " small">>
<<elseif $args[0].boobs < 800>>
	<<set _fileName = _fileName + " big">>
<<elseif $args[0].boobs < 6000>>
	<<set _fileName = _fileName + " huge">>
<<else>>
	<<set _fileName = _fileName + " hyper">>
<</if>>
<<if $args[0].muscles > 30>>
	<<set _fileName = _fileName + " muscle">>
<<else>>
	<<set _fileName = _fileName + " soft">>
<</if>>
<<if $args[0].fuckdoll > 0>>
	<<set _fileName = _fileName + " rebellious">>
<<elseif $args[0].devotion <= 20>>
	<<if $args[0].trust < -20>>
		<<set _fileName = _fileName + " reluctant">>
	<<else>>
		<<set _fileName = _fileName + " rebellious">>
	<</if>>
<<elseif $args[0].fetish == "mindbroken">>
	<<set _fileName = _fileName + " reluctant">>
<<elseif $args[0].devotion <= 50 || $args[0].fetishKnown != 1 || ($seeMainFetishes == 0 && $args[1] < 2)>>
	<<set _fileName = _fileName + " obedient">>
<<else>>
	<<if $args[0].fetish == "none">>
		<<set _fileName = _fileName + " obedient">>
	<<else>>
		<<set _fileName = _fileName + " " + $args[0].fetish>>
	<</if>>
<</if>>

<<set _fileName = "'resources/renders/" + _fileName + ".png' ">>
<<if $args[1] == 3>>
	<<print "">>
<<elseif $args[1] == 2>>
	<<print "">>
<<elseif $args[1] == 1>>
	<<print "">>
<<else>>
	<<print "">>
<</if>>

<</if>> /* CLOSES IMAGE CHOICE */

<</widget>>


code:
:: Art_Vector_Arm_ [nobr]

/*
<<if _artSlave.amp == -1>>
	<<if $args[0].devotion > 50>>
		<<include Art_Vector_Arm_Left_ProstheticBasic_High>>
		<<include Art_Vector_Arm_Right_ProstheticBasic_High>>
		<<include Art_Vector_Arm_Left_ProstheticBasic_Thumb_Down>>
		<<include Art_Vector_Arm_Right_ProstheticBasic_Low>>
	<<elseif $args[0].trust >= -20>>
		<<if $args[0].devotion < -20>>
			<<include Art_Vector_Arm_Left_ProstheticBasic_Rebel>>
			<<include Art_Vector_Arm_Right_ProstheticBasic_Low>>
		<<elseif $args[0].devotion <= 20>>
			<<include Art_Vector_Arm_Left_ProstheticBasic_Low>>
			<<include Art_Vector_Arm_Right_ProstheticBasic_Low>>
		<<else>>
			<<include Art_Vector_Arm_Left_ProstheticBasic_Mid>>
			<<include Art_Vector_Arm_Right_ProstheticBasic_High>>
		<</if>>
	<<else>>
		<<include Art_Vector_Arm_Left_ProstheticBasic_Mid>>
		<<include Art_Vector_Arm_Right_ProstheticBasic_Mid>>
	<</if>>
<</if>>
*/

/* Arms position switch courtesy of Nov-X */

<<if $args[0].amp != 1>>
	<<if $args[0].devotion > 50>>
		<<set _leftArmType = "High">>
		<<set _rightArmType = "High">>
	<<elseif $args[0].trust >= -20>>
		<<if $args[0].devotion < -20>>
			<<set _leftArmType = "Rebel">>
			<<set _rightArmType = "Low">>
		<<elseif $args[0].devotion <= 20>>
			<<set _leftArmType = "Low">>
			<<set _rightArmType = "Low">>
		<<else>>
			<<set _leftArmType = "Mid">>
			<<set _rightArmType = "High">>
		<</if>>
	<<else>>
		<<set _leftArmType = "Mid">>
		<<set _rightArmType = "Mid">>
	<</if>>

	<<set _art = "Art_Vector_Arm_Right_"+_rightArmType >>
	<<include _art>>
	<<set _art = "Art_Vector_Arm_Left_"+_leftArmType >>
	<<include _art>>

	/* shiny clothings */
	<<if $seeVectorArtHighlights == 1>>
		<<if _artSlave.fuckdoll != 0 || _artSlave.clothes == "restrictive latex" || _artSlave.clothes == "a latex catsuit" || _artSlave.clothes == "body oil">>
			/* only some arm positions have art (feel free to add more) */
			<<switch _leftArmType>>
			<<case "High">>
				<<include Art_Vector_Arm_Outfit_Shine_Left_High>>
			<<case "Mid">>
			<<include Art_Vector_Arm_Outfit_Shine_Left_Mid>>
			<<case "Low">>
				<<include Art_Vector_Arm_Outfit_Shine_Left_Low>>
			<<default>>
				/* no art for this arm position */
			<</switch>>
		<</if>>
	<</if>>
<</if>>

/* TODO: simplify selection (select prefix, infix and suffix and combine instead of using switch statemens) */

<<if _artSlave.clothes == "a slave gown">>
		/* only some arm positions have art (feel free to add more) */
		<<switch _leftArmType>>
		<<case "High">>
			<<include Art_Vector_Arm_Outfit_SlaveGown_Left_High>>
		<<case "Mid">>
		<<include Art_Vector_Arm_Outfit_SlaveGown_Left_Mid>>
		<<case "Low">>
			<<include Art_Vector_Arm_Outfit_SlaveGown_Left_Low>>
		<<default>>
			/* no art for this arm position */
		<</switch>>
<</if>>

<<if _artSlave.clothes == "a hijab and abaya">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Hijab_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Hijab_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Hijab_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Hijab_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Hijab_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a hijab and abaya">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Hijab_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Hijab_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Hijab_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "cutoffs and a t-shirt">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "cutoffs and a t-shirt">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Cutoffs_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "battledress">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Battledress_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Battledress_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Battledress_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Battledress_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Battledress_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "battledress">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Battledress_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Battledress_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Battledress_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "conservative clothing">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Conservative_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Conservative_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Conservative_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Conservative_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Conservative_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "conservative clothing">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Conservative_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Conservative_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Conservative_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a huipil">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Huipil_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Huipil_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Huipil_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Huipil_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Huipil_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a huipil">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Huipil_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Huipil_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Huipil_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a kimono">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Kimono_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Kimono_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Kimono_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Kimono_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Kimono_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a kimono">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Kimono_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Kimono_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Kimono_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a nice maid outfit">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a nice maid outfit">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_NiceMaid_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a military uniform">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a military uniform">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_MilitaryUniform_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a nice nurse outfit">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a nice nurse outfit">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_NiceNurse_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a slutty nurse outfit">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a slutty nurse outfit">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyNurse_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a schoolgirl outfit">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a schoolgirl outfit">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Schoolgirl_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "Western clothing">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Western_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Western_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Western_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Western_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Western_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "Western clothing">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Western_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Western_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Western_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a slutty qipao">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a slutty qipao">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyQipao_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "nice business attire">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "nice business attire">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_NiceBusinessAttire_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "slutty business attire">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "slutty business attire">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyBusinessAttire_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a schutzstaffel uniform">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a schutzstaffel uniform">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a slutty schutzstaffel uniform">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a slutty schutzstaffel uniform">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SchutzstaffelUniform_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a red army uniform">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a red army uniform">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_RedArmyUniform_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "slutty jewelry">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "slutty jewelry">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_SluttyJewelry_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a cheerleader outfit">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "a cheerleader outfit">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_Cheerleader_Right_Low>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "clubslut netting">>
	<<if _leftArmType == "High">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Left_High>>
	<<elseif _leftArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Left_Mid>>
	<<elseif _leftArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Left_Low>>
	<<elseif _leftArmType == "Rebel">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Left_Rebel>>
	<<elseif _rightArmType == "Thumb Down">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Left_Thumb>>
	<</if>>
<</if>>

<<if _artSlave.clothes == "clubslut netting">>
	<<if _rightArmType == "High">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Right_High>>
	<<elseif _rightArmType == "Mid">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Right_Mid>>
	<<elseif _rightArmType == "Low">>
		<<include Art_Vector_Arm_Outfit_ClubslutNetting_Right_Low>>
	<</if>>
<</if>>


code:
:: Art_Vector_Belly_ [nobr]

/* default: do no scaling (for addons on flat bellies) */
<<set _art_transform = "">>

<<if _artSlave.belly >= 2000>>
	/* add pregnancy belly, scale dynamically (clothing and addons can be scaled, too) */
	<<set _art_belly_scale_factor = 0.300*Math.log(0.011*_artSlave.belly) >>
	/* TODO: add check in penis control. do not draw penis atop belly if _art_belly_scale_factor > 1. */
	<<set _art_scale_factor = _art_belly_scale_factor >>
	<<set _art_translation_x = -262*(_art_scale_factor-1) >>
	<<set _art_translation_y = -284*(_art_scale_factor-1) >>
	<<set _art_belly_transform = "matrix(" + _art_scale_factor +",0,0," + _art_scale_factor + "," + _art_translation_x + "," + _art_translation_y + ")">>
	<<set _art_transform = _art_belly_transform>>
	<<if _artSlave.navelPiercing == 1>>
		<<include Art_Vector_Belly_Pregnant_Piercing>>
	<<elseif _artSlave.navelPiercing == 2>>
		<<include Art_Vector_Belly_Pregnant_Piercing_Heavy>>
	<<else>>
			<<include Art_Vector_Belly>>
	<</if>>

  <<set _clothes = _artSlave.clothes>>
  <<switch _artSlave.clothes >>
    /* handling special cases */
    <<case "a slutty schutzstaffel uniform" >>
      <<set _clothes = "a schutzstaffel uniform">> /* slutty schutzstaffel uniform uses schutzstaffel uniform art */
  <</switch>>
  <<switch _clothes >> /* select available clothes */
		<<case "a ball gown" "a bunny outfit" "a chattel habit" "a cheerleader outfit" "a fallen nuns habit" "a halter top dress" "a hijab and abaya" "a huipil" "a kimono" "a leotard" "a maternity dress" "a military uniform" "a mini dress" "a monokini" "an apron" "a nice maid outfit" "a nice nurse outfit" "a penitent nuns habit" "a red army uniform" "a schoolgirl outfit" "a schutzstaffel uniform" "a slave gown" "a slutty maid outfit" "a slutty nurse outfit" "a slutty qipao" "a succubus outfit" "a toga" "battledress" "clubslut netting" "conservative clothing" "cutoffs and a t-shirt" "nice business attire" "slutty business attire" "spats and a tank top" "Western clothing">>
			<<set _art_outfit = clothing2artSuffix(_clothes) >>
			<<set _art = "Art_Vector_Belly_Outfit_"+_art_outfit >>
			<<include _art >>
	<</switch>>

	/* shiny clothings */
	<<if $seeVectorArtHighlights == 1>>
		<<if _artSlave.fuckdoll != 0 || _artSlave.clothes == "restrictive latex" || _artSlave.clothes == "a latex catsuit" || _artSlave.clothes == "body oil">>
			<<include Art_Vector_Belly_Outfit_Shine >>
		<</if>>
	<</if>>
<</if>>

/* belly piercings for flat bellies */
<<if _artSlave.belly == 0>>
	<<if _artSlave.navelPiercing == 1>>
		<<include Art_Vector_Belly_Piercing>>
	<</if>>
	<<if _artSlave.navelPiercing == 2>>
		<<include Art_Vector_Belly_Piercing_Heavy>>
	<</if>>
<</if>>

/* Torso Accessories */
<<if _artSlave.bellyAccessory == "a corset" && _torsoSize == "Normal" && _artSlave.belly == 0>>
	<<include Art_Vector_Corsetnormal>>
<</if>>
<<if _artSlave.bellyAccessory  == "a corset" && _torsoSize == "Hourglass" && _artSlave.belly == 0>>
	<<include Art_Vector_Corsethourglass>>
<</if>>
<<if _artSlave.bellyAccessory  == "a corset" && _torsoSize == "Unnatural" && _artSlave.belly == 0>>
	<<include Art_Vector_Corsetunnatural>>
<</if>>
<<if _artSlave.bellyAccessory  == "an extreme corset" && _torsoSize == "Normal" && _artSlave.belly == 0>>
	<<include Art_Vector_Corsetnormal>>
<</if>>
<<if _artSlave.bellyAccessory  == "an extreme corset" && _torsoSize == "Hourglass" && _artSlave.belly == 0>>
	<<include Art_Vector_Corsethourglass>>
<</if>>
<<if _artSlave.bellyAccessory  == "an extreme corset" && _torsoSize == "Unnatural" && _artSlave.belly == 0>>
	<<include Art_Vector_Corsetunnatural>>
<</if>>
<<if _artSlave.bellyAccessory  == "a small empathy belly">>
	<<include Art_Vector_Empathy_Belly_Small>>
<</if>>
<<if _artSlave.bellyAccessory  == "a medium empathy belly">>
	<<include Art_Vector_Empathy_Belly_Medium>>
<</if>>
<<if _artSlave.bellyAccessory  == "a large empathy belly">>
	<<include Art_Vector_Empathy_Belly_Large>>
<</if>>
<<if _artSlave.bellyAccessory  == "a huge empathy belly">>
	<<include Art_Vector_Empathy_Belly_Huge>>
<</if>>


code:
:: Art_Vector_Body_Clothing_Control_ [nobr]

<<set _eyeBallColor = "#ffffff">>

<<if _artSlave.eyeColor != "">>
	<<if _artSlave.eyeColor.split(" ").length > 1>>
		<<set _eyeLens = _artSlave.eyeColor.split(" ")[0]>>

		<<if _eyeLens == "demonic">>
			<<set _eyeBallColor = _eyeColor>>
		<<elseif _eyeLens == "devilish">>
			<<set _eyeBallColor = "#000000">>
		<</if>>
	<</if>>
<</if>>

<<set _muscles_value = _artSlave.muscles + 101>>
<<set _art_muscle_visibility = 0.910239*Math.log(0.02*_muscles_value) >>

<<set _showEyes = 1>>
<<set _showLips = 1>>
<<set _showMouth = 1>>
<<set _showPubic = 1>>
<<set _showPussy = _artSlave.vagina >= 0>>
<<set _showArmHair = 1>>
<<set _showHair = _artSlave.hStyle != "shaved">>
<<set _showBoobs = 1>>
<<set _showNipples = 1>>
<<set _showArmHighlight = 0>>
<<set _showTorsoHighlight = 0>>
<<set _showLegHighlight = 0>>
<<set _showBoobsHighlight = 0>>
<<set _showEyesHighlight = 1>>
<<set _showHeadHighlight = 1>>
<<set _showBellyPiercings = 1>>
<<set _showNipplePiercings = 1>>
<<set _chastityAnal = _artSlave.dickAccessory == "anal chastity" || _artSlave.dickAccessory == "combined chastity" || _artSlave.vaginalAccessory == "anal chastity" || _artSlave.vaginalAccessory == "combined chastity" >>

<<set _chastityVaginal = _artSlave.vaginalAccessory == "chastity belt" || _artSlave.vaginalAccessory == "combined chastity">>

<<if _artSlave.fuckdoll > 0>>
	<<set _showEyes = 0>>
	<<set _showPubic = 0>>
	<<set _showArmHair = 0>>
	<<set _showHair = 0>>
	<<set _showArmHighlight = 1>>
	<<set _showTorsoHighlight = 1>>
	<<set _showBoobsHighlight = 1>>
	<<set _showLegHighlight = 1>>
	<<set _showHeadHighlight = 1>>
<</if>>

<<if _artSlave.clothes == "a nice maid outfit">>
	<<set _showPubic = 0>>
	<<set _showBoobs = 0>>
	<<set _showBellyPiercings = 0>>
	<<set _showNipplePiercings = 0>>
	<<set _showNipples = 0>>
<</if>>

<<if _artSlave.clothes == "a slutty maid outfit">>
	<<set _showBellyPiercings = 0>>
<</if>>

<<if _artSlave.clothes == "restrictive latex">>
	<<set _showEyes = 0>>
	<<set _showPubic = 0>>
	<<set _showArmHair = 0>>
	<<set _showHair = 0>>
	<<set _showArmHighlight = 1>>
	<<set _showTorsoHighlight = 1>>
	<<set _showLegHighlight = 1>>
	<<set _showHeadHighlight = 1>>
	<<set _showBellyPiercings = 0>>
<</if>>

<<if _artSlave.clothes == "a latex catsuit">>
	<<set _showPubic = 0>>
	<<set _showArmHair = 0>>
	<<set _showArmHighlight = 1>>
	<<set _showTorsoHighlight = 1>>
	<<set _showLegHighlight = 1>>
	<<set _showBoobsHighlight = 1>>
	<<set _showHeadHighlight = 1>>
	<<set _showBellyPiercings = 0>>
	<<set _showNipplePiercings = 0>>
	<<set _chastityAnal = 0>>
	<<set _chastityVaginal = 0>>
<</if>>

<<if $showBodyMods == 0>>
	<<set _showNipplePiercings = 0>>
<</if>>

<<if $seeVectorArtHighlights == 1>>
	<<set _showArmHighlight = 0>>
	<<set _showTorsoHighlight = 0>>
	<<set _showLegHighlight = 0>>
	<<set _showBoobsHighlight = 0>>
<</if>>


code:
:: Art_Vector_Butt_ [nobr]

/* BEWARE: _buttSize is also used in Art_Vector_Leg_ */

<<if _artSlave.amp != 1>>
  <<if _artSlave.butt > 6>>
    <<set _buttSize = 3>>
  <<elseif _artSlave.butt > 4>>
    <<set _buttSize = 2>>
  <<elseif _artSlave.butt > 2>>
    <<set _buttSize = 1>>
  <<else>>
    <<set _buttSize = 0>>
  <</if>>
  <<set _art = "Art_Vector_Butt_"+_buttSize >>
  <<include _art >>
<</if>>


code:
:: Art_Vector_Collar_ [nobr]

/* TODO: find out where "uncomfortable leather" collar art went */

<<switch _artSlave.collar>>
<<case "leather with cowbell">>
<<include Art_Vector_Collar_Cowbell >>
<<case "heavy gold">>
<<include Art_Vector_Collar_Gold_Heavy >>
<<case "neck corset">>
<<include Art_Vector_Collar_Neck_Corset >>
<<case "pretty jewelry">>
<<include Art_Vector_Collar_Pretty_Jewelry >>
<<case "cruel retirement counter">>
<<include Art_Vector_Collar_Retirement_Cruel >>
<<case "nice retirement counter">>
<<include Art_Vector_Collar_Retirement_Nice >>
<<case "satin choker">>
<<include Art_Vector_Collar_Satin_Choker >>
<<case "shock punishment">>
<<include Art_Vector_Collar_Shock_Punishment >>
<<case "stylish leather">>
<<include Art_Vector_Collar_Stylish_Leather >>
<<case "tight steel">>
<<include Art_Vector_Collar_Tight_Steel >>
<<case "uncomfortable leather">>
<<include Art_Vector_Collar_Leather_Cruel >>
<<case "silk ribbon">>
<<include Art_Vector_Collar_Silk_Ribbon >>
<<case "bowtie">>
<<include Art_Vector_Collar_Bowtie >>
<<case "ancient Egyptian">>
<<include Art_Vector_Collar_Ancientegyptian >>
<<default>>
/* collar not supported - don't display anything */
<</switch>>


code:
:: Art_Vector_Feet_ [nobr]

/* BEWARE: Uses _legSize set by Art_Vector_Leg_ */

<<if _artSlave.amp != 1>>
  <<switch _artSlave.shoes>>
    <<case "heels">>
        <<include Art_Vector_Shoes_Heel>>
    <<case "pumps">>
        <<include Art_Vector_Shoes_Pump>>
    <<case "extreme heels">>
      <<if _legSize == "Narrow">>
		<<include Art_Vector_Shoes_Extreme_Heel_Narrow>>
	  <<elseif _legSize == "Normal">>
		<<include Art_Vector_Shoes_Extreme_Heel_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Extreme_Heel_Wide>>
      <</if>>
    <<case "boots">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Boot_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Boot_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Boot_Wide>>
      <</if>>
    <<case "flats">>
        <<include Art_Vector_Shoes_Flat>>
    <<default>>
      <<include Art_Vector_Feet>>
  <</switch>>
<</if>>

<<if _artSlave.legAccessory == "short stockings" && _artSlave.amp != 1>>
	<<if _artSlave.shoes == "heels">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Heel_SS_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Heel_SS_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Heel_SS_Wide>>
      <</if>>
	<<elseif _artSlave.shoes == "pumps">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Pump_SS_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Pump_SS_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Pump_SS_Wide>>
      <</if>>
	<<elseif _artSlave.shoes == "flats">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Flat_SS_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Flat_SS_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Flat_SS_Wide>>
      <</if>>
	<<elseif _artSlave.shoes == "none">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Stockings_SS_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Stockings_SS_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Stockings_SS_Wide>>
      <</if>>
	<</if>>
<</if>>

<<if _artSlave.legAccessory == "long stockings" && _artSlave.amp != 1>>
	<<if _artSlave.shoes == "heels">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Heel_LL_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Heel_LL_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Heel_LL_Wide>>
      <</if>>
	<<elseif _artSlave.shoes == "pumps">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Pump_LL_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Pump_LL_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Pump_LL_Wide>>
      <</if>>
	<<elseif _artSlave.shoes == "flats">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Flat_LL_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Flat_LL_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Flat_LL_Wide>>
      <</if>>
	<<elseif _artSlave.shoes == "none">>
      <<if _legSize == "Narrow">>
        <<include Art_Vector_Shoes_Stockings_LL_Narrow>>
      <<elseif _legSize == "Normal">>
        <<include Art_Vector_Shoes_Stockings_LL_Normal>>
      <<elseif _legSize == "Wide">>
        <<include Art_Vector_Shoes_Stockings_LL_Wide>>
      <</if>>
	<</if>>
<</if>>

<<unset _art_outfit >> /* clean up variable possibly already set by prior widget run */

<<switch _artSlave.clothes>> /* select available clothes */
  <<case "an apron" "attractive lingerie" "a ball gown" "a bunny outfit" "a cheerleader outfit" "a fallen nuns habit" "a halter top dress" "a hijab and abaya" "a huipil" "a kimono" "a latex catsuit" "a maternity dress" "a military uniform" "a mini dress" "a monokini" "a nice maid outfit" "a nice nurse outfit" "a red army uniform" "a schoolgirl outfit" "a schutzstaffel uniform" "a slutty schutzstaffel uniform" "a slave gown" "a slutty maid outfit" "a slutty nurse outfit" "a slutty qipao" "a succubus outfit" "a toga" "battledress" "body oil" "clubslut netting" "conservative clothing" "cutoffs and a t-shirt" "nice business attire" "restrictive latex" "slutty business attire" "spats and a tank top" "stretch pants and a crop-top" "Western clothing">>
    <<set _art_outfit = clothing2artSuffix(_artSlave.clothes) >>
<</switch>>

/* special case for shiny clothings */
<<if $seeVectorArtHighlights == 1>>
  /* this one is leg and partly butt-related, but needs to be here as shoes are drawn over legs and butt */
  <<if _artSlave.fuckdoll != 0 || _artSlave.clothes == "restrictive latex" || _artSlave.clothes == "a latex catsuit" || _artSlave.clothes == "body oil">>
    <<set _art_outfit = "Shine" >>
  <</if>>
<</if>>

<<if def _art_outfit >>
	<<if _artSlave.amp != 1>>
		<<if ["an apron", "a ball gown", "a bunny outfit", "attractive lingerie", "a chattel habit", "a cheerleader outfit", "a fallen nuns habit", "a halter top dress", "a hijab and abaya", "a huipil", "a kimono", "a latex catsuit", "a maternity dress", "a military uniform", "a mini dress", "a monokini", "a nice maid outfit", "a nice nurse outfit", "a red army uniform", "a schoolgirl outfit", "a schutzstaffel uniform", "a slutty schutzstaffel uniform", "slutty business attire", "a slutty maid outfit", "a slutty nurse outfit", "spats and a tank top", "a slave gown", "a succubus outfit", "a toga", "battledress", "body oil", "clubslut netting", "conservative clothing", "cutoffs and a t-shirt", "nice business attire", "restrictive latex", "stretch pants and a crop-top"].includes(_artSlave.clothes)>>
			<<set _art = "Art_Vector_Butt_Outfit_"+_art_outfit+"_"+_buttSize >><<include _art >>
		<</if>>
		<<if _artSlave.clothes != "a schoolgirl outfit">>
			<<set _art = "Art_Vector_Leg_Outfit_"+_art_outfit+"_"+_legSize >><<include _art >>
		<</if>>
	<<else>>
		<<if _artSlave.clothes != "a schoolgirl outfit">>
			<<set _art = "Art_Vector_Leg_Outfit_"+_art_outfit+"_Stump" >><<include _art >>
		<</if>>
	<</if>>
<</if>>


code:
:: Art_Vector_Generate_Stylesheet_ [nobr]

/* _art_display_class is the style class for this display */
<<if _art_display_id > 0 >>
	<<set _art_display_id += 1>>
<<else>>
	<<set _art_display_id = 1>>
<</if>>
<<set _art_display_class = "ad"+_art_display_id >>

<<print "<style>."+_art_display_class+" {
    position: absolute;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
}
."+_art_display_class+" .white   { fill:#FFFFFF; }
."+_art_display_class+" .skin    { fill:"+_skinColour+"; }
."+_art_display_class+" .head    { "+_headSkinStyle+"; }
."+_art_display_class+" .torso   { "+_torsoSkinStyle+"; }
."+_art_display_class+" .boob    { "+_boobSkinStyle+"; }
."+_art_display_class+" .penis   { "+_penisSkinStyle+"; }
."+_art_display_class+" .scrotum { "+_scrotumSkinStyle+"; }
."+_art_display_class+" .belly	 { "+_bellySkinStyle+"; }
."+_art_display_class+" .areola  { "+_areolaStyle+"; }
."+_art_display_class+" .labia   { "+_labiaStyle+"; }
."+_art_display_class+" .hair    { fill:"+_hairColour+"; }
."+_art_display_class+" .shoe    { fill:"+_shoeColour+"; }
."+_art_display_class+" .shoe_shadow    { fill:"+_shoeShadowColour+"; }
."+_art_display_class+" .smart_piercing { fill:#4DB748; }
."+_art_display_class+" .steel_piercing { fill:#787878; }
."+_art_display_class+" .steel_chastity { fill:#BABABA; }
."+_art_display_class+" .outfit_base  { fill:"+_outfitBaseColour+"; }
."+_art_display_class+" .gag     { fill:#BF2126; }
."+_art_display_class+" .shadow  { fill:#010101; }
."+_art_display_class+" .glasses { fill:"+_glassesColour+"; }
</style>" >>


code:
:: Art_Vector_Head_ [nobr]

<<include Art_Vector_Head>>

/* shiny clothings */
<<if $seeVectorArtHighlights == 1>>
  <<if _artSlave.fuckdoll != 0 || _artSlave.clothes == "restrictive latex" || _artSlave.clothes == "a latex catsuit">>
    <<include Art_Vector_Head_Outfit_Shine>>
  <</if>>
<</if>>

/* FACIAL APPEARANCE */

<<if _artSlave.markings == "beauty">>
	<<include Art_Vector_Beauty_Mark>>
<</if>>
<<if _artSlave.markings == "freckles">>
	<<include Art_Vector_Freckles>>
<</if>>
<<if _artSlave.markings == "heavily">>
	<<include Art_Vector_Freckles_Heavy>>
<</if>>
<<if _artSlave.markings == "birthmark">>
	<<include Art_Vector_Birthmark>>
<</if>>
<<if _artSlave.minorInjury == "black eye">>
	<<include Art_Vector_Black_Eye>>
<</if>>

/* ADDONS */

<<if _artSlave.fuckdoll == 0 >> /* fuckdolly cannot be decorated */
<<if _artSlave.collar == "dildo gag">>
  <<include Art_Vector_Dildo_Gag>>
<</if>>
<<if _artSlave.collar == "ball gag">>
  <<include Art_Vector_Ball_Gag>>
<</if>>
<<if _artSlave.collar == "bit gag">>
  <<include Art_Vector_Bit_Gag>>
<</if>>
<<if _artSlave.collar == "massive dildo gag">>
  <<include Art_Vector_Massive_Dildo_Gag>>
<</if>>
<<if _artSlave.collar == "porcelain mask">>
  <<include Art_Vector_Porcelain_Mask>>
<</if>>
<<if _artSlave.eyewear == "corrective glasses" || _artSlave.eyewear == "glasses" || _artSlave.eyewear == "blurring glasses">>
  <<include Art_Vector_Glasses>>
<</if>>

/* head clothing */
  <<if _artSlave.clothes == "a hijab and abaya">>
    <<include Art_Vector_Head_Outfit_Hijab>>
  <</if>>
  <<if _artSlave.clothes == "a succubus outfit">>
    <<include Art_Vector_Head_Outfit_Succubus>>
  <</if>>
  <<if _artSlave.clothes == "a bunny outfit">>
    <<include Art_Vector_Head_Outfit_Bunny>>
  <</if>>
  <<if _artSlave.clothes == "a chattel habit">>
    <<include Art_Vector_Head_Outfit_ChattelHabit>>
  <</if>>
  <<if _artSlave.clothes == "a fallen nuns habit">>
    <<include Art_Vector_Head_Outfit_FallenNunsHabit>>
  <</if>>
  <<if _artSlave.clothes == "harem gauze">>
    <<include Art_Vector_Head_Outfit_HaremGauze>>
  <</if>>
  <<if _artSlave.clothes == "a penitent nuns habit">>
    <<include Art_Vector_Head_Outfit_PenitentNunsHabit>>
  <</if>>
  <<if _artSlave.clothes == "Western clothing">>
    <<include Art_Vector_Head_Outfit_Western>>
  <</if>>
  <<if _artSlave.clothes == "a military uniform">>
    <<include Art_Vector_Head_Outfit_MilitaryUniform>>
  <</if>>
  <<if _artSlave.clothes == "a cybersuit">>
	<<include Art_Vector_Head_Outfit_Cybersuit>>
  <</if>>
  <<if _artSlave.clothes == "a schutzstaffel uniform">>
	<<include Art_Vector_Head_Outfit_SchutzstaffelUniform>>
  <</if>>
  <<if _artSlave.clothes == "a slutty schutzstaffel uniform">>
	<<include Art_Vector_Head_Outfit_SchutzstaffelUniform>>
  <</if>>
  <<if _artSlave.clothes == "a red army uniform">>
	<<include Art_Vector_Head_Outfit_RedArmyUniform>>
  <</if>>
<</if>>


code:
:: Art_Vector_Helper_Functions_ [script]

window.clothing2artSuffix = function(v) {
  if (v == "restrictive latex") { v = "latex"; } /* universal "special case": latex art is actually "restrictive latex" TODO: align name in vector source */
  return v.replace(/^a[n]? /,"") /* remove "a" and "an" from the beginning*/
          .replace(/ ?(outfit|clothing) ?/,"") /* remove "outfit" and "clothing" (redundant) */
          .replace(/ and .+/,"") /* remove concatenated descriptions */
          .replace(/\w\S*/g,
            function(txt){
                return txt.charAt(0).toUpperCase() +
                       txt.substr(1).toLowerCase();
            }
          ) /* CamelCase by whitespace */
          .replace(/\W/g,""); /* remove remaining whitespace */
}


code:
:: Art_Vector_Leg_ [nobr]

/* Leg wideness switch courtesy of Nov-X */

/* BEWARE: _legSize is also used in Art_Vector_Feet_ */
/* BEWARE: _buttSize set by Art_Vector_Butt_ */

<<if _artSlave.amp != 1>>
  <<set _legSize = "Normal">>
  <<if _artSlave.hips < 0>>
    <<if _artSlave.weight < -10>>
      <<set _legSize = "Narrow">>
    <<else>>
      <<set _legSize = "Normal">>
    <</if>>
  <<elseif _artSlave.hips == 0>>
    <<if _artSlave.weight > 115>>
      <<set _legSize = "Wide">>
    <<else>>
      <<set _legSize = "Normal">>
    <</if>>
  <<elseif _artSlave.hips > 1>>
    <<set _legSize = "Wide">>
  <</if>>
  <<set _art = "Art_Vector_Leg_"+_legSize >>
<<else>>
  <<set _art = "Art_Vector_Stump" >>
<</if>>
<<include _art >>