ap_xit_xenomorph_research_protocols = {
	potential = {
		is_country_type = default
		NOT = { xit_is_xenomorph_safe_owner = yes }
		NOT = { has_ascension_perk = ap_xit_xenomorph_research_protocols }
	}

	custom_tooltip = ap_xit_xenomorph_research_protocols_effect_desc

	modifier = {
		army_defense_damage_mult = 0.30
		army_morale = 0.15
		planet_orbital_bombardment_damage = -0.25
		category_biology_research_speed_mult = 0.10
		country_society_research_produces_mult = 0.05
		ship_anomaly_research_speed_mult = 0.10
	}

	on_enabled = {
		add_research_option = tech_xit_xenomorph_biosecurity
	}

	ai_weight = {
		factor = 35
		modifier = {
			factor = 4
			any_owned_planet = {
				OR = {
					has_modifier = xit_xenomorph_infestation
					has_modifier = xit_xenomorph_outbreak
					has_deposit = d_xit_dormant_ovomorph_cluster
				}
			}
		}
		modifier = {
			factor = 2
			has_technology = tech_xit_xenomorph_biosecurity
		}
	}
}

ap_xit_extragalactic_biosecurity_mandate = {
	potential = {
		is_country_type = default
		NOT = { xit_is_xenomorph_safe_owner = yes }
		NOT = { has_ascension_perk = ap_xit_extragalactic_biosecurity_mandate }
	}

	possible = {
		custom_tooltip = {
			fail_text = "requires_ascension_perks_2"
			num_ascension_perks > 1
		}
		custom_tooltip = {
			fail_text = "requires_technology_tech_alien_life_studies"
			OR = {
				has_technology = tech_alien_life_studies
				has_technology = tech_xit_xenomorph_biosecurity
			}
		}
	}

	custom_tooltip = ap_xit_extragalactic_biosecurity_mandate_effect_desc

	modifier = {
		planet_stability_add = 8
		planet_crime_add = -15
		army_defense_damage_mult = 0.50
		army_morale = 0.30
		planet_army_build_speed_mult = 0.35
		armies_upkeep_mult = -0.20
		planet_orbital_bombardment_damage = -0.35
		category_biology_research_speed_mult = 0.15
		country_society_research_produces_mult = 0.10
	}

	ai_weight = {
		factor = 20
		modifier = {
			factor = 5
			has_technology = tech_xit_xenomorph_biosecurity
		}
		modifier = {
			factor = 4
			has_tradition = tr_xit_biosecurity_finish
		}
		modifier = {
			factor = 6
			any_owned_planet = {
				OR = {
					has_modifier = xit_xenomorph_infestation
					has_modifier = xit_xenomorph_outbreak
					has_deposit = d_xit_dormant_ovomorph_cluster
				}
			}
		}
	}
}
