﻿# Tags:
# rank_headgear: any headgear that signifies a certain title. crowns, pope hat etc.

headgear_base = {

	usage = game
	selection_behavior = weighted_random
	priority = 1

## SP2 ## 
	
	sp2_western_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = sp2_western_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 90
				has_dlc_feature = elegance_of_the_empire
				portrait_imperial_trigger = {
					CULTURE_INPUT = western
				}	
			}
			modifier = {
				add = 90
				has_dlc_feature = elegance_of_the_empire
				portrait_imperial_trigger = {
					CULTURE_INPUT = northern
				}	
			}
			modifier = {
				add = 90
				has_dlc_feature = elegance_of_the_empire
				OR = {
					portrait_royalty_trigger = {
						CULTURE_INPUT = western
					}	
					portrait_imperial_trigger = {
						CULTURE_INPUT = western
					}					
				}
				is_female = yes
			}
			modifier = {
				add = 90
				has_dlc_feature = elegance_of_the_empire
				OR = {
					portrait_royalty_trigger = {
						CULTURE_INPUT = northern
					}	
					portrait_imperial_trigger = {
						CULTURE_INPUT = northern
					}					
				}
				is_female = yes
			}
			#modifier = {
			#	factor = 0
			#	has_ep2_dlc_trigger = yes
			#	NOT = {
			#		portrait_era2_trigger = yes 
			#	}
			#}
		}
	}

	sp2_western_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = sp2_western_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				has_dlc_feature = elegance_of_the_empire
				portrait_high_nobles_headgear_trigger = {
					CULTURE_INPUT = western
				}	
			}
			modifier = {
				factor = 0
				has_ep2_dlc_trigger = yes
				NOR = {
					portrait_era2_trigger = yes 
					portrait_era3_trigger = yes
				}
			}
		}
	}


## DDE HRE ##

	dde_hre_commoners = {

		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_hre_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 20
                portrait_commoner_clothing_trigger = {  
                    CULTURE_INPUT = dde_hre # CULTURE_INPUT gets added into the trigger referenced in 00_clothing_triggers.txt so it's important the input is a correct match to an existing culture trigger
                }
			}
		}
	}

	dde_hre_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_hre_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = dde_hre } # common/scripted_modifiers/00_portrait_modifiers.txt
			modifier = {
				add = 50
				portrait_low_nobles_clothing_trigger = {
					CULTURE_INPUT = dde_hre
				}
			}
            modifier = {
                factor = 0       # Should NOT show up if EP2 is active and we're not in the right era
                has_ep2_dlc_trigger = yes   
                NOR = { 
                	portrait_era3_trigger = yes 
                	portrait_era4_trigger = yes 
                } 
            }
		}
	}

	dde_hre_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_hre_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_high_nobles_headgear_trigger = {
					CULTURE_INPUT = dde_hre
				}	
			}
            modifier = {
                factor = 0       # Should NOT show up if EP2 is active and we're not in the right era
                has_ep2_dlc_trigger = yes   
                NOR = { 
                	portrait_era3_trigger = yes 
                	portrait_era4_trigger = yes 
                } 
            }
		}
	}

	dde_hre_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_hre_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_royalty_trigger = {
					CULTURE_INPUT = dde_hre
				}	
			}
            modifier = {
                factor = 0       # Should NOT show up if EP2 is active and we're not in the right era
                has_ep2_dlc_trigger = yes   
                NOR = { 
                	portrait_era3_trigger = yes 
                	portrait_era4_trigger = yes 
                } 
            }
		}
	}

	# Reichskrone
	dde_hre_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_hre_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100 # always pick the HRE crown over the western one
				portrait_reichskrone_trigger = yes
			}
		}
	}

## Western ##

	western_commoners = {

		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 80
				portrait_commoner_headgear_fallback_trigger = {
					CULTURE_INPUT = western
				}
				NOT = { has_ep2_dlc_trigger = yes }
			}
			modifier = {
				add = 20
				portrait_commoner_clothing_trigger = {
					CULTURE_INPUT = western
				}
				NOT = { has_ep2_dlc_trigger = yes }
			}
		}
	}

    ep2_western_era1_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = ep2_western_era1_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
			modifier = {
				add = 80
				portrait_commoner_headgear_fallback_trigger = {
					CULTURE_INPUT = western
				}
				has_ep2_dlc_trigger = yes 
				portrait_era1_trigger = yes 
			}
            modifier = {
                add = 20
                portrait_commoner_clothing_trigger = { 
                    CULTURE_INPUT = western
                } 
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes     
            }
        }
    }

    ep2_western_era2_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = western_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
			modifier = {
				add = 80
				portrait_commoner_headgear_fallback_trigger = {
					CULTURE_INPUT = western
				}
				has_ep2_dlc_trigger = yes 
				portrait_era2_trigger = yes 
			}
            modifier = {
                add = 20
                portrait_commoner_clothing_trigger = { 
                    CULTURE_INPUT = western
                } 
                has_ep2_dlc_trigger = yes   
                portrait_era2_trigger = yes     
            }
        }
    }

    ep2_western_era3_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = western_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
			modifier = {
				add = 80
				portrait_commoner_headgear_fallback_trigger = {
					CULTURE_INPUT = western
				}
				has_ep2_dlc_trigger = yes 
				portrait_era3_trigger = yes 
			}
            modifier = {
                add = 20
                portrait_commoner_clothing_trigger = { 
                    CULTURE_INPUT = western
                } 
                has_ep2_dlc_trigger = yes   
                portrait_era3_trigger = yes     
            }
        }
    }

	western_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
		    modifier = {
		        add = 50
		        court_fashion_level_4_headgear_trigger = {
		            CULTURE_INPUT = western
		        }
		        has_ep2_dlc_trigger = yes 
		        portrait_era1_trigger = yes 
		    }
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {  
                    CULTURE_INPUT = western 
                }
                NOT = { has_ep2_dlc_trigger = yes }
			}
		}
	}

	ep2_western_era1_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep2_western_era1_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
		    modifier = {
		        add = 50
		        court_fashion_level_4_headgear_trigger = {
		            CULTURE_INPUT = western
		        }
		        has_ep2_dlc_trigger = yes 
		        portrait_era1_trigger = yes 
		    }
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                portrait_era1_trigger = yes  
			}
		}
	}

	ep2_western_era2_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
		    modifier = {
		        add = 50
		        court_fashion_level_4_headgear_trigger = {
		            CULTURE_INPUT = western
		        }
		        has_ep2_dlc_trigger = yes 
		        portrait_era1_trigger = yes 
		    }
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                portrait_era2_trigger = yes  
			}
		}
	}

	ep2_western_era3_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
		    modifier = {
		        add = 50
		        court_fashion_level_4_headgear_trigger = {
		            CULTURE_INPUT = western
		        }
		        has_ep2_dlc_trigger = yes 
		        portrait_era1_trigger = yes 
		    }
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era3_trigger = yes  
                	portrait_era4_trigger = yes  
                }
			}
		}
	}

	western_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {  
                    CULTURE_INPUT = western 
                }
                NOT = { has_ep2_dlc_trigger = yes }
			}
		}
	}

	ep2_western_era1_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep2_western_era1_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                portrait_era1_trigger = yes  
			}
		}
	}

	ep2_western_era2_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                portrait_era2_trigger = yes  
			}
		}
	}

	ep2_western_era3_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era3_trigger = yes  
                	portrait_era4_trigger = yes  
                }
			}
		}
	}

	western_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_royalty_trigger = {
					CULTURE_INPUT = western 
				}
				NOT = { has_ep2_dlc_trigger = yes }
			}
		}
	}

	ep1_western_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_western_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_royalty_trigger = {
					CULTURE_INPUT = western 
				}
			}
			modifier = {
				factor = 0
				NOT = {
					has_ep1_dlc_trigger = yes
				}
			}
		}
	}

	ep2_western_era1_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep2_western_era1_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                portrait_era1_trigger = yes  
			}
		}
	}

	ep2_western_era2_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                portrait_era2_trigger = yes  
			}
		}
	}

	ep2_western_era3_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era3_trigger = yes
                	portrait_era4_trigger = yes
                }  
			}
		}
	}

	# Commented as it can create desync in multiplayer game
	#reward_western_royalty = {
	#	dna_modifiers = {
	#		accessory = {
	#			mode = add
	#			gene = headgear
	#			template = ep1_western_royalty
	#			range = { 0 1 } # For the randomness to work correctly
	#		}
	#	}
	#	weight = {
	#		base = 0
	#		modifier = {
	#			add = 50
	#			exists = this
	#			portrait_can_use_noble_headgear_trigger = yes
	#			OR = {
	#				AND = {
	#					OR = {
	#						highest_held_title_tier = tier_kingdom
	#						AND = { is_ruler = yes government_has_flag = government_is_theocracy }
	#						AND = {
	#							highest_held_title_tier = tier_empire
	#							portrait_northern_clothing_trigger = yes
	#							portrait_fp1_norse_clothing_trigger = no
	#						}
	#					}
	#					NOT = { AND = { is_ruler = yes government_has_flag = government_is_mercenary  } } # Blocked for mercenaries
	#					NOT = { government_has_flag = government_is_republic }
	#					OR = {
	#						portrait_western_clothing_trigger = yes
	#						AND = {
	#							portrait_northern_clothing_trigger = yes
	#							portrait_fp1_norse_clothing_trigger = no
	#						}
	#						AND = {
	#							portrait_fp1_norse_clothing_trigger = yes
	#							NOR = {
	#								government_has_flag = government_is_tribal
	#								religion = religion:germanic_religion
	#							}
	#						}
	#					}
	#				}
	#				AND = {
	#					exists = primary_spouse
	#					OR = {
	#						is_ruler = no
	#						highest_held_title_tier = tier_barony
	#					}
	#					primary_spouse = {
	#						OR = {
	#							highest_held_title_tier = tier_kingdom
	#							AND = { is_ruler = yes government_has_flag = government_is_theocracy }
	#							AND = {
	#								highest_held_title_tier = tier_empire
	#								portrait_northern_clothing_spouse_trigger = yes
	#								portrait_fp1_norse_clothing_spouse_trigger = no
	#							}
	#						}
	#						NOT = { AND = { is_ruler = yes government_has_flag = government_is_mercenary  } } # Blocked for mercenaries
	#						NOT = { government_has_flag = government_is_republic }
	#						OR = {
	#							portrait_western_clothing_spouse_trigger = yes
	#							AND = {
	#								portrait_northern_clothing_spouse_trigger = yes
	#								portrait_fp1_norse_clothing_spouse_trigger = no
	#							}
	#							AND = {
	#								portrait_fp1_norse_clothing_spouse_trigger = yes
	#								NOR = {
	#									government_has_flag = government_is_tribal
	#									religion = religion:germanic_religion
	#								}
	#							}
	#						}
	#					}
	#				}
	#			}
	#		}
	#		modifier = {
	#			factor = 0
	#			NOT = {
	#				has_reward_item = newsletter_crown
	#			}
	#		}
	#	}
	#}

	ep1_italian_royalty = { # The Iron Crown of Lombardy
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_italian_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_royalty_trigger = {
					CULTURE_INPUT = western 
				}
				culture = {
					has_cultural_pillar = heritage_latin
				}
				has_ep1_dlc_trigger = yes
			}
		}
	}

	western_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_imperial_trigger = {
					CULTURE_INPUT = western 
				}
				NOT = { has_ep2_dlc_trigger = yes }
			}
			modifier = {
				add = 50
				portrait_imperial_trigger = {
					CULTURE_INPUT = northern 
				}
				NOT = { has_ep2_dlc_trigger = yes }
			}
		}
	}

	ep2_western_era1_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep2_western_era1_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_imperial_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                portrait_era1_trigger = yes  
			}
			modifier = {
				add = 50
                portrait_imperial_trigger = {  
                    CULTURE_INPUT = northern 
                }
                has_ep2_dlc_trigger = yes
                portrait_era1_trigger = yes  
			}
		}
	}

	ep2_western_era2_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_imperial_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era2_trigger = yes
                	portrait_era3_trigger = yes
                }  
			}
			modifier = {
				add = 50
                portrait_imperial_trigger = {  
                    CULTURE_INPUT = northern 
                }
                has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era2_trigger = yes
                	portrait_era3_trigger = yes
                }  
			}
		}
	}

	ep2_western_era4_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_imperial_trigger = {  
                    CULTURE_INPUT = western 
                }
                has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era4_trigger = yes
                }  
			}
			modifier = {
				add = 50
                portrait_imperial_trigger = {  
                    CULTURE_INPUT = northern 
                }
                has_ep2_dlc_trigger = yes
                OR = {
                	portrait_era4_trigger = yes
                }  
			}
		}
	}

## Byzantine ##

	byzantine_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = byzantine_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 80
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = byzantine
                }
			}
			modifier = {
				add = 20
                portrait_commoner_clothing_trigger = {
                    CULTURE_INPUT = byzantine
                }
			}
		}
	}

	byzantine_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = byzantine_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = byzantine } 
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {  
                    CULTURE_INPUT = byzantine 
                }
			}
		}
	}

	byzantine_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = byzantine_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = byzantine
                }   
			}
		}
	}

	byzantine_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = byzantine_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {
                    CULTURE_INPUT = byzantine
                }   
			}
		}
	}

	byzantine_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = byzantine_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_imperial_trigger = {
                    CULTURE_INPUT = byzantine 
                }
			}
		}
	}

	ep1_byzantine_imperial = { # Crown of Justinian
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_byzantine_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_imperial_trigger = {
					CULTURE_INPUT = byzantine 
				}
			}
			modifier = {
				factor = 0
				NOT = {
					has_title = title:e_byzantium
				}
			}
			modifier = {
				factor = 0
				NOT = {
					has_ep1_dlc_trigger = yes
				}
			}
		}
	}
	zoroastrian_imperial_crown = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = male_imperial_crown_zoroastrian
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				AND = {
					religion = religion:zoroastrianism_religion
					has_title = title:e_persia
					is_male = yes
				}
			}
	    }
	}

	hunnic_diadem = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = hunnic_diadem_01
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				AND = {
					culture = culture:hun
					highest_held_title_tier = tier_empire
				}

			}
	    }
	}

	roman_crown = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = roman_crown
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 300
				OR = {
					AND = {
						culture = {
							has_cultural_pillar = heritage_latin
						}
						highest_held_title_tier = tier_empire
					}
					AND = {
						exists = primary_spouse
						primary_spouse = {
							culture = {
								has_cultural_pillar = heritage_latin
							}
							highest_held_title_tier = tier_empire
						}
					}
				}
				current_date > 530.1.1
			}
	    }
	}

	roman_diadem = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = roman_diadem
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				culture = {
					has_cultural_pillar = heritage_latin
				}
				highest_held_title_tier = tier_empire
				current_date <= 530.1.1
			}
	    }
	}

	roman_diadem_female = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = roman_diadem_female
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				AND = {
					exists = primary_spouse
					primary_spouse = {
						culture = {
							has_cultural_pillar = heritage_latin
						}
						highest_held_title_tier = tier_empire
					}
					current_date <= 530.1.1
				}
			}
	    }
	}

	roman_prefect_diadem = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = roman_prefect_diadem
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				AND = {
					exists = liege
					liege = {
						culture = {
							has_cultural_pillar = heritage_latin
						}
						highest_held_title_tier = tier_empire
					}
					highest_held_title_tier = tier_kingdom
				}
			}
	    }
	}

	roman_prefect_diadem_female = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = roman_prefect_diadem_female
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				AND = {
					exists = primary_spouse 
					primary_spouse = {
						exists = liege
						liege = {
							culture = {
								has_cultural_pillar = heritage_latin
							}
							highest_held_title_tier = tier_empire
						}
						highest_held_title_tier = tier_kingdom
					}
				}
			}
	    }
	}
	roman_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = roman_pannonian_hat_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 80
				exists = this
				portrait_can_use_noble_headgear_trigger = no
				culture = {
					has_cultural_pillar = heritage_latin
				}
			}
			modifier = {
				add = 20
				exists = this
				highest_held_title_tier < tier_county
				NOR = {
					AND = {
						exists = primary_spouse
						primary_spouse = {
							highest_held_title_tier > tier_county
						}
					}
					AND = {
						has_government = republic_government
						primary_title.tier > 1
					}
					AND = { is_ruler = yes has_government = theocracy_government }
				}
				culture = {
					has_cultural_pillar = heritage_latin
				}
			}
		}
	}

	roman_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = roman_pannonian_hat_low
				range = { 0 1 } # For the randomness to work correctly
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 50
				exists = this
				portrait_can_use_noble_headgear_trigger = yes
				OR = {
					AND = {
						highest_held_title_tier = tier_county
						NOR = {
							# has_dynasty = no
							AND = {
								has_government = republic_government
								primary_title.tier > 1
							}
							AND = { is_ruler = yes has_government = theocracy_government }
						}
						culture = {
							has_cultural_pillar = heritage_latin
						}
					}
					AND = {
						exists = primary_spouse
						OR = {
							is_ruler = no
							highest_held_title_tier = tier_barony
						}
						primary_spouse = {
							highest_held_title_tier = tier_county
							NOR = {
								# has_dynasty = no
								AND = {
									has_government = republic_government
									primary_title.tier > 1
								}
								AND = { is_ruler = yes has_government = theocracy_government }
							}
							culture = {
								has_cultural_pillar = heritage_latin
							}
						}
					}
				}

			}
		}
	}

	roman_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = roman_pannonian_hat_high
				range = { 0 1 } # For the randomness to work correctly
			}
		}		
		weight = {
			base = 0
			modifier = {
				add = 50
				exists = this
				portrait_can_use_noble_headgear_trigger = yes
				OR = {
					AND = {
						OR = {
							highest_held_title_tier = tier_duchy
							AND = {
								has_government = republic_government
								primary_title.tier > 2
							}
							AND = { is_ruler = yes has_government = theocracy_government }
						}
						NOT = { AND = { is_ruler = yes has_government = mercenary_government  } } # Blocked for mercenaries
						culture = {
							has_cultural_pillar = heritage_latin
						}
					}
					AND = {
						exists = primary_spouse
						OR = {
							is_ruler = no
							highest_held_title_tier = tier_barony
						}
						primary_spouse = {
							OR = {
								highest_held_title_tier = tier_duchy
								AND = {
									has_government = republic_government
									primary_title.tier > 2
								}
								AND = { is_ruler = yes has_government = theocracy_government }
							}
							culture = {
								has_cultural_pillar = heritage_latin
							}
						}
					}
				}

			}
		}
	}


	nobletorc = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = celtic_torque_01
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				is_landed = yes
				culture = {
					OR = {
						has_cultural_pillar = heritage_celtic
						has_cultural_pillar = heritage_pictish
						has_cultural_pillar = heritage_brythonic
						has_cultural_pillar = heritage_goidelic
					}
				}
				highest_held_title_tier <= tier_duchy
			}
	    }
	}
	hightorc = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = celtic_torque_02
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				is_landed = yes
				culture = {
					OR = {
						has_cultural_pillar = heritage_celtic
						has_cultural_pillar = heritage_pictish
						has_cultural_pillar = heritage_brythonic
						has_cultural_pillar = heritage_goidelic
					}
				}
				highest_held_title_tier = tier_kingdom
			}
	    }
	}
	imperialtorc = {
		dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = headgear
	            template = celtic_torque_03
	            range = { 0 1 }
	        }
	    }
		outfit_tags = { rank_headgear }
		weight = {
	        base = 0
	        modifier = {
				add = 100
				is_landed = yes
				culture = {
					OR = {
						has_cultural_pillar = heritage_celtic
						has_cultural_pillar = heritage_pictish
						has_cultural_pillar = heritage_brythonic
						has_cultural_pillar = heritage_goidelic
					}
				}
				highest_held_title_tier = tier_empire
			}
	    }
	}

## INDIAN ##

	indian_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = indian_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 80
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = indian
                }
			}
			modifier = { # Non-european jesters should not use the jester hat
				add = 1000
				portrait_jester_trigger = {  
                    CULTURE_INPUT = indian 
                }
			}
			modifier = {
				add = 20
				portrait_commoner_clothing_trigger = {  
                    CULTURE_INPUT = indian 
                }
			}
		}
	}

	indian_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = indian_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = indian } 
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {  
                    CULTURE_INPUT = indian 
                }
			}
		}
	}

	indian_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = indian_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = indian
                }   
			}
		}
	}

	indian_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = indian_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {
                    CULTURE_INPUT = indian
                }   
			}
		}
	}

	ep1_indian_royalty = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_indian_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_royalty_trigger = {
					CULTURE_INPUT = indian
				}
				culture = {
					has_cultural_pillar = heritage_burman
				}
				has_ep1_dlc_trigger = yes
			}
		}
	}

	indian_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = indian_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_imperial_trigger = {
                    CULTURE_INPUT = indian 
                }
			}
		}
	}

	ep1_indian_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_indian_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100
                portrait_imperial_trigger = {
                    CULTURE_INPUT = indian 
                }
				culture = {
					has_cultural_pillar = heritage_burman
				}
				has_ep1_dlc_trigger = yes
			}
		}
	}

## MENA ##

	mena_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 80
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = mena
                }
			}
			modifier = { # Non-european jesters should not use the jester hat
				add = 1000
                portrait_jester_trigger = {  
                    CULTURE_INPUT = mena 
                }
			}
			modifier = {
				add = 20
                portrait_commoner_clothing_trigger = {
                    CULTURE_INPUT = mena
                }
			}
		}
	}

	mena_mayors = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_low_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 60
				portrait_mayor_headgear_trigger = {
					CULTURE_INPUT = mena
				}
			}
		}
	}

	mena_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_low_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}	
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = mena } 
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {
                    CULTURE_INPUT = mena
                }
			}
		}
	}

	mena_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}		
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = mena
                }   
			}
		}
	}

	mena_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}		
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {
                    CULTURE_INPUT = mena
                }   
			}
		}
	}

	ep1_mena_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_mena_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}		
		weight = {
			base = 0
			modifier = {
				add = 100
                portrait_royalty_trigger = {
                    CULTURE_INPUT = mena 
                }
				culture = {
					has_cultural_pillar = heritage_east_african
				}
				religion = religion:islam_religion
				has_ep1_dlc_trigger = yes
			}
		}
	}

	mena_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_imperial_nobles_headgear_trigger = {
                    CULTURE_INPUT = mena 
                }
			}
		}
	}

	ep1_persian_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_persian_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_imperial_nobles_headgear_trigger = {
                    CULTURE_INPUT = mena 
                }
                culture = {
                    has_cultural_pillar = heritage_iranian
                }
                has_ep1_dlc_trigger = yes
			}
		}
	}

## DDE ABBASID ##

	dde_abbasid_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_abbasid_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 20
                portrait_commoner_clothing_trigger = {
                    CULTURE_INPUT = dde_abbasid
                }
			}
		}
	}

	dde_abbasid_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_abbasid_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = dde_abbasid
                } 
			}
		}
	}

	dde_abbasid_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_abbasid_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {
                    CULTURE_INPUT = dde_abbasid
                }  
			}
		}
	}

	dde_abbasid_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = dde_abbasid_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100 # pick over mena
                portrait_imperial_trigger = {
                    CULTURE_INPUT = dde_abbasid 
                }
			}
		}
	}

## Steppe ##

	steppe_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = steppe_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 80
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = steppe
                }
			}
			modifier = { # Non-european jesters should not use the jester hat
				add = 1000
                portrait_jester_trigger = {  
                    CULTURE_INPUT = steppe 
                }
				NOR = {
					portrait_western_clothing_trigger = yes
					portrait_byzantine_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
			}
			modifier = {
				add = 20
                portrait_commoner_clothing_trigger = {  
                    CULTURE_INPUT = steppe 
                }
			}
		}
	}

	steppe_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = steppe_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = steppe } 
			modifier = {
				add = 50
                portrait_low_nobles_clothing_trigger = {
                    CULTURE_INPUT = steppe
                }
			}
		}
	}

	steppe_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = steppe_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = steppe
                }   
			}
		}
	}

	steppe_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = steppe_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				OR = {
					portrait_imperial_trigger = {
						CULTURE_INPUT = steppe
					}   
					portrait_royalty_trigger = {
						CULTURE_INPUT = steppe
					}   
				}
			}
		}
	}

	ep1_steppe_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_steppe_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                OR = {
					portrait_imperial_trigger = {
						CULTURE_INPUT = steppe
					}   
					portrait_royalty_trigger = {
						CULTURE_INPUT = steppe
					}   
				}
			}
			modifier = {
				factor = 0
				NOT = {
					has_ep1_dlc_trigger = yes
				}
			}
		}
	}

## Northern Pagans ##

	northern_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = northern_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 70
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = northern
                }
			}
			modifier = {
				add = 30
                portrait_commoner_clothing_trigger = {
                    CULTURE_INPUT = northern
                }
			}
		}
	}

	northern_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = northern_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = northern } 
			modifier = {
				add = 50
				OR = {
	                portrait_low_nobles_clothing_trigger = {
	                    CULTURE_INPUT = northern
	                }
				}
			}
		}
	}

	northern_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = northern_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = northern
                }   
			}
		}
	}

	northern_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = northern_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_royalty_trigger = {
                    CULTURE_INPUT = northern
                }
			}
		}
	}

## FP2 Iberian ##
	fp2_iberian_muslim_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_muslim_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 80
				current_date >= 900.1.1
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = fp2_iberian_muslim
                }
			}
			modifier = {
				add = 41 # Slightly higher
				current_date >= 900.1.1
				portrait_commoner_no_mayors_trigger = {
                    CULTURE_INPUT = fp2_iberian_muslim
                }
			}
		}
	}

	fp2_iberian_muslim_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_muslim_low_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = fp2_iberian_muslim } 
			modifier = {
				add = 51 # Slightly higher
				current_date >= 900.1.1
                portrait_low_nobles_clothing_trigger = {
                    CULTURE_INPUT = fp2_iberian_muslim
                }
			}
		}
	}

	fp2_iberian_muslim_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_muslim_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 51 # Slightly higher
				current_date >= 900.1.1
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = fp2_iberian_muslim
                }   
			}
		}
	}

	fp2_iberian_muslim_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_muslim_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 51 # Slightly higher
				current_date >= 900.1.1
                portrait_royalty_trigger = {
                    CULTURE_INPUT = fp2_iberian_muslim
                }  
			}
		}
	}

	fp2_iberian_christian_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_christian_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { iberian_christian_shrimp_wrap }
		weight = {
			base = 0
			modifier = {
				add = 80
				current_date >= 900.1.1
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = fp2_iberian_christian
                }
			}
			modifier = {
				add = 41 # Slightly higher
				current_date >= 900.1.1
                portrait_commoner_clothing_trigger = {  
                    CULTURE_INPUT = fp2_iberian_christian 
                }
			}
		}
	}

	fp2_iberian_christian_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_christian_low_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = fp2_iberian_christian } 
			modifier = {
				add = 60 # Slightly higher
				current_date >= 900.1.1
                portrait_low_nobles_clothing_trigger = {
                    CULTURE_INPUT = fp2_iberian_christian
                }
			}
            modifier = {
                factor = 0       # Should NOT show up if EP2 is active and we're not in the right era
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes 
            }
		}
	}

	fp2_iberian_christian_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_christian_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 60 # Slightly higher
				current_date >= 900.1.1
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = fp2_iberian_christian
                } 
			}
            modifier = {
                factor = 0       # Should NOT show up if EP2 is active and we're not in the right era
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes 
            }
		}
	}

	fp2_iberian_christian_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp2_christian_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 51 # Slightly higher
				current_date >= 900.1.1
                portrait_royalty_trigger = {
                    CULTURE_INPUT = fp2_iberian_christian
                }  
			}
            modifier = {
                factor = 0       # Should NOT show up if EP2 is active and we're not in the right era
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes 
            }
		}
	}

## FP1 NORSE ##

	fp1_norse_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp1_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 80
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = fp1_norse
                }
			}
			modifier = {
				add = 41 # Slightly higher
                portrait_commoner_clothing_trigger = {  
                    CULTURE_INPUT = fp1_norse 
                }
			}
		}
	}

	fp1_norse_low_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp1_low_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			court_fashion_level_4_headgear_modifier = { INPUT_PARAMETER = fp1_norse } 
			modifier = {
				add = 51 # Slightly higher
                portrait_low_nobles_clothing_trigger = {
                    CULTURE_INPUT = fp1_norse
                }
			}
		}
	}

	fp1_norse_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp1_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 51 # Slightly higher
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = fp1_norse
                }   
			}
		}
	}

	fp1_norse_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp1_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 51 # Slightly higher
                portrait_royalty_trigger = {
                    CULTURE_INPUT = fp1_norse
                }   
			}
		}
	}

	fp1_norse_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = fp1_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100 # pick over northern
                portrait_imperial_trigger = {
                    CULTURE_INPUT = fp1_norse 
                }
			}
		}
	}

## Sub-Saharan Africans ##

	african_commoners = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = sub_saharan_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_commoner_headgear_fallback_trigger = {
                    CULTURE_INPUT = african
                }
			}
			modifier = { # Non-european jesters should not use the jester hat
				add = 1000
                portrait_jester_trigger = {  
                    CULTURE_INPUT = african 
                }
			}
			modifier = {
				add = 50
                portrait_commoner_clothing_trigger = {  
                    CULTURE_INPUT = african 
                }
			}
		}
	}

	sub_saharan_high_nobles = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = sub_saharan_high_nobility
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
                portrait_high_nobles_headgear_trigger = {
                    CULTURE_INPUT = african
                }   
			}
		}
	}

	sub_saharan_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = sub_saharan_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_royalty_african_headgear_trigger = yes
			}
		}
	}

	ep1_sub_saharan_royalty = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = ep1_sub_saharan_royalty
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_royalty_african_headgear_trigger = yes
			}
			modifier = {
				factor = 0
				NOT = {
					has_ep1_dlc_trigger = yes
				}
			}
		}
	}

	sub_saharan_imperial = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = sub_saharan_imperial
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 50
				portrait_imperial_nobles_headgear_trigger = {
					CULTURE_INPUT = african
				}
			}
		}
	}
}
