﻿
cloaks = {

	usage = game

    ep2_western_era1_low_nobles_cloaks = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ep2_cloak_western_era1_low_nobility
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
                portrait_era1_trigger = yes     
                has_ep2_dlc_trigger = yes   
                OR = {
	                portrait_low_nobles_trigger = { 
	                    CULTURE_INPUT = western
	                }   
                	portrait_high_nobles_headgear_trigger = { 
	                    CULTURE_INPUT = western
	                }               
                }
            }
            modifier = {
                add = 30
                portrait_era2_trigger = yes     
                has_ep2_dlc_trigger = yes   
                OR = {
	                portrait_low_nobles_trigger = { 
	                    CULTURE_INPUT = western
	                }   
                	portrait_high_nobles_headgear_trigger = { 
	                    CULTURE_INPUT = western
	                }               
                }
            }
            modifier = {
                add = 100       # Northern Era 1 kings and queens will use the era 1 low nobility cloak, if FP1 is not active
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes
            	portrait_royalty_trigger = { 
                    CULTURE_INPUT = northern
                }
                has_fp1_dlc_trigger = no
            }
            modifier = {
                factor = 0
                OR = {
                	is_adult = no
					AND = {
						is_ruler = yes
						has_government = theocracy_government
					}
					government_has_flag = government_is_landless_adventurer
                }  
            }
		    modifier = {
		        add = 50
		        court_fashion_level_4_trigger = {
		            CULTURE_INPUT = western
		        }
		        has_ep2_dlc_trigger = yes 
		        portrait_era1_trigger = yes 
		    }
        }
    }
    
    ep2_western_era1_high_nobles_cloaks = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ep2_cloak_western_era1_high_nobility
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
                OR = {   
                	portrait_high_nobles_headgear_trigger = { # Headgear trigger used because the regular high nobles one includes royalty and imperial tiers as well
	                    CULTURE_INPUT = western
	                }               
                }
				NAND = {
					is_ruler = yes
					has_government = theocracy_government
				}
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes     
            }
            modifier = {
                add = 30
                OR = { 
                	portrait_high_nobles_headgear_trigger = { 
	                    CULTURE_INPUT = western
	                }               
                }
                has_ep2_dlc_trigger = yes   
                portrait_era2_trigger = yes     
            }
            modifier = {
                factor = 0
                OR = {
                	is_adult = no
					AND = {
						is_ruler = yes
						has_government = theocracy_government
					}  
                } 
            }
            modifier = {
                add = 100       # Era 1 kings and queens will use the era 1 high nobility cloak and not the regular royalty one
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes
                OR = {
	            	portrait_royalty_trigger = { 
	                    CULTURE_INPUT = western
	                }
	            	portrait_royalty_trigger = { 
	                    CULTURE_INPUT = byzantine
	                }
	            	portrait_imperial_trigger = { 
	                    CULTURE_INPUT = western
	                }
	            	portrait_imperial_trigger = { 
	                    CULTURE_INPUT = byzantine
	                }
                }
            }
            modifier = {
                add = 100       # Era 1 kings and queens will use the era 1 high nobility cloak and not the regular royalty one
                has_ep2_dlc_trigger = yes   
                portrait_era1_trigger = yes
				government_has_flag = government_is_landless_adventurer
				has_realm_law = camp_purpose_legitimists
                OR = {
					portrait_western_clothing_trigger = yes
					portrait_byzantine_clothing_trigger = yes
                }
            }
		    modifier = {
		        add = 50
		        court_fashion_level_5_trigger = {
		            CULTURE_INPUT = western
		        }
		        has_ep2_dlc_trigger = yes 
		        portrait_era1_trigger = yes 
		    }	
		    modifier = {
		        factor = 0
		        has_ep3_dlc_trigger = yes 
		    }	
        }
    }

    western_no_cloak = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = no_cloak
				range = { 0 1 }
			}
		}
		outfit_tags = { no_clothes nightgown no_cloak beggar_rags }
		weight = {
			base = 0
			modifier = { # Some random chance for no cloak
				add = {
					value = 50
					if = {
						limit = {
							portrait_low_nobles_trigger = { 
								CULTURE_INPUT = western
							} 
						}
						add = -15
						if = {
							limit = {
								portrait_wear_armor_trigger = yes
							}
							add = 30
						}
					}
					else_if = {
						limit = {
							OR = {
								portrait_royalty_trigger = { 
									CULTURE_INPUT = western
								} 
								portrait_imperial_trigger = { 
									CULTURE_INPUT = western
								} 
							}
						}
						add = -50
					}
					if = {
						limit = {
							portrait_high_nobles_headgear_trigger = { 
								CULTURE_INPUT = western
							}
						}
						add = -30
						if = {
							limit = {
								portrait_wear_armor_trigger = yes
							}
							add = 15
						}
					}
				}
				portrait_western_clothing_trigger = yes
			}
		}
    }

	western_kings = {
		# outfit_tags = { rank_headgear } 
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = western_royalty
				range = { 0 1 }
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 50
				is_adult = yes
				OR = {
					AND = {
						government_has_flag = government_is_landless_adventurer
						has_realm_law = camp_purpose_legitimists
						OR = {
							portrait_western_clothing_trigger = yes
							portrait_byzantine_clothing_trigger = yes
							portrait_dde_hre_clothing_trigger = yes
							portrait_northern_clothing_trigger = yes
						}
					}
	                portrait_royalty_trigger = {
	                    CULTURE_INPUT = western
	                }  
	                portrait_royalty_trigger = {
	                    CULTURE_INPUT = dde_hre
	                } 
	                portrait_royalty_trigger = {
	                    CULTURE_INPUT = byzantine
	                } 
	                portrait_imperial_trigger = {
	                    CULTURE_INPUT = western
	                }  
	                portrait_imperial_trigger = {
	                    CULTURE_INPUT = dde_hre
	                } 
	                portrait_imperial_trigger = {
	                    CULTURE_INPUT = byzantine
	                } 
					AND = {
		                portrait_royalty_trigger = {
		                    CULTURE_INPUT = northern
		                }  
						OR = {
			                NOT = {
				                portrait_royalty_trigger = {
				                    CULTURE_INPUT = fp1_norse
				                }  
			                }
							AND = {
				                portrait_royalty_trigger = {
				                    CULTURE_INPUT = fp1_norse
				                }  
								NOR = {
									government_has_flag = government_is_tribal
									#AGOT Modified
									# religion = religion:germanic_religion
									religion = religion:the_ways_religion
									religion = religion:the_pact_religion
								}
							}
						}
					}				
				}
			}	
            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
            }	
            modifier = {
                factor = 0       # Should NOT show up if EP2 is active and we're not in the right era
                has_ep3_dlc_trigger = yes   
            }
		}
	}

	camp_purpose_brigands_cloaks = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = camp_purpose_brigands_cloaks
				range = { 0 1 }
			}
			morph = {
				mode = add
				gene = gene_bs_cloak
				template = cloak
				value = 1.0
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 100
				government_has_flag = government_is_landless_adventurer
				OR = {
					has_realm_law = camp_purpose_brigands
					liege ?= { has_realm_law = camp_purpose_brigands }
				}
				portrait_african_clothing_trigger = no
				has_fp1_dlc_trigger = yes
			}
		}
	}

	fp1_norse = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = fp1_cloak
				range = { 0 1 }
			}
			morph = {
				mode = add
				gene = gene_bs_cloak
				template = cloak
				value = 1.0
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = {
					value = 40
					if = {
						limit = {
							OR = {
								portrait_low_nobles_trigger = {
									CULTURE_INPUT = northern
								} 
								portrait_high_nobles_trigger = {
									CULTURE_INPUT = northern
								} 
							}
						}
						add = 40
					}
					else_if = {
						limit = {
							OR = {
								portrait_royalty_trigger = {
									CULTURE_INPUT = northern
								} 
								portrait_royalty_trigger = {
									CULTURE_INPUT = fp1_norse
								} 	                
							} 
						}
						add = 51
					}
				}
				portrait_fp1_norse_clothing_trigger = yes
			}
		}
	}


	fp1_norse_no_cloak = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = no_cloak
				range = { 0 1 }
			}
		}	
        outfit_tags = { no_clothes nightgown beggar_rags }
		weight = {
			base = 0
			modifier = {
				add = 60
				OR = {
					portrait_fp1_norse_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
			}	
			modifier = {
				add = -30
				OR = {
					portrait_fp1_norse_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
				highest_held_title_tier >= tier_county
			}	
			modifier = {
				add = -15
				OR = {
					portrait_fp1_norse_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
				exists = primary_spouse
				OR = {
					is_ruler = no
					highest_held_title_tier = tier_barony
				}
				primary_spouse = {
					highest_held_title_tier >= tier_county
				}
			}	
			modifier = {
				add = -30
				OR = {
					portrait_fp1_norse_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
				highest_held_title_tier >= tier_duchy
			}	
			modifier = {
				add = -15
				OR = {
					portrait_fp1_norse_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
				exists = primary_spouse
				OR = {
					is_ruler = no
					highest_held_title_tier = tier_barony
				}
				primary_spouse = {
					highest_held_title_tier >= tier_duchy
				}
			}	
			modifier = {
				add = -60
				OR = {
					portrait_fp1_norse_clothing_trigger = yes
					portrait_northern_clothing_trigger = yes
				}
				OR = {
					portrait_royalty_trigger = {
	                    CULTURE_INPUT = northern
	                } 
	                highest_held_title_tier >= tier_kingdom
				}
			}	
			modifier = {
				add = -60
				portrait_fp1_norse_clothing_trigger = yes
				OR = {
					portrait_wear_armor_trigger = yes
					portrait_has_trait_trigger = { TRAIT = berserker }
				}
			}
		}
	}

	fp1_norse_berserker = {
		dna_modifiers = {
			accessory = {
				mode = add
				
				gene = cloaks
				template = fp1_cloak_berserker
				range = { 0 1 }
			}
		}	
		weight = {
			base = 0
			modifier = {
				add = 100
				has_fp1_dlc_trigger = yes
				portrait_has_trait_trigger = { TRAIT = berserker }
			}
		}
	}

	sp2_western_imperial = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = sp2_cloak_imperial
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
                is_adult = yes
                OR = {   
                	portrait_royalty_trigger = { 
	                    CULTURE_INPUT = western
	                }    
                	portrait_imperial_trigger = { 
	                    CULTURE_INPUT = western
	                }              
                }
                OR = {
                	portrait_era1_trigger = yes
                	portrait_era2_trigger = yes
                }
				NAND = {
					is_ruler = yes
					has_government = theocracy_government
				} 
                has_dlc_feature = elegance_of_the_empire   
            }
            modifier = {
                factor = 0
                has_ep2_dlc_trigger = yes  
                NOR = {
                    portrait_era2_trigger = yes   
                    portrait_era3_trigger = yes 
                }             
            }
        }
    }
    
    	fp4_western_era3_nobility_01 = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = fp4_cloak_western
                accessory = m_cloaks_sec_fp4_western_era3_nob_01
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 10
                is_adult = yes
                OR = {   
                	portrait_low_nobles_trigger = { 
	                    CULTURE_INPUT = western
	                }    
                	portrait_high_nobles_headgear_trigger = { 
	                    CULTURE_INPUT = western
	                }              
                }
                OR = {
                	portrait_era3_trigger = yes
                	portrait_era4_trigger = yes
                }
                has_ce1_dlc_trigger = yes
                portrait_wear_no_armor_trigger = yes  
            }
            modifier = {
                factor = 0
                government_has_flag = government_is_landless_adventurer
				NOT = { has_realm_law = camp_purpose_legitimists }
            }
        }
    }

	fp4_western_era3_nobility_02_a = { # With the hood pulled up
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = fp4_cloak_western
                accessory = m_cloaks_sec_fp4_western_era3_nob_02
            }
            accessory = {
                mode = add
                gene = headgear
                template = fp4_western_cloak_hoods
                range = { 0 1 }
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 5
                is_adult = yes
                OR = {   
                	portrait_low_nobles_trigger = { 
	                    CULTURE_INPUT = western
	                }    
                	portrait_high_nobles_headgear_trigger = { 
	                    CULTURE_INPUT = western
	                }              
                }
                OR = {
                	portrait_era3_trigger = yes
                	portrait_era4_trigger = yes
                }
                has_ce1_dlc_trigger = yes
                portrait_wear_no_armor_trigger = yes   
            }
            modifier = {
                factor = 0
                government_has_flag = government_is_landless_adventurer
				NOT = { has_realm_law = camp_purpose_legitimists }
            }
        }
    }

	fp4_western_era3_nobility_02_b = { # With the hood pulled down
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = fp4_cloak_western
                accessory = m_cloaks_sec_fp4_western_era3_nob_02
            }
            accessory = {
                mode = add
                gene = cloak_hoods
                template = fp4_western_cloak_hoods
                range = { 0 1 }
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 5
                is_adult = yes
                OR = {   
                	portrait_low_nobles_trigger = { 
	                    CULTURE_INPUT = western
	                }    
                	portrait_high_nobles_headgear_trigger = { 
	                    CULTURE_INPUT = western
	                }              
                }
                OR = {
                	portrait_era3_trigger = yes
                	portrait_era4_trigger = yes
                }
                has_ce1_dlc_trigger = yes
                portrait_wear_no_armor_trigger = yes
            }
            modifier = {
                factor = 0
                government_has_flag = government_is_landless_adventurer
				NOT = { has_realm_law = camp_purpose_legitimists }
            }
        }
    }

	sp3_western_royalty = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = sp3_cloak
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 100
                is_adult = yes
                has_dlc_feature = couture_of_the_capets     
                portrait_royalty_trigger = {
                    CULTURE_INPUT = western
                }           
                portrait_royalty_trigger = {
                    CULTURE_INPUT = french
                } 
            }
            modifier = {
                add = 50
                is_adult = yes
                OR = {   
					AND = {
						government_has_flag = government_is_landless_adventurer
						has_realm_law = camp_purpose_legitimists
						portrait_western_clothing_trigger = yes
					}
                	portrait_royalty_trigger = { 
	                    CULTURE_INPUT = western
	                }    
                	portrait_imperial_trigger = { 
	                    CULTURE_INPUT = western
	                }              
                }
				NAND = {
					is_ruler = yes
					has_government = theocracy_government
				} 
                has_dlc_feature = couture_of_the_capets   
            }
            modifier = {
                factor = 0
                has_ep2_dlc_trigger = yes 
                OR = {
                    portrait_era1_trigger = yes   
                    portrait_era2_trigger = yes   
                }     
                NAND = {
                	portrait_era1_trigger = no
                    portrait_royalty_trigger = {
                        CULTURE_INPUT = french
                    } 
                }         
            }
        }
    }

	afr_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = afr_cloaks
                range = { 0 0.32 }
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
                portrait_commoner_no_mayors_trigger = {
                    CULTURE_INPUT = afr_berber
                }
				NAND = {
					is_ruler = yes
					has_government = theocracy_government
				}
            }
            modifier = {
                factor = 0
                OR = {
                	is_adult = no
					is_male = yes
					AND = {
						is_ruler = yes
						has_government = theocracy_government
					}  
                }  
            }
        }
    }
	
	afr_low_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = afr_cloaks
                range = { 0.34 0.65 }
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
				OR = {
					portrait_low_nobles_clothing_trigger = {
						CULTURE_INPUT = afr_berber
					}
					portrait_mayor_trigger = {
						CULTURE_INPUT = afr_berber
					}
				}
            }
            modifier = {
                factor = 0
                OR = {
                	is_adult = no
					is_male = yes
					AND = {
						is_ruler = yes
						has_government = theocracy_government
					}  
                }  
            }
        }
    }
	
	afr_high_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = afr_cloaks
                range = { 0.66 1.0 }
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
				OR = {
                portrait_high_nobles_clothing_trigger = {
                    CULTURE_INPUT = afr_berber
                }
					AND = {
						government_has_flag = government_is_landless_adventurer
						has_realm_law = camp_purpose_legitimists
						portrait_afr_berber_clothing_trigger = yes
					}
				}
            }
            modifier = {
                factor = 0
                OR = {
                	is_adult = no
					is_male = yes
					AND = {
						is_ruler = yes
						has_government = theocracy_government
					}  
                }  
            }
        }
    }

	sami_and_ugro_permian_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ccp4_sami_cloaks_com
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
				portrait_commoner_clothing_trigger = {
					CULTURE_INPUT = sami
				}
				NAND = {
					is_ruler = yes
					has_government = theocracy_government
				}
            }
        }
    }
	
	sami_and_ugro_permian_low_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ccp4_sami_cloaks_lo_nob
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
				portrait_low_nobles_clothing_trigger = {
					CULTURE_INPUT = sami
				}
            }
        }
    }
	
	sami_and_ugro_permian_high_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ccp4_sami_cloaks_hi_nob
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 50
				portrait_high_nobles_clothing_trigger = {
					CULTURE_INPUT = sami
				}
            }
        }
    }


## EP3 - Roads to Power ##

    ep3_byzantine_era1_low_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ep3_byzantine_era1_nob
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 25
                portrait_low_nobles_clothing_trigger = { 
                    CULTURE_INPUT = byzantine
                } 
                has_ep3_dlc_trigger = yes   
                portrait_era1_trigger = yes     
            }
        }
    }

    ep3_byzantine_era2_low_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ep3_byzantine_era2_nob
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 25
                portrait_low_nobles_clothing_trigger = { 
                    CULTURE_INPUT = byzantine
                } 
                has_ep3_dlc_trigger = yes   
                OR = {
                	portrait_era2_trigger = yes  
                	portrait_era3_trigger = yes  
                	portrait_era4_trigger = yes  
                }    
            }
        }
    }

    ep3_byzantine_era1_high_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ep3_byzantine_era1_nob
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 45
                portrait_high_nobles_clothing_trigger = { 
                    CULTURE_INPUT = byzantine
                } 
                has_ep3_dlc_trigger = yes   
                portrait_era1_trigger = yes     
            }
        }
    }

    ep3_byzantine_era2_high_nobles = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ep3_byzantine_era2_nob
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 45
                portrait_high_nobles_clothing_trigger = { 
                    CULTURE_INPUT = byzantine
                } 
                has_ep3_dlc_trigger = yes   
                OR = {
                	portrait_era2_trigger = yes  
                	portrait_era3_trigger = yes  
                	portrait_era4_trigger = yes  
                }   
            }
            modifier = {
                factor = 0
                OR = {
	                portrait_royalty_clothing_trigger = { 
	                    CULTURE_INPUT = byzantine
	                } 
	                portrait_imperial_clothing_trigger = { 
	                    CULTURE_INPUT = byzantine
	                } 
                } 
            }
        }
    }

    ep3_byzantine_era1_imperial = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = ep3_byzantine_era1_imperial
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 100
                OR = {
	                portrait_royalty_trigger = { 
	                    CULTURE_INPUT = byzantine
	                }   
	                portrait_imperial_trigger = { 
	                    CULTURE_INPUT = byzantine
	                }               
                }
                has_ep3_dlc_trigger = yes   
                portrait_era1_trigger = yes     
            }
        }
    }

    ep3_no_cloak = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = no_cloak
				range = { 0 1 }
			}
		}
		outfit_tags = { no_clothes nightgown no_cloak beggar_rags }
		weight = {
			base = 0
			modifier = { # Some random chance for no cloak
				add = 50
				portrait_byzantine_clothing_trigger = yes
			}
			modifier = { 
				add = -15
            	portrait_low_nobles_trigger = { 
                    CULTURE_INPUT = byzantine
                } 
			}
			modifier = { 
				add = -30
            	portrait_high_nobles_headgear_trigger = { 
                    CULTURE_INPUT = byzantine
                } 
			}
			modifier = { 
				add = -50
				OR = {
	            	portrait_royalty_trigger = { 
	                    CULTURE_INPUT = byzantine
	                } 
	            	portrait_imperial_trigger = { 
	                    CULTURE_INPUT = byzantine
	                } 
				}
			}
		}
    }

	#
	#pope = {
	#    dna_modifiers = {
	#        accessory = {
	#            mode = add
	#            gene = capes
	#            template = pope_capes
	#            range = { 0 1 }
	#        }
	#    }
	#    weight = {
	#        base = 100
	#        modifier = {
	#            factor = 0
	#			NAND = {
	#				is_ruler = yes
	#				primary_title = {
	#					any_controlled_faith = {
	#						this = faith:catholic
	#					}
	#				}
	#			}
	#        }
	#    }
	#}
	#empty_capes_modifier = {
	#	dna_modifiers = {
	#		accessory = {
	#			mode = add				
	#			gene = capes
	#			template = empty_capes_template
	#			#value = 0.75
	#		}
	#	}
	#	weight = {
	#		base = 0.001
	#	}
	#}	
	# western_kings_capes_modifier = {
	# 	dna_modifiers = {
	# 		accessory = {
	# 			mode = add				
	# 			gene = capes
	# 			template = western_kings_capes_template
	# 			#value = 0.75
	# 		}
	# 	}
	# 	weight = {
	# 		base = 0	#if weight is >= 100, this one will be picked without ever doing the weighted random selection
			
	# 		#TODO only for Christian religion group
	# 		#TODO not for tribal
			
	# 		modifier = {
	# 			#humble people just wanna wear rags
	# 			add = -100
	# 			portrait_has_trait_trigger = { TRAIT = humble }
	# 		}
	# 		modifier = {
	# 			add = 50
	# 			#arrogant people just wanna show off...
	# 			portrait_has_trait_trigger = { TRAIT = arrogant }
	# 			OR = {
	# 				highest_held_title_tier >= tier_kingdom
	# 				AND = {
	# 					#...and love acting above their station
	# 					highest_held_title_tier = tier_duchy
	# 					is_independent_ruler = yes
	# 				}
	# 			}
	# 		}
	# 		modifier = {
	# 			#kings and emperors will usually have to look fancy anyway
	# 			add = 50
	# 			highest_held_title_tier >= tier_kingdom
	# 		}
	# 	}
	# }	

	#AGOT Added

	agot_cloaks_no_cloaks = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = no_cloak
				value = 1
			}
		}
		weight = {
			base = 200
			modifier = {
				add = -500
				has_trait = kingsguard
				NOT = { has_character_flag = use_stealth_clothes }
			}
			modifier = {
				add = 500
					has_ep1_dlc_trigger = no
					has_trait = kingsguard
				}
			#Ned's Armor
			modifier = {
				add = 500
				portrait_wear_armor_trigger = yes
				house ?= dynasty:dynn_Stark.dynasty_founder.house
			}
			}
		}

	# Night's Watch
	agot_cloaks_nights_watch = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = nw_fur_01
				value = 1
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 400
				OR = {
					has_trait = nightswatch
					has_trait = nightswatch_temp
					has_trait = nightswatch_historical
				}
			}
		}
	}

	agot_cloak_kingsguard_iron_throne = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = kingsguard_cloak
				value = 1
			}
			morph = {
				mode = modify_multiply
				gene = gene_bs_bust
				value = 0.8 # Setting this lower to reduce the exaggerated effect of large bust size when wearing clothes
				template = bust_clothes
			}
		 }
		weight = {
			base = 0
			modifier = {
				add = 1500
				##Don't want to make Paradox angry, don't remove this unless we replace the asset with a custom in house made cloak/cape
				has_ep1_dlc_trigger = yes
				has_trait = kingsguard
				NOT = { has_character_flag = use_stealth_clothes }

				OR = {
					##Armor of the kingsguard is not loaded
					is_aotk_loaded_trigger = no
					
					##Armor of the kingsguard is loaded, but the game rule is off
					AND = {
						NOT = {	has_game_rule = show_armor_enabled}
					}
					##Armor of the kingsguard is loaded, and they should use the white cloak from the base mod
					AND = {
						is_aotk_loaded_trigger = yes
						has_game_rule = show_armor_enabled
						exists = title:h_the_iron_throne.holder
						title:h_the_iron_throne.holder = {
							primary_title = { 
								has_variable = kingsguard 
								OR = {
									AND = {
										has_variable = kingsguard_choice
										OR = {
											var:kingsguard_choice = 0
											var:kingsguard_choice = 4
										}
									}
									NOT = { has_variable = kingsguard_choice }
								}
							}
						}
					}
				}
	 		}
		}
	 }
	
	agot_cloak_goldcloak = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = cloaks
                template = male_goldcloak_01
                value = 1
            }
            morph = {
                mode = modify_multiply
                gene = gene_bs_bust
                value = 0.8 # Setting this lower to reduce the exaggerated effect of large bust size when wearing clothes
                template = bust_clothes
            }
        }
        weight = {
            base = 0
            modifier = {
                add = 1500
				has_ep1_dlc_trigger = yes
				has_court_position = goldcloaks_court_position
				is_target_in_global_variable_list = {
					name = agot_goldcloaks_founded
					target = flag:goldcloaks_founded
				}
			}
        }
    }
    
    agot_cloak_northman_low = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_coa_cloaks_fp1_dynamic_low
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 210
				has_fp1_dlc_trigger = yes
				OR = {
					portrait_low_nobles_clothing_trigger = {
						CULTURE_INPUT = the_north
					}
					portrait_low_nobles_armor_trigger = {
						CULTURE_INPUT = the_north
					}
				}
			}
		}
	}

	agot_cloak_northman_high = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_coa_cloaks_fp1_dynamic_high
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 210
				has_fp1_dlc_trigger = yes
				OR = {
					portrait_high_nobles_clothing_trigger = {
						CULTURE_INPUT = the_north
					}
					portrait_high_nobles_armor_trigger = {
						CULTURE_INPUT = the_north
					}
				}
			}
		}
	}

	agot_cloak_northman_stark = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_coa_cloaks_fp1_dynamic_stark
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 220
				has_fp1_dlc_trigger = yes
				OR = {
					portrait_high_nobles_clothing_trigger = {
						CULTURE_INPUT = the_north
					}
					portrait_high_nobles_armor_trigger = {
						CULTURE_INPUT = the_north
					}
				}
				house ?= dynasty:dynn_Stark.dynasty_founder.house
			}
		}
	}

	agot_cloak_northman_torrhen_stark = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_historic_capes
				accessory = male_cloaks_secular_north_high_winter_torrhen_01
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 230
				has_fp1_dlc_trigger = yes
				OR = {
					portrait_high_nobles_clothing_trigger = {
						CULTURE_INPUT = the_north
					}
					portrait_high_nobles_armor_trigger = {
						CULTURE_INPUT = the_north
					}
				}
				has_inactive_trait = is_Stark_66
			}
		}
	}

	agot_cloak_northman_ned_stark = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_historic_capes
				accessory = male_cloaks_secular_north_high_winter_stark_01
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 230
				has_fp1_dlc_trigger = no
				OR = {
					portrait_high_nobles_clothing_trigger = {
						CULTURE_INPUT = the_north
					}
					portrait_high_nobles_armor_trigger = {
						CULTURE_INPUT = the_north
					}
				}
				has_inactive_trait = is_Stark_3
			}
		}
	}

	agot_cloak_northman_ned_stark_dlc = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_historic_capes
				accessory = male_cloaks_secular_fp1_agot_northern_ned_01
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 230
				has_fp1_dlc_trigger = yes
				OR = {
					portrait_high_nobles_clothing_trigger = {
						CULTURE_INPUT = the_north
					}
					portrait_high_nobles_armor_trigger = {
						CULTURE_INPUT = the_north
					}
				}
				has_inactive_trait = is_Stark_3
			}
		}
	}

	agot_cloak_riverman = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = male_cloaks_secular_shouldercape_dynastic
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 240
				is_male = yes
				portrait_high_nobles_armor_trigger = {
					CULTURE_INPUT = riverlander
				}
			}
		}
	}

	agot_cloak_valeman = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_coa_cloaks_ep1
				range = { 0 1 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 240
				has_ep1_dlc_trigger = yes
				is_male = yes
				OR = {
					agot_portrait_high_armor_trigger = {
						CULTURE_INPUT = valeman
					}
					agot_portrait_high_armor_trigger = {
						CULTURE_INPUT = valeman_upper
					}
				}
				NOT = {
					dynasty ?= dynasty:dynn_Royce
				}
			}
		}
	}
	
	agot_clothing_raven_feather_cloak_artifact = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = cloaks
				template = agot_all_fp1_cloaks
				accessory = m_cloaks_secular_fp1_agot_northern_nw_02
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 400
				has_fp1_dlc_trigger = yes
				agot_has_artifact_equipped = { ARTIFACT_VARIABLE = raven_feather_cloak_artifact }
			}
		}
	}
	
	##SMC Added
	kingsguard_cloak_black = {
	    dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = cloaks
	            template = kingsguard_cloak_aotk
	            value = 0.0
	        }
	 		morph = {
	 			mode = modify_multiply
	 			gene = gene_bs_bust
	 			value = 0.8 # Setting this lower to reduce the exaggerated effect of large bust size when wearing clothes
	 			template = bust_clothes
	 		}
	     }
	    weight = {
	        base = 0
	        modifier = {
				has_trait = kingsguard
					#portrait_wear_armor_trigger = yes
					is_aotk_loaded_trigger = yes
					has_game_rule = show_armor_enabled
					exists = title:h_the_iron_throne.holder
					title:h_the_iron_throne.holder = {
						primary_title = { 
							has_variable = kingsguard 
							AND = {
								has_variable = kingsguard_choice 
								OR = {
									var:kingsguard_choice = 2
									var:kingsguard_choice = 5
								}
							}
						}
					}
	 			add = 1500
				##Don't want to make Paradox angry, don't remove this unless we replace the asset with a custom in house made cloak/cape
				has_ep1_dlc_trigger = yes
	 		}
	     }
	 }
	 
	 kingsguard_cloak_tan = {
	    dna_modifiers = {
	        accessory = {
	            mode = add
	            gene = cloaks
	            template = kingsguard_cloak_aotk
	            value = 1.0
	        }
	 		morph = {
	 			mode = modify_multiply
	 			gene = gene_bs_bust
	 			value = 0.8 # Setting this lower to reduce the exaggerated effect of large bust size when wearing clothes
	 			template = bust_clothes
	 		}
	     }
	    weight = {
	        base = 0
	        modifier = {
				has_trait = kingsguard
					is_aotk_loaded_trigger = yes
					#portrait_wear_armor_trigger = yes
					has_game_rule = show_armor_enabled
					exists = title:h_the_iron_throne.holder
					title:h_the_iron_throne.holder = {
						primary_title = { 
							has_variable = kingsguard 
							AND = {
								has_variable = kingsguard_choice 
								OR = {
									var:kingsguard_choice = 1
									var:kingsguard_choice = 3
								}
							}
						}
					}
	 			add = 1500
				##Don't want to make Paradox angry, don't remove this unless we replace the asset with a custom in house made cloak/cape
				has_ep1_dlc_trigger = yes
	 		}
	     }
	 }
}
