﻿randomize_blood_paths = {
	category = interaction_category_diplomacy
	common_interaction = yes
	icon = blood_brother
	interface_priority = 90
	desc = randomize_blood_paths_desc
	
	auto_accept = yes

	is_shown = {
		scope:recipient = {
			olympia_has_congenital_traits = yes
		}
		has_game_rule = abomab_reroll_pathways_enabled
		years_from_game_start <= 1
	}
	
	send_option = {
		is_shown = {
			scope:recipient = {
				OR = {
					has_trait = beauty_good
					has_trait = beauty_bad
				}
			}
		}
		flag = change_beauty_paths
		localization = change_beauty_paths_local
	}
	
	send_option = {
		is_shown = {
			scope:recipient = {
				OR = {
					has_trait = intellect_good
					has_trait = intellect_bad
				}
			}
		}
		flag = change_intellect_paths
		localization = change_intellect_paths_local
	}
	
	send_option = {
		is_shown = {
			scope:recipient = {
				OR = {
					has_trait = physique_good
					has_trait = physique_bad
				}
			}
		}
		flag = change_physique_paths
		localization = change_physique_paths_local
	}
	
	send_options_exclusive = no
	
	on_auto_accept = {
		if = {
			limit = { scope:change_beauty_paths ?= yes }
			scope:recipient = {
				if = {
					limit = { has_trait = beauty_good_1 }
					remove_trait = beauty_good_1
					add_trait = beauty_good_1
				}
				else_if = {
					limit = { has_trait = beauty_good_2 }
					remove_trait = beauty_good_2
					add_trait = beauty_good_2
				}
				else_if = {
					limit = { has_trait = beauty_good_3 }
					remove_trait = beauty_good_3
					add_trait = beauty_good_3
				}
				else_if = {
					limit = { has_trait = beauty_bad_1 }
					remove_trait = beauty_bad_1
					add_trait = beauty_bad_1
				}
				else_if = {
					limit = { has_trait = beauty_bad_2 }
					remove_trait = beauty_bad_2
					add_trait = beauty_bad_2
				}
				else_if = {
					limit = { has_trait = beauty_bad_3 }
					remove_trait = beauty_bad_3
					add_trait = beauty_bad_3
				}
				abomab_add_beauty_xp_adult = yes
			}
		}
		
		if = {
			limit = { scope:change_intellect_paths ?= yes }
			scope:recipient = {
				if = {
					limit = { has_trait = intellect_good_1 }
					remove_trait = intellect_good_1
					add_trait = intellect_good_1
				}
				else_if = {
					limit = { has_trait = intellect_good_2 }
					remove_trait = intellect_good_2
					add_trait = intellect_good_2
				}
				else_if = {
					limit = { has_trait = intellect_good_3 }
					remove_trait = intellect_good_3
					add_trait = intellect_good_3
				}
				else_if = {
					limit = { has_trait = intellect_bad_1 }
					remove_trait = intellect_bad_1
					add_trait = intellect_bad_1
				}
				else_if = {
					limit = { has_trait = intellect_bad_2 }
					remove_trait = intellect_bad_2
					add_trait = intellect_bad_2
				}
				else_if = {
					limit = { has_trait = intellect_bad_3 }
					remove_trait = intellect_bad_3
					add_trait = intellect_bad_3
				}
				abomab_add_intellect_xp_adult = yes
			}
		}
		
		if = {
			limit = { scope:change_physique_paths ?= yes }
			scope:recipient = {
				if = {
					limit = { has_trait = physique_good_1 }
					remove_trait = physique_good_1
					add_trait = physique_good_1
				}
				else_if = {
					limit = { has_trait = physique_good_2 }
					remove_trait = physique_good_2
					add_trait = physique_good_2
				}
				else_if = {
					limit = { has_trait = physique_good_3 }
					remove_trait = physique_good_3
					add_trait = physique_good_3
				}
				else_if = {
					limit = { has_trait = physique_bad_1 }
					remove_trait = physique_bad_1
					add_trait = physique_bad_1
				}
				else_if = {
					limit = { has_trait = physique_bad_2 }
					remove_trait = physique_bad_2
					add_trait = physique_bad_2
				}
				else_if = {
					limit = { has_trait = physique_bad_3 }
					remove_trait = physique_bad_3
					add_trait = physique_bad_3
				}
				abomab_add_physique_xp_adult = yes
			}
		}
	}

	ai_will_do = {
		base = 0
	}
}