﻿headgear_religious = {

	usage = game
	selection_behavior = weighted_random
	priority = 3

## Orthodox ##

	religious_orthodox_high = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_orthodox_high
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit bishop_outfit }
		weight = {
			base = 0
			modifier = {
				add = 130
				portrait_religious_orthodox_trigger = yes
				portrait_religious_high_headgear_trigger = {
					FAITH_INPUT = orthodox
				}
			}
		}
	}

	religious_orthodox_head = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_orthodox_head
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 200
				portrait_religious_head_trigger = yes
				faith = faith:orthodox
			}
		}
	}


## Catholic ##

	catholic_devoted = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_catholic_devoted
				range = { 0 1 } # For the randomness to work correctly
			}
			accessory = {
				mode = add
				gene = additive_headgear
				template = no_additive
				range = { 0 1 }
			}
		}
		outfit_tags = { monk_outfit }
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_religious_devoted_trigger = yes
				portrait_religious_christian_trigger = yes
			}
		}
	}

	catholic_head = {
		outfit_tags = { rank_headgear }
		usage = game
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = catholic_head
				range = { 0 1 }
			}
			accessory = {
				mode = add
				gene = additive_headgear
				template = no_additive
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 120			
				portrait_religious_head_trigger = yes
				portrait_religious_catholic_trigger = yes	
			}	
		}
	}

	catholic_high = {
		outfit_tags = { rank_headgear }
		usage = game
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = catholic_high
				range = { 0 1 }
			}
			accessory = {
				mode = add
				gene = additive_headgear
				template = no_additive
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit bishop_outfit }
		weight = {
			base = 0
			modifier = {
				add = 120
				portrait_religious_christian_trigger = yes
				portrait_religious_high_trigger = yes
			}
		}
	}

	popes = {
		outfit_tags = { rank_headgear }
		usage = game
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = catholic_head
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 140
				portrait_religious_head_popes_trigger = yes
			}
		}
	}

## Jewish ##

	religious_jewish_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_jewish_high
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_religious_high_no_poverty_trigger = yes
				OR = {
					portrait_religious_jewish_trigger = yes
					portrait_religious_hellenism_trigger = yes
				}
			}
		}
	}

	religious_jewish_head = {
		outfit_tags = { rank_headgear }
		usage = game
		dna_modifiers = {
			accessory = {
				mode = add

				gene = headgear
				template = religious_jewish_head
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 140
				portrait_religious_head_no_poverty_trigger = yes
				portrait_religious_jewish_trigger = yes
			}
		}
	}

## Muslim ##

	religious_muslim_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_muslim_high
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 111
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_muslim_trigger = yes
			}
		}
	}



## Northern Pagan ##

	religious_northern_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_northern_high
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_norse_trigger = yes
			}
		}
	}

## CCP4 Siberian Khanty / Sami ##

religious_siberian_high_headgear = {
	dna_modifiers = {
		accessory = {
			mode = add
			gene = headgear
			template = ccp4_khanty_headgear
			range = { 0.81 1 }
		}
	}
	outfit_tags = { priest_outfit }
	weight = {
		base = 0
		modifier = {
			add = 105 # higher than steppe
			portrait_religious_high_no_poverty_trigger = yes
			portrait_religious_siberian_trigger = yes
		}
	}
}

religious_sami_high_headgear = {
	dna_modifiers = {
		accessory = {
			mode = add
			gene = headgear
			template = ccp4_sami_headgear
			range = { 0.33 0.64 } # For the randomness to work correctly
		}
	}
	outfit_tags = { priest_outfit }
	weight = {
		base = 0
		modifier = {
			add = 105 # higher than norse
			portrait_religious_high_no_poverty_trigger = yes
			portrait_religious_sami_trigger = yes
		}
	}
}

    ## CCP7 Emishi Ainu Kamuy ##
    religious_kamuyist_high_headgear = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = ccp7_emishi_nivkh_headgear
				range = { 0.52 0.56 } # For the randomness to work correctly
            }
        }
        outfit_tags = { priest_outfit }
        weight = {
            base = 0
            modifier = {
                add = 105 #higher than steppe
                portrait_religious_high_trigger = yes
                portrait_religious_emishi_trigger = yes
            }
        }
    }

    ## CCP7 Shaman ##
    religious_shamanist_high_headgear = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = religious_steppe_high
                range = { 0 1 }
            }
        }
        outfit_tags = { priest_outfit }
        weight = {
            base = 0
            modifier = {
                add = 105 #higher than steppe
                portrait_religious_high_trigger = yes
                portrait_religious_shamanism_trigger = yes
            }
        }
    }
	
    ## CCP7 Nivkh Shaman ##
    religious_nivkh_shamanist_high_headgear = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = headgear
                template = ccp7_emishi_nivkh_headgear
                range = { 0.96 1 }
            }
        }
        outfit_tags = { priest_outfit }
        weight = {
            base = 0
            modifier = {
                add = 105 #higher than steppe
                portrait_religious_high_trigger = yes
                portrait_religious_emishi_trigger = yes
            }
        }
    }	

## Steppe ##

	religious_steppe_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_steppe_high
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_steppe_trigger = yes
			}
			modifier = {
				add = 100
				has_court_position = court_astrologer_court_position
				exists = situation:the_great_steppe
				liege ?= {
					any_character_situation = {
						this = situation:the_great_steppe
					}
				}
			}
		}
	}

## Japanese (Shinto) ##

	religious_japanese_headgear = { 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = tgp_japanese_headgear
				accessory = m_headgear_rel_tgp_shinto_priest
			}
		}
		outfit_tags = { monk_outfit }
		weight = {
			base = 0
			modifier = {
				add = 110
				OR = {
					portrait_religious_high_trigger = yes
					portrait_religious_devoted_trigger = yes
				}
			   	portrait_religious_buddhist_trigger = no # Not appropriate for Buddhists
				portrait_japanese_clothing_trigger = yes
			}
		}
	}

## Buddhist ##

	religious_buddhist_devoted_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = no_headgear
				range = { 0 1 } # For the randomness to work correctly
			}
			accessory = {
				mode = add
				gene = hairstyles
				template = no_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
			accessory = {
				mode = add
				gene = beards
				template = no_beard
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { monk_outfit }
		weight = {
			base = 0
			modifier = {
				add = 300
				OR = {
					portrait_religious_devoted_trigger = yes
					portrait_religious_high_trigger = yes
				}
				portrait_religious_buddhist_trigger = yes
				NOT = { has_character_flag = has_scripted_appearance }
			}
			modifier = {
				factor = 0
				has_tgp_dlc_trigger = yes
                OR = {
                    portrait_chinese_clothing_trigger = yes
					portrait_epe_uyghur_clothing_trigger = yes
					portrait_epe_sino_iranian_clothing_trigger = yes						
                }
			}
		}
	}

	religious_buddhist_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = no_headgear
				range = { 0 1 } # For the randomness to work correctly
			}
			accessory = {
				mode = add
				gene = hairstyles
				template = no_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
			accessory = {
				mode = add
				gene = beards
				template = no_beard
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 110
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_buddhist_trigger = yes
				NOT = { has_character_flag = has_scripted_appearance }
			}
			modifier = {
				factor = 0
				has_tgp_dlc_trigger = yes
                OR = {
                    portrait_chinese_clothing_trigger = yes
					portrait_epe_uyghur_clothing_trigger = yes
					portrait_epe_sino_iranian_clothing_trigger = yes						
                }
			}
		}
	}

## Chinese Buddhist (TGP) ##

	religious_buddhist_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = no_headgear
				range = { 0 1 } # For the randomness to work correctly
			}
			accessory = {
				mode = add
				gene = hairstyles
				template = no_hairstyles
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 110
				OR = {
					portrait_religious_devoted_trigger = yes
					portrait_religious_high_no_poverty_trigger = yes
				}
				portrait_religious_buddhist_trigger = yes
				NOT = { has_character_flag = has_scripted_appearance }
                OR = {
                    portrait_chinese_clothing_trigger = yes
					portrait_epe_uyghur_clothing_trigger = yes
					portrait_epe_sino_iranian_clothing_trigger = yes						
                }
			}
		}
	}
	
## TGP Chinese Taoist ##

	religious_taoist_devoted_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = tgp_chinese_headgear
                accessory = male_headgear_secular_chinese_nobility_06
			}
		}
		outfit_tags = { monk_outfit }
        weight = {
            base = 0
            modifier = {
                add = 110
                portrait_religious_taoist_trigger = yes
                OR = {
                    portrait_religious_devoted_trigger = yes
                    portrait_religious_high_trigger = yes
                }
            }
        }
	}	

## Hinduist ##

	religious_hindu_devoted_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = no_headgear
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { monk_outfit }
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_has_trait_trigger = { TRAIT = devoted }
				portrait_religious_hindu_trigger = yes
			}
		}
	}

	religious_hindu_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = no_headgear
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 110
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_hindu_trigger = yes
			}
		}
	}

## Zoroastrian ##

	religious_zoroastrian_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_zoroastrian_high
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_zoroastrian_trigger = yes
			}
		}
	}

## Jain ##

	religious_jain_devoted_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = no_headgear
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { monk_outfit }
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_has_trait_trigger = { TRAIT = devoted }
				portrait_religious_jain_trigger = yes
			}
		}
	}

	religious_jain_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = no_headgear
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 110
				exists = this
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_jain_trigger = yes
			}
		}
	}

## African Pagan ##

	# religious_african_devoted_clothes = {
	# 	dna_modifiers = {
	# 		accessory = {
	# 			mode = add
	# 			gene = clothes
	# 			template = mena_commoner_clothes
	# 			range = { 0 1 } # For the randomness to work correctly
	# 		}
	# 	}
	#	outfit_tags = { monk_outfit }
	# 	weight = {
	# 		base = 0
	# 		modifier = {
	# 			add = 100
	# 			portrait_has_trait_trigger = { TRAIT = devoted }
	# 			religion = religion:islam_religion
	# 		}
	# 	}
	# }

	religious_african_high_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = religious_african_high
				range = { 0 1 }
			}
		}
		outfit_tags = { priest_outfit }
		weight = {
			base = 0
			modifier = {
				add = 110
				portrait_religious_high_no_poverty_trigger = yes
				portrait_religious_african_trigger = yes
			}
		}
	}

}
