code:
:: slave generation widgets [nobr widget]

<<widget "NationalityToRace">>
<<set $args[0].race
	= hashChoice(setup.raceSelector[$args[0].nationality] || setup.raceSelector[""])>>
<</widget>>

<<widget "NationalityToName">>
<<set $args[0].birthName =
	(setup.namePoolSelector[$args[0].nationality + "." + $args[0].race]
		|| setup.namePoolSelector[$args[0].nationality]
		|| setup.whiteAmericanSlaveNames).random()>>
<<set $args[0].birthSurname =
	(setup.surnamePoolSelector[$args[0].nationality + "." + $args[0].race]
		|| setup.surnamePoolSelector[$args[0].nationality]
		|| setup.whiteAmericanSlaveSurnames).random()>>
<<set $args[0].slaveName = $args[0].birthName>>
<<set $args[0].slaveName = $args[0].birthName, $args[0].slaveSurname = $args[0].birthSurname>>
<<if $useFSNames == 1>>
<<if $arcologies[0].FSChattelReligionist > 20>>
	<<set $args[0].slaveName = setup.chattelReligionistSlaveNames.random(), $args[0].slaveSurname = 0>>
<<elseif $arcologies[0].FSRomanRevivalist > 20>>
	<<set $args[0].slaveName = setup.romanSlaveNames.random(), $args[0].slaveSurname = setup.romanSlaveSurnames.random()>>
<<elseif $arcologies[0].FSAztecRevivalist > 20>>
	<<set $args[0].slaveName = setup.aztecSlaveNames.random(), $args[0].slaveSurname = 0>>
<<elseif $arcologies[0].FSEgyptianRevivalist > 20>>
	<<set $args[0].slaveName = setup.ancientEgyptianSlaveNames.random(), $args[0].slaveSurname = 0>>
<<elseif $arcologies[0].FSEdoRevivalist > 20>>
	<<set $args[0].slaveName = setup.edoSlaveNames.random(), $args[0].slaveSurname = setup.edoSlaveSurnames.random()>>
<<elseif $arcologies[0].FSDegradationist != "unset">>
	<<DegradingName $args[0]>>
<</if>>
<</if>>

<</widget>>

<<widget "NationalityToAccent">>

<<set _naturalAccent = either(0,1,1,2,2,2,3,3,3,3)>>

<<switch $args[0].nationality>>
<<case "Afghan">>
	<<if $language == "Pashto">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Albanian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Algerian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "American">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Spanish" && $args[0].race == "latina">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Chinese" && $args[0].race == "asian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Arabic" && $args[0].race == "middle eastern">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Andorran">>
	<<if $language == "Catalan">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Angolan">>
	<<if $language == "Portuguese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Antiguan">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Argentinian">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Armenian">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Aruban">>
	<<if $language == "Dutch">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Portuguese">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Australian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Austrian">>
	<<if $language == "German">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Serbian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Slovene">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Turkish" && $args[0].race == "middle eastern">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Azerbaijani">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Bahamian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bahraini">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bangladeshi">>
	<<if $language == "Bengali">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Hindi">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Barbadian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Belarusian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Belgian">>
	<<if $language == "Dutch">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "German">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Belizean">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Beninese">>
	<<if $language == "French">>
		<<set $args[0].accent = 1>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bermudian">>
	<<if $language == "English">>
		<<set $args[0].accent = 1>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bhutanese">>
	<<if $language == "Dzongkha">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bissau-Guinean">>
	<<if $language == "Portuguese">>
		<<set $args[0].accent = 1>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bolivian">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = 1>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bosnian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Brazilian">>
	<<if $language == "Portuguese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "British">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bruneian">>
	<<if $language == "Malay">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Bulgarian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Burkinabé">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Burmese">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Burundian">>
	<<if $language == "Kirundi">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Cambodian">>
	<<if $language == "Khmer">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Cham">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Cameroonian">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Canadian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Cape Verdean">>
	<<if $language == "Portuguese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Catalan">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Central African">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Chadian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Chilean">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Chinese">>
	<<if $language == "Tibetan">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Korean">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Kazakh">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Colombian">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Comorian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Congolese">>
	<<if $language == "Lingala">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Kikongo">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "a Cook Islander">>
	<<if $language == "Cook Islands Māori">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Costa Rican">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Croatian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Cuban">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Cypriot">>
	<<if $language == "Greek">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Turkish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Czech">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Danish">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Djiboutian">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Dominican">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Dominiquais">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Dutch">>
	<<set $args[0].accent = _naturalAccent>>
<<case "East Timorese">>
	<<if $language == "Tetum">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Portuguese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Malay">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ecuadorian">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Egyptian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Emirati">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Equatoguinean">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Eritrean">>
	<<if $language == "Tigrinya">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Estonian">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ethiopian">>
	<<if $language == "Amharic">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Tigrinya">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Fijian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Filipina">>
	<<if $language == "Filipino">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Tagalog">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Spanish">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Finnish">>
	<<if $language == "Swedish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "French">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Spanish">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "German">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Arabic" && $args[0].race == "middle eastern">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Catalan">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "French Guianan">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "French Polynesian">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Gabonese">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Gambian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Georgian">>
	<<if $language == "Abkhaz">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "German">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Turkish" && $args[0].race == "middle eastern">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ghanan">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Hausa">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Greek">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Greenlandic">>
	<<if $language == "Danish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Grenadian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Guamanian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Guatemalan">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Guinean">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Guyanese">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Haitian">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Honduran">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Hungarian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "I-Kiribati">>
	<<if $language == "Gilbertese">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Icelandic">>
	<<if $language == "Danish">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Indian">>
	<<if $language == "Hindi">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Indonesian">>
	<<if $language == "Malay">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Iranian">>
	<<if $language == "Persian">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Iraqi">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Kurdish">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Irish">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Israeli">>
	<<if $language == "Hebrew">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Italian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Ivorian">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Jamaican">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>><<case "Japanese">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Jordanian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Kazakh">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Kenyan">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Kittitian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Korean">>
	<<if $language == "Chinese">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Kosovan">>
	<<if $language == "Albanian">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Serbian">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Kurdish">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Kuwaiti">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Kyrgyz">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Laotian">>
	<<if $language == "Lao">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Khmu">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Latvian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Lebanese">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Liberian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Libyan">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "a Liechtensteiner">>
	<<if $language == "German">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Lithuanian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Luxembourgian">>
	<<if $language == "German">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Macedonian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Malagasy">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Malawian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Malaysian">>
	<<if $language == "Malay">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Maldivian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Malian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Maltese">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Italian">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Marshallese">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Mauritanian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Mauritian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Mexican">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Micronesian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Moldovan">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Monégasque">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Mongolian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Montenegrin">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Moroccan">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Mosotho">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Motswana">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Mozambican">>
	<<if $language == "Portuguese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Namibian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Afrikaans">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Nauruan">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Nepalese">>
	<<set $args[0].accent = _naturalAccent>>
<<case "New Caledonian">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "a New Zealander">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ni-Vanuatu">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Nicaraguan">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Nigerian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Hausa">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Nigerien">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Hausa">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Niuean">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Norwegian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Omani">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Pakistani">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Palauan">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Sonsorolese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Tobian">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Japanese">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Palestinian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Panamanian">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Papua New Guinean">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Paraguayan">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Peruvian">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Polish">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Portuguese">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Puerto Rican">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Qatari">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Romanian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Russian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Rwandan">>
	<<if $language == "Kinyarwanda">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Sahrawi">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Saint Lucian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Salvadoran">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Sammarinese">>
	<<if $language == "Italian">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Samoan">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "São Toméan">>
	<<if $language == "Portuguese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Saudi">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Scottish">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Senegalese">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Serbian">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Seychellois">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Sierra Leonean">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Singaporean">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Chinese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Malay">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Tamil">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Slovak">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Slovene">>
	<<set $args[0].accent = _naturalAccent>>
<<case "a Solomon Islander">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Somali">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "South African">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Afrikaans">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "South Sudanese">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Spanish">>
	<<if $language == "Catalan">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Sri Lankan">>
	<<if $language == "Sinhalese">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Tamil">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Sudanese">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Surinamese">>
	<<if $language == "Dutch">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Swazi">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Swedish">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Finnish">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Norwegian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "German">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Swiss">>
	<<if $language == "German">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Italian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Syrian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Taiwanese">>
	<<if $language == "Chinese">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Tajik">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Tanzanian">>
	<<if $language == "Swahili">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Thai">>
	<<if $language == "Chinese">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Malay">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<elseif $language == "Khmer">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Tibetan">>
	<<if $language == "Chinese">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Togolese">>
	<<if $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Tongan">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Trinidadian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Tunisian">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Turkish">>
	<<set $args[0].accent = _naturalAccent>>
<<case "Turkmen">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Tuvaluan">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ugandan">>
	<<if $language == "Swahili">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ukrainian">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Uruguayan">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Uzbek">>
	<<if $language == "Russian">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Vatican">>
	<<if $language == "Italian">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Venezuelan">>
	<<if $language == "Spanish">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Vietnamese">>
	<<if $language == "Chinese">>
		<<set $args[0].accent = either(0,1,2,2,2,3,3)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Vincentian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Yemeni">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Zairian">>
	<<if $language == "Lingala">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<elseif $language == "Kikongo">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "Swahili">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<elseif $language == "French">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Zambian">>
	<<if $language == "English">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Zimbabwean">>
	<<if $language == "English" && $args[0].race == "white">>
		<<set $args[0].accent = either(0,1,1,1,2)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ancient Chinese Revivalist">>
	<<if $language == "Chinese">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Ancient Egyptian Revivalist">>
	<<if $language == "Ancient Egyptian">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Arabian Revivalist">>
	<<if $language == "Arabic">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Aztec Revivalist">>
	<<if $language == "Nahuatl">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Edo Revivalist">>
	<<if $language == "Japanese">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<case "Roman Revivalist">>
	<<if $language == "Latin">>
		<<set $args[0].accent = either(0,0,0,1)>>
	<<else>>
		<<set $args[0].accent = _naturalAccent>>
	<</if>>
<<default>>
	<<set $args[0].accent = _naturalAccent>>
<</switch>>

<<if $args[0].nationality == $language>>
	<<set $args[0].accent = either(0,0,0,1)>>
<</if>>

<</widget>>

/* Call as <<GenerateAge slave>> */
<<widget "GenerateAge">>

<<if $activeSlaveOneTimeMaxAge > 998>>
	<<if $pedo_mode == 1>>
		<<set $activeSlaveOneTimeMaxAge = 18>>
	<<else>>
		<<set $activeSlaveOneTimeMaxAge = 42>>
	<</if>>
<<elseif $pedo_mode == 1 && $one_time_age_overrides_pedo_mode == 0 && $activeSlaveOneTimeMaxAge > 18>>
	<<set $activeSlaveOneTimeMaxAge = 18>>
<</if>>
<<if $retirementAge < $activeSlaveOneTimeMaxAge>>
	<<set $activeSlaveOneTimeMaxAge = ($retirementAge-1)>>
<</if>>
<<if $activeSlaveOneTimeMinAge < $minimumSlaveAge>>
	<<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
<<elseif $pedo_mode == 1 && $one_time_age_overrides_pedo_mode == 0>>
	<<set $activeSlaveOneTimeMinAge = $minimumSlaveAge>>
<</if>>
<<if $activeSlaveOneTimeMaxAge < $activeSlaveOneTimeMinAge>>
	<<set $activeSlaveOneTimeMaxAge = $activeSlaveOneTimeMinAge>>
<</if>>
<<if ($activeSlaveOneTimeMaxAge >= 30) && ($arcologies[0].FSMaturityPreferentialist != "unset")>>
	<<if $ageAdjustOverride != 1>>
		<<set $activeSlaveOneTimeMaxAge = ($activeSlaveOneTimeMaxAge + 10)>>
	<</if>>
<</if>>
<<set $args[0].actualAge = random($activeSlaveOneTimeMinAge,$activeSlaveOneTimeMaxAge)>>
<<set _secondAgeRoll = random($activeSlaveOneTimeMinAge,$activeSlaveOneTimeMaxAge)>>
<<if ($arcologies[0].FSYouthPreferentialist != "unset") && ($arcologies[0].FSYouthPreferentialist >= random(1,100))>>
	<<set $args[0].actualAge = Math.min($args[0].actualAge, _secondAgeRoll)>>
<<elseif ($arcologies[0].FSMaturityPreferentialist != "unset") && ($arcologies[0].FSMaturityPreferentialist >= random(1,100))>>
	<<set $args[0].actualAge = Math.max($args[0].actualAge, _secondAgeRoll)>>
<</if>>
<<if $args[0].actualAge >= $retirementAge>>
	<<set $args[0].actualAge = ($retirementAge-2)>>
<</if>>
<<set $activeSlaveOneTimeMinAge = 0>>
<<set $activeSlaveOneTimeMaxAge = 999>>
<<set $one_time_age_overrides_pedo_mode = 0>>
<<set $ageAdjustOverride = 0>>
<<set $args[0].visualAge = $args[0].actualAge>>
<<set $args[0].physicalAge = $args[0].actualAge>>
<<set $args[0].ovaryAge = $args[0].actualAge>>
<<set $args[0].age = $args[0].actualAge>> /*compatibility*/
<<set $args[0].pubertyAgeXX = $fertilityAge>>
<<set $args[0].pubertyAgeXY = $potencyAge>>

<</widget>>


code:
:: Summary Widgets [widget nobr]

/%
 Call as <<SlaveStatClamp $slave>>
%/
<<widget "SlaveStatClamp">>
<<set $args[0].energy = Math.clamp($args[0].energy, 0, 100)>>

<<if $args[0].devotion > 100>>
	<<if $args[0].trust < -95>>
		<<set $args[0].trust = -100>>
	<<elseif ($args[0].trust < 100) && ($args[0].trust >= 20)>>
		<<set $args[0].trust += (Math.trunc(($args[0].devotion-100)*5)/10)>>
	<<else>>
		<<set $rep += 10*($args[0].devotion-100)>>
	<</if>>
	<<set $args[0].devotion = 100>>
<<elseif $args[0].devotion < -95>>
	<<set $args[0].devotion = -100>>
<</if>>
<<if $args[0].trust > 100>>
	<<if $args[0].devotion < -95>>
		<<set $args[0].devotion = -100>>
	<<elseif $args[0].devotion < 100 && $args[0].devotion >= 20>>
		<<set $args[0].devotion += Math.trunc($args[0].trust-100)>>
	<<else>>
		<<set $rep += 10*($args[0].trust-100)>>
	<</if>>
	<<set $args[0].trust = 100>>
<<elseif $args[0].trust < -95>>
	<<set $args[0].trust = -100>>
<</if>>
<<if $args[0].trust < -100>><<set $args[0].trust = -100>><</if>>
<<if $args[0].devotion < -100>><<set $args[0].devotion = -100>><</if>>
<<if isNaN($args[0].oralCount)>><<set $args[0].oralCount = 0>>//Oral count has broken, report what you just did!<</if>>
<<if isNaN($args[0].analCount)>><<set $args[0].analCount = 0>>//Anal count has broken, report what you just did!<</if>>
<<if isNaN($args[0].vaginalCount)>><<set $args[0].vaginalCount = 0>>//Vaginal count has broken, report what you just did!<</if>>
<<if isNaN($args[0].mammaryCount)>><<set $args[0].mammaryCount = 0>>//Titfuck count has broken, report what you just did!<</if>>
<<if isNaN($args[0].penetrativeCount)>><<set $args[0].penetrativeCount = 0>>//Penetration count has broken, report what you just did!<</if>>
<<if ndef $args[0].foreskin>><<set $args[0].foreskin = 0>><</if>>
<<if $args[0].amp != 0 && $args[0].heels == 1>><<set $args[0].heels = 0>><</if>>
<<if $args[0].vagina < 0 && $args[0].mpreg == 0 && $args[0].preg == -1>><<set $args[0].preg = 0, WombFlush($args[0])>><</if>>
<</widget>>

repo_name: Akane/fc


code:
index.html
audio/
fonts/
icon/
img/
lib/
movies/
save/
greenworks.js
package.json
Game.rpgproject
steam_api*
errorlog.txt
*.7z

repo_name: Rexhunk/karryn

path: .gitignore

license: unknown


code:
## This branch is now deprecated.  It has been merged into dev.  Leaving it here so links don't break.

## Gyaru mod dev branch.  Skin/hair/eye color changes with edicts and passives.

Look at CCMOD_GYARU_SUPPORTED_POSES to see what art assets exist so far.

Don't use this branch unless you know what you're doing.  It's unfinished and might be unstable.  Though testing and feedback is appreciated.

The rotateHue function to get the colors does have a fairly significant performance impact.  Once my brain has time time to rest I might look into some options to mitigate this with some complicated caching processes, but it's still playable and only really noticeable on rapid pose changes (standby -> defend -> attack -> standby -> etc.).  No problem on scenes with just one pose where the whole thing doesn't have to be redrawn.

If you're interested in contributing art assets, particularly hair cutouts, feel free to contact me.


code:
## Gyaru mod dev branch.  Skin/hair/eye color changes with edicts and passives.

Look at CCMOD_GYARU_SUPPORTED_POSES to see what art assets exist so far.

Don't use this branch unless you know what you're doing.  It's unfinished and might be unstable.  Though testing and feedback is appreciated.

The rotateHue function to get the colors does have a fairly significant performance impact.  Once my brain has time time to rest I might look into some options to mitigate this with some complicated caching processes, but it's still playable and only really noticeable on rapid pose changes (standby -> defend -> attack -> standby -> etc.).  No problem on scenes with just one pose where the whole thing doesn't have to be redrawn.

If you're interested in contributing art assets, particularly hair cutouts, feel free to contact me.


Secretary Halberd

description: Karryn's starting Halberd

note:
<REM NAME EN>
Secretary Halberd
</REM NAME EN>
<REM NAME JP>
セクレタリー・ハルバード
</REM NAME JP>
<REM DESC EN>
Karryn's treasured halberd that she uses to protect the Emperor.
It can be used to strike, slash and thrust, as well as parry attacks.
</REM DESC EN>
<REM DESC JP>
皇帝を護衛するために愛用している槍斧。
斬・打・突の３種の攻撃が出来る他、盾としても役立つ。
</REM DESC JP>

Specialization

note:
<REM NAME EN>
Specialization
</REM NAME EN>
<REM NAME JP>
特化訓練
</REM NAME JP>
<Set Sts Data>
skill: 2000,2001,0,0,2002,0,0,2003,0,0,2004,0,0,2005,0,0
</Set Sts Data>

Shopping

note:
<REM NAME EN>
Shopping
</REM NAME EN>
<REM NAME JP>
ショップ
</REM NAME JP>
<Set Sts Data>
skill: 450
</Set Sts Data>

Prison

note:
<REM NAME EN>
Fort Ganon
</REM NAME EN>
<REM NAME JP>
要塞ガナン
</REM NAME JP>
<Set Sts Data>
skill: 0,368,0,0,0,386,387,388,0,405,404,0,0,422
</Set Sts Data>

Level 1

note:
<REM NAME EN>
Level 1
</REM NAME EN>
<REM NAME JP>
Lv１
</REM NAME JP>
<Set Sts Data>
skill: 372,0,506,0,0,0,522,0,0,523,526,529,530,0,531,0
</Set Sts Data>

Level 2

note:
<REM NAME EN>
Level 2
</REM NAME EN>
<REM NAME JP>
Lv２
</REM NAME JP>
<Set Sts Data>
skill: 373,561,0,0,568,573,576,578,580,582,589,0,549,0,
</Set Sts Data>

Level 3

note:
<REM NAME EN>
Level 3
</REM NAME EN>
<REM NAME JP>
Lv３
</REM NAME JP>
<Set Sts Data>
skill: 0
</Set Sts Data>

Level 4

note:
<REM NAME EN>
Level 4
</REM NAME EN>
<REM NAME JP>
Lv４
</REM NAME JP>
<Set Sts Data>
skill: 0
</Set Sts Data>

Research

note:
<REM NAME EN>
Research
</REM NAME EN>
<REM NAME JP>
調査室
</REM NAME JP>
<Set Sts Data>
skill: 1901,1902,1905,1909,1911,1916,1914
</Set Sts Data>

Insurance

note:
<REM NAME EN>
Insurance
</REM NAME EN>
<REM NAME JP>
保険
</REM NAME JP>
<Set Sts Data>
skill: 1868,1870,1872,1874,1876
</Set Sts Data>


code:
var CC_Mod = CC_Mod || {};
CC_Mod.Gyaru = CC_Mod.Gyaru || {};

//=============================================================================
 /*:
 * @plugindesc Skin/eye/hair recolors and supporting passives/edicts
 * @author chainchariot/drchainchair/whatever random throwaway name I picked
 *  Current account on F95: https://f95zone.to/members/drchainchair2.2159881/
 *
 *  Art assets by tessai.san https://f95zone.to/members/tessai-san.1204811/
 *
 * @help
 * This is a free plugin.
 * If you want to redistribute it, leave this header intact.
 *
 */
//=============================================================================

// Mod Options
//////////////////////////////////////////////////////////////

var CCMod_gyaruEnabled = true;
var CCMod_edict_gyaruRequiredSlutLevel = 100;

//=============================================================================
//////////////////////////////////////////////////////////////
// Vars & Utility Functions

const CCMOD_DEBUG_GYARU = false;

const CCMOD_GYARU_SUFFIX_NONE               = '';

// Only skin tone is in a separate file
const CCMOD_GYARU_SUFFIX_SKINCOLOR_TAN      = '_tan';

// Not currently used as file paths but still need something to call colors
const CCMOD_GYARU_SUFFIX_HAIRCOLOR_PURPLE   = '_purple'; // default
const CCMOD_GYARU_SUFFIX_HAIRCOLOR_BLONDE   = '_blonde';
const CCMOD_GYARU_SUFFIX_HAIRCOLOR_RED      = '_red';
const CCMOD_GYARU_SUFFIX_HAIRCOLOR_GREEN    = '_green';
const CCMOD_GYARU_SUFFIX_HAIRCOLOR_BLUE     = '_blue';

const CCMOD_GYARU_SUFFIX_EYECOLOR_BLUE      = '_eyeBlue'; // default
const CCMOD_GYARU_SUFFIX_EYECOLOR_RED       = '_eyeRed';
const CCMOD_GYARU_SUFFIX_EYECOLOR_GREEN     = '_eyeGreen';
const CCMOD_GYARU_SUFFIX_EYECOLOR_BROWN     = '_eyeBrown';

// Cropped image with only hair
// Either actor.tachieBody or actor.tachieHead is added to the filename
// eg. hairpart_1, hairpart_fera, hairpart_normal_1, etc.
const CCMOD_GYARU_PREFIX_HAIRCOLOR_HAIRPART = 'hairpart_';

// Hair Colors
// hueRotation, toneR, toneG, toneB
const CCMOD_GYARU_DEFINE_HAIRCOLOR_NONE     = [0, 0, 0, 0];
const CCMOD_GYARU_DEFINE_HAIRCOLOR_BLONDE   = [120, 0, 0, 0];
const CCMOD_GYARU_DEFINE_HAIRCOLOR_RED      = [80, 0, 0, 0];
const CCMOD_GYARU_DEFINE_HAIRCOLOR_GREEN    = [180, 0, 0, 0];
const CCMOD_GYARU_DEFINE_HAIRCOLOR_BLUE     = [240, 0, 0, 0];

// Eye Colors
const CCMOD_GYARU_DEFINE_EYECOLOR_NONE      = [0, 0, 0, 0];
const CCMOD_GYARU_DEFINE_EYECOLOR_RED       = [120, 0, 0, 0];
const CCMOD_GYARU_DEFINE_EYECOLOR_BROWN     = [180, 0, 0, 0];
const CCMOD_GYARU_DEFINE_EYECOLOR_GREEN     = [240, 0, 0, 0];

// Edicts
const CCMOD_EDICT_HAIRCOLOR_NONE_ID     = 1980;
const CCMOD_EDICT_EYECOLOR_NONE_ID      = 1982;
const CCMOD_EDICT_SKINCOLOR_NONE_ID     = 1981;

const CCMOD_EDICT_HAIRCOLOR_BLONDE_ID   = 1983;
const CCMOD_EDICT_HAIRCOLOR_RED_ID      = 1984;
const CCMOD_EDICT_HAIRCOLOR_GREEN_ID    = 1985;
const CCMOD_EDICT_HAIRCOLOR_BLUE_ID     = 1986;

const CCMOD_EDICT_EYECOLOR_RED_ID       = 1990;
const CCMOD_EDICT_EYECOLOR_GREEN_ID     = 1991;
const CCMOD_EDICT_EYECOLOR_BROWN_ID     = 1992;

const CCMOD_EDICT_SKINCOLOR_TAN_ID      = 1989;

const CCMOD_EDICTS_NONE = [ CCMOD_EDICT_HAIRCOLOR_NONE_ID,
                            CCMOD_EDICT_EYECOLOR_NONE_ID,
                            CCMOD_EDICT_SKINCOLOR_NONE_ID ];
const CCMOD_EDICTS_HAIR = [ CCMOD_EDICT_HAIRCOLOR_BLONDE_ID,
                            CCMOD_EDICT_HAIRCOLOR_RED_ID,
                            CCMOD_EDICT_HAIRCOLOR_GREEN_ID,
                            CCMOD_EDICT_HAIRCOLOR_BLUE_ID ];
const CCMOD_EDICTS_EYE  = [ CCMOD_EDICT_EYECOLOR_RED_ID,
                            CCMOD_EDICT_EYECOLOR_GREEN_ID,
                            CCMOD_EDICT_EYECOLOR_BROWN_ID ];
const CCMOD_EDICTS_SKIN = [ CCMOD_EDICT_SKINCOLOR_TAN_ID ];

// Passives
// Ideas: increase slut level based on days as gyaru?
//        general desire modifiers, like faster desire increase?

// See RemtairyPoses.js
const CCMOD_GYARU_SUPPORTED_POSES_SKINCOLOR =
    [ POSE_MAP, POSE_ATTACK ];

const CCMOD_GYARU_SUPPORTED_POSES_HAIRCOLOR =
    [ POSE_MAP, POSE_STANDBY, POSE_UNARMED, POSE_ATTACK, POSE_WAITRESS_SEX ];

// Should just be all of them
const CCMOD_GYARU_UNSUPPORTED_POSES_EYECOLOR =
    [ ];

// Todo
const CCMOD_GYARU_SUPPORTED_CUTIN =
    [ ];

// Pose map for hair attached to the body or head in image file
// to determine file name of the hair part file
// Poses in here have the body and head merged in the body file
const CCMOD_GYARU_POSES_HEADBODY_MERGED =
    [ POSE_ATTACK, POSE_BJ_KNEELING, POSE_DEFEATED_GUARD, POSE_DEFEATED_LEVEL1, POSE_DEFEATED_LEVEL2,
      POSE_DEFEND, POSE_DOWN_FALLDOWN, POSE_DOWN_ORGASM, POSE_DOWN_STAMINA, POSE_EVADE, POSE_GOBLINCUNNILINGUS,
      POSE_GUARDGANGBANG, POSE_HJ_STANDING, POSE_KICK, POSE_KICKCOUNTER, POSE_ORC_PAIZURI, POSE_PAIZURI_LAYING,
      POSE_RECEPTIONIST, POSE_RIMJOB, POSE_SLIME_PILEDRIVER_ANAL, POSE_STANDBY, POSE_THUGGANGBANG, POSE_UNARMED,
      POSE_WAITRESS_SEX ];
    // Pose 'dogeza' appears to fit in here but it's just wip sketches still

// mas_1 is special case, the only pose with 'hair' parts built in
const CCMOD_GYARU_POSES_WITHHAIR =
    [ POSE_MASTURBATE1 ];

// Setup
CC_Mod.initializeGyaruMod = function(actor) {
    if (actor._CCMod_version < CCMOD_VERSION_6n_2) {
        CC_Mod.setupGyaruRecords(actor);
        actor.CCMod_setupStartingGyaruEdicts();
    }

    CC_Mod.CCMod_currentPoseName = false;
    CC_Mod.CCMod_currentHairName = false;
    CC_Mod.CCMod_currentEyeName = false;

    actor._CCMod_currentHairColor = CC_Mod.Gyaru_getHairName(actor);
    actor._CCMod_currentEyeColor = CC_Mod.Gyaru_getEyeName(actor);
    actor._CCMod_currentSkinColor = CC_Mod.Gyaru_getSkinName(actor);

    CC_Mod.Gyaru_initEdictRequirements();
};

CC_Mod.setupGyaruRecords = function(actor) {
    actor._CCMod_recordDaysDyedHair = 0;
    actor._CCMod_recordDaysDyedEyes = 0;
    actor._CCMod_recordDaysDyedSkin = 0;

    actor._CCMod_recordDaysAsGyaru  = 0;
};

CC_Mod.Gyaru_advanceNextDay = function(actor) {
    if (CC_Mod.Gyaru_isHairChanged(actor)) {
        actor._CCMod_recordDaysDyedHair++;
    }
    if (CC_Mod.Gyaru_isEyeChanged(actor)) {
        actor._CCMod_recordDaysDyedEyes++;
    }
    if (CC_Mod.Gyaru_isSkinChanged(actor)) {
        actor._CCMod_recordDaysDyedSkin++;
    }

    if (CC_Mod.isGyaru(actor)) {
        actor._CCMod_recordDaysAsGyaru++;
    }
};

// hasEdict of type, all edicts go here
CC_Mod.Gyaru_hasHairEdict = function(actor) {
    let edict = false;
    for (var n = 0; n < CCMOD_EDICTS_HAIR.length; n++) {
        if (actor.hasEdict(CCMOD_EDICTS_HAIR[n])) {
            edict = true;
            break;
        }
    }
    return edict;
};

CC_Mod.Gyaru_hasEyeEdict = function(actor) {
    let edict = false;
    for (var n = 0; n < CCMOD_EDICTS_EYE.length; n++) {
        if (actor.hasEdict(CCMOD_EDICTS_EYE[n])) {
            edict = true;
            break;
        }
    }
    return edict;
};

CC_Mod.Gyaru_hasSkinEdict = function(actor) {
    let edict = false;
    for (var n = 0; n < CCMOD_EDICTS_SKIN.length; n++) {
        if (actor.hasEdict(CCMOD_EDICTS_SKIN[n])) {
            edict = true;
            break;
        }
    }
    return edict;
};

// isChanged in current pose
CC_Mod.Gyaru_isHairEdictChanged = function(actor) {
    currentHair = CC_Mod.Gyaru_getHairName(actor);
    let changed = false;
    if (currentHair != actor._CCMod_currentHairColor) {
        changed = true;
    }
    return changed;
};

CC_Mod.Gyaru_isHairChanged = function(actor) {
    if (!CCMod_gyaruEnabled) {
        return false;
    }

    let changed = false;
    // Hair is always drawn in supported poses
    if (CC_Mod.Gyaru_isHairPoseSupported(actor.poseName)) {
        changed = true;
    }
    return changed;
};

CC_Mod.Gyaru_isEyeEdictChanged = function(actor) {
    currentEye = CC_Mod.Gyaru_getEyeName(actor);
    let changed = false;
    if (currentEye != actor._CCMod_currentEyeColor) {
        changed = true;
    }
    return changed;
};

CC_Mod.Gyaru_isEyeChanged = function(actor) {
    if (!CCMod_gyaruEnabled) {
        return false;
    }

    let changed = false;
    if (CC_Mod.Gyaru_isEyePoseSupported(actor.poseName) &&
        CC_Mod.Gyaru_hasEyeEdict(actor)) {
        changed = true;
    }
    return changed;
};

CC_Mod.Gyaru_isSkinEdictChanged = function(actor) {
    currentSkin = CC_Mod.Gyaru_getSkinName(actor);
    let changed = false;
    if (currentSkin != actor._CCMod_currentSkinColor) {
        changed = true;
    }
    return changed;
};

CC_Mod.Gyaru_isSkinChanged = function(actor) {
    if (!CCMod_gyaruEnabled) {
        return false;
    }

    let changed = false;
    if (CC_Mod.Gyaru_isSkinPoseSupported(actor.poseName) &&
        CC_Mod.Gyaru_hasSkinEdict(actor)) {
        changed = true;
    }
    return changed;
};

// getSuffixName
// Should return empty if default or inactive
CC_Mod.Gyaru_getHairName = function(actor) {
    let name = CCMOD_GYARU_SUFFIX_NONE;
    if (CC_Mod.Gyaru_isHairChanged(actor)) {
        if (actor.hasEdict(CCMOD_EDICT_HAIRCOLOR_BLONDE_ID)) {
            name = CCMOD_GYARU_SUFFIX_HAIRCOLOR_BLONDE;
        } else if (actor.hasEdict(CCMOD_EDICT_HAIRCOLOR_RED_ID)) {
            name = CCMOD_GYARU_SUFFIX_HAIRCOLOR_RED;
        } else if (actor.hasEdict(CCMOD_EDICT_HAIRCOLOR_GREEN_ID)) {
            name = CCMOD_GYARU_SUFFIX_HAIRCOLOR_GREEN;
        } else if (actor.hasEdict(CCMOD_EDICT_HAIRCOLOR_BLUE_ID)) {
            name = CCMOD_GYARU_SUFFIX_HAIRCOLOR_BLUE;
        }
    }
    return name;
};

CC_Mod.Gyaru_getEyeName = function(actor) {
    let name = CCMOD_GYARU_SUFFIX_NONE;
    if (CC_Mod.Gyaru_isEyeChanged(actor)) {
        if (actor.hasEdict(CCMOD_EDICT_EYECOLOR_RED_ID)) {
            name = CCMOD_GYARU_SUFFIX_EYECOLOR_RED;
        } else if (actor.hasEdict(CCMOD_EDICT_EYECOLOR_GREEN_ID)) {
            name = CCMOD_GYARU_SUFFIX_EYECOLOR_GREEN;
        } else if (actor.hasEdict(CCMOD_EDICT_EYECOLOR_BROWN_ID)) {
            name = CCMOD_GYARU_SUFFIX_EYECOLOR_BROWN;
        }
    }
    return name;
};

CC_Mod.Gyaru_getSkinName = function(actor) {
    let name = CCMOD_GYARU_SUFFIX_NONE;
    if (CC_Mod.Gyaru_isSkinChanged(actor)) {
        if (actor.hasEdict(CCMOD_EDICT_SKINCOLOR_TAN_ID)) {
            name = CCMOD_GYARU_SUFFIX_SKINCOLOR_TAN;
        }
    }
    return name;
};

// Full hairFileName
CC_Mod.Gyaru_getHairPartFileName = function(actor) {
    let name = CCMOD_GYARU_PREFIX_HAIRCOLOR_HAIRPART;
    if (CCMOD_GYARU_POSES_HEADBODY_MERGED.includes(actor.poseName)) {
        // using tachieBody
        name += actor.tachieBody;
    } else {
        // using tachieHead
        name += actor.tachieHead;
    }
    return name;
};

// getColorData
CC_Mod.Gyaru_getHairColorData = function(actor) {
    hair = CC_Mod.Gyaru_getHairName(actor);
    color = CCMOD_GYARU_DEFINE_HAIRCOLOR_NONE;
    if (hair == CCMOD_GYARU_SUFFIX_HAIRCOLOR_BLONDE) {
        color = CCMOD_GYARU_DEFINE_HAIRCOLOR_BLONDE;
    } else if (hair == CCMOD_GYARU_SUFFIX_HAIRCOLOR_RED) {
        color = CCMOD_GYARU_DEFINE_HAIRCOLOR_RED;
    } else if (hair == CCMOD_GYARU_SUFFIX_HAIRCOLOR_GREEN) {
        color = CCMOD_GYARU_DEFINE_HAIRCOLOR_GREEN;
    } else if (hair == CCMOD_GYARU_SUFFIX_HAIRCOLOR_BLUE) {
        color = CCMOD_GYARU_DEFINE_HAIRCOLOR_BLUE;
    }
    return color;
};

CC_Mod.Gyaru_getEyeColorData = function(actor) {
    eye = CC_Mod.Gyaru_getEyeName(actor);
    color = CCMOD_GYARU_DEFINE_EYECOLOR_NONE;
    if (eye == CCMOD_GYARU_SUFFIX_EYECOLOR_RED) {
        color = CCMOD_GYARU_DEFINE_EYECOLOR_RED;
    } else if (eye == CCMOD_GYARU_SUFFIX_EYECOLOR_GREEN) {
        color = CCMOD_GYARU_DEFINE_EYECOLOR_GREEN;
    } else if (eye == CCMOD_GYARU_SUFFIX_EYECOLOR_BROWN) {
        color = CCMOD_GYARU_DEFINE_EYECOLOR_BROWN;
    }
    return color;
};

// Filter for supported poses
CC_Mod.Gyaru_isHairPoseSupported = function(pose) {
    if (CCMOD_GYARU_SUPPORTED_POSES_HAIRCOLOR.includes(pose)) {
        return true;
    }
    return false;
};

CC_Mod.Gyaru_isEyePoseSupported = function(pose) {
    if (CCMOD_GYARU_UNSUPPORTED_POSES_EYECOLOR.includes(pose)) {
        return false;
    }
    return true;
};

CC_Mod.Gyaru_isSkinPoseSupported = function(pose) {
    if (CCMOD_GYARU_SUPPORTED_POSES_SKINCOLOR.includes(pose)) {
        return true;
    }
    return false;
};

// Need to have changes to hair, skin, and eyes
CC_Mod.isGyaru = function(actor) {
    return (CC_Mod.Gyaru_hasHairEdict(actor) && CC_Mod.Gyaru_hasEyeEdict(actor) && CC_Mod.Gyaru_hasSkinEdict(actor));
};

// returns TRUE for draw on body, FALSE for draw on head
CC_Mod.Gyaru_checkHairDrawOrder = function(actor) {
    if (CCMOD_GYARU_POSES_HEADBODY_MERGED.includes(actor.poseName)) {
        return true;
    }
    return false;
};

//=============================================================================
//////////////////////////////////////////////////////////////
// Edicts

CC_Mod.Gyaru_initEdictRequirements = function() {
    let skill = $dataSkills[CCMOD_EDICT_HAIRCOLOR_BLONDE_ID];
    skill.remMessageEN[2] = "Testing dynamic text";
};

Game_Actor.prototype.CCMod_edict_gyaruHairColorReq = function() {
    return true;
};

Game_Actor.prototype.CCMod_edict_gyaruEyeColorReq = function() {
    return true;
};

Game_Actor.prototype.CCMod_edict_gyaruSkinColorReq = function() {
    return true;
};

Game_Actor.prototype.CCMod_setupStartingGyaruEdicts = function() {
    this.learnSkill(CCMOD_EDICT_HAIRCOLOR_NONE_ID);
    this.learnSkill(CCMOD_EDICT_EYECOLOR_NONE_ID);
    this.learnSkill(CCMOD_EDICT_SKINCOLOR_NONE_ID);
};

//=============================================================================
//////////////////////////////////////////////////////////////
// SabaTachie Hooks

// Using file name instead of tachie name since that one is used in direct comparisons to set other stuff up

CC_Mod.Gyaru.Game_Actor_tachieBodyFile = Game_Actor.prototype.tachieBodyFile;
Game_Actor.prototype.tachieBodyFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieBodyFile.call(this);
    if (f != null) {
        //if (CCMOD_GYARU_SUPPORTED_POSES_HAIRCOLOR.includes(this.poseName)) {
        //    f = f + CC_Mod.Gyaru_getHairName(this);
        //}
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieRightArmFile = Game_Actor.prototype.tachieRightArmFile;
Game_Actor.prototype.tachieRightArmFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieRightArmFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieLeftArmFile = Game_Actor.prototype.tachieLeftArmFile;
Game_Actor.prototype.tachieLeftArmFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieLeftArmFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieHeadFile = Game_Actor.prototype.tachieHeadFile;
Game_Actor.prototype.tachieHeadFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieHeadFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieHatFile = Game_Actor.prototype.tachieHatFile;
Game_Actor.prototype.tachieHatFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieHatFile.call(this);
    //if (f != null) {
    //    f = f + CC_Mod.Gyaru_getHairName(this);
    //}
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachiePubicFile = Game_Actor.prototype.tachiePubicFile;
Game_Actor.prototype.tachiePubicFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachiePubicFile.call(this);
    //if (f != null) {
    //    f = f + CC_Mod.Gyaru_getHairName(this);
    //}
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieLegsFile = Game_Actor.prototype.tachieLegsFile;
Game_Actor.prototype.tachieLegsFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieLegsFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieBoobsFile = Game_Actor.prototype.tachieBoobsFile;
Game_Actor.prototype.tachieBoobsFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieBoobsFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieLeftBoobFile = Game_Actor.prototype.tachieLeftBoobFile;
Game_Actor.prototype.tachieLeftBoobFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieLeftBoobFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieRightBoobFile = Game_Actor.prototype.tachieRightBoobFile;
Game_Actor.prototype.tachieRightBoobFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieRightBoobFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieButtFile = Game_Actor.prototype.tachieButtFile;
Game_Actor.prototype.tachieButtFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieButtFile.call(this);
    if (f != null) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieFrontAFile = Game_Actor.prototype.tachieFrontAFile;
Game_Actor.prototype.tachieFrontAFile = function () {
    // Need to filter this here to check for 'leftarm'
    let f = CC_Mod.Gyaru.Game_Actor_tachieFrontAFile.call(this);
    if (f != null && f.includes('leftarm')) {
        f = f + CC_Mod.Gyaru_getSkinName(this);
    }
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieEyesFile = Game_Actor.prototype.tachieEyesFile;
Game_Actor.prototype.tachieEyesFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieEyesFile.call(this);
    //if (f != null) {
    //    f = f + CC_Mod.Gyaru_getEyeName(this);
    //}
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieHairFile = Game_Actor.prototype.tachieHairFile;
Game_Actor.prototype.tachieHairFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieHairFile.call(this);
    //if (f != null) {
    //    f = f + CC_Mod.Gyaru_getHairName(this);
    //}
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieCutInFile = Game_Actor.prototype.tachieCutInFile;
Game_Actor.prototype.tachieCutInFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieCutInFile.call(this);
    //if (f != null) {
    //    f = f + CC_Mod.Gyaru_getHairName(this) + CC_Mod.Gyaru_getSkinName(this);
    //}
    return f;
};

CC_Mod.Gyaru.Game_Actor_tachieFaceFile = Game_Actor.prototype.tachieFaceFile;
Game_Actor.prototype.tachieFaceFile = function () {
    let f = CC_Mod.Gyaru.Game_Actor_tachieFaceFile.call(this);
    return f;
};

//=============================================================================
//////////////////////////////////////////////////////////////
// Bitmap Layers

// Need to create and manage new bitmaps
// The color function is costly to performance, so need to redraw these bitmaps
// as little as possible
//
// The eye bitmap holds eyes only, it's only updated on a change, and then merged into
// either the normal cache or the tempBitmap.  The temp bitmap also holds the cutIn files
// which is where the big performance hit (as in, 1 fps on a gaming machine performance hit)
// comes if it is redrawn every time (so don't do that)

//////////////////////////////////////////////////////////////
// Bitmap Objects

const CCMOD_BITMAP_CACHE_ARRAY_SIZE = 5;

CC_Mod.Gyaru_bitmapCacheInit = function() {
    // TODO: annoyingly complicated caching processes to improve performance
    // TODO: Explore option to render everything on game load so there's no extra delays during scenes

    /*
    if (!$gameTemp.tachieTmpBitmap) {
        $gameTemp.tachieTmpBitmap = new Bitmap(Graphics.width + TACHIE_REM_CUSTOM_WIDTH, Graphics.height+TACHIE_REM_CUSTOM_HEIGHT);
    } */
};

CC_Mod.Gyaru_clearAllCaches = function() {
    CC_Mod.Gyaru_clearHairCache();
    CC_Mod.Gyaru_clearPubicCache();
    CC_Mod.Gyaru_clearEyeCache();
};

CC_Mod.Gyaru_clearHairCache = function() {
    CC_Mod.CCMod_bitmapHairLayer().clear();
};

CC_Mod.Gyaru_clearPubicCache = function() {
    CC_Mod.CCMod_bitmapPubicLayer().clear();
};

CC_Mod.Gyaru_clearEyeCache = function() {
    CC_Mod.CCMod_bitmapEyeLayer().clear();
};

// Hair
Game_Temp.prototype.CCMod_getActorBitmapHairLayer = function (actor) {
    this.CCMod_actorBitmapHairLayer = this.CCMod_actorBitmapHairLayer || {};
    var actorId = actor.actorId();
    if (actor.temp) {
        actorId = -1;
    }
    if (!this.CCMod_actorBitmapHairLayer[actorId]) {
        this.CCMod_actorBitmapHairLayer[actorId] = new Bitmap(Graphics.width + TACHIE_REM_CUSTOM_WIDTH, Graphics.height+TACHIE_REM_CUSTOM_HEIGHT);
    }
    return this.CCMod_actorBitmapHairLayer[actorId];
};

// Pubic - Layering issues if head and body are not merged in one image, so it needs it's own bitmap
Game_Temp.prototype.CCMod_getActorBitmapPubicLayer = function (actor) {
    this.CCMod_actorBitmapPubicLayer = this.CCMod_actorBitmapPubicLayer || {};
    var actorId = actor.actorId();
    if (actor.temp) {
        actorId = -1;
    }
    if (!this.CCMod_actorBitmapPubicLayer[actorId]) {
        this.CCMod_actorBitmapPubicLayer[actorId] = new Bitmap(Graphics.width + TACHIE_REM_CUSTOM_WIDTH, Graphics.height+TACHIE_REM_CUSTOM_HEIGHT);
    }
    return this.CCMod_actorBitmapPubicLayer[actorId];
};

// Eyes
Game_Temp.prototype.CCMod_getActorBitmapEyeLayer = function (actor) {
    this.CCMod_actorBitmapEyeLayer = this.CCMod_actorBitmapEyeLayer || {};
    var actorId = actor.actorId();
    if (actor.temp) {
        actorId = -1;
    }
    if (!this.CCMod_actorBitmapEyeLayer[actorId]) {
        this.CCMod_actorBitmapEyeLayer[actorId] = new Bitmap(Graphics.width + TACHIE_REM_CUSTOM_WIDTH, Graphics.height+TACHIE_REM_CUSTOM_HEIGHT);
    }
    return this.CCMod_actorBitmapEyeLayer[actorId];
};

// getBitmapLayer
CC_Mod.CCMod_bitmapHairLayer = function() {
    return $gameTemp.CCMod_getActorBitmapHairLayer($gameActors.actor(ACTOR_KARRYN_ID));
};

CC_Mod.CCMod_bitmapPubicLayer = function() {
    return $gameTemp.CCMod_getActorBitmapPubicLayer($gameActors.actor(ACTOR_KARRYN_ID));
};

CC_Mod.CCMod_bitmapEyeLayer = function() {
    return $gameTemp.CCMod_getActorBitmapEyeLayer($gameActors.actor(ACTOR_KARRYN_ID));
};

//////////////////////////////////////////////////////////////
// Bitmap Rendering

CC_Mod.Gyaru_isHairLayerActive = function(actor) {
    //let active = CC_Mod.Gyaru_isHairChanged(actor);
    return CC_Mod.Gyaru_isHairChanged(actor);
};

CC_Mod.Gyaru_isEyeLayerActive = function(actor) {
    //let active = CC_Mod.Gyaru_isEyeChanged(actor);
    return CC_Mod.Gyaru_isEyeChanged(actor);
};

// Call this at the start of drawTachieActor
CC_Mod.Gyaru_checkCacheChange = function(sabaTachie, actor, cache, x, y, rect, scale) {
    // Reference stuff here that's needed later but not visible to the drawTachiePart functions
    CC_Mod.tachie_sabaTachie = sabaTachie;
    CC_Mod.tachie_actor = actor;
    CC_Mod.tachie_cache = cache;
    CC_Mod.tachie_x = x;
    CC_Mod.tachie_y = y;
    CC_Mod.tachie_rect = rect;
    CC_Mod.tachie_scale = scale;

    if (actor.isCacheChanged()) {
        CC_Mod.Gyaru_redrawAll();
    } else if (actor.tachieEyesFile() != CC_Mod.CCMod_currentEyeName) {
        CC_Mod.Gyaru_drawEyes(true);
    }

    CC_Mod.CCMod_currentPoseName = actor.poseName;
};

// Called on status window, so it'll trigger when exiting the edict menu
CC_Mod.Gyaru_checkEdictChanged = function() {
    let actor = $gameActors.actor(ACTOR_KARRYN_ID);
    if (CC_Mod.Gyaru_isHairEdictChanged(actor) ||
        CC_Mod.Gyaru_isEyeEdictChanged(actor) ||
        CC_Mod.Gyaru_isSkinEdictChanged(actor)) {

        actor.setCacheChanged();
        actor._CCMod_currentHairColor = CC_Mod.Gyaru_getHairName(actor);
        actor._CCMod_currentEyeColor = CC_Mod.Gyaru_getEyeName(actor);
        actor._CCMod_currentSkinColor = CC_Mod.Gyaru_getSkinName(actor);
    }
};

// This will draw and prepare all bitmaps, which will then get combined during the normal part draw call
CC_Mod.Gyaru_redrawAll = function() {
    //CC_Mod.Gyaru_clearAllCaches();

    CC_Mod.Gyaru_drawHair();
    CC_Mod.Gyaru_drawPubic();
    CC_Mod.Gyaru_drawEyes();
};

// drawTachiePart
CC_Mod.Gyaru_drawPart = function(fileName, bitmap, colorArray) {
    CC_Mod.tachie_sabaTachie.drawTachieFile(fileName, bitmap, CC_Mod.tachie_actor);
    CC_Mod.Gyaru_setBitmapColor(bitmap, colorArray);
};

CC_Mod.Gyaru_drawHair = function(limitedRedraw = false) {
    if (CC_Mod.Gyaru_isHairLayerActive(CC_Mod.tachie_actor)) {
        let hairFileName = CC_Mod.Gyaru_getHairPartFileName(CC_Mod.tachie_actor);
        let hairBitmap = CC_Mod.CCMod_bitmapHairLayer();
        let hairColor = CC_Mod.Gyaru_getHairColorData(CC_Mod.tachie_actor);
        CC_Mod.CCMod_currentHairName = hairFileName;

        CC_Mod.Gyaru_clearHairCache();
        CC_Mod.Gyaru_drawPart(hairFileName, hairBitmap, hairColor);
    }
};

CC_Mod.Gyaru_drawPubic = function(limitedRedraw = false) {
    if (CC_Mod.Gyaru_isHairLayerActive(CC_Mod.tachie_actor)) {
        let pubicFileName = CC_Mod.tachie_actor.tachiePubicFile();
        let pubicBitmap = CC_Mod.CCMod_bitmapPubicLayer();
        let pubicColor = CC_Mod.Gyaru_getHairColorData(CC_Mod.tachie_actor);

        CC_Mod.Gyaru_clearPubicCache();
        CC_Mod.Gyaru_drawPart(pubicFileName, pubicBitmap, pubicColor);
    }
};

CC_Mod.Gyaru_drawEyes = function(limitedRedraw = false) {
    if (limitedRedraw) {
        if (CC_Mod.tachie_actor.tachieEyesFile() == CC_Mod.CCMod_currentEyeName) {
            return;
        }
    }

    if (CC_Mod.Gyaru_isEyeLayerActive(CC_Mod.tachie_actor)) {
        let eyeFileName = CC_Mod.tachie_actor.tachieEyesFile();
        let eyeBitmap = CC_Mod.CCMod_bitmapEyeLayer();
        let eyeColor = CC_Mod.Gyaru_getEyeColorData(CC_Mod.tachie_actor);
        CC_Mod.CCMod_currentEyeName = eyeFileName;

        CC_Mod.Gyaru_clearEyeCache();
        CC_Mod.Gyaru_drawPart(eyeFileName, eyeBitmap, eyeColor);
    }
};

// Move ready custom bitmaps into the main bitmap
CC_Mod.Gyaru_combineBitmaps = function(src, dest) {
    CC_Mod.tachie_sabaTachie.drawTachieCache(CC_Mod.tachie_actor, src, dest, CC_Mod.tachie_x, CC_Mod.tachie_y, CC_Mod.tachie_rect, CC_Mod.tachie_scale);
};

CC_Mod.Gyaru_combineHairBitmaps = function(dest) {
    CC_Mod.Gyaru_combineBitmaps(CC_Mod.CCMod_bitmapHairLayer(), dest);
};

CC_Mod.Gyaru_combinePubicBitmaps = function(dest) {
    if (CC_Mod.tachie_actor.tachiePubicFile() != null) {
        CC_Mod.Gyaru_combineBitmaps(CC_Mod.CCMod_bitmapPubicLayer(), dest);
    }
};

CC_Mod.Gyaru_combineEyeBitmaps = function(dest) {
    CC_Mod.Gyaru_combineBitmaps(CC_Mod.CCMod_bitmapEyeLayer(), dest);
};

// The color function destroys performance, so need to be much more aware of when it's used
// and limit bitmap changes as much as possible
// This is really just a problem on cutIn, but eyes are drawn at the same time as cutIn
// There is also a small but noticeable performance hit when shifting poses rapidly, like when attacking
// hueRotation, toneR, toneG, toneB
CC_Mod.Gyaru_setBitmapColor = function(bitmap, colorArray) {
    if (colorArray[0] != 0) {
        bitmap.rotateHue(colorArray[0]);
    }
    if ((colorArray[1] != 0) || (colorArray[2] != 0) || (colorArray[3] != 0)) {
        bitmap.adjustTone(colorArray[1], colorArray[2], colorArray[3]);
    }
};