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: NovX/fc


code:
# Auto detect text files and perform LF normalization
* text=auto

path: .gitattributes

license: mit


code:
full:
	make standard
	make withgit

standard:
	rm -f ../Regula_Magistri.zip
	zip ../Regula_Magistri.zip -r Regula_Magistri
	zip -u ../Regula_Magistri.zip Regula_Magistri.mod

withgit:
	rm -f ../Regula_Magistri_git.zip
	zip ../Regula_Magistri_git.zip -r Regula_Magistri
	zip -u ../Regula_Magistri_git.zip Regula_Magistri.mod
	zip -ur ../Regula_Magistri_git.zip .git
	zip -u ../Regula_Magistri_git.zip .gitattributes

path: Makefile


code:
version="0.101"
picture="Regula_Magistri.png"
tags={
	"Gameplay"
	"Character Interactions"
	"Decisions"
	"Religion"
	"Schemes"
}
name="Regula Magistri"
supported_version="1.8.*"
path="mod/Regula_Magistri"


code:
# Regula Magistri Changelog
0.1
Initial release.

0.2
Added a series of Magister traits, keyed to devotion levels.
Added Paelex, Domina and Orba traits.
Added the Domitans Tribunal interaction, which recruits landed vassals into your harem.
Added the Favens paelex and Demitte domina interactions, to promote and demote concubines.
Added Magister and Devoted tenets.
Added re-initiation events, to add some effects when a PC dies.

0.3
Added a recurring event, "Throw an Orgy". It gives ongoing bonuses and cures STIs.
Added the AI scheme "Rapta Maritus". Will cause charmed wives to attempt to kidnap their husbands and deliver them to your dungeon.
Reworked how the paelex piety bonus is administered.  It's now merged with the other paelex bonuses, as a character modifier.

0.4
Completely reworked the Regula Magistri Holy sites.
The fall of Jerusalem introduces a rot deep into both Christianity and Islam. Their fervor decreases by 10 for every year that you hold this holy site, while all followers of the Keeper of Souls see income from their vassals increase by 20%.

Alexandria unlocks an AI character interaction, Abice Maritus. Zealous, unlanded wives may now take their husband's titles, sending their spouse off to live with the nuns (increased success chance for relatives of the Magister). All followers become slightly more attractive to members of the opposite sex.

Lesbos adjusts the gender of newborns, ensuring that 80% of births in your religion are female. All followers gain a small prowess and health boost.

Carthage provides a bonus to levy size and follower's piety. Also unlocks the Sanctifica Serva interactions, which allows MCs to make their Paelices immortal, at the cost of their own health.

Brescia allows Mulsae, Paelices and Dominae to perform the Fascinare scheme, adding the Mulsa trait to others in their court and dynasty. Slightly increases follower's diplomacy and lifestyle XP gain.

New Interactions:
Added a faction for foreign Mulsa: Servitude. Servitude factions seek to swear fealty to the Magister, and will wage war against their liege to do so.
    -Added a character interaction for the Magister to join an ongoing Servitude civil war (Target the defender).
Added a war type: Usurption. Winning the war transfers all vassals with the Mulsa trait to the Magister's realm.
Added a Mulsa interaction, "Revelum Secretum".  Will cause foreign Mulsas to disclose secrets from their court, or potentially create some.
Reformed the Head of Faith. The Magister is now the head of the faithful.
Added a new Head of Faith character interaction: Potestas non Transfunde. Magisters that have acquired the title Pontifex Carnalis can now publicly demand neighbouring independent, female Compeditae swear fealty to them (at the cost of a large amount of prestige, reduced based on rank and magister level).
Added an event to entrance your wards and the wards of your mulsa, paelex, domina etc.

Misc.
Promoted all Paelices to the role of sister-wife. The concubinage is closed.
Added an effect to strip Magister traits from heathens, and another to give a penalty to magisters with unlanded wives/concubines.
Expanded the roster of Fascinare events.
Slowed the appearance of the aging process in Mulsae, Paelices and Dominae. Maybe she's born with it. Maybe it's demonic possession.

Bugfixes and Tweaks:
Fixed the Rapta Maritus requirements, and slightly tweaked the benefits for the Mulsa (adds callous and arbitrary traits, instead of deceitful).
Increased the difficulty of the Fascinare scheme against foreign characters, while providing a bonus when targeting people in your realm.
Corrected the holy order names.  Added a bunch of fresh orders to the rolls in the process.
Corrected the Head of Faith inheritance.

0.5
Added a new type of vassalization war: Domination. Crush the independence and will of nearby female rulers, then add them to your harem.
Enabled the Regula Magistri for non-independent MCs.  You can now work to take down the HRE or Byzantine empire from within, slowly suborning your liege's vassals. Note: They WILL try to depose you. Be prepared for war.
Implemented the Hereditas Compedita Inheritance for Compeditae that are not your vassals (both independent rulers and those sworn to another character). Unlike in your realm, only the Compedita's laws will change; those above and below them will keep their default inheritance laws.
Added a few random events, linked to either a fight within the harem or generous vassals that wish to give you gold.

Bugfixes and Tweaks:
Overwrote the adultery and conversion triggers. It should be impossible for spouses to cheat or lose faith now.
Made it so extramarital sex by the MC will not anger their spouses.
The AI will now use the Abice Maritus interaction when possible. If you hold Alexandria expect to periodically see female Compenditae deposing their husbands.
Fixed an issue with wards not gaining the Witch trait when appropriate.
Finally fixed the issues around inheritance of the Regula Magistri.  The event will now fire 1-4 weeks after the death of a previous Magister.

Known bugs:
Despite the flavour text, those that are one with the book don't die when the book is destroyed.

0.6
Added an alternate set of Holy Sites, with their own minor benefits.  The sites are:
Rome - Bloodlust of the She-Wolf
Toulouse - Faith of the Perfecti
Zeeland - Acumen of Nehalennia
Gotland - Vitality of Freyja
Krakow - Glamour of Wanda

This variant can be selected during the initialization event or swapped to using the settings menu (see below).  The three tenets are Regula Magistri, Concubinocracy and Warmonger.

Reworked the major Jerusalem/Rome Holy Site bonus. Holders of Jerusalem will now give two traits when using the Fascinare Scheme: Mulsa and Infecta. This second trait represents a parasitic portion of the Magister's will, which will hop from host to host in the target's realm, converting/charming each time. The chain will naturally end after ~4 conversions.
-Does not affect wards.

Added a set of prisoner interactions. Female captives can be charmed, fucked, brainwashed to become your lover, or reduced to mindless thralls. Fascinare/Astringere interactions are cheaper when applied to prisoners.

Added a new Compeditae scheme: Instiga Discordia. Instruct your servants to sow discord in their liege's court, triggering a rivalry between their liege and either a powerful vassal or their liege lord.

Added a new interaction, Astringere (and associated interactions Destringere and Restringere). Add strong hooks to Compeditae, at the cost of a bit of their health and fertility. Will add a small amount of tyrrany/dread.

Added two new random events. In the first an ambitious Paelex will ask to be made Domina, in the second a militant Paelex will request resources to set up a holy order in their demesne.

Created a settings menu, accessible via the minor decision "Manage Regula Magistri Settings"
Players can now auto-assign their children to be raised in their mother's court. The "Manage Child Education Settings" option in the settings menu/event will lead to an event that allows boys, girls, or both to be educated by their mothers without player involvement. Base code by shaaaaq.
Players can switch their religion between the old Mediterranean Holy Sites and the new European set by selecting "Change Regula Magistri Holy Sites" in the settings event. All Compeditae in your realm will convert, as will your counties.

Added another Domitans Tribunal event to the roster, "Monumental."

Added an action to inform the player when Mulsae can be dominated, Orbae can be claimed, or independent rulers can be vassalized. (Initial code by shaaaaq).

Bugfixes and Tweaks:
Fixed the domitans tribunal interaction.  New Paelices will now break up with every lover, not just one
Adjusted Abice Maritus.  The player can trigger the interaction without the requisite holy site, but possessing the holy site allows the AI to take the interction and reduces the cost for the player from 250 -> 100 piety.
Patched the Orgy invitation. Attendees will no longer invite homosexual/bisexual men, no matter how ridiculously good looking they are.
Fascinare will now remove the nemesis relationship, not just a rivalry.

Known issues:
The shackles often don't line up with prisoner's wrists.  This is due to an error in the game's default animation.
Despite the flavour text, those that are one with the book don't die when the book is destroyed.
Default game doctrines don't show up when creating a new religion (the tenets still do, and existing religions are unaffected).

0.61
The third Domitans Tribunal action, "Mix it with your seed and breath life into her womb", now has a small percent chance of giving the Pure-Blooded trait, instead of One With the Book.
Made the Domitans Tribunal actions a little more transparent.  Mouse over each to see some info on what they might do.
Updated the Domitans Tribunal/Potestas Non Transfunde Important actions (suggestions) so that invalid characters aren't suggested.
Fixed a bug preventing most of the random events from firing.  Disabled the Holy Order event until it can be properly bugfixed.
Tweaked the religion-switching interaction.

Known issues:
Switching to another Magister religion via the Config decision doesn't seem to affect counties, just characters.
The shackles often don't line up with prisoner's wrists.  This is due to an error in the game's default animation.
Despite the flavour text, those that are one with the book don't die when the book is destroyed.
Default game doctrines don't show up when creating a new religion (the tenets still do, and existing religions are unaffected).

0.70
The traits Mulsa, Paelex, Contubernalis, and One with the Book now all change a character's appearance. The first three have altered (or no) pupils, while One with the Book transforms the character's hair, skin, and eyes in different ways, depending on their highest skill.
It may be nigh impossible to stop lustful characters from cheating, but their lasciviousness now works to your advantage. Paelicies will now trigger mod-specific cheating events rather than the base game versions, allowing you to choose to dominate (female) or punish (male) their lovers.
If you are the Pontifex Carnalis you can now ally with independent female rulers, via the "Forge a Compeditaen Alliance" interaction.
Rather than simply revoke the lease of a hostile holy order within your realm, you may corrupt them instead.  The titles within your demesne will be granted to a new holy order within your religion. This is the first mod interaction to require the Exarch trait.
Regula Magistri has been added to the list of polygamous religions. This required overwriting the base game files 00_marriage_scripted_modifiers and 00_marriage_interaction_effects. Thanks to dverago for the code!

Bugfixes and tweaks:
Adding the Mulsa trait to the ward of a Paelex or the MC will now add a small amount of renown, if the ward is of a different dynasty (5 for paelex/10 for magister)
Generals will no longer abandon their armies to go to an orgy.
Fixed the Fascinare ward event. In some cases it wasn't firing correctly when the guardian was a Mulsa.
Limited the Fascinare ward events to the MC and their direct vassals, to reduce the number of events firing. Events with more distant vassals/mulsae will auto-succeed.
Reduced the piety gain from Domitans Tribunal from 250 to 100.  It was a little too overpowered with dozens of Paelices.
Reduced the chance that an Infecta would entrance their spouse from 40% to 20%.
Militant Paelices can now successfully petition to found a holy order in their realm, with your assistance.  Unlike the default AI interaction this requires only that they hold a duchy title or greater, but you will have to financially support their efforts.

Known issues:
Not all holy order titles can be corrupted. This stems from issues with how the base game's has_revokable_lease trigger is coded, and will hopefully be resolved in the next update from Paradox.
Switching to another Magister religion via the Config decision leaves the holy orders behind.
Shackles often don't line up with prisoner's wrists.  This is due to an error in the game's default animation.
Despite the flavour text, those that are one with the book don't die when the book is destroyed.

0.71
The mod is now compatible with CK3 version 1.4.
You can now make your Domina and Paelex naked at all times with the "Compeditae Clothing" Game Rule.
The Mulsa/Paelex/One with the Book/etc. portrait modifiers can be disabled with the "Portrait Modifiers" Game Rule.

Bugfixes and tweaks:
Adjusted the Mulsa and Paelex eyes, so they don't stand out as much. Tweaked the structure of the Paelex eye.
Added descriptors to some of the events, explaining what happens when they fire.
The religion has been overhauled to take advantage of the new deactivate_holy_site effect.  There should be little visible change on the player side, but swapping between holy sites mid-game should now be seamless.

Known issues:
Not all holy order titles can be corrupted. This stems from issues with how the base game's has_revokable_lease trigger is coded, and will hopefully be resolved in the next update from Paradox.
Shackles often don't line up with prisoner's wrists.  This is due to an error in the game's default animation.
Despite the flavour text, those that are one with the book don't die when the book is destroyed.

0.72
Fascinare is now a Personal scheme, not a Hostile one.  It benefits from all perks that improve seduction, but is no longer boosted by the spymaster.
Added an AI-focused de-stress event. Those with Paelex and Domina traits can work through their frustrations with your other wives. These sex events remove virtually all stress, and may lead to lover relationships and bisexual traits.
-This is primarily meant to allow the AI to survive death cascades. If Paradox ever fixes the grief spirals the stress reduction will be reduced to more reasonable levels.

Bugfixes and tweaks:
Replaced the hair and skin palattes. Random characters should no longer show up green.
Kicked men out of the orgy, again.
Tweaked the appearance of characters with the One with the Book trait.
Added a game rule to make every entranced character naked, not just the Paelices and Domina.

0.80
Added a set of Holy Sites for West Africa. As with the European and Mediterranean Holy Sites this comes with a different base tenet, in this case Communal Identity.
Added a set of Holy Sites for South-central Asia, based on the path of Alexander the Great. The base tenet is Pursuit of Power.
Players can now force Mulsa to break their betrothals and divorce their courtier spouses.
Players can now summon Mulsa courtiers to their court.

Bugfixes and tweaks:
Added relationship status to the list of Fascinare modifiers.  Charming friends/lovers is now easier, while rivals/nemeses will be much harder to subdue.
Rebalanced the Fascinare scheme.  The minimum score is much higher, but having a consistent 100% success rate will require at least some optimization. Standard failures now return half the piety invested, critical failures unchanged.
Fixed an issue with initializing the mod. Popes, Caliphs, etc. must forsake all they hold holy before they can get laid.
Fixed an issue with joining an ongoing servitude war. Now you join on the side of the characters fighting to be enslaved by you, instead of fighting against them.
Fixed an issue with the game rules not executing correctly when all compeditae were supposed to be naked.
Fixed a loophole where multiple Sanctifica Serva events could be running simultaneously, dodging the minimum health requirements.
The Abice Maritus interaction now transfers the husband's gold to his wife, alongside his titles.  Where he's going gold won't be useful anyway. Thanks to nobullyplz for the code!

0.81
Added a new title succession law, Compeditae Elective. Power passes from the Magister to a son, cousin, or uncle, according to the votes of landed Mulsae, Paelices, etc. in the realm.
-Note: This succession law will affect all the player's directly held titles, and effectively serves as an improved form of Primogeniture. It's intended to be a late game advance, and can be enabled via the appropriately priced "Adopt the Compeditae Elective Succession Law" decision.
Added a new title succession law, Heritament, to ensure that Compeditae elective works as it intuitively should, instead of how Paradox implemented title succession laws. This law is automatically applied to all the player's titles, so long as Compeditae Elective is in place.

Bugfixes and tweaks:
The infectious Fascinare effect no longer converts men.
Tweaked the Fascinare scheme code.  It should be easier to recruit agents now.
The "Domitans Tribunal Available" suggestion has been tweaked to only include direct vassals.

0.82
Bugfixes and tweaks:
In rare circumstances underage characters were being invited to the orgy.  They've been tucked back in bed.

0.90
The mod initialization has been completely reworked. The mod now starts with a much cheaper version of the major decision, "Acquire the Regula Magistri." Buying the book gives the player the "Spellbound" secret, and allows them to show the book to female characters in their realm (giving them the Spellbound secret as well). This also unlocks a major decision to "Free the Keeper of Souls."
-Before the player can free the Keeper of Souls they must show the book to their primary wife and at least two female powerful vassals.
-Spellbound NPC rulers gain a modified female-preference succession, "Hereditas Enatic-Cognatic." Female rulers can be created by either granting characters titles in your realm or by imposing Hereditas Enatic-Cognatic succession on male vassals through the "Historical Forgery Scheme." If your religion/culture won't allow you to grant titles to unlanded women you can first target them with "Bestow Barony".
-Freeing the Keeper of Souls unlocks the core of the mod, converts all Spellbound characters and their holdings to Regula Magistri, and grants a number of bonuses to the player/NPCs.

Added a series of "bloodlines", inheritable traits awarded when a character dies after doing something noteworthy. The current list:
Charmer - 30 successful fascinare actions in a single lifetime (prisoners and wards count). Female only.
Mindshaper - 40 successful domitans tribunal actions in a single lifetime (domination wars count). Female only.
Thrallmaker - Make 5 contubernalis in a single lifetime. Male only.
Subjugator - Win 12 Domination wars in a single lifetime. Male only.
Chessmaster - Trigger 5 successful Servitude faction wars in a single lifetime. Male only.
Imperator - Bring 4 queens into the fold using the Potestas non Transfunde action. Male only.

-Plus two bloodlines that are awarded on pregnancy:
Multitasker - 3 wives/concubines pregnant at the same time. AI or PC, male or female.
    -8 if you're the magister.  You've got 40 wives, standards are higher.
Breeder - Pregnant with a 6th child. AI or PC, female only.

Multitasker and Breeder can be applied multiple times throughout a playthrough, while the others are single-shot. When the trait is earned it will be automatically applied to all offspring.
-Values for your current character can be checked with the "Manage Regula Magistri Settings" minor decision.

The list of religious given names has been updated to feature famous men and women from history. The men are largely known for their vices, while the women are a mix of those known for their beauty/sexual skills (Helen, Theodora etc.) and those known for great accomplishments (Hypatia, Enheduanna, etc.).

Bugfixes and tweaks:
Limited the number of electors to 21, to keep the voting process from slowing everything down.
Magisters of any rank can now have sex with their prisoners at will.
Characters created for the orgy invitation event now have appropriate education traits, and can be directly recruited to your court.
Your wives can no longer be invited as a "surprise" guest at the orgy.  No one cares that you carpooled, Susan.

0.91
Added a new trait, Child of the Book. The product of an event chain that can be randomly triggered when Domitans Tribunal is used on a pregnant character. Shows up on the child's fourth birthday.
Added a new Martial Custom, Female Famuli Only.  Can be implemented like other Martial customs (Royal Court) or with the "Enact the Female Famuli Only Martial Custom" major decision. When active only women can become knights, and all members of your culture get a few small army/men-at-arms bonuses.

Bugfixes and tweaks:
Added Breeder, Gossip, and Multitasker to the Ruler Designer, with appropriate costs.
Winning 10 Domination OR Usurp Vassal wars will now trigger the Subjugator bloodline.
Fixed the Divorce Courtier interaction.
Added some text to the "Acquire the Regula Magistri" decision, so it'll flag when you've improperly converted to the religion before triggering the decision.
Tweaked the "Acquire the Regula Magistri" decision so that it'll show as invalid when your character is a child/woman, instead of hiding itself.
Tweaked the Regula Magistri Tenets so that the custom pieces only show within the Regula Magistri religious group.
Changed the default religious Gender Doctrine to Female Dominated (from Complex). This should enable shield maidens and a few of the Paradox-scripted gender events. To keep compatibility with prior saves the Complex doctrine is still in the code; it will be removed in a later update.
The Bestow Barony interaction has been renamed to "Bestow Landed Title," and it does what it says on the tin. Thanks to Noutei for the improved code!
Upped the penalty for NPCs that sleep with Paelices.  Try laughing off stab wounds, cuckoos.

0.92
Updated for 1.5.10
French localization has been added to the game. All credit for this great feat goes to Mederic.

Bugfixes and tweaks:
Getting caught while Spellbound no longer breaks the game.
Using Domitans Tribunal on a pregnant Mulsa no longer runs the risk of giving them the One with the Book trait.
The Servitude Faction War is now only valid against Lieges that don't worship the Keeper of Souls.
Tweaked the Yadz Holy Site benefit so that it improves all personal schemes, including mod ones.
Added can_set_relation_soulmate to the list of tweaked triggers, as part of the neverending fight to quash the cuckhold code Paradox has put in.

0.93
Simplified Chinese localization added to the game. All credit to waibibabo.

Bugfixes and tweaks:
French localization tweaked.

0.94
Updated to 1.6.0

0.95
By Ban10

Fixes
    - Fix common\genes\regula_gene_accessories_misc.txt so that Character Body Overhaul doesnt crash when used with Regula Magistri
    - Fix common\religion\doctrines\regula_core_tenets.txt, recopy base game due to changes from CK3 1.8 "Robe"

Changes
    - Regula Religeon changes
        1. Religeon colour changed to purple
        2. First tenet set to Sacred Childbirth
        3. Change virtues and sins
        4. Clerical Doctrine set to Recruitment
      As part of this change, changing your holy sites will no longer change your first tenet to a different one, it is now fixed.

    - Show Book (initial conversion before freeing Keeper of Souls) now has no cooldown, and a six month cooldown against recipients (in case they decline)
    - Fascinare is now faster for your wife/concubine, close family and extended family.
        - Wife/concubine start at 9 progress
        - close family start at 6 progress
        - extended family start at 3 progress

    - Bloodline goal changes
        - Multitasker now only needs 3 pregnant wives at once, 8 was a bit much

New Features
    - Add new set of holy sites to Britain, contained within Brittania (the Empire Title), Plan to make more of these with all 5 holy sites contained within an empire title. I like the idea of playing a campaign where taking an empire title gives you all the holy sites and their associated powers/benefits.

    - Add new decision "Claim Initiates", similar to "Invite Debutantes". If you have Holy Orders of the Magistratin Faith you can generate new female courtiers for your own court. The more counties your Holy orders hold (combined across your realm), the better traits and educated the initiates will be. Holding the Holy site that makes girls more common increases number of initiates to five.
    For now:
        - 1-14 counties gives you "commoner" initiates, on par with "Invite Debutantes"
        - 14-29 counties gives you "noble" initiates, very good courtiers
        - 30+ counties gives you "royal" inititates, probally OP, but you deserve it!

    - Add Obedience Blood Trait - 10 successful ward enslavements in a single lifetime (having a mulsa/domina give you their ward counts). Female only. Gives Stress reduction and bonus opinion of those of the same faith. Obedient female Characters in your realm will automatically come to you to be dominated, even if they aren't your ward or the ward of a mulsa.

New Features - Work in progress
    - Add Revealing clothing rule, using CBO clothing. Needs Character Body Overhaul installed. Still work in progess so not on by default for now. If you do not have CBO installed and set the option to enabled, it wont crash, just wont load any clothes.

    - Add Magistri culture, uses [Cheri - Lewd COAs](https://www.loverslab.com/files/file/20916-lewd-coas/) for COAs. Currently using anglic/english culture as base, with different traditions. Mostly playable, minor issues with mercenary groups not being properly generated sometimes (no Knights/COAs) late in a campaign, might be related to gender law. Note, this culture uses custom COAs which replaces coat_of_arms_template_lists {all{}}, not sure how to correctly merge this with vanilla COA templates.

0.96
By Ban10

Fixes
    - Add option to Regula settings to use Britain for Holy sites
    - Some Britian holy sites had the wrong strings under effects, fixed now
    - Forgot to comment out the 5 year cooldown for claim initates, fixed
    - Refactored number of holy order counties, definately works now and also shows in the Claim inititates decision how many you have

Changes
    - Changed Abice Maritus costs
        - No longer costs piety from the receipt, (I think this was a bug as in an earlier changelog it talks about player piety cost + it doesnt seem consistent with other interactions)
        - Now costs piety based on the titles that the spouse owns, similar to the prestige cost of Potestas non Transfunde (basically the same)
        - Having the Abice Maritus Holy site will half the piety cost as usual

    - Add common_interaction = yes to all Regula interactions, this makes them all show up in menu when you right click a character
      Fixes a bug whereby duplicate interactions would show up in the menu when clicking "show more"

    - Change Holy site effects for Britain, each site is attuned to an attribute, and gives you +1 per piety level for that attribute, plus two effects that are in line with the attribute.

    - Solider Inititates now have prowess stats to match their martial ability

    - All Valid Bloodline events are run upon death of the previous magister, rack up those achievements while you are alive!
      Also refactored the requirements for each bloodline, if you want to change them, edit the values in "common\script_values\regula_script_values.txt" in the Regula Mod folder
      Added the requirements to the Character Statistics page as well.

    - The Compeditae Elective Succession now adds +1 domain limit instead of -2, seriously wtf man thats the worst thing I've ever seen, I'm actually slightly mad
      Also, Magister now gets +500% voting power, I really dont get why the player character (The Master!) gets -50% voting power?

0.97
By Ban10

Fixes
    - Minor fixes, typos and wrong file encoding etc

    - TODO: fix piety cost check for Potestas non Transfunde, it was causing scripting errors as it didnt have the correct scope for the piety check, disabling the check for now so it will always show the action (even if you cant afford it)

    - Reduce clipping with CBO clothes

Changes
    - Work on CBO clothing: Add Jester clothing, Change miltary outfits and change up lady outfits as well, with commoner,noble,royal and imperial outfits (and jester!)

    - Magister trait now has more compatibilities, Zealous is now a + medium, and humble a + high (this is for opinion attractions etc)

    - Charming a ward with landed titles who is NOT of your Dynasty now gives your dynasty prestige based on that title rank:
        - Empress   - 1250
        - Queen     - 750
        - Duchess   - 300
        - Countess  - 100
        - Baroness  - 25
    I want this to also give you dynasty prestige if the ward is the primary heir of a title but I cant figure out how to do it yet, something in the TODO list

    - Change bloodline tally goals, lower the harder ones while raising the easier ones

    - Lower title costs, for both claiming foreign vassals via Potestas non Transfunde and taking titles from your own vassals via Titulm Novis, new values feel much better

    - Change Magistrain culture traditions, including new custom Famuli Warriors tradition, feel free to edit the culture in common\culture\cultures\00_magistri.txt for your personal taste, though the Famuli Warrior tradition is quite key now for the new regiments.

    - Famuli Martial Custom now increase regiment sizes of Light infantry, Light Cavalry and Archers.

    - More changes to bonus starting progress for the Fascinare scheme.
        - Now is based on opinion of target and a bunch of modifers: Religion, Culture, Relationships (including friend/family/rival etc), distance (in court/not in court) and intimidation
        - Goal was to make it feel more organic, having a good opinion with someone makes it faster to find the time and occasion to charm them. It should now be possible to actually charm your own realm in a reasonable time frame rather then it taking years.
        - Overall this does make things easier, as once your kingdom is setup and everyone likes you you will find it much faster to Fascinare them, need to test/iterate on values.
        - Note, this only effects the time taken to finish the scheme, chance of success is still unchanged

Features
    - Notification Settings: Added extra page to Regula settings (acessible via decision)
        - Inspired by Less event spam mod, you can now deactivate events for fascinare and ward enslavement.
        - The event will fire like normal, with the assumption that you automatically click "yes" for the event, you will get a message for sucess or failure

    - Titulum Novis:
        - Revoke Titles, but for Mulsae only. Lets you take titles without tyranny/opinion loss and dread, but costs piety based on title tier (or titles, if you take a duchy and the counties/baronies below it then the cost is cumulative). You need to be a Skeuophylax to use this power.

    - Famuli Warriors:
        - Adds a new Cultural Tradition that is gained alongside the Famuli Martial custom during its the deicison to instate female warriors.
        - It gives you access to female regiments that are designed to replace Light Infantry, Archers, Light Cavalry and Heavy Infantry.
            - Famuli Regiments have custom art, if you have better art to replace it with feel free to let me know!
            - They start with +50 soliders in each stack compared to vanilla
            - They counter an extra type of enemy unit then vanilla
            - They start slightly weaker then their vanilla counterparts
        - The tradition itself also has modifiers:
            - +5 advantage to all combat encounters (very strong buff, might nerf)
            - +25% movement speed to armies
            - +25% enemy fatal casualties
            - +30% retreating casualties (You will lose more soliders if forced to retreat!)
        - The Magistri custom culture starts with Famuli Warriors (along with the Famuli Martial custom). You wont be able to recruit Famuli soliders untill you Free the keeper of souls, as you need the Regula religion as well.
        - AI characters will recruit these warriors if the Magister has Famuli Warriors in his culture and if they have the Regula faith (same faith as Magister)
        Hoping this isn't overpowered. Goal was to create a tradition that embraced the "quantity" not "quality" of having an army built from charmed women.
        They may not be as strong as their male counterparts, but they make up for it in numbers and zeal.

0.98
By Ban10

Fixes
    - Fix ward enslavement for wards NOT of your dynasty, they now give prestige based on the highest LANDED title that the ward has. Decided not to use implicit claims / designted heirs to give prestige as it seems really complex and wont always work the way I expect it to. For now, only wards with titles they currently hold will give dynasty prestige.

    - Titulm Novis now tells you how much piety you need if you dont have enough (fixed the message in the UI when choosing a title to revoke)

    - Fix Famuli MAA regiments causing script errors, now check that the Magister exists before checking the regiment can be used

    - Move notification settings into an on_action on on_game_start, so that the setting does not reset when the magister changes

    - Fix Fascinare notification settings, now actually supress the scheme, runs the event like normal and tells you whether you succeded or failed. Note, doesnt have the "extra" effects that some of the events have I would need to somehow make all the existing events have hidden versions, or something.

Changes
    -  Sanctifica Serva's
        - Health penalty now only lasts for five years (it was permanent before)
        - Some hair/skin colour changes to Goddess portraits

Features
    - Mutare Corpus - New interaction, costs 300 piety
        - Basically just the Domitans part where you get to improve your new palex, except can be done on any charmed women every six months

0.99
By Ban10

Fixes
    - Fix one case for claim initates having the wrong variable name (so no characters were generated!)

    - Fix piety level reduction, having the lowest piety level increases costs by 10% (for things like revoking titles / getting vassals using piety/prestige)

    - Other minor fixes, such as resaving with UTF-8 with BOM or typos

Changes
    - Forgot to mention change to orba, now has higher health penalty

    - Cooldown for Mutare Corpus is now a year

    - Initates now have Mulsa trait if you have a holy site with the Fascinare flag

    - Upon freeing the Keeper of souls, you will also become the head of faith

    - Swap Craven out for Lovers pox as a sin

    - Change domination war to use similar calculation as Abice/Titulm Novis, though keeping the vanilla cost reductions for now and give extra reduction so that war costs less then just vassalising straight up, may need to balance/nerf numbers a bit.

Features
    - Completely rework Mutare Corpus interaction
        - Each effect (Physical/Mental/Sexual boost) now have very different effects
            - Physical boost gives strength traits, improves health and heals physical defects
            - Mental boost gives intelligence traits, improves education and heals mental defects
            - Sexual boost gives beauty traits, gives some fertility/other traits, heals diseases and can impregenate
        - The ritual can have the quality Backfire / Bad / Good / Great / Fantastic, with each tier having different effects
        - The quality chance is shown in the tooltips, and is based on your piety level, with the higher piety levels have much better odds of success
        - Long term plan is to change domitans to use the same system

    - Add Issues and Todo files with stuff to fix and do

0.100
By Ban10

Fixes
    - Regula Bloodline traits (the ones based on Regula objectives) are now applied to your entire Dynasty, now just the children/grand-children++ of the Magistri that achieved it. I had a campaign where my player heir was my grandchild where the son in between had died, and the Bloodlines were not applied to the grandchild, meaning that when I became him the run effectively broke. Hopefully this should prevent that as your entire Dynasty gets the traits.

    - Tried to fix Mutare Corpus message box, doesnt seem to show the right traits being added (sometimes). Not sure what is causing this or how to fix it. Been working on this for a while, honestly no clue. Its like the message box runs the function twice, once for the message and once for the actual effect. Guess its just a vanilla bug.

    - If a servitude war is won by ultimatum, you get +1 to the Servitude wars won bloodline tally goal.

Changes
    - Mutare Corpus changes:
        - Cooldown is now 3 years
        - Has 300 piety cost again
        - Nerfs to % chance of getting bonus traits (eg double/triple strength/intelligence/beauty).
        - Will still be possible to make really good wives but takes longer and costs a bit more.
        - Some minor changes to possible traits you can get, eg healing now heals regular wounds, and can get physicain from mental boost
        - Now generates event reminder when available.

    - Regula book purchase now costs medium gold (Vanilla game value), a dynamic value thats based on your income.

    - Magistri Culture is now a "divergent" culture of english culture. Testing to see if this gets AI to promote culture more often.

    - Change British Empire holy site effects a bit, shuffle the Scotland/English/Welsh ones, Scottish is now Martial, Wales is Intrigue and England is Stewardship. Feels like it fits more.

    - Refactor Doctrines and Tenents so that we dont need to overwrite the games vanilla doctrine/tenent files. Should be less buggy and more compatible with other mods now.

    - Regula Magister Tenent now has "No unfaithfullness penalty", same effect as Polyamory (Vanilla Tenent).
        "Oh husband, did you have sex with that women I bought to YOUR orgy last year? Shes pregnant now, how could you do this to our marriage!"

Features
    - Add Magistri Submission Tradition
        - Focuses on social attributes. General idea is to make it easier to manage vassals/counties but make it harder to wage war and defend against intrigue.
        - Is added to the player characters culture after freeing the keeper of souls, note, no check for whether player is the head of Culture (yet), still need figure it out the right check.
        - Has the following effects:
            - Decreases stress gain AND increases stress loss
            - AI changes (more zeal, less bold etc), makes them less likely to wage war on each other (or foreign lands)
            - Characters are more likely to be content
            - Isolation tradition parameters, courtiers are less likely to leave and marraige is harder between this culture and others.
            - Increases county control, development and opinion
            - Also addes some negative effects, which are knight effectivness malus, -3 prowess and hostile/personal scheme resistance down by 30%. Pretty major negative effects but as the positives are really good there has to be a strong downside.

    - Add Bloodline tally goals - Cumulative option
        - This game rule changes how bloodline tally goals are counted up, you can either
            - Single-Life: Like how it is now, each goal must be completed in a Magisters lifetime
            - Cumulative: Goals are higher, but they do not reset after each Magister switch. Designed to take longer to achieve but be less stressfull, as you dont "lose" any progress that you make.
        - Note, not backwards compatiable as this changes the variables behind the scenes from local (on each character) to global. No way to do this otherwise as the variables would disappear if they werent global when your player Magister dies.
        - You can change values to what you prefer in "common\script_values\regula_script_values.txt"
        - Change Statistics page to show who achieved what bloodline goal and what it gave

0.101
By Ban10

Fixes
    - Refactor some Portrait modifiers (Charmed portraits)

    - Fix Martial Custom decision, had incorrect is_valid statement for Magister rank

    - Fix for unmarried Magister dominating a Mulsa, now you marry your target and make her your Domina

Changes
    - Edit Servitude faction AI weights, should incline AI to join Servitude faction a bit more

    - Nerf Magistri Submission, both its bad and good effects. Was a bit to easy to reach 100% stress reduction which basically removed it as a mechanic.

    - Modify Devoted traits (Mulsa/Paelex/Domina), Stats are generally more varied and a bit better.

    - Contubernalis Changes:
        - Contubernalis now have + 15 to diplomacy and prowess, making them useful as diplomacy courtiers or throwaway champions/knights. Build an army of thralls and send them to battle or keep them as slaves in your court, the choice is yours.
        - When turning someone into a Contubernalis, it will now remove ALL of their traits, give them lustful,zealous and humble, make them comely and heal them. I think this ties neatly into the idea that they lost their soul/memories and have become husks of their former self.
        - Add a flag to them that makes them unable to leave your court.
        - Change opinion modifers of turning someone into a Contubernalis (their family). Its now permenant and though not as bad as the murder opinion modifer, is pretty close.

    - Merge Domitans with Mutare Corpus, now triggers the same "boost" effects.

    - Mutare corpus now has the particpant wear blindfolds (I noticed someone tried to code this for the Domitans but coudnt get it to work)

    - Orgy start now heals a single disease from each participant on start, not just lovers/great pox

    - Magistri Submission AI war chance is now the same as Pacifist (-75%). My Vassals are still very bloodthirsty though :(

Features
    - Fascinare important action notification. Lets you know if any of your direct vassals (that have a county title or greater) can be charmed (>16 years old and female).


code:
# Issues

Current Issues list

- Mercanary regiments For Magistri culture
    - Have men as their knights, even though the Famuli Custom is setup (Female knights only)
    - Eventually, after enough time has passed, they "run out" of knights and they end up having no knights at all
    - Not sure what causes this, seems to actually be a vanilla bug because having inverted gender rule causes this to happen to other cultures as well.
    - Also, they dont use Famuli Warriors as their Regiments

- Holy Order Knight Companies
    - Dont use Fmauli Warrior Regiments (Aside from the heavy infantry one)

- Localisation
    - Make sure Localisation is updated for other languages

- Portrait Modifier overwrites
    - Some portrait modifers are not correctly overwritten
    - For example a Contubernalis should have full pink eyes (contubernalis_portrait) but vanilla code eg the animation AI_zealous_decal (Crusader Kings III\game\gfx\portraits\portrait_modifiers\01_animation_expressions.txt) overwrites the "eye_accessory", so sometimes they will apear with regular eyes again. I've noticed this happen when you use a Contubernalis as a Champion/Knight, as they adopt the "zealous" animation.

- Number of Wives Cultural Tenent Clash
    - The Polygamy/Monogamy/Concubine Cultural Tenets override the mod's cap on spouses.


code:
# Regula Magistri

A mind-control "Haremocracy" mod for Crusader Kings 3.

[LoversLab Page](https://www.loverslab.com/topic/157067-mod-regula-magestri/)

[Hypnopics-Collective Page](https://hypnopics-collective.net/smf_forum/index.php?topic=24167.0)

## Overview

This mod creates a number of traits, events, schemes, and interactions based around the Player's interaction with the Regula Magistri (Rule of the Master). The intent of these is to create a state headed by a single (male) ruler and his harem of vassals.

## Highlights

Creates a mind controller trait for the MC (Keeper of Souls) and charmed traits for female characters (Mulsa, Paelex, Domina and Orba).

Creates a religion, Regula Magistri. This religion has two custom tenets linked to the Magister and his harem. The magister can have unlimited wives, each of which can boost desmesne income and development. The holy sites unlock different character interactions, adjust the sex of newborns, or otherwise changes the base game.

Creates a scheme (Fascinare) to add the Mulsa trait to female characters and convert them to the Regula Magistri religion. Each woman with the Mulsa and at least one landed title (county or higher) can be upgraded to the Paelex trait and added to the MC's harem. Mulsa can also be forced to act against their liege and family, revealing secrets, kidnapping or deposing their husband, and even waging war against their leige for the right to swear fealty to the magister.

Creates a number of new wars linked to the enslavement of other rulers. Free female rulers can be dominated, while those already charmed can be stolen from their rightful liege or allowed to break their former bonds of fealty through a custom faction, Servitude.

Creates two new gender succession laws, Hereditas Magistri and Hereditas Compedita. The MC's titles pass to their male offspring, while those of their vassals pass to female offspring. All MC vassals will adopt Hereditas Compedita on a quarterly basis.

Creates a new decision to use your Holy Orders to collect the finest females from across your land. The more barony titles that your Holy Orders have collectively, the better educated and trained the girls will be. Having the Holy Site that makes females more common adds extra choices to the decision.

## Requirements

This mod requires Carnalitas to function.
https://www.loverslab.com/topic/152833-mod-carnalitas-unified-sex-mod-framework-for-ck3/

## Incompatibilities

This version is not compatible with Regula Magistri 0.7 saves.

This mod may conflict with any mod that overwrites or replaces the following:
Files:
00_doctrines
00_marriage_scripted_modifiers
00_marriage_interaction_effects
00_succession_laws
01_title_succession_laws
02_genes_accessories_misc
adultery_events
hair_palette.dds
skin_palette.dds
story_cycle_infidelity_confrontation
coat_of_arms_template_lists

Triggers:
might_cheat_on_partner_trigger
can_set_relation_lover_trigger
can_set_relation_soulmate_trigger
valid_demand_conversion_conditions_trigger

## Installation

Unzip into your /Documents/Paradox Interactive/Crusader Kings III/mod folder.
Add "Regula Magistri" to your mod playset.
Start the mode by taking the "Acquire the Regula Magistri" decision.

## Contributing

If you are interested in contributing, please get in touch at the links above. Assistance with art or event dialogue would be greatly appreciated.

## Sources
[Title image](https://www.flickr.com/photos/peterscherub/26640204103/in/dateposted-ff/) - CC BY 2.0
[Initialize Decision](https://www.artstation.com/artwork/alJY9)
[Religious Symbol](https://www.zazzle.com/dark_triskele_stickers-217310945176612803)
[Godless shrine](https://www.instagram.com/julesmartinvos/?hl=en)
[Chained heart](https://www.zedge.net/wallpaper/4361d8ce-550f-34a7-9c17-3660573fd820)
[Paelex gem](https://www.deviantart.com/heartkitty/art/Saga-Ruby-Red-781427609)
[Contubernalis Lock](https://www.redbubble.com/i/poster/Vintage-lock-by-Elsbet/44210515.LVTDI)
[Child of the Book](http://www.boltonft.nhs.uk/services/maternity/information/complementary-therapies/yoga/)
[Magister Book](http://portfolio.jessegreenberg.com/search/label/Icons)
[Magister Book 2](https://www.cleanpng.com/png-bible-psalms-book-of-nehemiah-magic-books-217459/) - Free download, no attached license.
[Magister Heart](https://opengameart.org/content/painterly-spell-icons-part-1) - CC BY SA 3.0
[Gossip Icon](https://www.pinterest.ca/pin/577445983442068585/)
[Multitasker Bloodline Icon](http://clipart-library.com/clipart/1193241.htm)
[Breeder Bloodline Icon](https://photostockeditor.com/clip-art-vector/download/158571426)
[Mindshaper Bloodline Icon](https://www.pinterest.ca/pin/598204762996918891/)
[Obedience Bloodline Icon](https://www.needpix.com/photo/download/1412104/black-silhouette-woman-female-kneeling-long-hair-isolated-white)
[Thrallmaker Bloodline Icon](https://www.gribbin.eu/portfolio/toys-project/)
[Subjugator Bloodline Icon](https://www.pinpng.com/picture/mwbmwx_vector-illustration-of-middle-ages-medieval-chivalry-knight/)
[Imperator Bloodline Crown](https://www.pinterest.ca/pin/268738302750826212/)
[Imperator Bloodline Laurels](https://www.redbubble.com/i/sticker/Laurel-wreath-Laurels-sport-sports-win-wins-winner-winning-won-glory-glorious-by-TOMSREDBUBBLE/35075681.EJUG5)
[Infecta chain](https://www.zedge.net/wallpaper/f1fb39b1-5761-32d7-bbdd-f6807e10aa42)
[Magister Tenet](http://img1.stylowi.pl//images/items/xs/201403/stylowi_pl_podroze-i-miejsca_google-_20285447.gif)
[Devoted Tenet](https://www.instagram.com/p/Bim-ephn68l/?igshid=1s8mimo339ya0)
[Paelex modifier](https://dribbble.com/shots/3637376-Collar-Heart)
[Throw orgy decision] Franz Xaver Winterhalter: Florinda - Public domain.
[Corrupt Holy Order Decision] Louis Licherie: Abigail, femme de Nabal - Public domain. (https://collections.louvre.fr/en/ark:/53355/cl010053162)
[Orgy background](https://www.deviantart.com/fmacmanus/art/Scarlet-Chamber-529103492)
[Regula Bedchamber Threshold](https://www.artstation.com/artwork/86BKG)
[Castle Alcove](https://www.deviantart.com/raelsatu/art/Castle-Wing-437848959)
[Night Workshop](https://www.artstation.com/artwork/exy2X)
[Prison cell background](https://www.deviantart.com/eneada/art/Prison-420162562)
[House Arrest Room background](https://www.artstation.com/artwork/DJRGE)
[Stables background](https://www.artstation.com/artwork/N51wvq)
[Keeper of Souls Ritual](https://www.artstation.com/artwork/qeG92)
[Sanctifica Serva Ritual - Diplomacy] (https://www.artstation.com/artwork/rR66q2)
[Sanctifica Serva Ritual - Martial] (https://www.artstation.com/artwork/1n2Gwe)
[Sanctifica Serva Ritual - Stewardship] (https://www.artstation.com/artwork/w8en45)
[Sanctifica Serva Ritual - Intrigue] (https://www.artstation.com/artwork/3dB2YE)
[Sanctifica Serva Ritual - Learning] (https://www.artstation.com/artwork/GXwqOV)
[Servitude Faction Logo] (https://thenounproject.com/term/ball-gag/1671782/) - CC BY

[Warrior Women Tradition Artwork] (https://www.deviantart.com/mitchfoust/art/Shieldmaiden-293076902)
[Regula Submission Tradition Artwork] (https://fineartamerica.com/featured/submission-in-black-obey-bdsm-love.html)
[Regula Heavy Infantry] (https://www.deviantart.com/mitchfoust/art/Sisters-of-Divine-Retribution-302260573)
[Regula Calavry] (https://www.deviantart.com/zpapageo/art/Last-charge-of-the-Amazons-153378556)
[Regula Infantry] (https://tomwoodfantasyart.com/products/valkyrie?_pos=1&_sid=14b61aef3&_ss=r)
[Regula Rangers] (https://www.pinterest.co.uk/pin/elvish-ranger-by-terese-nielsen-no-one-may-fault-an-elvish-rangers-heart-but-the-simplest-frailty-may-fel--417357090445971373/)

[Wife Spellbound Theme](Dragonball Super - Regret)
[The Keeper of Souls is Reborn Music](Dragonball Z OST - Saiyajin Kitaru Part 2)
[Sanctifica Serva Music] (https://soundcloud.com/amherst-symphony-orch/verdi-requiem-dies-irae)

[Domitans tribunal suggestion code] by shaaaaq.
[Polygamy code] by dverago

French Translation by Mederic
Simplified Chinese Translation by waibibabo

## Regula Magistri Succession Law
By contributing material for this mod you are agreeing to distribute it under the [GNU General Public License 3.0](https://gitgud.io/cherisong/carnalitas/-/blob/development/LICENSE.md).
tldr:
Anyone can copy/modify/distribute this software.  The source must be disclosed and any changes stated.
Any derivatives of this work must be distributed under the same license.
This code may be used for commercial purposes.