﻿
special_eyelashes = {

	usage = game

	eyelashes = {
		dna_modifiers = {
			accessory = {
				mode = replace
				gene = eyelashes_accessory
				template = no_eyelashes
				value = 0.5
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 200
				scope:age < 10
			}
		}
	}

}

weight = {
	usage = game

	@overweight_multiplier = 0.5
	@underweight_multiplier = -0.5

	overweight = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = modify
				gene = gene_bs_body_type
				value = {
					value = scope:weight_for_portrait # An absolute and normalized value derived from character body weight
					multiply = @overweight_multiplier
				}
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100
				scope:current_weight > overweight_threshold
			}
			modifier = {
                add = -100
				exists = this
                has_character_flag = has_scripted_weight
            }
		}
	}

	underweight = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = modify
				gene = gene_bs_body_type
				value = {
					value = scope:weight_for_portrait # An absolute and normalized value derived from character body weight
					multiply = @underweight_multiplier
				}
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100
				scope:current_weight < underweight_threshold
			}
			modifier = {
                add = -100
				exists = this
                has_character_flag = has_scripted_weight
            }
		}
	}

	ruler_designer_overweight = {
		dna_modifiers = {
			morph = {
				mode = modify
				gene = gene_bs_body_type
				value = {
					value = scope:weight_for_portrait # An absolute and normalized value derived from character body weight
					multiply = @overweight_multiplier
				}
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100
				exists = scope:ruler_designer
				scope:current_weight > overweight_threshold
			}
		}
	}
	ruler_designer_underweight = {
		dna_modifiers = {
			morph = {
				mode = modify
				gene = gene_bs_body_type
				value = {
					value = scope:weight_for_portrait # An absolute and normalized value derived from character body weight
					multiply = @underweight_multiplier
				}
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100
				exists = scope:ruler_designer
				scope:current_weight < underweight_threshold
			}
		}
	}
}

@muscle_multiply = 1
@muscle_max = 1.0

muscularity = {

	usage = game
	
	muscular = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = modify
				gene = gene_bs_body_shape
				value = {
					value = 0

					if = { 
						limit = { exists = scope:ruler_designer }
						add = scope:prowess
					}
					else_if = {
						limit = { exists = this }
						add = prowess_for_portrait
					}
					else = {
						add = scope:prowess
					}

					multiply = 4

					max = 1.0
				}
			}
		}
		weight = {
			base = 100
		}
	}
}

special_pregnancy = {

	usage = game

	pregnant = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_bs_pregnant
				template = pregnant
				value = {
					value = 1
					if = {
						# Overweight females should have less visible pregnancy, so we change the 100% pregnant value
						limit = { current_weight > overweight_threshold }
						value = scope:weight_for_portrait # An absolute and normalized value derived from character body weight
						multiply = -1.0 
						add = 1.5
						max = 1.0
					}
					if = {
						limit = {  
							NOT = { this = character:animation_test_female_pregnant }
						}
						multiply = {
							add = pregnancy_days
							# Only change every 10 days
							divide = 10
							round = yes
							multiply = 10
							divide = 250 # PREGNANCY_DAYS is 280; we want 1 month at 100%
							max = 1
						}
					}					
				}
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 100
				portrait_has_trait_trigger = { TRAIT = pregnant }
			}			
		}
	}
}


special_shrink_body = {
	
	usage = game
	
	shrink_body = {
        dna_modifiers = {
            morph = {
                mode = add
                gene = gene_shrink_body
                template = shrink_all
               	value = 1 # For the randomness to work correctly
            }
        }   
        weight = {
            base = 10
            
        }
    }
}


special_prophet = {

    usage = game
    selection_behavior = weighted_random
    priority = 50

    33922_caliph_muhammad = { # Has no portrait 
        dna_modifiers = {
			morph = {
				mode = replace
				gene = gene_bs_body_type
				template = no_portrait
				value = 1.0
			}
			morph = {
				mode = replace
				gene = complexion
				template = complexion_no_face
				value = 1.0
			}
			morph = {
				mode = replace
				gene = gene_age
				template = no_aging
				value = 1.0
			}
			morph = {
				mode = modify
				gene = gene_eyebrows_shape
				template = no_eyebrows
				value = 0.5
			}
			morph = {
				mode = modify
				gene = gene_eyebrows_fullness
				template = no_eyebrows
				value = 0.5
			}
			accessory = {
				mode = modify
				gene = eye_accessory
				template = no_eyes
				value = 0.5
			}
			accessory = {
				mode = modify
				gene = teeth_accessory
				template = no_teeth
				value = 0.5
			}
			accessory = {
				mode = add
				gene = props
				template = prophet_shield
				value = 0.5
			}
			accessory = {
				mode = add
				gene = clothes
				template = no_clothes
				value = 0.5
			}
        	accessory = {
                 mode = add
                 gene = hairstyles
                 template = no_hairstyles
                 value = 0
            }
            accessory = {
                mode = add
                gene = beards
                template = no_beard
                value = 0
            }
            accessory = {
                mode = add
                gene = headgear
                template = no_headgear
                value = 0
            }
            accessory = {
                mode = add
                gene = cloaks
                template = no_cloak
                value = 0
            }  
        }
        weight = {
            base = 0
            modifier = {
                add = 999
                exists = this
                exists = character:33922
                this = character:33922
            }
            modifier = {
				add = 2000
				exists = this
				has_character_flag = islam_prophet
			}
			modifier = {
				add = 2000
				exists = this
				trigger_if = {
					limit = {
						exists = global_var:prophet
					}
					THIS = global_var:prophet
				}
				trigger_else = {
					always = no
				}
			}
        }
    }
}
special_celtic_warpaint_custom = {
	usage = customization
	interface_position = 8
	celtic_warpaint1 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint1
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint2 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint2
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint3 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint3
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint4 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint4
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint5 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint5
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
}
special_celtic_warpaint = {
	usage = game
	celtic_warpaint1 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint1
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint2 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint2
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint3 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint3
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint4 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint4
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
	celtic_warpaint5 = {
		ignore_outfit_tags = yes
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_celtic_warpaint
				template = celtic_warpaint5
				range = { 0 1.0 }
			}
		}
		weight = {
			base = 0
			modifier = {
				add = 1500
				AND = {
					OR = {
						culture = { has_cultural_pillar = heritage_celtic }
						culture = { has_cultural_pillar = heritage_brythonic }
					}
					OR = {
						portrait_wear_helmet_trigger = yes
						is_commanding_army = yes
					}
				}
			}
		}
	}
}
