##########################################################################
# Empire edicts
##########################################################################

@Edict1Cost = 10
@Edict2Cost = 20
@Edict3Cost = 30
@EdictSpecialCost = 1

@EdictPerpetual = -1

#################
# Toggle Edicts
#################

evacuation_protocols = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_colony_development_speed_mult = 1.00
		pop_resettlement_cost_mult = -0.50
	}

	potential = {
		has_origin = origin_doomsday
		is_nomadic = no
		any_owned_planet = {
			is_doomsday_planet = yes
		}
	}

	allow = {
		custom_tooltip = {
			fail_text = "requires_doomsday_colony"
			any_planet_within_border = {
				OR = {
					is_colonizable = yes
					is_colony = yes
				}
				is_doomsday_planet = no
			}
		}
	}

	ai_weight = {
		weight = 500
	}
}

fortify_the_border = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		starbase_upgrade_speed_mult = 0.50
		country_starbase_capacity_add = 2
	}

	potential = {
		is_nomadic = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			factor = 0
			NOT = { has_country_flag = has_encountered_other_empire }
		}
	}
}

nutritional_plenitude = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		logistic_growth_mult = 0.1
		biological_pop_happiness = 0.05
		lithoid_pop_happiness = 0.05
		planet_pops_organics_food_upkeep_mult = 0.25
		planet_pops_organics_minerals_upkeep_mult = 0.25
		planet_pops_organics_alloys_upkeep_mult = 0.25
	}

	potential = {
		is_gestalt = no
	}

	prerequisites = {
		"tech_gene_crops"
	}

	show_tech_unlock_if = {
		is_gestalt = no
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

nutritional_plenitude_hive = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		logistic_growth_mult = 0.1
		planet_pops_organics_food_upkeep_mult = 0.25
		planet_pops_organics_minerals_upkeep_mult = 0.25
		planet_pops_organics_alloys_upkeep_mult = 0.25
	}

	potential = {
		is_hive_empire = yes
	}

	prerequisites = {
		"tech_gene_crops"
	}

	show_tech_unlock_if = {
		is_hive_empire = yes
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

expanded_breeding_program_servitor = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		logistic_growth_mult = 0.1
		biological_pop_happiness = 0.05
		lithoid_pop_happiness = 0.05
		planet_pops_organics_food_upkeep_mult = 0.25
		planet_pops_organics_minerals_upkeep_mult = 0.25
		planet_pops_organics_alloys_upkeep_mult = 0.25
	}

	potential = {
		has_valid_civic = civic_machine_servitor
	}

	prerequisites = {
		"tech_gene_crops"
	}

	show_tech_unlock_if = {
		has_valid_civic = civic_machine_servitor
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

fleet_supremacy = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	prerequisites = {
		"tech_doctrine_fleet_size_1"
	}

	modifier = {
		ship_starting_experience_add = 100
		starbase_shipyard_build_speed_mult = 0.10
		diplo_weight_naval_mult = 0.10
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

diplomatic_grants = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		envoys_add = 1
		diplo_weight_mult = 0.1
	}

	potential = {
		has_tradition = tr_diplomacy_adopt
		has_comms_with_alien_empire = yes
	}

	ai_weight = {
		weight = 0
	}
}

enhanced_surveillance = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_stability_add = 5
		intel_encryption_add = 1
		pop_happiness = -0.10
		pop_ethic_authoritarian_attraction_mult = 0.25
	}

	potential = {
		has_active_tradition = tr_domination_judgment_corps
		is_gestalt = no
	}

	allow = {
		has_comms_with_alien_empire = yes
	}

	ai_weight = {
		weight = @EdictMedPrio
		modifier = {
			factor = 2
			has_ethic = ethic_authoritarian
		}
		modifier = {
			factor = 3
			has_ethic = ethic_fanatic_authoritarian
		}
		modifier = {
			factor = 0
			is_egalitarian = yes
		}
	}
}

bureau_of_espionage = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		envoys_add = 1
		intel_decryption_add = 2
		add_base_country_intel = 10
		spy_network_levels_add = 10
	}

	potential = {
		has_comms_with_alien_empire = yes
		is_gestalt = no
	}

	show_tech_unlock_if = {
		is_gestalt = no
	}

	prerequisites = {
		tech_decryption_1
	}

	ai_weight = {
		weight = @EdictMedPrio
		modifier = {
			factor = 2
			has_ethic = ethic_authoritarian
		}
		modifier = {
			factor = 3
			has_ethic = ethic_fanatic_authoritarian
		}
		modifier = {
			factor = 0
			is_egalitarian = yes
		}
	}
}

observation_instinct = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		envoys_add = 1
		intel_decryption_add = 2
		add_base_country_intel = 10
		spy_network_levels_add = 10
	}

	potential = {
		has_comms_with_alien_empire = yes
		is_hive_empire = yes
	}

	show_tech_unlock_if = {
		is_hive_empire = yes
	}

	prerequisites = {
		tech_decryption_1
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

covert_analysis_algorithm = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		envoys_add = 1
		intel_decryption_add = 2
		add_base_country_intel = 10
		spy_network_levels_add = 10
	}

	potential = {
		has_comms_with_alien_empire = yes
		is_machine_empire = yes
	}

	show_tech_unlock_if = {
		is_machine_empire = yes
	}

	prerequisites = {
		tech_decryption_1
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

tracking_implants = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		intel_encryption_add = 1
		pop_happiness = -0.10
		planet_crime_add = -10
		pop_ethic_authoritarian_attraction_mult = 0.25
	}

	potential = {
		has_comms_with_alien_empire = yes
		is_gestalt = no
	}

	prerequisites = {
		tech_tracking_implants
	}

	show_tech_unlock_if = {
		is_gestalt = no
	}

	ai_weight = {
		weight = @EdictMedPrio
		modifier = {
			factor = 2
			has_ethic = ethic_authoritarian
		}
		modifier = {
			factor = 3
			has_ethic = ethic_fanatic_authoritarian
		}
		modifier = {
			factor = 0
			is_egalitarian = yes
		}
	}
}

thought_enforcement = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		custom_tooltip = edict_thought_enforcement_effect
		intel_encryption_add = 1
		pop_happiness = -0.10
		pop_government_ethic_attraction = 0.25
	}

	potential = {
		is_gestalt = no
	}

	prerequisites = {
		tech_thought_enforcement
	}

	show_tech_unlock_if = {
		is_gestalt = no
	}

	ai_weight = {
		weight = @EdictMedPrio
		modifier = {
			factor = 2
			has_ethic = ethic_authoritarian
		}
		modifier = {
			factor = 3
			has_ethic = ethic_fanatic_authoritarian
		}
		modifier = {
			factor = 0
			is_egalitarian = yes
		}
	}
}

thought_enforcement_gestalt = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		custom_tooltip = edict_thought_enforcement_gestalt_effect
		intel_encryption_add = 1
		planet_stability_add = 5
		planet_jobs_upkeep_mult = -0.1
	}

	potential = {
		has_shroud_dlc = yes
		is_gestalt = yes
	}

	prerequisites = {
		tech_thought_enforcement
	}

	show_tech_unlock_if = {
		has_shroud_dlc = yes
		is_gestalt = yes
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

extended_shifts = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		pop_cat_worker_bonus_workforce_mult = 0.10
		pop_slave_bonus_workforce_mult = 0.10
		pop_cat_worker_happiness = -0.15
		pop_slave_happiness = -0.15
	}

	potential = {
		has_active_tradition = tr_domination_workplace_motivators
	}

	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			factor = 1.5
			has_ethic = ethic_authoritarian
		}
		modifier = {
			factor = 2
			has_ethic = ethic_fanatic_authoritarian
		}
	}
}

synaptic_reinforcement = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_maintenance_drones_trade_produces_add = 1
	}

	potential = {
		is_hive_empire = yes
	}

	prerequisites = {
		"tech_hive_cluster"
	}

	ai_weight = {
		weight = @EdictLowPrio
	}
}

industrial_maintenance = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_maintenance_drones_trade_produces_add = 1
	}

	potential = {
		is_machine_empire = yes
		has_tradition = tr_synchronicity_finish
	}

	ai_weight = {
		weight = @EdictLowPrio
	}
}

drone_overdrive = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		pop_cat_simple_drone_bonus_workforce_mult = 0.10
		pop_amenities_usage_no_happiness_mult = 0.15
	}

	potential = {
		is_gestalt = yes
		is_wilderness_empire = no
		OR = {
			has_active_tradition = tr_domination_drone_network
			has_active_tradition = tr_domination_wilderness_network
		}
	}

	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			factor = 1.5
			has_ethic = ethic_authoritarian
		}
		modifier = {
			factor = 2
			has_ethic = ethic_fanatic_authoritarian
		}
	}
}

drone_overdrive_wilderness = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		pop_cat_simple_drone_bonus_workforce_mult = 0.10
		pop_amenities_usage_no_happiness_mult = 0.15
	}

	potential = {
		is_wilderness_empire = yes
		OR = {
			has_active_tradition = tr_domination_drone_network
			has_active_tradition = tr_domination_wilderness_network
		}
	}

	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			factor = 1.5
			has_ethic = ethic_authoritarian
		}
		modifier = {
			factor = 2
			has_ethic = ethic_fanatic_authoritarian
		}
	}
}

capacity_subsidies = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		technician_jobs_bonus_workforce_mult = 0.20
		planet_technician_trade_upkeep_add = 0.50
	}

	potential = {
		is_wilderness_empire = no
	}
	show_tech_unlock_if = {
		is_wilderness_empire = no
	}

	prerequisites = {
		"tech_power_hub_1"
	}

	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			should_ai_focus_on_trade = yes
			factor = 0
		}
	}
}

capacity_subsidies_wilderness = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_technician_produces_mult = 0.20
		planet_technician_trade_upkeep_add = 0.50
	}

	potential = {
		is_wilderness_empire = yes
	}
	show_tech_unlock_if = {
		is_wilderness_empire = yes
	}

	prerequisites = {
		"tech_power_hub_1"
	}

	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			should_ai_focus_on_trade = yes
			factor = 0
		}
	}
}

mining_subsidies = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		miner_jobs_bonus_workforce_mult = 0.20
		planet_miners_trade_upkeep_add = 0.50
	}

	potential = {
		is_wilderness_empire = no
		is_nomadic = no
	}

	show_tech_unlock_if = {
		is_wilderness_empire = no
		is_nomadic = no
	}

	prerequisites = {
		"tech_mineral_purification_1"
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

mining_subsidies_wilderness = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_miners_produces_mult = 0.20
		planet_miners_trade_upkeep_add = 0.50
	}

	potential = {
		is_wilderness_empire = yes
	}

	show_tech_unlock_if = {
		is_wilderness_empire = yes
	}

	prerequisites = {
		"tech_mineral_purification_1"
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

mining_subsidies_nomadic = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		ark_harvester_jobs_bonus_workforce_mult = 0.20
		planet_ark_harvester_trade_upkeep_add = 0.50
	}

	potential = {
		is_nomadic = yes
	}

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	prerequisites = {
		"tech_mineral_purification_1"
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

farming_subsidies = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		farmer_jobs_bonus_workforce_mult = 0.20
		planet_farmers_trade_upkeep_add = 0.50
	}

	potential = {
		is_wilderness_empire = no
	}

	show_tech_unlock_if = {
		is_wilderness_empire = no
	}

	prerequisites = {
		"tech_food_processing_1"
	}

	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			country_uses_food = no
			factor = 0
		}
	}
}

farming_subsidies_wilderness = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_farmers_produces_mult = 0.20
		planet_farmers_trade_upkeep_add = 0.50
	}

	potential = {
		is_wilderness_empire = yes
	}

	show_tech_unlock_if = {
		is_wilderness_empire = yes
	}

	prerequisites = {
		"tech_food_processing_1"
	}

	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			country_uses_food = no
			factor = 0
		}
	}
}

industrial_subsidies = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		artisan_jobs_bonus_workforce_mult = 0.10
		planet_artisans_trade_upkeep_add = 1
	}

	potential = {
		country_uses_consumer_goods = yes
	}

	prerequisites = {
		tech_global_production_strategy
	}

	show_tech_unlock_if = {
		country_uses_consumer_goods = yes
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

forge_subsidies = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		foundry_jobs_bonus_workforce_mult = 0.10
		planet_metallurgists_trade_upkeep_add = 1
	}

	potential = {
		is_wilderness_empire = no
	}

	show_tech_unlock_if = {
		is_wilderness_empire = no
	}

	prerequisites = {
		tech_global_production_strategy
	}

	ai_weight = {
		weight = @EdictLowPrio
	}
}

forge_subsidies_wilderness = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_metallurgists_produces_mult = 0.10
		planet_metallurgists_trade_upkeep_add = 1
	}

	potential = {
		is_wilderness_empire = yes
	}

	show_tech_unlock_if = {
		is_wilderness_empire = yes
	}

	prerequisites = {
		tech_global_production_strategy
	}

	ai_weight = {
		weight = @EdictLowPrio
	}
}

research_subsidies = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		researcher_jobs_bonus_workforce_mult = 0.10
		planet_physicists_trade_upkeep_add = 1
		planet_biologists_trade_upkeep_add = 1
		planet_engineers_trade_upkeep_add = 1
	}

	potential = {
		has_tradition = tr_discovery_databank_uplinks
		is_wilderness_empire = no
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

research_subsidies_wilderness = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict3Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_researchers_produces_mult = 0.10
		planet_physicists_trade_upkeep_add = 1
		planet_biologists_trade_upkeep_add = 1
		planet_engineers_trade_upkeep_add = 1
	}

	potential = {
		has_tradition = tr_discovery_databank_uplinks
		is_wilderness_empire = yes
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

veneration_of_saints = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		pop_bureaucrat_bonus_workforce_mult = 0.05
		pop_ethic_spiritualist_attraction_mult = 0.25
	}

	potential = {
		is_spiritualist = yes
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

peace_festivals = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		pop_happiness = 0.05
		pop_ethic_pacifist_attraction_mult = 0.25
	}

	potential = {
		is_pacifist = yes
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

information_quarantine = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_stability_add = 5
		pop_government_ethic_attraction = 0.25
	}

	potential = {
		is_authoritarian = yes
	}

	ai_weight = {
		weight = @EdictLowPrio
	}
}

encourage_free_thought = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		pop_ethics_shift_speed_mult = 1
	}

	potential = {
		is_egalitarian = yes
	}

	ai_weight = {
		weight = 0
	}
}

map_the_stars = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		science_ship_survey_speed = 0.25
		ship_anomaly_generation_chance_mult = 0.10
		ship_hyperlane_range_add = 1
	}

	potential = {
		has_tradition = tr_discovery_adopt
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictHighPrio
			years_passed < 50
		}
	}
}

land_of_opportunity = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_resettlement_unemployed_destination_mult = 0.5
	}

	potential = {
		is_xenophile = yes
		has_comms_with_alien_empire = yes
		is_nomadic = no
	}

	ai_weight = {
		weight = 0
	}
}

greater_than_ourselves = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_resettlement_unemployed_mult = 2.00
	}

	potential = {
		is_nomadic = no
		is_galactic_community_member = yes
		OR = {
			is_active_resolution = "resolution_greatergood_greater_than_ourselves"
			is_active_resolution = "resolution_greatergood_balance_in_the_middle"
			is_active_resolution = "resolution_greatergood_universal_prosperity_mandate"
		}
	}

	ai_weight = {
		weight = @EdictLowPrio
	}
}

relay_network_dummy = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	potential = {
		always = no
	}
	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_overlord_dlc = yes
	}

	modifier = {
		custom_tooltip = edict_relay_network_dummy_tooltip
	}
	prerequisites = { "tech_hyper_relays" }

	show_tech_unlock_if = { always = yes }
}

relay_network_stability = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_overlord_dlc = yes
		has_technology = tech_hyper_relays
		is_nomadic = no
	}

	allow = {
		NOT = { has_deficit = exotic_gases }
		exists = capital_scope
		capital_scope = {
			solar_system = {
				has_hyper_relay = yes
			}
		}
	}

	prerequisites = {
		"tech_galactic_bureaucracy"
	}

	modifier = {
		megastructures_hyper_relay_exotic_gases_upkeep_add = 0.1
	}

	relay_network_modifier = {
		relay_network_stability_edict_modifier = 1
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictHighPrio
			has_monthly_income = { resource = exotic_gases value > 5 }
		}
	}
}

relay_network_movement = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_overlord_dlc = yes
		has_technology = tech_hyper_relays
		is_nomadic = no
	}

	allow = {
		NOT = { has_deficit = volatile_motes }
		exists = capital_scope
		capital_scope = {
			solar_system = {
				has_hyper_relay = yes
			}
		}

	}

	prerequisites = {
		"tech_hyper_drive_3"
	}

	modifier = {
		megastructures_hyper_relay_volatile_motes_upkeep_add = 0.1
	}

	relay_network_modifier = {
		relay_network_movement_edict_modifier = 1
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			has_monthly_income = { resource = volatile_motes value > 5 }
		}
	}
}

relay_network_amenities = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_overlord_dlc = yes
		is_gestalt = no
		has_technology = tech_hyper_relays
		is_nomadic = no
	}

	allow = {
		NOT = { has_deficit = rare_crystals }
		exists = capital_scope
		capital_scope = {
			solar_system = {
				has_hyper_relay = yes
			}
		}
	}

	prerequisites = {
		"tech_artificial_moral_codes"
	}

	show_tech_unlock_if = {
		is_gestalt = no
	}

	modifier = {
		megastructures_hyper_relay_rare_crystals_upkeep_add = 0.1
	}

	relay_network_modifier = {
		relay_network_amenities_edict_modifier = 1
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			has_monthly_income = { resource = rare_crystals value > 5 }
		}
	}
}

relay_network_amenities_gestalt = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_overlord_dlc = yes
		is_gestalt = yes
		has_technology = tech_hyper_relays
		is_nomadic = no
	}

	allow = {
		NOT = { has_deficit = rare_crystals }
		exists = capital_scope
		capital_scope = {
			solar_system = {
				has_hyper_relay = yes
			}
		}
	}

	prerequisites = {
		"tech_unity_of_purpose"
	}

	show_tech_unlock_if = {
		is_gestalt = yes
	}

	modifier = {
		megastructures_hyper_relay_rare_crystals_upkeep_add = 0.1
	}

	relay_network_modifier = {
		relay_network_amenities_gestalt_edict_modifier = 1
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			has_monthly_income = { resource = rare_crystals value > 5 }
		}
	}
}

zro_crystal = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		cost = {
			sr_zro = 0.2
			multiplier = value:zro_crystal_leaders
		}
		upkeep = {
			sr_zro = 0.2
			multiplier = value:zro_crystal_leaders
		}

	}

	potential = {
		has_relic = r_zro_crystal
		is_machine_empire = no
	}

	allow = {
		NOT = {
			resource_stockpile_compare = {
				resource = sr_zro
				value = 0
			}
		}
	}

	modifier = {
		species_leader_exp_gain = 0.10
		leader_lifespan_add = 30
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			has_monthly_income = { resource = sr_zro value > 5 }
		}
	}
}

zro_crystal_machine = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		cost = {
			sr_zro = 0.2
			multiplier = value:zro_crystal_leaders
		}
		upkeep = {
			sr_zro = 0.2
			multiplier = value:zro_crystal_leaders
		}
	}

	potential = {
		has_relic = r_zro_crystal
		is_machine_empire = yes
	}

	allow = {
		NOT = {
			resource_stockpile_compare = {
				resource = sr_zro
				value = 0
			}
		}
	}

	modifier = {
		species_leader_exp_gain = 0.10
		leader_lifespan_add = 30
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			has_monthly_income = { resource = sr_zro value > 5 }
		}
	}
}

damn_the_consequences = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	edict_lock_in_months = 60

	resources = {
		category = edicts_unscaled
		cost = {
			unity = @EdictSpecialCost
			multiplier = value:consequences_cost
		}
		upkeep = {
			unity = @EdictSpecialCost
			multiplier = value:consequences_cost
		}
	}

	modifier = {
		custom_tooltip = "edict_damn_the_consequences_effects"
		show_only_custom_tooltip = no
		planet_pops_organics_upkeep_mult = 1
	}

	potential = {
		has_origin = origin_overtuned
	}

	allow = { }

	ai_weight = {
		weight = 0
	}
}

shadow_matrix = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			sr_dark_matter = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_dark_matter = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		is_dark_consortium_empire = yes
	}

	modifier = {
		intel_encryption_add = 1
		intel_decryption_add = 1
		spy_network_levels_add = 10
	}
}

obsidian_veil = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			sr_dark_matter = 2
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_dark_matter = 2
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		is_dark_consortium_empire = yes
		has_first_contact_dlc = yes
	}

	prerequisites = {
		tech_cloaking_1
	}

	show_tech_unlock_if = {
		is_dark_consortium_empire = yes
	}

	modifier = {
		ship_cloaking_strength_add = 1
		ship_cloaking_detection_add = 1
	}
}

dark_matter_forging = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			sr_dark_matter = 3
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_dark_matter = 3
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		is_dark_consortium_empire = yes
	}

	modifier = {
		country_alloys_produces_mult = 0.05
	}
}

dark_matter_unravelling = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			sr_dark_matter = 4
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_dark_matter = 4
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		is_dark_consortium_empire = yes
	}

	allow = {
		NOT = {
			resource_stockpile_compare = {
				resource = sr_dark_matter
				value < 4
			}
		}
	}

	modifier = {
		country_energy_produces_mult = 0.1
	}
}

baryonic_insight = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			sr_dark_matter = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_dark_matter = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		is_dark_consortium_empire = yes
	}

	modifier = {
		country_physics_research_produces_mult = 0.1
	}
}

spontaneous_crystallization = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts_unscaled
		cost = {
			minerals = 1
			mult = value:percent_monthly_resource_income_edict_cost|RESOURCE|minerals|PERCENT|1|
		}
		produces = {
			rare_crystals = 1
			mult = value:percent_monthly_resource_income|RESOURCE|minerals|PERCENT|1|
		}
		upkeep = {
			minerals = 1
			mult = value:percent_monthly_resource_income_edict_cost|RESOURCE|minerals|PERCENT|1|
		}
	}

	potential = {
		has_country_flag = has_spontaneous_crystallization
	}

	modifier = {
		custom_tooltip = edict_spontaneous_crystallization_tooltip
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			has_monthly_income = { resource = minerals value > 500 }
		}
	}
}

inner_focus = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			influence = 3
		}
		upkeep = {
			influence = 3
		}
	}

	potential = {
		is_sovereign_guardianship_empire = yes
	}

	modifier = {
		country_unity_produces_mult = 0.10
	}
	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			has_monthly_income = { resource = influence value > 3 }
		}
	}
}

astral_cloaking = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			astral_threads = 5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			astral_threads = 5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = astral_cloaking_available
	}

	modifier = {
		ship_cloaking_strength_add = 1
	}
	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictLowPrio
			has_technology = tech_cloaking_1
		}
	}
}

astral_binding = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			astral_threads = 25
			multiplier = value:edict_size_effect
		}
		upkeep = {
			astral_threads = 25
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = action_planar_mastery_activated
	}

	allow = {
		NOT = {
			resource_stockpile_compare = {
				resource = astral_threads
				value < 10
			}
		}
	}

	modifier = {
		pop_bonus_workforce_mult = 0.05
	}
	ai_weight = {
		weight = @EdictHighPrio
	}
}

astral_shielding = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			astral_threads = 10
			multiplier = value:edict_size_effect
		}
		upkeep = {
			astral_threads = 10
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = action_planar_mastery_activated
	}

	allow = {
		NOT = {
			resource_stockpile_compare = {
				resource = astral_threads
				value < 10
			}
		}
	}

	modifier = {
		ship_shield_mult = 0.10
		ship_shield_hardening_add = 0.25
	}
	ai_weight = {
		weight = @EdictMedPrio
	}
}

dimensional_artificing = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			astral_threads = 10
			multiplier = value:edict_size_effect
		}
		upkeep = {
			astral_threads = 10
			multiplier = value:edict_size_effect
		}
		produces = {
			minor_artifacts = 5
		}
	}

	potential = {
		has_country_flag = action_planar_mastery_activated
		has_ancrel = yes
	}

	allow = {
		NOT = {
			resource_stockpile_compare = {
				resource = astral_threads
				value < 10
			}
		}
	}

	modifier = {
		custom_tooltip = edict_dimensional_artificing_tooltip
	}
}

decentralized_research = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = 10
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = 10
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		is_galactic_curators_empire = yes
		has_grand_archive_dlc = yes
		is_nomadic = no
	}

	modifier = {
		researcher_jobs_bonus_workforce_mult = -0.10
		station_researchers_produces_mult = 1.0
	}
}

decentralized_research_nomad = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = 10
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = 10
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		is_galactic_curators_empire = yes
		has_grand_archive_dlc = yes
		is_nomadic = yes
	}

	modifier = {
		planet_researchers_produces_mult = -0.05
		starbase_collected_system_physics_research_mult = 1.0
		starbase_collected_system_society_research_mult = 1.0
		starbase_collected_system_engineering_research_mult = 1.0
	}
}

storm_attraction_field = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = 15
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = 15
			multiplier = value:edict_size_effect
		}
	}

	allow = {
		NOT = {
			has_edict = storm_repel_field
		}
	}

	modifier = {
		country_storm_attraction_influence_add = 0.15
	}

	prerequisites = {
		"tech_storm_manipulation"
	}

	ai_weight = {
		weight = 0
		modifier = {
			set = @EdictMedPrio
			OR = {
				has_storm_attraction_civic = yes
				has_origin = origin_storm_chasers
			}
		}
	}
}

storm_repel_field = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = 15
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = 15
			multiplier = value:edict_size_effect
		}
	}

	allow = {
		NOT = {
			has_edict = storm_attraction_field
		}
	}

	modifier = {
		country_storm_repulsion_influence_add = 0.15
	}

	prerequisites = {
		"tech_storm_manipulation"
	}

	ai_weight = {
		weight = @EdictLowPrio
		modifier = {
			set = @EdictMedPrio
			AND = {
				num_cosmic_storms_encountered >= 1
				num_storm_exploitation_buildings < 3
			}
		}
	}
}

auto_hunker_down = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"

	resources = {
		category = edicts
		cost = {
			unity = 15
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = 15
			multiplier = value:edict_size_effect
		}
	}

	effect = {
		custom_tooltip = edict_auto_hunker_down_tt
		every_planet_within_border = {
			limit = {
				solar_system = {
					has_star_flag = storm_system
				}
			}
			select_decision = {
				name = decision_hunker_down
			}
		}
	}

	on_disabled = {
		every_planet_within_border = {
			limit = {
				solar_system = {
					has_star_flag = storm_system
				}
			}
			select_decision = {
				name = decision_stop_hunker_down
			}
		}
	}

	prerequisites = {
		"tech_advanced_industrial_storm_protection"
	}
}

centrifugal_siphoning = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"
	resources = {
		category = edicts
		cost = {
			unity = 15
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = 5
			multiplier = value:edict_size_effect
		}
	}
	potential = { is_galvanic_empire = yes }
	modifier = {
		# Adjust concept_inf_lm_edicts if this changes
		planet_metallurgists_alloys_produces_add = -1
		planet_metallurgists_sr_living_metal_produces_add = 0.25
	}
	ai_weight = {
		weight = @EdictHighPrio
	}
}

modular_growth_compounds = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"
	resources = {
		category = edicts
		cost = {
			sr_living_metal = 10
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_living_metal = 5
			multiplier = value:edict_size_effect
		}
	}
	potential = { is_galvanic_empire = yes }
	modifier = {
		founder_species_growth_mult = @inf_modular_growth
	}
	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			factor = 0
			resource_income_compare = {
				resource = sr_living_metal
				value < 50
			}
			resource_stockpile_compare = {
				resource = sr_living_metal
				value < 500
			}
		}
	}
}

entropy_harnessing = {
	length = @EdictPerpetual
	icon = "GFX_edict_type_policy"
	resources = {
		category = edicts
		cost = {
			unity = 5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = 5
			multiplier = value:edict_size_effect
		}
	}
	potential = { has_menace_perk = menp_hyperthermia_harnessing }
	modifier = {
		planet_technician_energy_produces_add = -2.5
		planet_technician_entropy_crystals_produces_add = 0.4
	}
	ai_weight = {
		weight = @EdictHighPrio
		modifier = {
			add = 5
			resource_income_compare = {
				resource = entropy_crystals
				value < 250
			}
		}
	}
}
