﻿headgear_situational = {

	usage = game
	selection_behavior = weighted_random
	priority = 5


	western_stealth = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_stealth
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = {
			western_stealth
			western_stealth_hood
		}
		weight = {
			base = 0
			modifier = {
				add = 110
				portrait_stealth_trigger = yes
				OR = {
					portrait_western_clothing_trigger = yes
					portrait_byzantine_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
			}
		}
	}

	mena_stealth = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_stealth
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = {
			mena_stealth
			mena_stealth_hood
		}
		weight = {
			base = 0
			modifier = {
				add = 110
				portrait_stealth_trigger = yes
				OR = {
					portrait_mena_clothing_trigger = yes
					portrait_indian_clothing_trigger = yes
					portrait_steppe_clothing_trigger = yes
					portrait_african_clothing_trigger = yes
				}
			}
		}
	}

	jester_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add

				gene = headgear
				template = ep1_jester
				range = { 0 1 }
			}
		}
		outfit_tags = { jester_outfit }
		weight = {
			base = -100
			modifier = {
				add = 1000
				OR = {
					portrait_jester_trigger = { CULTURE_INPUT = western }
					portrait_jester_trigger = { CULTURE_INPUT = byzantine }
					portrait_jester_trigger = { CULTURE_INPUT = northern }
				}
			}
			modifier = {
				factor = 0
				OR = {
					is_adult = no
					should_be_naked_trigger = yes
				}
			}
		}
	}

	hajj_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_common
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 500
				exists = this
				OR = {
					portrait_ep2_hajj_clothes_trigger = yes
					portrait_ep2_ihram_clothes_trigger = yes
				}
			}
		}
	}

	# EP2 - WEDDINGS

	wedding_western_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = western_wedding
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { spouse_outfit }
		weight = {
			base = 0
			modifier = {
				add = 1000
				has_ep2_dlc_trigger = yes
				portrait_ep2_wedding_clothes_trigger = yes
				OR = {
					portrait_western_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
			}
		}
	}

	wedding_mena_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = mena_wedding
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { spouse_outfit }
		weight = {
			base = 0
			modifier = {
				add = 1000
				has_ep2_dlc_trigger = yes
				portrait_ep2_wedding_clothes_trigger = yes
				OR = {
					portrait_mena_clothing_trigger = yes
					portrait_african_clothing_trigger = yes
					portrait_indian_clothing_trigger = yes
					portrait_steppe_clothing_trigger = yes
				}
			}
		}
	}

	wedding_byz_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = headgear
				template = byzantine_wedding
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { spouse_outfit }
		weight = {
			base = 0
			modifier = {
				add = 1000
				has_ep2_dlc_trigger = yes
				portrait_ep2_wedding_clothes_trigger = yes
				portrait_byzantine_clothing_trigger = yes
			}
		}
	}


	# BP2
	university_teacher_headgear = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = special_headgear_spectacles
				template = spectacles
				range = { 0 1 } # For the randomness to work correctly
			}
		}
		outfit_tags = { spectacles_outfit }
		weight = {
			base = 0
			modifier = {
				add = 1000
				OR = {
					has_character_flag = teacher_1
					has_character_flag = teacher_2
					has_character_flag = imperial_examiner
					has_character_flag = has_reading_glasses
				}
				NOR = {
					has_trait = blind
					has_trait = one_eyed
					culture = {
						OR = {
							has_building_gfx = chinese_building_gfx
							has_building_gfx = steppe_building_gfx
							has_building_gfx = indian_building_gfx
							has_building_gfx = tibetan_building_gfx
							has_building_gfx = southeast_asian_building_gfx
							has_building_gfx = japanese_building_gfx
						}
					}
				}
			}
			modifier = {
				add = 50
				learning >= high_skill_rating
				age >= 25
				is_ai = yes
				static_group_filter = {
					group = glasses
					match = 0.25
				}
				OR = {
					has_realm_law_flag = nerd_camp_purpose
					host ?= { has_realm_law_flag = nerd_camp_purpose }
				}
			}
			modifier = {
				factor = 0
				OR = {
					this = character:41702
					has_trait = blind
					has_trait = disfigured
					has_trait = one_eyed
					portrait_wear_helmet_trigger = yes
					government_has_flag = government_is_nomadic
					culture = {
						OR = {
							has_building_gfx = chinese_building_gfx
							has_building_gfx = steppe_building_gfx
							has_building_gfx = indian_building_gfx
							has_building_gfx = southeast_asian_building_gfx
							has_building_gfx = japanese_building_gfx
						}
					}
				}
			}
		}
	}
}
