# Forked Minds: clone the highest-level leader of a chosen class.
# One-day edict whose effect opens the class choice (apb_forked.1).
# The cooldown starts when the edict is enacted.
apb_fork_instance = {
	length = 1
	icon = "GFX_edict_type_time"

	resources = {
		category = edicts
		cost = {
			influence = 100
		}
	}

	potential = {
		has_ascension_perk = ap_forked_minds
	}

	allow = {
		custom_tooltip = {
			fail_text = apb_fork_instance_cooldown
			NOT = { has_country_flag = apb_fork_cooldown }
		}
		custom_tooltip = {
			fail_text = apb_fork_instance_no_leader
			any_owned_leader = {
				OR = {
					leader_class = scientist
					leader_class = commander
					leader_class = official
				}
				apb_can_be_forked = yes
			}
		}
	}

	effect = {
		custom_tooltip = apb_fork_instance_effect_tt
		hidden_effect = {
			if = {
				limit = { is_virtual_empire = yes }
				set_timed_country_flag = {
					flag = apb_fork_cooldown
					years = 10
				}
			}
			else = {
				set_timed_country_flag = {
					flag = apb_fork_cooldown
					years = 15
				}
			}
			country_event = { id = apb_forked.1 }
		}
	}

	ai_weight = {
		weight = 10
	}
}
