﻿
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_body_threshold #Unop Use correct 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_body_threshold #Unop Use correct 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_body_threshold #Unop Use correct 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_body_threshold #Unop Use correct 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 = 2

					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_body_threshold } #Unop Use correct 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_stretched_earlobes = {

	usage = game
	stretched_earlobes = {
		dna_modifiers = {
			morph = {
				mode = add
				gene = gene_ear_stretch
				template = ear_stretch
				value = 1 
			}
		}   
		weight = {
			base = 10
		}
	}
}

additive_headgears = {

	usage = game
	additive_headgears = {
			dna_modifiers = {
			morph = {
				mode = add
				gene = gene_bs_additive_headgears
				template = additive_headgears
				value = 1 
			}
		}
	}
}

cloak_offset = {

	usage = game
	cloak_offset = {
			dna_modifiers = {
			morph = {
				mode = add
				gene = gene_bs_cloak_offset
				template = cloak_offset
				value = 1 # For the randomness to work correctly
			}
		}
	}
}

long_beard = {

	usage = game
	long_beard = {
			dna_modifiers = {
			morph = {
				mode = add
				gene = gene_bs_long_beard
				template = long_beard
				value = 1 # For the randomness to work correctly
			}
		}
	}
}

enclosed_helmet = {

	usage = game
	enclosed_helmet = {
			dna_modifiers = {
			morph = {
				mode = add
				gene = gene_enclosed_helmet
				template = enclosed_helmet
				value = 1 # For the randomness to work correctly
			}
		}
	}
}

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_left
				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
			}
		}
	}
}

special_beardless_eunuch = {

	usage = game
	selection_behavior = weighted_random

	no_body_hair = { # Has no portrait 
		dna_modifiers = {
			morph = {
				mode = replace
				gene = gene_body_hair
				template = body_hair_sparse
				value = 0
			} 
			accessory = {
				mode = add
				gene = beards
				template = no_beard
				range = { 0 1 } # For the randomness to work correctly
			} 
		}
		weight = {
			base = 0
			modifier = {
				add = 999
				has_trait = beardless_eunuch
			}
		}
	}
}
