﻿@baby_hair_age = 5
@african_clothing_no_hair_chance = 6.5

# Make sure the weights here match up best as possible with the custom_hair set
hairstyles = {

    usage = game
    selection_behavior = weighted_random

    western_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_western_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    western_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_western_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    western_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_western_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    western_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_afro
                }
                portrait_western_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    mena_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = mena_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_mena_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    this = character:33922 # Prophet Muhammad
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    mena_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = mena_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_mena_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    this = character:33922 # Prophet Muhammad
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    mena_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = mena_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_mena_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    this = character:33922 # Prophet Muhammad
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    mena_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = mena_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_afro
                }
                portrait_mena_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    this = character:33922 # Prophet Muhammad
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    byzantine_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = byzantine_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_byzantine_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    byzantine_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = byzantine_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_byzantine_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    byzantine_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = byzantine_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_byzantine_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    byzantine_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = byzantine_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_afro
                }
                portrait_byzantine_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    indian_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = indian_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_indian_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    indian_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = indian_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_indian_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    indian_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = indian_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_indian_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    indian_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = indian_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_afro
                }
                portrait_indian_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    steppe_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = steppe_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_steppe_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    steppe_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = steppe_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_steppe_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    steppe_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = steppe_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_steppe_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    steppe_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = steppe_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_afro
                }
                portrait_steppe_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    northern_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = northern_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_northern_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    northern_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = northern_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_northern_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    northern_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = northern_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_northern_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    northern_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = northern_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_afro
                }
                portrait_northern_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    african_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = sub_saharan_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_african_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    african_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = sub_saharan_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_african_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    african_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = sub_saharan_hairstyles_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_african_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    african_afro = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = sub_saharan_hairstyles_afro
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_afro
                }
                portrait_african_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

	baby_hair = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = western_baby_hairstyles
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        # outfit_tags = { no_clothes }
        weight = {
            base = 0
            modifier = {
                add = 100
                scope:age < @baby_hair_age
                NOT = { portrait_african_clothing_trigger = yes } # Should be replaced with a has_gene trigger when we get that
            }
        }
    }

    baby_hair_sub_saharan = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = sub_saharan_baby_hairstyles
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        # outfit_tags = { no_clothes }
        weight = {
            base = 0
            modifier = {
                add = 100
                scope:age < @baby_hair_age
                portrait_african_clothing_trigger = yes # Should be replaced with a has_gene trigger when we get that
            }
        }
    }

    no_hair = { # This is to give a random chance of a clean shaven look
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = no_hairstyles
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = -100
                scope:age < @baby_hair_age
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
            # Different likelyhood of a clean shaven look in different cultures
            modifier = {
                add = @african_clothing_no_hair_chance
                portrait_african_clothing_trigger = yes
            }
        }
    }

    # default_hair = {
    #     weight = {
    #         base = 0
    #         modifier = {
    #             add = 100
    #             scope:age >= @baby_hair_age
    #         }
    #         # This can't be always 100 otherwise it will get insta picked, so we subtract the no hair chance off to weight it properly
    #         modifier = {
    #             add = {
    #                 subtract = @african_clothing_no_hair_chance
    #             }
    #             portrait_african_clothing_trigger = yes
    #         }
    #     }
    # }


    ### FP2 Hair ###

    fp2_hairstyles_iberian_muslim_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_muslim_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_fp2_iberian_muslim_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                is_lowborn = no 
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

     fp2_hairstyles_iberian_muslim_straight_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_muslim_straight_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_fp2_iberian_muslim_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                is_lowborn = yes
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

    fp2_hairstyles_iberian_muslim_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_muslim_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
              	is_lowborn = no 
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_fp2_iberian_muslim_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

    fp2_hairstyles_iberian_muslim_wavy_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_muslim_wavy_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
              	is_lowborn = yes 
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_fp2_iberian_muslim_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

    fp2_hairstyles_iberian_muslim_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_muslim_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                is_lowborn = no
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_fp2_iberian_muslim_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

fp2_hairstyles_iberian_muslim_curly_commoners = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_muslim_curly_common
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                is_lowborn = yes 
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_fp2_iberian_muslim_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

    fp2_hairstyles_iberian_christian_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_christian_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
				OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_fp2_iberian_christian_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

    fp2_hairstyles_iberian_christian_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_christian_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_fp2_iberian_christian_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

    fp2_hairstyles_iberian_christian_curly = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp2_hairstyles_iberian_christian_curly
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
                portrait_fp2_iberian_christian_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                }
            }
        }
    }

    ### FP1 Hair ###

    fp1_straight = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp1_hairstyles_straight
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                OR = {
                    NOT = { exists = this }
					has_gene = {
						category = gene_hair_type
						template = hair_straight
					}
					has_gene = {
						category = gene_hair_type
						template = hair_straight_thin_beard
					}
				}
                portrait_fp1_norse_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

    fp1_wavy = {
        dna_modifiers = {
            accessory = {
                mode = add
                gene = hairstyles
                template = fp1_hairstyles_wavy
                range = { 0 1 } # For the randomness to work correctly
            }
        }   
        weight = {
            base = 0
            modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                portrait_fp1_norse_clothing_trigger = yes
            }
            modifier = {
                add = -100
                exists = this
                OR = {
                    is_from_ruler_designer = yes
                    has_character_flag = has_scripted_appearance
                    has_character_flag = islam_prophet
                    trigger_if = {
                        limit = {
                            exists = global_var:prophet
                        }
                        this = global_var:prophet
                    }
                    trigger_else = {
					    always = no
				    }
                }
            }
        }
    }

	male_hair_rtt_01 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 0
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 6
			trigger_if = {
				limit = { exists = root }
				is_female = no
			}
			trigger_else = {
				scope:female = no
			}
		}

		weight = {
			base = 0
			modifier = {
                add = 55
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_wavy
                }
                culture = culture:scottish
            }
		}
	}

	male_hair_rtt_02 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 1
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 2
			trigger_if = {
				limit = { exists = root }
				is_female = no
			}
			trigger_else = {
				scope:female = no
			}
		}

		weight = {
			base = 0
		}
	}
	
	female_hair_rtt_02 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 0.5
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 8
			trigger_if = {
				limit = { exists = root }
				is_female = yes
			}
			trigger_else = {
				scope:female = yes
			}
		}

		weight = {
			base = 0
			modifier = {
                add = 25
                exists = this
                has_gene = {
                    category = gene_hair_type
                    template = hair_curly
                }
				culture = { has_cultural_pillar = heritage_frankish }
            }
		}
	}

	female_hair_rtt_01 = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 0
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 7
			trigger_if = {
				limit = { exists = root }
				is_female = yes
			}
			trigger_else = {
				scope:female = yes
			}
		}

		weight = {
			base = 0
		}
	}

	female_hair_rtt_02_milla = {
		dna_modifiers = {
			accessory = {
				mode = add
				gene = hairstyles
				template = rtt_hairstyles
				value = 1
			}
		}

		is_valid_custom = {
			#monarchs_journey_unlock = 7
			trigger_if = {
				limit = { exists = root }
				is_female = yes
			}
			trigger_else = {
				scope:female = yes
			}
		}

		weight = {
			base = 0
		}
	}
}
