# The choice is made based on a weighted random, but the first factor that evaluates to >= 100 will be automatically chosen
# Two passes are done when choosing properties; first from lowest to highest, then from highest to lowest. Be aware of this if you reference other properties, as the old properties will still be active in the first pass
# hide_layers is interpreted from bottom to top. Hidden layers won't hide other layers, but if a lower layer hides a higher layer, the higher layer won't be rechecked, so it might still be hiding other layers despite being hidden itself

# p0 background
0 = {
	0 = { # castle 1
		factor = 1

		trigger = {
			religion_group = christian
			is_nomadic = no
			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}
	}

	1 = { # throne room
		factor = 15

		trigger = {
			higher_real_tier_than = DUKE
			is_tribal = no
			is_nomadic = no
			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}

		mult_modifier = {
			factor = 5

			OR = {
				real_tier = emperor
				any_spouse = { real_tier = emperor }
			}
		}
	}

	2 = { # dungeon
		factor = 100

		trigger = {
			OR = {
				prisoner = yes
				death_reason = death_dungeon
			}

			NOT = { trait = saint }
		}
	}

	3 = { # forest
		factor = 10

		trigger = {
			location = {
				OR = {
					terrain = forest
					terrain = woods
				}

				NOR = {
					region = world_middle_east_jerusalem
					region = world_middle_east_arabia
					region = world_africa
				}
			}

			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}

		mult_modifier = {
			factor = 0.01
			is_nomadic = yes
		}

		mult_modifier = {
			factor = 10
			is_tribal = yes
		}

		mult_modifier = {
			factor = 2
			religion_group = pagan_group
		}
	}

	4 = { # bed
		factor = 100

		trigger = {
			trigger_if = {
				limit = { is_alive = yes }

				OR = {
					is_incapable = yes
					trait = infirm
				}
			}

			is_at_sea = no
			NOT = { trait = saint }
		}

		mult_modifier = {
			factor = 0.001

			OR = {
				death_reason = death_battle
				death_reason = death_dungeon
				death_sacrificed_trigger = yes
				death_execution_trigger = yes
			}
		}

		mult_modifier = {
			factor = 0.02

			trait = infirm
			is_alive = yes
		}
	}

	5 = { # secret room
		factor = 100

		trigger = {
			OR = {
				trait = lustful
				trait = drunkard
				trait = hedonist
			}

			NOR = {
				religion_group = muslim
				religion_group = indian_group
				religion_group = zoroastrian_group
				religion_openly_zun_or_reformed_trigger = yes
				trait = saint
			}
		}

		mult_modifier = {
			factor = 0.25

			OR = {
				higher_real_tier_than = DUKE
				any_spouse = { higher_real_tier_than = DUKE }
			}
		}
	}

	6 = { # military camp
		factor = 100

		trigger = {
			trigger_if = {
				limit = { is_alive = yes }

				OR = {
					in_command = yes
					has_job_title = job_marshal
				}
			}
			trigger_else = {
				death_reason = death_battle
			}

			is_at_sea = no
			NOT = { trait = saint }
		}

		mult_modifier = {
			factor = 0.02
			has_job_title = job_marshal
		}

		mult_modifier = {
			factor = 10000
			in_command = yes
		}
	}

	7 = { # Dolmen
		factor = 5

		trigger = {
			religion_group = pagan_group

			location = {
				OR = {
					region = world_europe
					region = world_steppe
				}
			}

			is_at_sea = no
			in_command = no

			NOR = {
				culture_group = west_african
				culture_group = central_african
				culture_group = arabic
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}

		mult_modifier = {
			factor = 100
			is_alive = no
		}

		mult_modifier = {
			factor = 2
			is_priest = yes
		}
	}

	8 = { # Gallows
		factor = 5

		trigger = {

			OR = {
				trait = cruel
				trait = impaler
				death_execution_trigger = yes
			}

			NOT = { trait = saint }
		}

		mult_modifier = {
			factor = 20

			OR = {
				trait = impaler
				death_execution_trigger = yes
			}
		}

		mult_modifier = {
			factor = 0.75

			OR = {
				higher_real_tier_than = DUKE
				any_spouse = { higher_real_tier_than = DUKE }
			}
		}
	}

	9 = { # Church
		factor = 100

		trigger = {
			religion_group = christian

			OR = {
				is_ruler = yes
				is_theocracy = yes
				has_job_title = job_spiritual
			}

			is_at_sea = no
			in_command = no

			NOR = {
				trait = saint
				has_landed_title = k_papacy
				has_landed_title = k_hellenic_pagan_reformed
				has_landed_title = d_fraticelli
				has_claim = k_papacy
				has_claim = d_fraticelli

				# CK2Plus
				has_landed_title = d_papal_guards
			}
		}
	}

	10 = { # Desert
		factor = 5

		trigger = {
			OR = {
				trait = desert_mother
				trait = desert_father

				location = {
					OR = {
						terrain = desert
						region = world_middle_east_jerusalem
						region = world_middle_east_arabia
						region = world_africa
					}
				}
			}

			is_at_sea = no
			in_command = no

			NOR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}

		mult_modifier = {
			factor = 10

			OR = {
				is_tribal = yes
				is_nomadic = yes
			}
		}

		# CK2Plus
		mult_modifier = {
			factor = 2
			location = { terrain = desert }
		}

		mult_modifier = {
			factor = 2
			religion_group = pagan_group
		}

		mult_modifier = {
			factor = 2

			OR = {
				religion_group = muslim
				religion_openly_egyptian_or_reformed_trigger = yes
				religion = arabic_pagan
				religion = berber_pagan
			}
		}

		mult_modifier = {
			factor = 100

			OR = {
				trait = desert_mother
				trait = desert_father
			}
		}
	}

	11 = { # Steppe
		factor = 1

		trigger = {
			location = {
				OR = {
					terrain = steppe
					region = world_steppe
				}
			}

			is_at_sea = no
			in_command = no

			NOR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}

		mult_modifier = {
			factor = 10
			is_nomadic = yes
		}

		# CK2Plus
		mult_modifier = {
			factor = 10

			culture_group = altaic
			NOT = { culture = turkish }
		}
	}

	12 = { # Ocean w ships
		factor = 10

		trigger = {
			capital_scope = {
				is_coastal = yes
			}

			location = {
				terrain = coastal_desert
			}

			NOR = {
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}

		mult_modifier = {
			factor = 10000
			is_at_sea = yes
		}
	}

	13 = { # Muslim interior
		factor = 2

		trigger = {
			OR = {
				religion_group = muslim
				religion_group = indian_group
				religion_group = zoroastrian_group
				religion_openly_zun_or_reformed_trigger = yes

				# CK2Plus
				religion = arabic_pagan
				religion = berber_pagan
			}

			is_at_sea = no
			in_command = no

			NOT = { trait = saint }
		}
	}

	14 = { # Harem
		factor = 1

		trigger = {
			OR = {
				religion_group = muslim
				religion_group = indian_group
				religion_group = zoroastrian_group
				religion_openly_zun_or_reformed_trigger = yes

				# CK2Plus
				religion = arabic_pagan
				religion = berber_pagan
			}

			is_at_sea = no
			in_command = no

			NOT = { trait = saint }
		}

		mult_modifier = {
			factor = 100

			OR = {
				trait = lustful
				trait = hedonist
			}
		}
	}

	15 = { # Muslim interior 2
		factor = 10

		trigger = {
			location = {
				OR = {
					region = world_middle_east_jerusalem
					region = world_middle_east_arabia
					region = world_africa
				}
			}

			OR = {
				religion_group = muslim
				religion = arabic_pagan
				religion = berber_pagan
			}

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}

			is_at_sea = no
			in_command = no

			NOR = {
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}
	}

	16 = { # Mongol camp 1
		factor = 2

		trigger = {
			culture = mongol
			is_nomadic = yes
			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}
	}

	17 = { # Mongol camp 2
		factor = 10

		trigger = {
			culture = mongol

			location = {
				region = world_steppe
			}

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}

			is_at_sea = no
			in_command = no

			NOR = {
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}

		mult_modifier = {
			factor = 2
			culture = mongol
		}
	}

	18 = { # Papal palace
		factor = 100

		trigger = {
			OR = {
				has_landed_title = k_papacy
				has_landed_title = d_fraticelli
				has_claim = k_papacy
				has_claim = d_fraticelli

				# CK2Plus
				has_landed_title = d_papal_guards
				location = { province_id = c_roma } # Rome
			}

			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}
	}

	19 = { # Muslim mosque
		factor = 100

		trigger = {
			religion_group = muslim

			OR = {
				is_ruler = yes
				is_theocracy = yes
				has_job_title = job_spiritual
			}

			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}
	}

	20 = { # Pagan human sacrifice
		factor = 1

		trigger = {
			death_sacrificed_trigger = yes
			is_alive = no
			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}

		mult_modifier = {
			factor = 1000
			death_sacrificed_trigger = yes
		}

		mult_modifier = {
			factor = 10
			is_priest = yes
		}
	}

	21 = { # Saint Halo
		factor = 1

		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = {
			trait = saint
		}

		mult_modifier = {
			factor = 1000
			trait = saint
		}
	}

	22 = { # blue curtains
		factor = 4

		trigger = {
			culture_group = latin
			is_at_sea = no
			in_command = no
			NOT = { trait = saint }
		}
	}

	23 = { # ocean window
		factor = 5

		trigger = {
			location = {
				OR = {
					region = world_europe_west
					region = world_europe_south
				}
			}

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}

			is_at_sea = no
			in_command = no

			NOR = {
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}

		mult_modifier = {
			factor = 5

			location = {
				is_coastal = yes
			}
		}
	}

	24 = { # field window
		factor = 5

		trigger = {
			location = {
				OR = {
					region = world_europe_east
					region = world_europe_north
					terrain = farmlands
					terrain = plains
				}
			}

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}

			is_at_sea = no
			in_command = no

			NOR = {
				trait = saint
				is_offmap_tag_including_dead = offmap_china
			}
		}
	}
}

# p1 hair  --- WARNING! Property 1 MUST be Hair, otherwise the hair hiding helmets wont work ---
1 = {
	0 = { # Completely bald
		factor = 1

		trigger = {
			follows_filial_piety_trigger = no

			# Does not suit African females of a Western Culture - TODO: check for correctness
			trigger_if = {
				limit = {
					graphical_culture = westafricangfx
					is_female = yes

					OR = {
						higher_real_tier_than = COUNT
						any_spouse = { higher_real_tier_than = COUNT }
						has_minor_title = title_prince
					}
				}

				OR = {
					culture = mande
					culture = ethiopian
				}
			}
		}

		mult_modifier = {
			factor = 0.1

			trigger_if = {
				limit = { is_female = no }

				practical_age < 50

				NOR = {
					trait = monk
					trait = desert_father
				}
			}
			trigger_else = {
				NOT = { trait = desert_mother }
			}
		}

		mult_modifier = {
			factor = 100
			is_devout_chinese_buddhist_trigger = yes
		}

		# CK2Plus
		mult_modifier = {
			factor = 2

			OR = {
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	1 = { # Black Adder
		factor = 1

		# Does not suit African females of a Western Culture
		trigger = {
			trigger_if = {
				limit = {
					graphical_culture = westafricangfx
					is_female = yes

					OR = {
						higher_real_tier_than = COUNT
						any_spouse = { higher_real_tier_than = COUNT }
						has_minor_title = title_prince
					}
				}

				OR = {
					culture = mande
					culture = ethiopian
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	2 = { # Page
		factor = 1

		trigger = {
			trigger_if = {
				limit = { is_female = yes }

				# Does not suit Western females with African style headgear
				trigger_if = {
					limit = {
						OR = {
							culture = mande
							culture = ethiopian
						}

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					OR = {
						graphical_culture = westafricangfx
						graphical_culture = muslimgfx
					}
				}
				trigger_else_if = {
					limit = {
						OR = {
							is_married = yes
							higher_real_tier_than = COUNT
						}
					}

					trigger_if = {
						limit = { graphical_culture = westernslavicgfx }

						NOR = {
							culture = pomeranian
							culture = bohemian
							culture = polish
						}
					}
					trigger_else_if = {
						limit = { graphical_culture = croatsouthslavicgfx }

						NOT = { culture = croatian }
					}
					trigger_else_if = {
						limit = {
							OR = {
								graphical_culture = serbsouthslavicgfx
								graphical_culture = magyargfx
							}
						}

						NOR = {
							culture = serbian
							culture = bulgarian
							culture = vlach
							culture = hungarian
						}
					}
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	3 = { # Synth
		factor = 1

		trigger = {
			# Does not suit Western females with African style headgear
			trigger_if = {
				limit = {
					is_female = yes

					OR = {
						culture = mande
						culture = ethiopian
					}

					OR = {
						higher_real_tier_than = count
						any_spouse = { higher_real_tier_than = COUNT }
						has_minor_title = title_prince
					}
				}

				OR = {
					graphical_culture = westafricangfx
					graphical_culture = muslimgfx
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	4 = { # Long Straight
		factor = 1

		trigger = {
			trigger_if = {
				limit = { is_female = yes }

				# Does not suit Western females with African style headgear
				trigger_if = {
					limit = {
						OR = {
							culture = mande
							culture = ethiopian
						}

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					OR = {
						graphical_culture = westafricangfx
						graphical_culture = muslimgfx
					}
				}
				trigger_else_if = {
					limit = {
						OR = {
							is_married = yes
							higher_real_tier_than = COUNT
						}
					}

					trigger_if = {
						limit = { graphical_culture = westernslavicgfx }

						NOR = {
							culture = pomeranian
							culture = bohemian
							culture = polish
						}
					}
					trigger_else_if = {
						limit = { graphical_culture = croatsouthslavicgfx }

						NOT = { culture = croatian }
					}
					trigger_else_if = {
						limit = {
							OR = {
								graphical_culture = serbsouthslavicgfx
								graphical_culture = magyargfx
							}
						}

						NOR = {
							culture = serbian
							culture = bulgarian
							culture = vlach
							culture = hungarian
						}
					}
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	5 = { # Long Curly
		factor = 1

		trigger = {
			trigger_if = {
				limit = { is_female = yes }

				# Does not suit African females of a Western Culture
				trigger_if = {
					limit = {
						graphical_culture = westafricangfx

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					NOR = {
						culture = mande
						culture = ethiopian
					}
				}
				trigger_else_if = {
					limit = {
						OR = {
							is_married = yes
							higher_real_tier_than = COUNT
						}
					}

					trigger_if = {
						limit = { graphical_culture = westernslavicgfx }

						NOR = {
							culture = pomeranian
							culture = bohemian
							culture = polish
						}
					}
					trigger_else_if = {
						limit = { graphical_culture = croatsouthslavicgfx }

						NOT = { culture = croatian }
					}
					trigger_else_if = {
						limit = {
							OR = {
								graphical_culture = serbsouthslavicgfx
								graphical_culture = magyargfx
							}
						}

						NOR = {
							culture = serbian
							culture = bulgarian
							culture = vlach
							culture = hungarian
						}
					}
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	6 = { # Tonsure
		factor = 1

		trigger = {
			trigger_if = {
				limit = { is_female = no }

				religion_group = christian
				lower_real_tier_than = BARON

				OR = {
					has_job_title = job_spiritual
					has_education_learning_trigger = yes
					trait = monk
					trait = desert_father
				}
			}
			trigger_else = {
				# Does not suit Western females with African style headgear
				trigger_if = {
					limit = {
						OR = {
							culture = mande
							culture = ethiopian
						}

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					OR = {
						graphical_culture = westafricangfx
						graphical_culture = muslimgfx
					}
				}

				# Does not suit African females of a Western Culture
				trigger_else_if = {
					limit = {
						graphical_culture = westafricangfx

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					NOR = {
						culture = mande
						culture = ethiopian
					}
				}

			}
		}

		mult_modifier = {
			factor = 50
			is_female = no
		}
	}

	7 = { # Short
		factor = 1

		trigger = {
			trigger_if = {
				limit = { is_female = yes }

				# Does not suit Western females with African style headgear
				trigger_if = {
					limit = {
						OR = {
							culture = mande
							culture = ethiopian
						}

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					OR = {
						graphical_culture = westafricangfx
						graphical_culture = muslimgfx
					}
				}

				# Does not suit African females of a Western Culture
				trigger_else_if = {
					limit = {
						graphical_culture = westafricangfx

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					NOR = {
						culture = mande
						culture = ethiopian
					}
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	8 = { # Short Curly
		factor = 1

		trigger = {
			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}

	9 = { # Short Uncouth
		factor = 1

		trigger = {
			trigger_if = {
				limit = { is_female = yes }

				follows_filial_piety_trigger = no

				# Does not suit Western females with African style headgear
				trigger_if = {
					limit = {
						OR = {
							culture = mande
							culture = ethiopian
						}

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					OR = {
						graphical_culture = westafricangfx
						graphical_culture = muslimgfx
					}
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}

		mult_modifier = {
			factor = 5
			religion_group = pagan_group
		}
	}

	10 = { # Long Uncouth
		factor = 1

		trigger = {
			follows_filial_piety_trigger = no

			trigger_if = {
				limit = { is_female = yes }

				# Does not suit Western females with African style headgear
				trigger_if = {
					limit = {
						OR = {
							culture = mande
							culture = ethiopian
						}

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					OR = {
						graphical_culture = westafricangfx
						graphical_culture = muslimgfx
					}
				}
				trigger_else_if = {
					limit = {
						OR = {
							is_married = yes
							higher_real_tier_than = COUNT
						}
					}

					trigger_if = {
						limit = { graphical_culture = westernslavicgfx }

						NOR = {
							culture = pomeranian
							culture = bohemian
							culture = polish
						}
					}
					trigger_else_if = {
						limit = { graphical_culture = croatsouthslavicgfx }

						NOT = { culture = croatian }
					}
					trigger_else_if = {
						limit = {
							OR = {
								graphical_culture = serbsouthslavicgfx
								graphical_culture = magyargfx
							}
						}

						NOR = {
							culture = serbian
							culture = bulgarian
							culture = vlach
							culture = hungarian
						}
					}
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}

		mult_modifier = {
			factor = 5
			religion_group = pagan_group
		}
	}

	11 = { # Balding
		factor = 1

		trigger = {
			trigger_if = {
				limit = { is_female = yes }

				follows_filial_piety_trigger = no

				trigger_if = {
					limit = {
						OR = {
							is_married = yes
							higher_real_tier_than = COUNT
						}
					}

					trigger_if = {
						limit = { graphical_culture = westernslavicgfx }

						NOR = {
							culture = pomeranian
							culture = bohemian
							culture = polish
						}
					}
					trigger_else_if = {
						limit = { graphical_culture = croatsouthslavicgfx }

						NOT = { culture = croatian }
					}
					trigger_else_if = {
						limit = {
							OR = {
								graphical_culture = serbsouthslavicgfx
								graphical_culture = magyargfx
							}
						}

						NOR = {
							culture = serbian
							culture = bulgarian
							culture = vlach
							culture = hungarian
						}
					}
				}
			}
		}

		mult_modifier = {
			factor = 0.1

			is_female = no
			practical_age < 50

			NOR = {
				trait = monk
				trait = desert_father
			}
		}
	}

	12 = { # Marine
		factor = 1

		trigger = {
			follows_filial_piety_trigger = no

			trigger_if = {
				limit = { is_female = yes }

				# Does not suit Western females with African style headgear
				trigger_if = {
					limit = {
						OR = {
							culture = mande
							culture = ethiopian
						}

						OR = {
							higher_real_tier_than = count
							any_spouse = { higher_real_tier_than = COUNT }
							has_minor_title = title_prince
						}
					}

					OR = {
						graphical_culture = westafricangfx
						graphical_culture = muslimgfx
					}
				}
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}

		mult_modifier = {
			factor = 2
			filial_piety_maiden_trigger = yes
		}
	}

	13 = { # Mohawk
		factor = 1

		trigger = {
			follows_filial_piety_trigger = no

			trigger_if = {
				limit = { graphical_culture = chinesegfx }

				is_married = no
				is_ruler = no
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}

		mult_modifier = {
			factor = 2
			filial_piety_maiden_trigger = yes
		}
	}

	14 = { # Mohawk
		factor = 1

		trigger = {
			follows_filial_piety_trigger = no

			trigger_if = {
				limit = { graphical_culture = chinesegfx }

				is_married = no
				is_ruler = no
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}

		mult_modifier = {
			factor = 2
			filial_piety_maiden_trigger = yes
		}
	}

	15 = { # Mohawk
		factor = 1

		trigger = {
			trigger_if = {
				limit = { graphical_culture = chinesegfx }

				is_married = no
				is_ruler = no
			}

			NOR = {
				trait = monk
				trait = desert_father
				trait = desert_mother
			}
		}
	}
}

# p2 base
2 = {
}

# p3 clothes
3 = {
	0 = { # Royal clothes 1
		factor = 1

		trigger = {
			OR = {
				higher_real_tier_than = DUKE
				any_spouse = { higher_real_tier_than = DUKE }
				has_minor_title = title_prince
				is_offmap_tag_including_dead = offmap_china
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			trigger_if = {
				limit = {
					OR = {
						trait = peasant_leader
						trait = heresiarch
						government = order_government

						# CK2Plus
						trait = monk
						trait = nun
						trait = desert_father
						trait = desert_mother
						trait = perfecti
					}
				}

				is_offmap_tag_including_dead = offmap_china
			}

			NOR = { # Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 1 }
				has_portrait_property = { layer = 3 index = 2 }
			}
		}
	}

	1 = { # Royal clothes 2
		factor = 1

		trigger = {
			OR = {
				higher_real_tier_than = DUKE
				any_spouse = { higher_real_tier_than = DUKE }
				has_minor_title = title_prince
				is_offmap_tag_including_dead = offmap_china
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			trigger_if = {
				limit = {
					OR = {
						trait = peasant_leader
						trait = heresiarch
						government = order_government

						# CK2Plus
						trait = monk
						trait = nun
						trait = desert_father
						trait = desert_mother
						trait = perfecti
					}
				}

				is_offmap_tag_including_dead = offmap_china
			}

			NOR = { # Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 0 }
				has_portrait_property = { layer = 3 index = 2 }
			}
		}
	}

	2 = { # Royal clothes 3
		factor = 1

		trigger = {
			OR = {
				higher_real_tier_than = DUKE
				any_spouse = { higher_real_tier_than = DUKE }
				has_minor_title = title_prince
				is_offmap_tag_including_dead = offmap_china
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			trigger_if = {
				limit = {
					OR = {
						trait = peasant_leader
						trait = heresiarch
						government = order_government

						# CK2Plus
						trait = monk
						trait = nun
						trait = desert_father
						trait = desert_mother
						trait = perfecti
					}
				}

				is_offmap_tag_including_dead = offmap_china
			}

			NOR = { # Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 0 }
				has_portrait_property = { layer = 3 index = 1 }
			}
		}
	}

	3 = { # Noble clothes 1
		factor = 1

		trigger = {
			OR = {
				AND = {
					is_ruler = yes
					lower_real_tier_than = KING
				}

				any_spouse = {
					is_ruler = yes
					lower_real_tier_than = KING
				}

				has_minor_title = title_prince
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				trait = peasant_leader
				trait = heresiarch
				government = order_government

				# Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 4 }
				has_portrait_property = { layer = 3 index = 5 }

				# CK2Plus
				trait = monk
				trait = nun
				trait = desert_father
				trait = desert_mother
				trait = perfecti
			}
		}
	}

	4 = { # Noble clothes 2
		factor = 1

		trigger = {
			OR = {
				AND = {
					is_ruler = yes
					lower_real_tier_than = KING
				}

				any_spouse = {
					is_ruler = yes
					lower_real_tier_than = KING
				}

				has_minor_title = title_prince
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				trait = peasant_leader
				trait = heresiarch
				government = order_government

				# Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 3 }
				has_portrait_property = { layer = 3 index = 5 }

				# CK2Plus
				trait = monk
				trait = nun
				trait = desert_father
				trait = desert_mother
				trait = perfecti
			}
		}
	}

	5 = { # Noble clothes 3
		factor = 1

		trigger = {
			OR = {
				AND = {
					is_ruler = yes
					lower_real_tier_than = KING
				}

				any_spouse = {
					is_ruler = yes
					lower_real_tier_than = KING
				}

				has_minor_title = title_prince
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				trait = peasant_leader
				trait = heresiarch
				government = order_government

				# Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 3 }
				has_portrait_property = { layer = 3 index = 4 }

				# CK2Plus
				trait = monk
				trait = nun
				trait = desert_father
				trait = desert_mother
				trait = perfecti
			}
		}
	}

	6 = { # Modest clothes 1
		factor = 1

		trigger = {
			OR = {
				trait = peasant_leader
				trait = heresiarch

				NOR = {
					is_ruler = yes
					government = order_government
					has_minor_title = title_prince

					any_spouse = {
						higher_real_tier_than = COUNT
					}
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = { # Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 7 }
				has_portrait_property = { layer = 3 index = 8 }
			}
		}

		mult_modifier = {
			factor = 10

			is_theocracy = yes
			is_ruler = yes
			religion_group = pagan_group
		}
	}

	7 = { # Modest clothes 2
		factor = 1

		trigger = {
			OR = {
				trait = peasant_leader
				trait = heresiarch

				NOR = {
					government = order_government
					is_or_was_offmap_power_ruler = yes
					is_ruler = yes
					has_minor_title = title_prince

					any_spouse = {
						higher_real_tier_than = COUNT
					}
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = { # Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 6 }
				has_portrait_property = { layer = 3 index = 8 }
			}
		}
	}

	8 = { # Modest clothes 3
		factor = 1

		trigger = {
			OR = {
				trait = peasant_leader
				trait = heresiarch

				NOR = {
					government = order_government
					is_or_was_offmap_power_ruler = yes
					is_ruler = yes
					has_minor_title = title_prince

					any_spouse = {
						higher_real_tier_than = COUNT
					}
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = { # Prevent clothes switching on portrait refresh
				has_portrait_property = { layer = 3 index = 6 }
				has_portrait_property = { layer = 3 index = 7 }
			}
		}
	}

	9 = { # Shady clothes
		factor = 3

		trigger = {
			OR = {
				has_job_title = job_spymaster

				AND = {
					lower_real_tier_than = DUKE
					intrigue >= 10
				}
			}

			trigger_if = {
				limit = { is_landed = yes }
				lower_real_tier_than = DUKE
			}
			trigger_else = {
				lower_real_tier_than = KING
			}

			prisoner = no

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				government = order_government

				any_spouse = {
					higher_real_tier_than = DUKE
				}
			}
		}
	}

	# Martial
	10 = {
		factor = 100

		trigger = {
			trigger_if = {
				limit = { is_ruler = yes }

				in_command = yes

				has_game_rule = {
					name = martial_headgear
					value = on
				}
			}
			trigger_else = {
				OR = {
					has_minor_title = title_commander
					has_job_title = job_marshal
					trait = shieldmaiden
					holy_order = yes
					mercenary = yes
					has_landed_title = e_china_west_governor
				}
			}

			trigger_if = {
				limit = { is_priest = yes }
				NOT = { religion_group = christian }
			}

			chinese_martial_modifier_trigger = no
			chinese_martial_2_modifier_trigger = no
			chinese_generals_modifier_trigger = no
		}

		mult_modifier = {
			factor = 100 # This ensures that the reverse order check stays matched
			has_portrait_property = { layer = 5 index = 10 }
		}
	}

	# Ragged prison clothes
	11 = {
		factor = 100

		trigger = {
			prisoner = yes
		}
	}

	# Chinese Martial Extension 1
	12 = {
		factor = 99

		trigger = {
			chinese_generals_modifier_trigger = yes
		}

		mult_modifier = {
			factor = 100 # This ensures that the reverse order check stays matched
			has_portrait_property = { layer = 5 index = 12 }
		}
	}

	# Chinese Martial Extension 2
	13 = {
		factor = 99

		trigger = {
			chinese_martial_modifier_trigger = yes
			chinese_martial_2_modifier_trigger = no
			chinese_generals_modifier_trigger = no
		}

		mult_modifier = {
			factor = 100 # This ensures that the reverse order check stays matched
			has_portrait_property = { layer = 5 index = 13 }
		}
	}

	# Chinese Martial Extension 3
	14 = {
		factor = 99

		trigger = {
			chinese_martial_2_modifier_trigger = yes
			chinese_generals_modifier_trigger = no
		}

		mult_modifier = {
			factor = 100 # This ensures that the reverse order check stays matched
			has_portrait_property = { layer = 5 index = 14 }
		}
	}
}

# p4 beard
4 = {
	0 = {
		factor = 1

		trigger = {
			trigger_if = {
				limit = {
					OR = {
						religion_group = muslim
						religion = arabic_pagan
						religion = berber_pagan
					}
				}

				graphical_culture = muslimgfx
			}
		}

		mult_modifier = {
			factor = 30

			OR = {
				culture = greek
				culture = italian
				culture = roman
			}

			OR = {
				religion_group = christian
				religion_openly_hellenic_or_reformed_trigger = yes
				graphical_culture = southerngfx
				graphical_culture = byzantinegfx
			}
		}

		mult_modifier = {
			factor = 15

			religion_group = christian
			culture_group = iberian

			OR = {
				graphical_culture = southerngfx
				graphical_culture = byzantinegfx
			}
		}

		mult_modifier = {
			factor = 100
			is_devout_chinese_buddhist_trigger = yes
		}

		mult_modifier = {
			factor = 100 # No longer bearded Ottavian
			character = 145290
		}

		# Frankish men less likely to wear beards after the 12th century, in stages
		mult_modifier = {
			factor = 5
			year = 1100
		}

		mult_modifier = {
			factor = 15
			year >= 1150
		}

		mult_modifier = {
			factor = 30
			year >= 1200
		}
	}

	1 = {
		factor = 1
	}

	2 = {
		factor = 1
	}

	3 = {
		factor = 1
	}

	4 = {
		factor = 1
	}

	5 = {
		factor = 1
	}

	6 = {
		factor = 1
	}

	7 = {
		factor = 1
	}

	8 = {
		factor = 1
	}

	9 = {
		factor = 1

		mult_modifier = {
			factor = 5

			religion_group = christian
			culture_group = iberian

			OR = {
				graphical_culture = southerngfx
				graphical_culture = byzantinegfx
			}
		}
	}

	10 = {
		factor = 1

		trigger = {
			trigger_if = {
				limit = {
					OR = {
						religion_group = muslim
						religion = arabic_pagan
						religion = berber_pagan
					}
				}

				graphical_culture = muslimgfx
			}
		}

		mult_modifier = {
			factor = 20

			religion_group = christian
			culture_group = iberian

			OR = {
				graphical_culture = southerngfx
				graphical_culture = byzantinegfx
			}
		}

		mult_modifier = {
			factor = 60

			religion_group = christian

			OR = {
				culture = greek
				culture = italian
			}

			OR = {
				graphical_culture = southerngfx
				graphical_culture = byzantinegfx
			}
		}
	}

	11 = {
		factor = 1
	}

	12 = {
		factor = 1
	}

	13 = {
		factor = 1
	}

	14 = {
		factor = 1
	}
}

# p5 headgear
5 = {
	# Imperial crown/Caliph turban
	0 = {
		factor = 100

		hide_layers = { 31 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers
		hide_layers = { 32 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers

		trigger = {
			OR = {
				real_tier = EMPEROR
				any_spouse_even_if_dead = { real_tier = EMPEROR }
				is_offmap_tag_including_dead = offmap_china
			}

			trigger_if = {
				limit = { is_nomadic = yes }
				population >= 10000
			}

			# Nomads marrying lowly pagans should not give them Imperial crowns, unless the spouse has enough population to warrant it
			trigger_if = {
				limit = {
					is_ruler = yes
					lower_real_tier_than = EMPEROR

					any_spouse = {
						is_nomadic = yes
						real_tier = EMPEROR
					}
				}

				any_spouse = {
					is_nomadic = yes
					real_tier = EMPEROR
					population >= 10000
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			# If you are Emperor and died without being crowned, you don't wear a crown.
			trigger_if = {
				limit = { real_tier = EMPEROR }
				NOT = { trait = uncrowned } # Only on death of uncrowned Catholics/Fraticelli
			}

			# If you are a living Emperor and are not crowned, you don't wear a crown
			trigger_if = {
				limit = {
					real_tier = EMPEROR
					is_alive = yes
					has_dlc = "Holy Fury" # Ignore Coronation triggers if Holy Fury is disabled

					OR = {
						religion = catholic
						religion = fraticelli
					}

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					# trait = crowned_by_priest
					# trait = crowned_by_bishop
					trait = crowned_by_pope
					# trait = crowned_by_myself

					# CK2Plus
					trait = crowned
					trait = strong_basileus
					trait = weak_basileus
					trait = crowned_by_relhead
					trait = crowned_by_vip
				}
			}

			# If you are the spouse of an Emperor while not being Empress yourself, and your husband died without being crowned, you don't wear a crown
			trigger_if = {
				limit = {
					any_spouse_even_if_dead = {
						real_tier = EMPEROR
						trait = uncrowned # Only on death of uncrowned Catholics/Fraticelli
					}

					has_dlc = "Holy Fury"

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					real_tier = EMPEROR

					any_spouse = {
						is_alive = yes
						real_tier = EMPEROR

						trigger_if = {
							limit = {
								OR = {
									religion = catholic
									religion = fraticelli
								}
							}

							OR = {
								# trait = crowned_by_priest
								# trait = crowned_by_bishop
								trait = crowned_by_pope
								# trait = crowned_by_myself

								# CK2Plus
								trait = crowned
								trait = strong_basileus
								trait = weak_basileus
								trait = crowned_by_relhead
								trait = crowned_by_vip
							}
						}
					}
				}
			}

			trigger_if = {
				limit = {
					OR = {
						trait = peasant_leader
						trait = heresiarch

						# CK2Plus
						trait = monk
						trait = nun
						trait = desert_father
						trait = desert_mother
						trait = perfecti
					}
				}

				is_offmap_tag_including_dead = offmap_china
			}

			# Otherwise dead landless Queens don't wear the crown, as they default to nogovernment
			trigger_if = {
				limit = {
					is_feudal = no
					is_tribal = no
					is_nomadic = no
				}

				OR = {
					is_ruler = no
					is_offmap_tag_including_dead = offmap_china
				}
			}

			trigger_if = {
				limit = { is_republic = yes }
				is_alive = yes
			}

			trigger_if = {
				limit = {
					is_alive = no
					is_ruler = no
				}

				# Dead wives of Patricians are nogovernment, thus they would wear crowns for being married to an Empire-tier
				NOT = {
					any_spouse_even_if_dead = {
						is_republic = yes
					}
				}
			}

			primary_title = {
				NOR = {
					title = e_great_britain
					title = e_yugoslavia
				}
			}

			NOR = {
				trait = saint
				has_landed_title = e_china_west_governor # Uses martial clothing instead
			}

			song_dynasty_futou_trigger = no
		}
	}

	# Royal crown/turban 1
	1 = {
		factor = 1

		hide_layers = { 31 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers
		hide_layers = { 32 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers

		trigger = {
			OR = {
				real_tier = KING
				any_spouse = { real_tier = KING }
			}

			# CK2Plus
			OR = {
				independent = yes
				any_spouse = { independent = yes }
			}

			trigger_if = {
				limit = { is_nomadic = yes }
				population >= 5000
			}

			# Nomads marrying lowly pagans should not give them crowns unless proper population is met
			trigger_if = {
				limit = {
					is_ruler = yes
					lower_real_tier_than = KING

					any_spouse = {
						is_nomadic = yes
						real_tier = KING
					}
				}

				any_spouse = {
					is_nomadic = yes
					real_tier = KING
					population >= 5000
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			# If you are King and died without being crowned, you don't wear a crown.
			trigger_if = {
				limit = { real_tier = KING }
				NOT = { trait = uncrowned } # Only on death of uncrowned Catholics/Fraticelli
			}

			# If you are a living King and are not crowned, you don't wear a crown
			trigger_if = {
				limit = {
					real_tier = KING
					is_alive = yes
					has_dlc = "Holy Fury" # Ignore Coronation triggers if Holy Fury is disabled

					OR = {
						religion = catholic
						religion = fraticelli
					}

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					# trait = crowned_by_priest
					# trait = crowned_by_bishop
					trait = crowned_by_pope
					# trait = crowned_by_myself

					# CK2Plus
					trait = crowned
					trait = strong_basileus
					trait = weak_basileus
					trait = crowned_by_relhead
					trait = crowned_by_vip
				}
			}

			# If you are the spouse of an King while not being Queen yourself, and your husband died without being crowned, you don't wear a crown
			trigger_if = {
				limit = {
					any_spouse_even_if_dead = {
						real_tier = KING
						trait = uncrowned # Only on death of uncrowned Catholics/Fraticelli
					}

					has_dlc = "Holy Fury"

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					real_tier = KING

					any_spouse = {
						is_alive = yes
						real_tier = KING

						trigger_if = {
							limit = {
								OR = {
									religion = catholic
									religion = fraticelli
								}
							}

							OR = {
								# trait = crowned_by_priest
								# trait = crowned_by_bishop
								trait = crowned_by_pope
								# trait = crowned_by_myself

								# CK2Plus
								trait = crowned
								trait = strong_basileus
								trait = weak_basileus
								trait = crowned_by_relhead
								trait = crowned_by_vip
							}
						}
					}
				}
			}

			# Otherwise dead landless Queens don't wear the crown, as they default to nogovernment
			trigger_if = {
				limit = {
					is_feudal = no
					is_tribal = no
					is_nomadic = no
				}

				is_ruler = no
			}

			trigger_if = {
				limit = { is_republic = yes }
				is_alive = yes
			}

			trigger_if = {
				limit = {
					is_alive = no
					is_ruler = no
				}

				# Dead wives of Patricians are nogovernment, thus they would wear crowns for being married to a King-tier
				NOT = {
					any_spouse_even_if_dead = {
						is_republic = yes
					}
				}
			}

			NOR = {
				trait = saint
				trait = peasant_leader
				trait = heresiarch
				has_landed_title = e_china_west_governor # Uses martial clothing instead
				has_portrait_property = { layer = 5 index = 2 }
				has_portrait_property = { layer = 5 index = 3 }

				# CK2Plus
				trait = monk
				trait = nun
				trait = desert_father
				trait = desert_mother
				trait = perfecti
			}
		}
	}

	# Royal crown/turban 2
	2 = {
		factor = 1

		hide_layers = { 31 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers
		hide_layers = { 32 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers

		trigger = {
			OR = {
				real_tier = KING
				any_spouse = { real_tier = KING }
			}

			# CK2Plus
			OR = {
				independent = yes
				any_spouse = { independent = yes }
			}

			trigger_if = {
				limit = { is_nomadic = yes }
				population >= 5000
			}

			# Nomads marrying lowly pagans should not give them crowns unless proper population is met
			trigger_if = {
				limit = {
					is_ruler = yes
					lower_real_tier_than = KING

					any_spouse = {
						is_nomadic = yes
						real_tier = KING
					}
				}

				any_spouse = {
					is_nomadic = yes
					real_tier = KING
					population >= 5000
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			# If you are King and died without being crowned, you don't wear a crown.
			trigger_if = {
				limit = { real_tier = KING }
				NOT = { trait = uncrowned } # Only on death of uncrowned Catholics/Fraticelli
			}

			# If you are a living King and are not crowned, you don't wear a crown
			trigger_if = {
				limit = {
					real_tier = KING
					is_alive = yes
					has_dlc = "Holy Fury" # Ignore Coronation triggers if Holy Fury is disabled

					OR = {
						religion = catholic
						religion = fraticelli
					}

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					# trait = crowned_by_priest
					# trait = crowned_by_bishop
					trait = crowned_by_pope
					# trait = crowned_by_myself

					# CK2Plus
					trait = crowned
					trait = strong_basileus
					trait = weak_basileus
					trait = crowned_by_relhead
					trait = crowned_by_vip
				}
			}

			# If you are the spouse of an King while not being Queen yourself, and your husband died without being crowned, you don't wear a crown
			trigger_if = {
				limit = {
					any_spouse_even_if_dead = {
						real_tier = KING
						trait = uncrowned # Only on death of uncrowned Catholics/Fraticelli
					}

					has_dlc = "Holy Fury"

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					real_tier = KING

					any_spouse = {
						is_alive = yes
						real_tier = KING

						trigger_if = {
							limit = {
								OR = {
									religion = catholic
									religion = fraticelli
								}
							}

							OR = {
								# trait = crowned_by_priest
								# trait = crowned_by_bishop
								trait = crowned_by_pope
								# trait = crowned_by_myself

								# CK2Plus
								trait = crowned
								trait = strong_basileus
								trait = weak_basileus
								trait = crowned_by_relhead
								trait = crowned_by_vip
							}
						}
					}
				}
			}

			# Otherwise dead landless Queens don't wear the crown, as they default to nogovernment
			trigger_if = {
				limit = {
					is_feudal = no
					is_tribal = no
					is_nomadic = no
				}

				is_ruler = no
			}

			trigger_if = {
				limit = { is_republic = yes }
				is_alive = yes
			}

			trigger_if = {
				limit = {
					is_alive = no
					is_ruler = no
				}

				# Dead wives of Patricians are nogovernment, thus they would wear crowns for being married to a King-tier
				NOT = {
					any_spouse_even_if_dead = {
						is_republic = yes
					}
				}
			}

			NOR = {
				trait = saint
				trait = peasant_leader
				trait = heresiarch
				has_landed_title = e_china_west_governor # Uses martial clothing instead
				has_portrait_property = { layer = 5 index = 1 }
				has_portrait_property = { layer = 5 index = 3 }

				# CK2Plus
				trait = monk
				trait = nun
				trait = desert_father
				trait = desert_mother
				trait = perfecti
			}
		}
	}

	# Royal crown/turban 3
	3 = {
		factor = 1

		hide_layers = { 31 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers
		hide_layers = { 32 = { } } # Prevent hedge-incompatibilities with Ducal French Overlayers

		trigger = {
			OR = {
				real_tier = KING
				any_spouse = { real_tier = KING }
				song_dynasty_futou_trigger = yes
			}

			# CK2Plus
			OR = {
				independent = yes
				any_spouse = { independent = yes }
				song_dynasty_futou_trigger = yes
			}

			trigger_if = {
				limit = { is_nomadic = yes }
				population >= 5000
			}

			# Nomads marrying lowly pagans should not give them crowns unless proper population is met
			trigger_if = {
				limit = {
					is_ruler = yes
					lower_real_tier_than = KING

					any_spouse = {
						is_nomadic = yes
						real_tier = KING
					}
				}

				any_spouse = {
					is_nomadic = yes
					real_tier = KING
					population >= 5000
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			# If you are King and died without being crowned, you don't wear a crown.
			trigger_if = {
				limit = { real_tier = KING }
				NOT = { trait = uncrowned } # Only on death of uncrowned Catholics/Fraticelli
			}

			# If you are a living King and are not crowned, you don't wear a crown
			trigger_if = {
				limit = {
					real_tier = KING
					is_alive = yes
					has_dlc = "Holy Fury" # Ignore Coronation triggers if Holy Fury is disabled

					OR = {
						religion = catholic
						religion = fraticelli
					}

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					# trait = crowned_by_priest
					# trait = crowned_by_bishop
					trait = crowned_by_pope
					# trait = crowned_by_myself

					# CK2Plus
					trait = crowned
					trait = strong_basileus
					trait = weak_basileus
					trait = crowned_by_relhead
					trait = crowned_by_vip
				}
			}

			# If you are the spouse of an King while not being Queen yourself, and your husband died without being crowned, you don't wear a crown
			trigger_if = {
				limit = {
					any_spouse_even_if_dead = {
						real_tier = KING
						trait = uncrowned # Only on death of uncrowned Catholics/Fraticelli
					}

					has_dlc = "Holy Fury"

					OR = {
						has_game_started = yes
						is_save_game = yes
					}
				}

				OR = {
					real_tier = KING

					any_spouse = {
						is_alive = yes
						real_tier = KING

						trigger_if = {
							limit = {
								OR = {
									religion = catholic
									religion = fraticelli
								}
							}

							OR = {
								# trait = crowned_by_priest
								# trait = crowned_by_bishop
								trait = crowned_by_pope
								# trait = crowned_by_myself

								# CK2Plus
								trait = crowned
								trait = strong_basileus
								trait = weak_basileus
								trait = crowned_by_relhead
								trait = crowned_by_vip
							}
						}
					}
				}
			}

			# Otherwise dead landless Queens don't wear the crown, as they default to nogovernment
			trigger_if = {
				limit = {
					is_feudal = no
					is_tribal = no
					is_nomadic = no
				}

				OR = {
					is_ruler = no
					song_dynasty_futou_trigger = yes
				}
			}

			trigger_if = {
				limit = { is_republic = yes }
				is_alive = yes
			}

			trigger_if = {
				limit = {
					is_alive = no
					is_ruler = no
				}

				# Dead wives of Patricians are nogovernment, thus they would wear crowns for being married to a King-tier
				NOT = {
					any_spouse_even_if_dead = {
						is_republic = yes
					}
				}
			}

			trigger_if = {
				limit = {
					OR = {
						trait = peasant_leader
						trait = heresiarch
					}
				}

				song_dynasty_futou_trigger = yes
			}

			NOR = {
				trait = saint
				has_landed_title = e_china_west_governor # Uses martial clothing instead
				has_portrait_property = { layer = 5 index = 1 }
				has_portrait_property = { layer = 5 index = 2 }

				# CK2Plus
				trait = monk
				trait = nun
				trait = desert_father
				trait = desert_mother
				trait = perfecti
			}
		}

		mult_modifier = {
			factor = 100
			song_dynasty_futou_trigger = yes
		}
	}

	# Simple golden band/turban
	4 = {
		factor = 1

		trigger = {
			OR = {
				higher_real_tier_than = BARON
				has_minor_title = title_prince
				any_spouse = { higher_real_tier_than = BARON }
			}

			# Alternative for uncrowned rulers, if using Holy Fury
			trigger_if = {
				limit = {
					OR = {
						higher_real_tier_than = DUKE
						any_spouse = { higher_real_tier_than = DUKE }
					}
				}

				has_dlc = "Holy Fury"
			}

			# Not if crowned
			trigger_if = {
				limit = { has_dlc = "Holy Fury" }

				NOR = {
					AND = {
						higher_real_tier_than = DUKE

						OR = {
							religion = catholic
							religion = fraticelli
						}

						OR = {
							# trait = crowned_by_priest
							# trait = crowned_by_bishop
							trait = crowned_by_pope
							# trait = crowned_by_myself

							# CK2Plus
							trait = crowned
							trait = strong_basileus
							trait = weak_basileus
							trait = crowned_by_relhead
							trait = crowned_by_vip

							trigger_if = {
								limit = { is_alive = no }
								NOT = { trait = uncrowned }
							}
							trigger_else = {
								has_game_started = no
								is_save_game = no
							}
						}
					}

					any_spouse = {
						higher_real_tier_than = DUKE

						OR = {
							religion = catholic
							religion = fraticelli
						}

						OR = {
							# trait = crowned_by_priest
							# trait = crowned_by_bishop
							trait = crowned_by_pope
							# trait = crowned_by_myself

							# CK2Plus
							trait = crowned
							trait = strong_basileus
							trait = weak_basileus
							trait = crowned_by_relhead
							trait = crowned_by_vip

							trigger_if = {
								limit = { is_alive = no }
								NOT = { trait = uncrowned }
							}
							trigger_else = {
								has_game_started = no
								is_save_game = no
							}
						}
					}
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			# Dead Doges should not wear crowns
			trigger_if = {
				limit = { is_republic = yes }
				is_alive = yes
			}

			# French Counts also wear the golden band
			trigger_if = {
				limit = {
					OR = {
						culture = french
						culture = occitan
					}

					has_dlc = "Holy Fury"
				}

				lower_real_tier_than = DUKE

				NOT = {
					any_spouse = {
						higher_real_tier_than = COUNT
					}
				}
			}

			# Wear King-tier crown instead
			trigger_if = {
				limit = {
					is_ruler = yes

					NOR = {
						trait = uncrowned
						religion = catholic
						religion = fraticelli
					}
				}

				OR = {
					lower_real_tier_than = KING

					trigger_if = {
						limit = { is_nomadic = yes }
						population < 5000
					}
				}
			}

			NOR = {
				trait = saint
				trait = peasant_leader
				trait = heresiarch

				# CK2Plus
				trait = monk
				trait = nun
				trait = desert_mother
				trait = desert_father
				trait = perfecti
			}
		}
	}

	# Common headgear 1 - hood
	5 = {
		factor = 1

		trigger = {
			trigger_if = {
				limit = {
					OR = {
						is_ruler = yes
						has_minor_title = title_prince
						is_or_was_offmap_power_ruler = yes

						any_spouse = {
							higher_real_tier_than = COUNT
						}
					}
				}

				OR = {
					trait = peasant_leader
					trait = heresiarch

					# CK2Plus
					trait = druze_uqqal
					trait = druze_ajawid
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				trait = saint
				trait = shieldmaiden
			}

			# Specific rules for French / Occitanian layering
			french_courtier_overlayer_trigger = yes
		}

		mult_modifier = {
			factor = 10

			is_ruler = yes
			is_theocracy = yes
			religion_group = pagan_group
		}

		mult_modifier = {
			factor = 2

			graphical_culture = westernslavicgfx
			is_female = yes
			is_married = no

			OR = {
				culture = pomeranian
				culture = bohemian
				culture = polish
			}
		}

		mult_modifier = {
			factor = 2

			graphical_culture = croatsouthslavicgfx
			culture = croatian
			is_female = yes
			is_married = no
		}

		mult_modifier = {
			factor = 2

			OR = {
				graphical_culture = serbsouthslavicgfx
				graphical_culture = magyargfx
			}

			is_female = yes
			is_married = no

			OR = {
				culture = serbian
				culture = bulgarian
				culture = vlach
				culture = hungarian
			}
		}
	}

	# Common headgear 2 - hood
	6 = {
		factor = 1

		trigger = {
			trigger_if = {
				limit = {
					OR = {
						is_ruler = yes
						has_minor_title = title_prince
						is_or_was_offmap_power_ruler = yes

						any_spouse = {
							higher_real_tier_than = COUNT
						}
					}
				}

				OR = {
					trait = peasant_leader
					trait = heresiarch

					# CK2Plus
					trait = monk
					trait = desert_father
					trait = perfecti
				}
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				trait = saint
				trait = shieldmaiden
			}

			# Specific rules for Frankish / Occitanian layering
			french_courtier_overlayer_trigger = yes
		}

		# modifier = { # Specific rules for Frankish / Occitanian layering
		# 	factor = 0
		#
		# 	has_dlc = "Holy Fury"
		# 	is_female = yes
		#
		# 	OR = {
		# 		culture = french
		# 		culture = occitan
		# 	}
		#
		# 	OR = {
		# 		is_ruler = yes
		# 		any_spouse = { is_ruler = yes }
		# 	}
		#
		# 	trigger_if = {
		# 		limit = { is_married = yes }
		# 		practical_age < 40
		# 	}
		#
		# 	NOT = {
		# 		has_portrait_property = { layer = 3 index = 10 } # Martial gear
		# 	}
		# }

		mult_modifier = {
			factor = 100

			OR = {
				trait = monk
				trait = desert_father
			}
		}

		mult_modifier = {
			factor = 100

			trait = perfecti
			is_female = no
		}
	}

	# Common headgear 3 - Red hat
	7 = {
		factor = 1

		trigger = {
			# Specific rules for French / Occitanian layering
			french_courtier_overlayer_trigger = yes

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			trigger_if = {
				limit = {
					OR = {
						NOT = { religion = orthodox }
						is_ruler = yes
						has_minor_title = title_prince
						is_or_was_offmap_power_ruler = yes

						any_spouse = {
							higher_real_tier_than = COUNT
						}
					}
				}

				OR = {
					trait = peasant_leader
					trait = heresiarch
				}
			}

			NOR = {
				trait = shieldmaiden
				trait = saint
			}
		}

		# modifier = { # Specific rules for French / Occitanian layering
		# 	factor = 0
		#
		# 	has_dlc = "Holy Fury"
		# 	is_female = yes
		#
		# 	OR = {
		# 		culture = french
		# 		culture = occitan
		# 	}
		#
		# 	OR = {
		# 		is_ruler = yes
		# 		spouse = { is_ruler = yes }
		# 	}
		#
		# 	trigger_if = {
		# 		limit = { is_married = yes }
		# 		practical_age < 40
		# 	}
		#
		# 	NOT = {
		# 		has_portrait_property = { layer = 3 index = 10 } # Martial gear
		# 	}
		# }
	}

	# Common headgear 4 - hood
	8 = {
		factor = 1

		trigger = {
			# Specific rules for French / Occitanian layering
			french_courtier_overlayer_trigger = yes

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			trigger_if = {
				limit = {
					OR = {
						is_ruler = yes
						has_minor_title = title_prince
						is_or_was_offmap_power_ruler = yes

						any_spouse = {
							higher_real_tier_than = COUNT
						}
					}
				}

				OR = {
					trait = peasant_leader
					trait = heresiarch

					# CK2Plus
					trait = nun
					trait = desert_mother
					trait = perfecti
				}
			}

			trigger_if = {
				limit = {
					is_female = yes
					is_married = yes
				}

				NAND = {
					graphical_culture = westernslavicgfx

					OR = {
						culture = pomeranian
						culture = bohemian
						culture = polish
					}
				}

				NAND = {
					graphical_culture = croatsouthslavicgfx
					culture = croatian
				}

				NAND = {
					OR = {
						graphical_culture = serbsouthslavicgfx
						graphical_culture = magyargfx
					}

					OR = {
						culture = serbian
						culture = bulgarian
						culture = vlach
						culture = hungarian
					}
				}
			}

			NOR = {
				trait = shieldmaiden
				trait = saint
			}
		}

		mult_modifier = {
			factor = 2

			graphical_culture = westernslavicgfx

			OR = {
				culture = pomeranian
				culture = bohemian
				culture = polish
			}

			is_female = yes
			is_married = no
		}

		mult_modifier = {
			factor = 2

			graphical_culture = croatsouthslavicgfx
			culture = croatian
			is_female = yes
			is_married = no
		}

		mult_modifier = {
			factor = 2

			OR = {
				graphical_culture = serbsouthslavicgfx
				graphical_culture = magyargfx
			}

			OR = {
				culture = serbian
				culture = bulgarian
				culture = vlach
				culture = hungarian
			}

			is_female = yes
			is_married = no
		}

		# modifier = { # Specific rules for French / Occitanian layering
		# 	factor = 0
		#
		# 	has_dlc = "Holy Fury"
		# 	is_female = yes
		#
		# 	OR = {
		# 		culture = french
		# 		culture = occitan
		# 	}
		#
		# 	OR = {
		# 		is_ruler = yes
		# 		spouse = { is_ruler = yes }
		# 	}
		#
		# 	trigger_if = {
		# 		limit = { is_married = yes }
		# 		practical_age < 40
		# 	}
		#
		# 	NOT = {
		# 		has_portrait_property = { layer = 3 index = 10 } # Martial gear
		# 	}
		# }

		# CK2Plus
		mult_modifier = {
			factor = 100

			OR = {
				trait = nun
				trait = desert_mother
			}
		}

		mult_modifier = {
			factor = 100

			trait = perfecti
			is_female = yes
		}
	}

	# Shady headgear
	9 = {
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		factor = 3

		trigger = {
			OR = {
				has_job_title = job_spymaster

				AND = {
					lower_real_tier_than = DUKE
					intrigue >= 10
				}
			}

			trigger_if = {
				limit = { is_landed = yes }
				lower_real_tier_than = DUKE
			}
			trigger_else = {
				lower_real_tier_than = KING
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				any_spouse = {
					higher_real_tier_than = DUKE
				}

				trait = saint
			}
		}
	}

	# Martial headgear
	10 = {
		factor = 100

		trigger = {
			has_portrait_property = { layer = 3 index = 10 } # Martial gear

			trigger_if = {
				limit = { trait = shieldmaiden }

				in_command = yes

				has_game_rule = {
					name = martial_headgear
					value = on
				}
			}

			NOT = { government = order_government } # Holy Orders in peace time should wear martial clothes, but not the helmet
			mercenary = no
			NOT = { trait = saint }
		}
	}

	# Blank
	11 = {
		factor = 3

		trigger = {
			OR = {
				trait = saint
				is_republic = yes
				government = order_government

				NOR = {
					higher_real_tier_than = COUNT
					has_minor_title = title_prince

					any_spouse = {
						higher_real_tier_than = COUNT
						is_republic = no
					}
				}
			}

			trigger_if = {
				limit = {
					in_command = yes

					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}

				trait = saint
			}
		}

		mult_modifier = {
			factor = 20000
			trait = saint
		}

		mult_modifier = {
			factor = 20000

			trait = shieldmaiden

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}

		mult_modifier = {
			factor = 20000

			# Holy Orders in peace time should wear martial clothes, but not the helmet
			government = order_government
		}

		mult_modifier = {
			factor = 4

			graphical_culture = westernslavicgfx

			OR = {
				culture = pomeranian
				culture = bohemian
				culture = polish
			}

			is_female = yes
			is_married = no
		}

		mult_modifier = {
			factor = 4

			graphical_culture = croatsouthslavicgfx
			culture = croatian
			is_female = yes
			is_married = no
		}

		mult_modifier = {
			factor = 4

			OR = {
				graphical_culture = serbsouthslavicgfx
				graphical_culture = magyargfx
			}

			OR = {
				culture = serbian
				culture = bulgarian
				culture = vlach
				culture = hungarian
			}

			is_female = yes
			is_married = no
		}
	}

	# Chinese Martial Extension 1
	12 = {
		factor = 100

		trigger = {
			has_portrait_property = { layer = 3 index = 12 }
			NOT = { trait = saint }
		}
	}

	# Chinese Martial Extension 2
	13 = {
		factor = 100

		trigger = {
			has_portrait_property = { layer = 3 index = 13 }
			NOT = { trait = saint }
		}
	}

	# Chinese Martial Extension 3
	14 = {
		factor = 100

		trigger = {
			has_portrait_property = { layer = 3 index = 14 }
			NOT = { trait = saint }
		}
	}
}

# p6 imprisoned
6 = {
	0 = { # blank
		factor = 100

		trigger = {
			prisoner = no
		}
	}

	1 = { # prisoner
		factor = 100

		trigger = {
			prisoner = yes
		}

		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked
	}
}

# p7 scars - Tier I
7 = {
	0 = { # blank
		factor = 100

		trigger = {
			trigger_if = {
				limit = {
					OR = {
						trait = scarred
						trait = scarred_female
					}
				}

				NOR = {
					trait = scarred_type_1
					trait = scarred_type_2
					trait = scarred_type_3
					trait = scarred_type_4
					trait = scarred_type_5
					trait = scarred_type_6
					trait = scarred_type_7
					trait = scarred_type_8
					trait = scarred_type_9
					trait = scarred_type_10
				}
			}
		}
   	}

	1 = { # scar 1 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_1

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	2 = { # scar 2 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_2

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	3 = { # scar 3 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_3

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	4 = { # scar 4 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_4

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	5 = { # scar 5 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_5

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	6 = { # scar 6 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_6

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	7 = { # scar 7 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_7

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	8 = { # scar 8 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_8

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	9 = { # scar 9 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_9

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}

	10 = { # scar 10 - TIER I
		factor = 1

		trigger = {
			trait = scarred_type_10

			OR = {
				trait = scarred
				trait = scarred_female
			}

			NOR = {
				trait = scarred_mid
				trait = scarred_high
			}
		}
   	}
}

# p8 red dots
8 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOR = {
				trait = measles
				trait = smallpox
			}
		}
 	}

	1 = { # red dots
		factor = 100

		trigger = {
			OR  = {
				trait = measles
				trait = smallpox
			}
		}
  	}
}

# p9 boils
9 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOT = { trait = bubonic_plague }
		}
 	}

	1 = { # boils
		factor = 100

		trigger = {
			trait = bubonic_plague
		}
 	}
}

# p10 blinded
10 = {
	0 = {
		factor = 100

		trigger = {
			NOT = { trait = blinded }
		}
	}

	1 =  {
		factor = 100

		trigger = {
			trait = blinded
		}
	}
}

# p11 player
11 = {
	0 = { # blank
		factor = 100

		trigger = {
			trigger_if = {
				limit = { ai = no }
				multiplayer = no
			}
		}
	}

	1 = { # player
		factor = 100

		trigger = {
			ai = no
			multiplayer = yes
		}
	}
}

# p12 mask for the disfigured
12 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}
		}
	}

	1 = { # mask 1 bone
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			OR = {
				is_tribal = yes
				is_nomadic = yes
				religion_group = pagan_group
			}

			NOT = { has_character_modifier = golden_mask }
		}
	}

	2 = { # mask 2 silver
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			is_tribal = no
			is_nomadic = no

			trigger_if = {
				limit = { is_landed = no }

				is_married = yes

				any_spouse = {
					higher_real_tier_than = DUKE
				}
			}
			trigger_else = {
				higher_real_tier_than = DUKE
			}

			NOR = {
				religion_group = pagan_group
				has_character_modifier = golden_mask
				culture = mande
				culture = maghreb_arabic

				# CK2Plus
				culture_group = amazigh
				culture_group = maghrebi
			}
		}
	}

	3 = { # mask 3 iron
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			is_tribal = no
			is_nomadic = no

			trigger_if = {
				limit = { is_landed = yes }
				lower_real_tier_than = KING
			}
			trigger_else_if = {
				limit = { is_married = yes }

				NOT = {
					any_spouse = {
						higher_real_tier_than = DUKE
					}
				}
			}

			NOR = {
				religion_group = pagan_group
				has_character_modifier = golden_mask
			}
		}
	}

	4 = { # mask 4 bone - blue stripes
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			trigger_if = {
				limit = { trait = disfigured }

				OR = {
					is_tribal = yes
					is_nomadic = yes
					religion_group = pagan_group
				}
			}

			NOT = { has_character_modifier = golden_mask }
		}
	}

	5 = { # mask 5 bone - orange stripes
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			trigger_if = {
				limit = { trait = disfigured }

				OR = {
					is_tribal = yes
					is_nomadic = yes
					religion_group = pagan_group
				}
			}

			NOT = { has_character_modifier = golden_mask }
		}
	}

	6 = { # mask 6 bone - red dots
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			OR = {
				religion_openly_west_african_or_reformed_trigger = yes
				culture = mande
				culture_group = east_african
			}

			OR = {
				is_tribal = yes
				is_nomadic = yes
			}

			NOT = { has_character_modifier = golden_mask }

		}
	}

	7 = { # mask 7 bone - black stripes
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			OR = {
				religion_openly_west_african_or_reformed_trigger = yes
				culture = mande
				culture_group = east_african
			}

			OR = {
				is_tribal = yes
				is_nomadic = yes
			}

			NOT = { has_character_modifier = golden_mask }
		}
	}

	8 = { # mask 8 bone - red stripes/eyes
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			trigger_if = {
				limit = { trait = disfigured }

				OR = {
					is_tribal = yes
					is_nomadic = yes
					religion_group = pagan_group
				}
			}

			NOT = { has_character_modifier = golden_mask }
		}
	}

	9 = { # mask 9 bone - black eyes/lightning
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			trigger_if = {
				limit = { trait = disfigured }

				OR = {
					is_tribal = yes
					is_nomadic = yes
					religion_group = pagan_group
				}
			}

			NOT = { has_character_modifier = golden_mask }
		}
	}

	10 = { # mask 10 - decorated silver
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			trigger_if = {
				limit = { is_landed = no }

				is_married = yes

				any_spouse = {
					higher_real_tier_than = DUKE
				}
			}
			trigger_else = {
				higher_real_tier_than = DUKE
			}

			is_tribal = no
			is_nomadic = no

			NOR = {
				religion_group = pagan_group
				has_character_modifier = golden_mask
				culture = mande
				culture = maghreb_arabic

				# CK2Plus
				culture_group = amazigh
				culture_group = maghrebi
			}
		}
	}

	11 = { # mask 11 - decorated gold
		factor = 2

		trigger = {
			trigger_if = {
				limit = {
					NOT = { has_character_modifier = golden_mask }
				}

				OR = {
					trait = disfigured
					has_character_modifier = attending_masquerade
					has_character_modifier = forced_mask
				}

				OR = {
					trait = greedy
					trait = proud
					trait = ambitious
					trait = envious
					culture = mande
					culture = maghreb_arabic

					# CK2Plus
					culture_group = amazigh
					culture_group = maghrebi
				}

				trigger_if = {
					limit = { is_landed = no }

					is_married = yes

					any_spouse = {
						higher_real_tier_than = DUKE
					}
				}
				trigger_else = {
					higher_real_tier_than = DUKE
				}

				is_tribal = no
				is_nomadic = no
				NOT = { religion_group = pagan_group }
			}
		}

		mult_modifier = {
			factor = 5
			has_landed_title = k_papacy
		}

		mult_modifier = {
			factor = 1000
			has_character_modifier = golden_mask
		}
	}

	12 = { # mask 12 - full mask 1 leather
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			trigger_if = {
				limit = { is_landed = no }

				is_married = yes

				any_spouse = {
					higher_real_tier_than = DUKE
				}
			}
			trigger_else = {
				higher_real_tier_than = DUKE
			}

			NOR = {
				religion_group = pagan_group
				has_character_modifier = golden_mask
			}
		}
	}

	13 = { # mask 13 - full mask 2 bone
		factor = 1

		trigger = {
			OR = {
				trait = disfigured
				has_character_modifier = attending_masquerade
				has_character_modifier = forced_mask
			}

			trigger_if = {
				limit = { is_landed = no }

				is_married = yes

				any_spouse = {
					higher_real_tier_than = DUKE
				}
			}
			trigger_else = {
				higher_real_tier_than = DUKE
			}

			NOR = {
				religion_group = pagan_group
				has_character_modifier = golden_mask
			}
		}
	}
}

# p13 eyepatch for one_eyed
13 = {
	0 = { # blank
		factor = 100

		trigger = {
			trigger_if = {
				limit = { trait = one_eyed }
				has_character_modifier = glass_eye
			}
		}
	}

	1 = { # eyepatch 1
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { has_character_modifier = glass_eye }
		}
	}

	2 = { # eyepatch 2 - red leather
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { has_character_modifier = glass_eye }
		}
	}

	3 = { # eyepatch 3 - painted eye
		factor = 2

		trigger = {
			trait = one_eyed

			OR = {
				trait = paranoid
				trait = possessed
			}

			NOT = { has_character_modifier = glass_eye }
		}
	}

	4 = { # eyepatch 4 - red
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { has_character_modifier = glass_eye }
		}
	}

	5 = { # eyepatch 5 - white rag
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { has_character_modifier = glass_eye }
		}

		mult_modifier = {
			factor = 3

			is_theocracy = yes
			religion = catholic
		}
	}

	6 = { # eyepatch 6 - blue rag
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { has_character_modifier = glass_eye }
		}

		mult_modifier = {
			factor = 2
			religion_openly_tengri_or_reformed_trigger = yes
		}
	}

	7 = { # eyepatch 7 - green rag
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { has_character_modifier = glass_eye }
		}

		mult_modifier = {
			factor = 2
			religion_group = muslim
		}
	}

	8 = { # eyepatch 8 - red rag
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { has_character_modifier = glass_eye }
		}
	}

	9 = { # eyepatch 9 - bloodied rag
		factor = 1

		trigger = {
			trait = one_eyed

			OR = {
				trait = wroth
				trait = cruel
				has_minor_title = title_commander
			}

			NOT = { has_character_modifier = glass_eye }
		}

		mult_modifier = {
			factor = 2

			OR = {
				trait = wroth
				trait = cruel
				has_minor_title = title_commander
			}
		}

		mult_modifier = {
			factor = 2
			martial >= 12
		}
	}

	10 = { # eyepatch 10 - tartan rag
		factor = 3

		trigger = {
			trait = one_eyed
			culture_group = celtic
			NOT = { has_character_modifier = glass_eye }
		}
	}

	11 = { # eyepatch 11 - scarred eye 1
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { trait = shy }
		}

		mult_modifier = {
			factor = 4

			OR = {
				is_tribal = yes
				is_nomadic = yes
				trait = stubborn
			}
		}
	}

	12 = { # eyepatch 12 - scarred eye 2
		factor = 1

		trigger = {
			trait = one_eyed
			NOT = { trait = shy }
		}

		mult_modifier = {
			factor = 4

			OR = {
				is_tribal = yes
				is_nomadic = yes
				trait = stubborn
			}
		}
	}
}

# p14 chinese makeup
14 = {
	0 = { # blank
		factor = 100

		trigger = {
			chinese_makeup_trigger = no
		}
	}

	1 = { # white powder
		factor = 1
	}

	2 = { # rouge a only
		factor = 1
	}

	3 = { # white powder and rouge a
		factor = 1
	}

	4 = { # rouge b only
		factor = 1
	}

	5 = { # white powder and rouge b
		factor = 1
	}
}

# p15 chinese makeup 2
15 = {
	0 = { # blank
		factor = 100

		trigger = {
			chinese_makeup_trigger = no
		}
	}

	1 = { # full lips
		factor = 1
	}

	2 = { # top lip
		factor = 1
	}

	3 = { # 'heart' lips
		factor = 1
	}
}

# p16 chinese empress jewelry
16 = {
	0 = { # blank
		factor = 100

		trigger = {
			chinese_empress_jewelry_trigger = no
		}
	}

	1 = { # Full face pearls and earrings
		factor = 1
	}

	2 = { # pearl earrings only
		factor = 1
	}

	3 = { # full face pearls and earrings 2
		factor = 1
	}
}

# p17 immortality
17 = {
	0 = { # blank
		factor = 100

		trigger = {
			immortal = no
		}
	}

	1 = {
		factor = 100
	}
}

# p18 Special crowns_behind
18 = {
	0 = { # blank
		factor = 100

		trigger = {
			# Has to wear helmet instead
			trigger_if = {
				limit = {
					OR = {
						# Dead kings don't have artifacts
						trait = dead_crown_hre
						trait = dead_crown_byzantine
						trait = dead_crown_pahlavi
						trait = dead_crown_fylkir
						trait = dead_crown_tengri_fylkir
						trait = dead_crown_finnish_fylkir
						trait = dead_crown_slavic_fylkir
						trait = dead_crown_romuva_fylkir
						trait = dead_crown_zun_fylkir
						trait = dead_crown_west_african_fylkir
						trait = dead_crown_aztec_fylkir
						trait = augustus # Laurels
						trait = dead_iron_crown_lombardy

						any_artifact = {
							OR = {
								artifact_type = crown_hre
								artifact_type = crown_byzantine
								artifact_type = crown_pahlavi
								artifact_type = crown_fylkir
								artifact_type = crown_tengri_fylkir
								artifact_type = crown_finnish_fylkir
								artifact_type = crown_slavic_fylkir
								artifact_type = crown_romuva_fylkir
								artifact_type = crown_zun_fylkir
								artifact_type = crown_west_african_fylkir
								artifact_type = crown_aztec_fylkir
								artifact_type = iron_crown_of_lombardy
								artifact_type = cursed_diamond_crown
							}

							is_artifact_equipped = yes
						}
					}
				}

				in_command = yes

				has_game_rule = {
					name = martial_headgear
					value = on
				}
			}

			NOR = {
				has_minor_title = title_cardinal
				has_minor_title = title_fraticelli_cardinal
			}
		}
	}

	1 = {
		factor = 1

		trigger = { # Makes it so the two layers are always matched (if conditions for p19/frame1 are true, use p18/frame1)
			has_portrait_property = { layer = 19 index = 1 }
		}
	}

	2 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 2 }
		}
	}

	3 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 3 }
		}
	}

	4 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 4 }
		}
	}

	5 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 5 }
		}
	}

	6 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 6 }
		}
	}

	7 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 7 }
		}
	}

	8 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 8 }
		}
	}

	9 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 9 }
		}
	}

	10 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 10 }
		}
	}

	11 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 11 }
		}
	}

	12 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 12 }
		}
	}

	13 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 13 }
		}
	}

	14 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 14 }
		}
	}

	15 = {
		factor = 1

		trigger = {
			has_portrait_property = { layer = 19 index = 15 }
		}
	}
}

# p19 Special crowns
19 = {
	0 = { # blank
		factor = 100

		trigger = {
			# Has to wear helmet instead
			trigger_if = {
				limit = {
					OR = {
						# Dead kings don't have artifacts
						trait = dead_crown_hre
						trait = dead_crown_byzantine
						trait = dead_crown_pahlavi
						trait = dead_crown_fylkir
						trait = dead_crown_tengri_fylkir
						trait = dead_crown_finnish_fylkir
						trait = dead_crown_slavic_fylkir
						trait = dead_crown_romuva_fylkir
						trait = dead_crown_zun_fylkir
						trait = dead_crown_west_african_fylkir
						trait = dead_crown_aztec_fylkir
						trait = augustus # Laurels
						trait = dead_iron_crown_lombardy

						any_artifact = {
							OR = {
								artifact_type = crown_hre
								artifact_type = crown_byzantine
								artifact_type = crown_pahlavi
								artifact_type = crown_fylkir
								artifact_type = crown_tengri_fylkir
								artifact_type = crown_finnish_fylkir
								artifact_type = crown_slavic_fylkir
								artifact_type = crown_romuva_fylkir
								artifact_type = crown_zun_fylkir
								artifact_type = crown_west_african_fylkir
								artifact_type = crown_aztec_fylkir
								artifact_type = iron_crown_of_lombardy
								artifact_type = cursed_diamond_crown
							}

							is_artifact_equipped = yes
						}
					}
				}

				in_command = yes

				has_game_rule = {
					name = martial_headgear
					value = on
				}
			}

			NOR = {
				has_minor_title = title_cardinal
				has_minor_title = title_fraticelli_cardinal
			}
		}
	}

	1 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # HRE crown
			OR = {
				any_artifact = {
					artifact_type = crown_hre
					is_artifact_equipped = yes
				}

				trait = dead_crown_hre
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	2 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Byzantine crown
			OR = {
				any_artifact = {
					artifact_type = crown_byzantine
					is_artifact_equipped = yes
				}

				trait = dead_crown_byzantine
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	3 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Cursed Diamond Crown
			OR = {
				any_artifact = {
					artifact_type = cursed_diamond_crown
					is_artifact_equipped = yes
				}

				trait = dead_cursed_diamond_crown
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	4 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Iron Crown of Lombardy
			OR = {
				any_artifact = {
					artifact_type = iron_crown_of_lombardy
					is_artifact_equipped = yes
				}

				trait = dead_iron_crown_lombardy
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	5 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = {
			trait = augustus # Imperial Laurels

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	6 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Pahlavi crown
			OR = {
				any_artifact = {
					artifact_type = crown_pahlavi
					is_artifact_equipped = yes
				}

				trait = dead_crown_pahlavi
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	7 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Fylkir crown
			OR = {
				any_artifact = {
					artifact_type = crown_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_crown_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	8 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Tengri Fylkir crown
			OR = {
				any_artifact = {
					artifact_type = crown_tengri_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_crown_tengri_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	9 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Finnish Fylkir crown
			OR = {
				any_artifact = {
					artifact_type = crown_finnish_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_crown_finnish_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	10 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # West-African Fylkir crown
			OR = {
				any_artifact = {
					artifact_type = crown_west_african_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_crown_west_african_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	11 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Slavic/Romva Fylkir crown
			OR = {
				any_artifact = {
					artifact_type = crown_slavic_fylkir
					is_artifact_equipped = yes
				}
				any_artifact = {
					artifact_type = crown_romuva_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_crown_slavic_fylkir
				trait = dead_crown_romuva_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	12 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Zunist Fylkir crown
			OR = {
				any_artifact = {
					artifact_type = crown_zun_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_crown_zun_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	13 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Aztec Fylkir crown
			OR = {
				any_artifact = {
					artifact_type = crown_aztec_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_crown_aztec_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	14 = {
		factor = 100

		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = {
			OR = {
				has_minor_title = title_cardinal
				has_minor_title = title_fraticelli_cardinal
			}

			year < 1245
		}
	}

	15 = {
		factor = 100

		hide_layers = { 3 = { } } # Hide layer 3 (clothes) when this frame is picked
		hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = {
			OR = {
				has_minor_title = title_cardinal
				has_minor_title = title_fraticelli_cardinal
			}

			year >= 1245
		}
	}
}

# p20 freckles
# Freckles traits from thinnest to thickest:
# freckles_3
# freckles_2
# freckles
# freckles_4
# freckles_5
20 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOR = {
				trait = freckles_3
				trait = freckles_2
				trait = freckles
				trait = freckles_4
				trait = freckles_5
			}
		}
 	}

	1 = { # freckles
		factor = 100

		trigger = {
			trait = freckles
		}
  	}
	2 = { # freckles
		factor = 100

		trigger = {
			trait = freckles_2
		}
  	}
	3 = { # freckles
		factor = 100

		trigger = {
			trait = freckles_3
		}
  	}
	4 = { # freckles
		factor = 100

		trigger = {
			trait = freckles_4
		}
  	}
	5 = { # freckles
		factor = 100

		trigger = {
			trait = freckles_5
		}
  	}
}

# p21 physique
21 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOR = {
				trait = fat
				trait = sturdy
			}
		}
 	}

	1 = {
		factor = 100

		trigger = {
			trait = sturdy
			practical_age < 30
			NOT = { trait = fat }
		}
  	}

	2 = {
		factor = 100

		trigger = {
			trait = sturdy
			practical_age >= 30
			practical_age < 50
			NOT = { trait = fat }
		}
  	}

	3 = {
		factor = 100

		trigger = {
			trait = sturdy
			practical_age >= 50
			NOT = { trait = fat }
		}
  	}

	4 = {
		factor = 100

		trigger = {
			trait = fat
			practical_age < 30
		}
  	}

	5 = {
		factor = 100

		trigger = {
			trait = fat
			practical_age >= 30
			practical_age < 50
		}
  	}

	6 = {
		factor = 100

		trigger = {
			trait = fat
			practical_age >= 50
		}
  	}
}

#p22 malnourished
22 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOR = {
				trait = ill
				trait = malnourished
			}
		}
 	}

	1 = { # pale
		factor = 100

		trigger = {
			OR = {
				trait = ill
				trait = malnourished
			}
		}
  	}
}

#p23 black eye
23 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOR = {
				has_character_modifier = black_eye
				has_character_modifier = concussion
				trait = wounded
			}
		}
 	}

	1 = { # black eye
		factor = 100

		trigger = {
			has_character_modifier = black_eye
			NOT = { has_character_modifier = concussion }
		}
  	}

	2 = { # concussion
		factor = 100

		trigger = {
			OR = {
				trait = wounded
				has_character_modifier = concussion
			}

			NOT = { has_character_modifier = black_eye }
		}
  	}

	3 = { # concussion AND black eye
		factor = 100

		trigger = {
			has_character_modifier = black_eye

			OR = {
				trait = wounded
				has_character_modifier = concussion
			}
		}
  	}
}

#p24 harelip
24 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOT = { trait = harelip }
		}
 	}

	1 = { # black eye
		factor = 100

		trigger = {
			trait = harelip
		}
  	}
}

# To add new set of scars, add new _type_ hidden trait, edit the scar-assignment scripted effect, add entries in portrait properties, add new frame and ALL THREE tiers (regular, _mid, and _high).
# p25 mid scars - Tier II
25 = {
	0 = { # blank
		factor = 100

		trigger = {
			trigger_if = {
				limit = {
					trait = scarred_mid

					OR = {
						trait = scarred_type_1
						trait = scarred_type_2
						trait = scarred_type_3
						trait = scarred_type_4
						trait = scarred_type_5
						trait = scarred_type_6
						trait = scarred_type_7
						trait = scarred_type_8
						trait = scarred_type_9
						trait = scarred_type_10
					}
				}

				has_dlc = "Holy Fury"
			}
		}
   	}

	1 = { # scar 1 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_1
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	2 = { # scar 2 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_2
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	3 = { # scar 3 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_3
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	4 = { # scar 4 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_4
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	5 = { # scar 5 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_5
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	6 = { # scar 6 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_6
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	7 = { # scar 7 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_7
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	8 = { # scar 8 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_8
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	9 = { # scar 9 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_9
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}

	10 = { # scar 10 - TIER II
		factor = 1

		trigger = {
			trait = scarred_type_10
			trait = scarred_mid

			NOR = {
				trait = scarred
				trait = scarred_high
			}
		}
   	}
}

# p26 high scars - Tier III
26 = {
	0 = { # blank
		factor = 100

		trigger = {
			trigger_if = {
				limit = {
					trait = scarred_high

					OR = {
						trait = scarred_type_1
						trait = scarred_type_2
						trait = scarred_type_3
						trait = scarred_type_4
						trait = scarred_type_5
						trait = scarred_type_6
						trait = scarred_type_7
						trait = scarred_type_8
						trait = scarred_type_9
						trait = scarred_type_10
					}
				}

				has_dlc = "Holy Fury"
			}
		}
   	}

	1 = { # scar 1 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_1
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	2 = { # scar 2 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_2
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	3 = { # scar 3 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_3
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	4 = { # scar 4 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_4
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	5 = { # scar 5 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_5
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	6 = { # scar 6 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_6
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	7 = { # scar 7 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_7
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	8 = { # scar 8 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_8
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	9 = { # scar 9 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_9
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}

	10 = { # scar 10 - TIER III
		factor = 100

		trigger = {
			trait = scarred_type_10
			trait = scarred_high

			NOR = {
				trait = scarred
				trait = scarred_mid
			}
		}
   	}
}

#p27 Blood Splatter
27 = {
	0 = { # blank
		factor = 100

		trigger = {
			trigger_if = {
				limit = {
					OR = {
						has_character_modifier = blood_splatter_1
						has_character_modifier = blood_splatter_2
						has_character_modifier = blood_splatter_3
						has_character_modifier = mud_splatter
					}
				}

				has_game_rule = {
					name = blood_splatter_rule
					value = off
				}
   			}
		}
 	}

	1 = { # Some
		factor = 100

		trigger = {
			has_character_modifier = blood_splatter_1

			has_game_rule = {
   				name = blood_splatter_rule
				value = on
   			}
		}
  	}

	2 = { # A lot
		factor = 100

		trigger = {
			has_character_modifier = blood_splatter_2

			has_game_rule = {
   				name = blood_splatter_rule
				value = on
   			}
		}
  	}

	3 = { # Bathory
		factor = 100

		trigger = {
			has_character_modifier = blood_splatter_3

			has_game_rule = {
   				name = blood_splatter_rule
				value = on
   			}
		}
  	}

	4 = { # Mud splatter
		factor = 100

		trigger = {
			has_character_modifier = mud_splatter

			has_game_rule = {
   				name = blood_splatter_rule
				value = on
   			}

			# Prioritize blood
			NOR = {
				has_character_modifier = blood_splatter_1
				has_character_modifier = blood_splatter_2
				has_character_modifier = blood_splatter_3
			}
		}
  	}
}

#p28 Tattoos
28 = {
	0 = { # blank
		factor = 1
 	}

	1 = {
		factor = 100

		trigger = {
			trait = african_tattoo_1
		}
  	}

	2 = {
		factor = 100

		trigger = {
			trait = african_tattoo_2
		}
  	}

	3 = {
		factor = 100

		trigger = {
			trait = african_tattoo_3
		}
  	}

	4 = {
		factor = 100

		trigger = {
			trait = african_tattoo_4
		}
  	}

	5 = {
		factor = 100

		trigger = {
			trait = african_tattoo_5
		}
  	}

	6 = {
		factor = 100

		trigger = {
			trait = african_tattoo_6
		}
  	}

	7 = {
		factor = 100

		trigger = {
			trait = african_tattoo_7
		}
  	}

	8 = {
		factor = 100

		trigger = {
			trait = african_tattoo_8
		}
  	}

	9 = {
		factor = 100

		trigger = {
			trait = norse_tattoo_1
		}
  	}

	10 = {
		factor = 100

		trigger = {
			trait = norse_tattoo_2
		}
  	}

	11 = {
		factor = 100

		trigger = {
			trait = norse_tattoo_3
		}
  	}

	12 = {
		factor = 100

		trigger = {
			trait = norse_tattoo_4
		}
  	}

	13 = {
		factor = 100

		trigger = {
			trait = norse_tattoo_5
		}
  	}

	14 = {
		factor = 100

		trigger = {
			trait = norse_tattoo_6
		}
  	}

	15 = {
		factor = 100

		trigger = {
			trait = slavic_tattoo_1
		}
  	}

	16 = {
		factor = 100

		trigger = {
			trait = slavic_tattoo_2
		}
  	}

	17 = {
		factor = 100

		trigger = {
			trait = slavic_tattoo_3
		}
  	}

	18 = {
		factor = 100

		trigger = {
			trait = slavic_tattoo_4
		}
  	}

	19 = {
		factor = 100

		trigger = {
			trait = slavic_tattoo_5
		}
  	}

	20 = {
		factor = 100

		trigger = {
			trait = slavic_tattoo_6
		}
  	}

	21 = {
		factor = 100

		trigger = {
			trait = african_tattoo_9
		}
  	}

	22 = {
		factor = 100

		trigger = {
			trait = african_tattoo_10
		}
  	}

	23 = {
		factor = 100

		trigger = {
			trait = african_tattoo_11
		}
  	}

	24 = {
		factor = 100

		trigger = {
			trait = african_tattoo_12
		}
  	}
}

#p29 Warpaint
29 = {
	0 = { # blank
		factor = 1
 	}

	1 = {
		factor = 100

		trigger = {
			has_character_modifier = aztec_warpaint_1
		}
  	}

	2 = {
		factor = 100

		trigger = {
			has_character_modifier = aztec_warpaint_2
		}
  	}

	3 = {
		factor = 100

		trigger = {
			has_character_modifier = finnish_warpaint_1
		}
  	}

	4 = {
		factor = 100

		trigger = {
			has_character_modifier = finnish_warpaint_2
		}
  	}

	5 = {
		factor = 100

		trigger = {
			has_character_modifier = zun_warpaint_1
		}
  	}

	6 = {
		factor = 100

		trigger = {
			has_character_modifier = zun_warpaint_2
		}
  	}

	7 = {
		factor = 100

		trigger = {
			has_character_modifier = tengri_warpaint_1
		}
  	}

	8 = {
		factor = 100

		trigger = {
			has_character_modifier = tengri_warpaint_2
		}
  	}
}

#p30 Demon Child (fantasy only)
30 = {
	0 = { # blank
		factor = 1
 	}

	1 = {
		factor = 100

		trigger = {
			has_character_modifier = demon_horns

			has_game_rule = {
				name = supernatural_events
				value = unrestricted
			}
		}
  	}
}

#p31 French Culture Overlayer - Male
31 = {
	0 = { # Blank
		factor = 100

		trigger = {
			OR = {
				has_game_started = no
				is_in_society = yes
				is_theocracy = yes
				is_merchant_republic = yes
				has_job_title = job_spiritual
				french_overlayer_special_crown_trigger = yes

				NOR = {
					# has_portrait_property = { layer = 5 index = 0 }
					# has_portrait_property = { layer = 5 index = 1 }
					# has_portrait_property = { layer = 5 index = 2 }
					# has_portrait_property = { layer = 5 index = 3 }
					# has_portrait_property = { layer = 5 index = 4 }
					# has_portrait_property = { layer = 5 index = 10 }
					french_martial_overlayer_trigger = yes
					french_count_overlayer_trigger = yes
					french_duke_overlayer_trigger = yes
				}
			}
		}
	}

	1 = { # Military Helm 01
		factor = 100

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	2 = { # Military Helm 02
		factor = 1

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	3 = { # Military Helm 03
		factor = 1

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	4 = { # Military Helm 04
		factor = 1

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	5 = { # Count Accessories
		factor = 1

		trigger = {
			french_count_overlayer_trigger = yes
			lower_real_tier_than = DUKE

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	6 = { # Count Accessories
		factor = 1

		trigger = {
			french_count_overlayer_trigger = yes
			lower_real_tier_than = DUKE

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	7 = { # Count Accessories
		factor = 1

		trigger = {
			french_count_overlayer_trigger = yes
			lower_real_tier_than = DUKE

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	8 = { # Count Accessories
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_count_overlayer_trigger = yes
			lower_real_tier_than = DUKE

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	9 = { # Count Accessories
		factor = 1

		trigger = {
			french_count_overlayer_trigger = yes
			lower_real_tier_than = DUKE

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	10 = { # Duke Accessories
		factor = 1

		trigger = {
			french_duke_overlayer_trigger = yes

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	11 = { # Duke Accessories
		factor = 1

		trigger = {
			french_duke_overlayer_trigger = yes

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	12 = { # Duke Accessories
		factor = 1

		trigger = {
			french_duke_overlayer_trigger = yes

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	13 = { # Duke Accessories
		factor = 1

		trigger = {
			french_duke_overlayer_trigger = yes

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	14 = { # Duke Accessories
		factor = 1

		trigger = {
			french_duke_overlayer_trigger = yes

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}
}

#p32 French Culture Overlayer - Female
32 = {
	0 = { # Blank
	factor = 100
		trigger = {
			OR = {
				has_game_started = no
				is_in_society = yes
				is_theocracy = yes
				is_merchant_republic = yes
				has_job_title = job_spiritual
				french_overlayer_special_crown_trigger = yes

				NOR = {
					# has_portrait_property = { layer = 5 index = 0 }
					# has_portrait_property = { layer = 5 index = 1 }
					# has_portrait_property = { layer = 5 index = 2 }
					# has_portrait_property = { layer = 5 index = 3 }
					# has_portrait_property = { layer = 5 index = 4 }
					# has_portrait_property = { layer = 5 index = 10 }
					french_martial_overlayer_trigger = yes
					french_duchess_overlayer_trigger = yes
					french_countess_overlayer_trigger = yes
					french_courtier_overlayer_trigger = yes
				}
			}
		}
	}

	1 = { # Military Helm 01
		factor = 1

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	2 = { # Military Helm 02
		factor = 1

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	3 = { # Military Helm 03
		factor = 1

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	4 = { # Military Helm 04
		factor = 1

		trigger = {
			french_martial_overlayer_trigger = yes
		}
	}

	5 = { # Duchess Accessories - Early
		factor = 1

		trigger = {
			french_duchess_overlayer_trigger = yes
			year < 1180

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	6 = { # Duchess Accessories - Early
		factor = 1

		trigger = {
			french_duchess_overlayer_trigger = yes
			year < 1180

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	7 = { # Duchess Accessories - Early
		factor = 1

		trigger = {
			french_duchess_overlayer_trigger = yes
			year < 1180

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	8 = { # Duchess Accessories - Post-1180
		factor = 1

		trigger = {
			french_duchess_overlayer_trigger = yes
			year >= 1180

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	9 = { # Duchess Accessories - Post-1180
		factor = 1

		trigger = {
			french_duchess_overlayer_trigger = yes
			year >= 1180

			OR = {
				higher_real_tier_than = COUNT
				any_spouse = { higher_real_tier_than = COUNT }
			}
		}
	}

	10 = { # Countess Accessories - Early
		factor = 1

		trigger = {
			french_countess_overlayer_trigger = yes
			lower_real_tier_than = DUKE
			year < 1180

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	11 = { # Countess Accessories - Early
		factor = 1

		trigger = {
			french_countess_overlayer_trigger = yes
			lower_real_tier_than = DUKE
			year < 1180

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	12 = { # Countess Accessories - Post-1180
		factor = 1

		trigger = {
			french_countess_overlayer_trigger = yes
			lower_real_tier_than = DUKE
			year >= 1180

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	13 = { # Countess Accessories - Post-1180
		factor = 1

		trigger = {
			french_countess_overlayer_trigger = yes
			lower_real_tier_than = DUKE
			year >= 1180

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	14 = { # Countess Accessories - Post-1180
		factor = 1

		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_countess_overlayer_trigger = yes
			lower_real_tier_than = DUKE
			year >= 1180

			NOT = {
				any_spouse = {
					higher_real_tier_than = COUNT
				}
			}
		}
	}

	15 = { # Countess Accessories - Post-1180
		factor = 1

		# hide_layers = { 1 = { } }
		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_countess_overlayer_trigger = yes
			lower_real_tier_than = DUKE
			year >= 1180

			NOR = {
				spouse = { higher_real_tier_than = COUNT }
			}
		}
	}
	16 = { # Non-noble Pre-1180
		factor = 1

		# hide_layers = { 1 = { } }
		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_courtier_overlayer_trigger = yes
			year < 1180
		}
	}

	17 = { # Non-noble Pre-1180
		factor = 1

		# hide_layers = { 1 = { } }
		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_courtier_overlayer_trigger = yes
			year < 1180
		}
	}

	18 = { # Non-noble Pre-1180
		factor = 1

		# hide_layers = { 1 = { } }
		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_courtier_overlayer_trigger = yes
			year < 1180
		}
	}

	19 = { # Non-noble Pre-1180
		factor = 1

		# hide_layers = { 1 = { } }
		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_courtier_overlayer_trigger = yes
			year < 1180
		}
	}

	20 = { # Non-noble Post-1180
		factor = 1

		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_courtier_overlayer_trigger = yes
			year >= 1180
		}
	}

	21 = { # Non-noble Post-1180
		factor = 1

		trigger = {
			french_courtier_overlayer_trigger = yes
			year >= 1180
		}
	}

	22 = { # Non-noble Post-1180
		factor = 1

		trigger = {
			french_courtier_overlayer_trigger = yes
			year >= 1180
		}
	}

	23 = { # Non-noble Post-1180
		factor = 1

		# hide_layers = { 1 = { } }
		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_courtier_overlayer_trigger = yes
			year >= 1180
		}
	}

	24 = { # Non-noble Post-1180
		factor = 1

		# hide_layers = { 1 = { } }
		# hide_layers = { 33 = { } } # Veil overload

		trigger = {
			french_courtier_overlayer_trigger = yes
			year >= 1180
		}
	}
}

#p33 French Culture Underlayer and Hair - Female
33 = {
	0 = { # Blank
		factor = 100

		trigger = {
			OR = {
				has_game_started = no
				is_in_society = yes
				is_theocracy = yes
				is_merchant_republic = yes
				has_job_title = job_spiritual
				french_overlayer_special_crown_trigger = yes

				NOR = {
					# has_portrait_property = { layer = 5 index = 0 }
					# has_portrait_property = { layer = 5 index = 1 }
					# has_portrait_property = { layer = 5 index = 2 }
					# has_portrait_property = { layer = 5 index = 3 }
					# has_portrait_property = { layer = 5 index = 4 }
					# has_portrait_property = { layer = 5 index = 10 }
					french_queen_underlayer_trigger = yes
					french_duchess_overlayer_trigger = yes
					french_countess_overlayer_trigger = yes
				}
			}
		}
	}

	1 = { # Empress / Queen Pre-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year < 1180
		}
	}

	2 = { # Empress / Queen Pre-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year < 1180
		}
	}

	3 = { # Empress / Queen Pre-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year < 1180
		}
	}

	4 = { # Empress / Queen Pre-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year < 1180
		}
	}

	5 = { # Empress / Queen Post-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year >= 1180
		}
	}

	6 = { # Empress / Queen Post-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year >= 1180
		}
	}

	7 = { # Empress / Queen Post-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year >= 1180
		}
	}

	8 = { # Empress / Queen Post-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_queen_underlayer_trigger = yes
			year >= 1180
		}
	}

	9 = { # Duchess Early
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_duchess_overlayer_trigger = yes
			year < 1180
		}
	}

	10 = { # Duchess Early
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_duchess_overlayer_trigger = yes
			year < 1180
		}
	}

	11 = {  # Duchess Early
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_duchess_overlayer_trigger = yes
			year < 1180
		}
	}

	12 = { # Duchess Early
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_duchess_overlayer_trigger = yes
			year < 1180
		}
	}

	13 = { # Duchess Post-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_duchess_overlayer_trigger = yes
			year >= 1180
		}
	}

	14 = { # Duchess Post-1180
		factor = 1

		hide_layers = { 1 = { } }

		trigger = {
			french_duchess_overlayer_trigger = yes
			year >= 1180
		}
	}

	15 = { # Countess Early
		factor = 100

		hide_layers = { 1 = { } }

		trigger = {
			french_countess_overlayer_trigger = yes
			year < 1180
		}
	}

	16 = { # Countess Early
		factor = 100

		hide_layers = { 1 = { } }

		trigger = {
			french_countess_overlayer_trigger = yes
			year < 1180
		}
	}

	17 = { # Countess Early
		factor = 100

		hide_layers = { 1 = { } }

		trigger = {
			french_countess_overlayer_trigger = yes
			year < 1180
		}
	}

	18 = { # Countess Post-1180
		factor = 100

		hide_layers = { 1 = { } }

		trigger = {
			french_countess_overlayer_trigger = yes
			year >= 1180
		}
	}

	19 = { # Countess Post-1180
		factor = 100

		hide_layers = { 1 = { } }

		trigger = {
			french_countess_overlayer_trigger = yes
			year >= 1180
		}
	}
}

# p34 Special Helmets
34 = {
	0 = { # blank
		factor = 1
	}

	1 = { # Templar special headgear
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			OR = {
				has_landed_title = d_knights_templar
				liege = { has_landed_title = d_knights_templar }
			}

			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	2 = { # Crusader King helmet - Male
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			any_artifact = {
				artifact_type = crown_crusader_king
				is_artifact_equipped = yes
			}

			is_female = no
			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	3 = { # Crusader King helmet - Female
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			any_artifact = {
				artifact_type = crown_crusader_king
				is_artifact_equipped = yes
			}

			is_female = yes
			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	4 = { # Hospitaler special headgear
		factor = 100
		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			OR = {
				has_landed_title = d_knights_hospitaller
				liege = { has_landed_title = d_knights_hospitaller }
			}

			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	5 = { # Teuton special headgear
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			OR = {
				has_landed_title = d_teutonic_order
				has_landed_title = k_teutonic_state

				liege = {
					OR = {
						has_landed_title = d_teutonic_order
						has_landed_title = k_teutonic_state
					}
				}
			}

			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	6 = { # Wearable Winged Helmet
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			any_artifact = {
				artifact_type = crown_winged_helmet
				is_artifact_equipped = yes
			}

			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	7 = {  # Calatrava/Santiago special headgear
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			OR = {
				has_landed_title = d_knights_santiago
				has_landed_title = d_knights_calatrava

				liege = {
					OR = {
						has_landed_title = d_knights_santiago
						has_landed_title = d_knights_calatrava
					}
				}
			}

			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	8 = { # Wearable Wrapped Helmet
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			any_artifact = {
				artifact_type = crown_wrapped_helmet
				is_artifact_equipped = yes
			}

			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}

	9 = { # Livonian special headgear
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			OR = {
				has_landed_title = d_livonian_order
				liege = { has_landed_title = d_livonian_order }
			}

			in_command = yes

			has_game_rule = {
				name = martial_headgear
				value = on
			}
		}
	}
	10 = { # Unicorn headgear
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked
		hide_layers = { 1  = { } } # Hide Hair
		hide_layers = { 3  = { } } # Hide Clothes
		hide_layers = { 18 = { } } # Hide layers with special crowns
		hide_layers = { 19 = { } } # Hide layers with special crowns
		hide_layers = { 31 = { } } # Veil overload
		hide_layers = { 32 = { } }
		hide_layers = { 33 = { } }

		trigger = {
			any_artifact = {
				artifact_type = crown_unicorn_helmet
				is_artifact_equipped = yes
			}

		#	in_command = yes
		#
		#	has_game_rule = {
		#		name = martial_headgear
		#		value = on
		#	}
		}
	}
}


# p35 Special Masks
35 = {
	0 = { # blank
		factor = 100

		trigger = {
			# Different modifier since in this case being in command should not prevent you from wearing the mask
			NOT = {
				any_artifact = {
					OR = {
						artifact_type = crown_african_mask_1
						artifact_type = crown_african_mask_2
						artifact_type = crown_african_mask_3
						artifact_type = crown_african_mask_4
						artifact_type = crown_african_mask_5
						artifact_type = crown_african_mask_6
						artifact_type = crown_african_mask_7
						artifact_type = crown_african_mask_8
					}

					is_artifact_equipped = yes
				}
			}
		}
	}

	1 = {
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_1
				is_artifact_equipped = yes
			}
		}
	}

	2 = {
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_2
				is_artifact_equipped = yes
			}
		}
	}

	3 = {
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_3
				is_artifact_equipped = yes
			}
		}
	}

	4 = {
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_4
				is_artifact_equipped = yes
			}
		}
	}

	5 = {
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_5
				is_artifact_equipped = yes
			}
		}
	}

	6 = {
		factor = 100

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_6
				is_artifact_equipped = yes
			}
		}
	}

	7 = {
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_7
				is_artifact_equipped = yes
			}
		}
	}

	8 = {
		factor = 100

		hide_layers = { 12 = { } } # Hide layer 12 (disfigured masks) when this frame is picked
		hide_layers = { 5  = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # African Masks
			any_artifact = {
				artifact_type = crown_african_mask_8
				is_artifact_equipped = yes
			}
		}
	}
}

# p36 Special Scepters
36 = {
	0 = { # blank
		factor = 100

		trigger = {
			trigger_if = {
				limit = {
					any_artifact = {
						OR = {
							artifact_type = scepter_bon_fylkir
							artifact_type = scepter_hellenic_fylkir
						}

						is_artifact_equipped = yes
					}

					in_command = yes
				}

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}

			NOR = {
				trait = dead_scepter_bon_fylkir
				trait = dead_scepter_hellenic_fylkir
			}
		}
	}

	1 = {
		factor = 100

		# hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Bon Fylkir Scepter
			OR = {
				any_artifact = {
					artifact_type = scepter_bon_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_scepter_bon_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}

	2 = {
		factor = 100

		# hide_layers = { 5 = { } } # Hide layer 5 (headgear) when this frame is picked

		trigger = { # Bon Fylkir Scepter
			OR = {
				any_artifact = {
					artifact_type = scepter_hellenic_fylkir
					is_artifact_equipped = yes
				}

				trait = dead_scepter_hellenic_fylkir
			}

			trigger_if = {
				limit = { in_command = yes }

				NOT = {
					has_game_rule = {
						name = martial_headgear
						value = on
					}
				}
			}
		}
	}
}

# p37 Special Relations (lover/rival) # TODO_CD: update once we have proper scopes
37 = {
	0 = { # blank
		factor = 100

		trigger = {
			NOT = {
				any_player = {
					OR = {
						is_rival = PREV
						is_lover = PREV
					}
				}
			}
		}
	}

	1 = {
		factor = 100

		trigger = {
			any_player = { is_rival = PREV }
		}
	}

	2 = {
		factor = 100

		trigger = {
			any_player = { is_lover = PREV }
		}
	}
}