namespace = apb_budding

# Five-year pulse: each full colony may bud (on_five_year_pulse_country, this = country)
country_event = {
	id = apb_budding.1
	hide_window = yes
	is_triggered_only = yes

	trigger = {
		has_ascension_perk = ap_budding_instinct
		is_hive_empire = yes
		is_nomadic = no
		is_wilderness_empire = no
		NOT = { has_edict = apb_restrain_the_brood }
	}

	immediate = {
		apb_budding_pulse = yes
	}
}

# Report a new bud (fired once per bud by apb_budding_bud_at)
country_event = {
	id = apb_budding.2
	title = apb_budding.2.name
	desc = apb_budding.2.desc
	picture = GFX_evt_hive_mind
	show_sound = event_alien_nature
	location = event_target:apb_budding_colony
	is_triggered_only = yes

	trigger = {
		any_owned_planet = { has_planet_flag = apb_budding_announce }
	}

	immediate = {
		random_owned_planet = {
			limit = { has_planet_flag = apb_budding_announce }
			remove_planet_flag = apb_budding_announce
			save_event_target_as = apb_budding_colony
		}
	}

	option = {
		name = apb_budding.2.a
	}
}
