#################
# Campaigns
# shorter duration, cost energy
#################

@Edict1Cost = 20
@Edict2Cost = 25
@Edict3Cost = 30

@EdictDuration = -1

# Sets the cost for all campaigns with this variable
@campaignCost = 15
@hiveFood = 15
@infernalAlloys = 4
@campaignDuration = -1

fear_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		country_unity_produces_mult = 0.10
		pop_ethic_xenophobe_attraction_mult = 0.25
	}

	potential = {
		is_xenophobe = yes
		has_comms_with_alien_civilization = yes
		has_technology = tech_planetary_unification
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictLowPrio
			has_resource = { type = energy amount > 5000 }
		}
	}
}

education_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		species_leader_exp_gain = 0.10
	}

	potential = {
		NOT = { has_ethic = ethic_gestalt_consciousness }
		has_technology = tech_planetary_unification
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = 1
			has_edict = healthcare_campaign
		}
	}
}

recycling_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_pops_consumer_goods_upkeep_mult = -0.10
	}

	potential = {
		NOT = { has_ethic = ethic_gestalt_consciousness }
		has_technology = tech_planetary_unification
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictLowPrio
			has_monthly_income = {
				resource = consumer_goods
				value < 0
			}
		}
	}
}

healthcare_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		logistic_growth_mult = 0.1
	}

	potential = {
		always = no
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

###########
# Machine Empire
###########

robot_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		planet_pop_assembly_mult = 0.10
	}

	potential = {
		always = no
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

machine_learning_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		species_leader_exp_gain = 0.10
	}

	potential = {
		is_machine_empire = yes
		has_technology = tech_planetary_unification
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = 1
			has_edict = robot_campaign
		}
	}
}

#################
# Hive Mind
#################

drone_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		logistic_growth_mult = 0.1
	}

	potential = {
		always = no
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

learning_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		species_leader_exp_gain = 0.10
	}

	potential = {
		is_hive_empire = yes
		has_technology = tech_planetary_unification
		is_wilderness_empire = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = 1
			has_edict = drone_campaign
		}
	}
}

learning_campaign_wilderness = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		species_leader_exp_gain = 0.10
	}

	potential = {
		has_technology = tech_planetary_unification
		is_wilderness_empire = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = 1
			has_edict = drone_campaign
		}
	}
}

war_drone_campaign = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		army_damage_mult = 0.15
	}

	potential = {
		is_hive_empire = yes
		has_technology = tech_planetary_unification
		is_wilderness_empire = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			is_at_war = yes
		}
	}
}

war_drone_campaign_wilderness = {
	length = @campaignDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = campaigns
		cost = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_or_infernal_empire = no
			}
			food = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_lithoid_empire = yes
			}
			minerals = @hiveFood
			multiplier = value:edict_size_effect
		}
		upkeep = {
			trigger = {
				is_infernal_empire = yes
			}
			alloys = @infernalAlloys
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		army_damage_mult = 0.15
	}

	potential = {
		is_hive_empire = yes
		has_technology = tech_planetary_unification
		is_wilderness_empire = yes
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			is_at_war = yes
		}
	}
}

##########################################################################
# Rare resource edicts
##########################################################################

terraforming_gas = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			exotic_gases = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			exotic_gases = 0.5
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		terraform_speed_mult = 0.50
	}

	prerequisites = {
		"tech_terrestrial_sculpting"
	}

	potential = {
		is_nomadic = no
	}

	show_tech_unlock_if = {
		is_nomadic = no
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictHighPrio
			any_planet_within_border = {
				is_terraforming = yes
			}
		}
	}
}

fuel_gases = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	is_wartime_edict = yes

	resources = {
		category = ship_edicts
		cost = {
			exotic_gases = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			exotic_gases = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = exotic_gases amount > 0 }
			has_edict = fuel_gases
		}
	}

	prerequisites = {
		OR = {
			"tech_mine_exotic_gases"
			"tech_exotic_gases"
		}
	}

	show_tech_unlock_if = {
		always = yes
	}

	modifier = {
		ship_speed_mult = 0.15
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			is_at_war = yes
			has_resource = { type = exotic_gases amount > 100 }
		}
	}
}

shield_gases = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	is_wartime_edict = yes

	resources = {
		category = ship_edicts
		cost = {
			exotic_gases = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			exotic_gases = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = exotic_gases amount > 0 }
			has_edict = shield_gases
		}
	}

	prerequisites = {
		OR = {
			"tech_mine_exotic_gases"
			"tech_exotic_gases"
		}
	}

	show_tech_unlock_if = {
		always = yes
	}

	modifier = {
		ship_shield_mult = 0.25
		ship_shield_hardening_add = 0.1
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			is_at_war = yes
			has_resource = { type = exotic_gases amount > 100 }
		}
	}
}

clearing_motes = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			volatile_motes = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			volatile_motes = 0.5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = volatile_motes amount > 0 }
			has_edict = clearing_motes
		}
		is_wilderness_empire = no
		is_nomadic = no
	}

	prerequisites = {
		OR = {
			"tech_mine_volatile_motes"
			"tech_volatile_motes"
		}
	}

	show_tech_unlock_if = {
		is_wilderness_empire = no
		is_nomadic = no
	}

	modifier = {
		deposit_blockers_cost_mult = -0.25
		planet_clear_blocker_speed_mult = 0.25
	}

	ai_weight = {
		weight = 0
	}
}

clearing_motes_wilderness = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			volatile_motes = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			volatile_motes = 0.5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = volatile_motes amount > 0 }
			has_edict = clearing_motes
		}
		is_wilderness_empire = yes
	}

	prerequisites = {
		OR = {
			"tech_mine_volatile_motes"
			"tech_volatile_motes"
		}
	}

	show_tech_unlock_if = {
		is_wilderness_empire = yes
	}

	modifier = {
		deposit_blockers_cost_mult = -0.25
		planet_clear_blocker_speed_mult = 0.25
	}

	ai_weight = {
		weight = 0
	}
}

clearing_motes_nomad = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			volatile_motes = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			volatile_motes = 0.5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = volatile_motes amount > 0 }
			has_edict = clearing_motes_nomad
		}
		is_nomadic = yes
	}

	prerequisites = {
		OR = {
			"tech_mine_volatile_motes"
			"tech_volatile_motes"
		}
	}

	show_tech_unlock_if = {
		is_nomadic = yes
	}

	modifier = {
		deposit_blockers_cost_mult = -0.25
		planet_clear_blocker_speed_mult = 0.25
	}

	ai_weight = {
		weight = 0
	}
}

motes_kinetic = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	is_wartime_edict = yes

	resources = {
		category = ship_edicts
		cost = {
			volatile_motes = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			volatile_motes = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = volatile_motes amount > 0 }
			has_edict = motes_kinetic
		}
	}

	prerequisites = {
		OR = {
			"tech_mine_volatile_motes"
			"tech_volatile_motes"
		}
	}

	show_tech_unlock_if = {
		always = yes
	}

	modifier = {
		weapon_type_kinetic_weapon_damage_mult = 0.25
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictHighPrio
			is_at_war = yes
			has_resource = { type = volatile_motes amount > 100 }
		}
	}
}

motes_explosives = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = ship_edicts
		cost = {
			volatile_motes = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			volatile_motes = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = volatile_motes amount > 0 }
			has_edict = motes_explosives
		}
	}

	prerequisites = {
		OR = {
			"tech_mine_volatile_motes"
			"tech_volatile_motes"
		}
	}

	show_tech_unlock_if = {
		always = yes
	}

	modifier = {
		weapon_type_explosive_weapon_damage_mult = 0.25
	}

	ai_weight = {
		weight = 0
	}
}

motes_armor = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	is_wartime_edict = yes

	resources = {
		category = ship_edicts
		cost = {
			volatile_motes = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			volatile_motes = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = volatile_motes amount > 0 }
			has_edict = motes_armor
		}
	}

	prerequisites = {
		OR = {
			"tech_mine_volatile_motes"
			"tech_volatile_motes"
		}
	}

	show_tech_unlock_if = {
		always = yes
	}

	modifier = {
		ship_armor_mult = 0.25
		ship_armor_hardening_add = 0.1
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			is_at_war = yes
			has_resource = { type = volatile_motes amount > 100 }
		}
	}
}

crystalline_sensors = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			rare_crystals = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			rare_crystals = 0.5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = rare_crystals amount > 0 }
			has_edict = crystalline_sensors
		}
	}

	prerequisites = {
		OR = {
			"tech_mine_rare_crystals"
			"tech_rare_crystals"
		}
	}

	show_tech_unlock_if = {
		always = yes
	}

	modifier = {
		ship_sensor_range_add = 1
	}

	ai_weight = {
		weight = 0
	}
}


crystal_focus = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	is_wartime_edict = yes
	resources = {
		category = ship_edicts
		cost = {
			rare_crystals = 1
			multiplier = value:edict_size_effect
		}
		upkeep = {
			rare_crystals = 1
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = rare_crystals amount > 0 }
			has_edict = crystal_focus
		}
	}

	prerequisites = {
		OR = {
			"tech_mine_rare_crystals"
			"tech_rare_crystals"
		}
	}

	show_tech_unlock_if = {
		always = yes
	}

	modifier = {
		weapon_type_energy_weapon_damage_mult = 0.25
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictHighPrio
			is_at_war = yes
			has_resource = { type = rare_crystals amount > 100 }
		}
	}
}

sight_beyond_sight = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_active_tradition = tr_psionics_mind_readers
			has_active_tradition = tr_psionics_shroud_finish
		}
	}

	modifier = {
		ship_sensor_range_add = 1
		ship_windup_mult = -0.15
		ship_winddown_mult = -0.15
		ship_jumpdrive_cooldown_mult = -0.15
		catapult_spread_mult = 0.15
	}

	ai_weight = {
		weight = 0
	}
}

zro_catalysis_utopia = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		exists = federation
		federation = {
			has_federation_perk = zro_catalysis_1
		}
		OR = {
			has_resource = { type = sr_zro amount > 0 }
			has_edict = zro_catalysis_utopia
		}
		is_wilderness_empire = no
	}

	modifier = {
		psionic_pop_bonus_workforce_mult = 0.10
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictMedPrio
			species = { is_psionic_species = yes }
		}
	}
}

# Kept as a stub (potential = always = no) for backward compatibility with savegames
# and mods referencing this edict key. Remaining fields are preserved so an active
# instance of this edict in an existing savegame can time out normally.
zro_catalysis_non_utopia = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		always = no
	}

	modifier = {
		pop_bonus_workforce_mult = 0.10
	}

	ai_weight = {
		weight = @EdictMedPrio
	}
}

living_metal_construction = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			sr_living_metal = 0.5
			multiplier = value:edict_size_effect
		}
		cost = {
			trigger = {
				has_modifier = living_metal_mega_construction_insight
			}
			sr_living_metal = -0.25
			multiplier = value:edict_size_effect
		}
		upkeep = {
			sr_living_metal = 0.5
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		megastructure_build_speed_mult = 0.50
	}

	potential = {
		has_resource = { type = sr_living_metal amount > 0 }
		OR = {
			has_any_megastructure_in_empire = yes
			has_technology = tech_mega_engineering
			has_technology = tech_habitat_1
			has_technology = tech_hyper_relays
			has_technology = tech_orbital_ring_tier_1
			has_technology = tech_quantum_catapult
			has_technology = tech_deep_space_citadel
			has_technology = tech_gateway_construction
			has_technology = tech_dyson_swarm
			has_technology = tech_orbital_arc_furnace
		}
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictHighPrio
			count_owned_megastructure = {
				count >= 1
				limit = { is_upgrading = yes }
			}
		}
	}
}

nanite_actuators = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		cost = {
			nanites = 10
			multiplier = value:edict_size_effect
		}
		upkeep = {
			nanites = 2
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		OR = {
			has_resource = { type = nanites amount > 0 }
			has_edict = nanite_actuators
		}
	}

	modifier = {
		all_technology_research_speed = 0.10
		planet_researchers_upkeep_mult = 0.10
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

zro_observators = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		upkeep = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		biologist_jobs_bonus_workforce_mult = 0.1
	}

	potential = {
		has_origin = origin_shroud_forged
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

shroud_bonded = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = rare_edicts
		upkeep = {
			sr_zro = 0.5
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		country_unity_produces_mult = 0.1
	}

	potential = {
		has_origin = origin_shroud_forged
		has_country_flag = finish_shroud_forged_liberation_flag
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

##########################################################################
# Event edicts
##########################################################################
masters_writings_politics = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = edict_masters_writings_politics
	}

	modifier = {
		planet_structures_cost_mult = -0.1
		planet_building_build_speed_mult = 0.10
	}

	allow = {
	}

	ai_weight = {
		weight = 1
	}
}

masters_writings_diplomacy = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = edict_masters_writings_diplomacy
	}

	modifier = {
		country_trust_growth = 1
	}

	allow = {
	}

	ai_weight = {
		weight = 1
	}
}

masters_writings_philosophy = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = edict_masters_writings_philosophy
	}

	modifier = {
		country_society_tech_research_speed = 0.05
		country_leader_pool_size = 1
	}

	allow = {
	}

	ai_weight = {
		weight = 1
	}
}

masters_writings_war = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		cost = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict1Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = edict_masters_writings_war
	}

	modifier = {
		country_naval_cap_mult = 0.1
		armies_upkeep_mult = -0.15
	}

	allow = {
	}

	ai_weight = {
		weight = 0
		modifier = {
			weight = @EdictHighPrio
			is_at_war = yes
		}
	}
}

improved_work_environment = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = edict_improved_work_environment
	}

	modifier = {
		pop_happiness = 0.05
		category_biology_research_speed_mult = 0.05
		category_statecraft_research_speed_mult = 0.05
	}

	allow = {
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

renewable_energy = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = edict_renewable_energy
	}

	modifier = {
		planet_pops_consumer_goods_upkeep_mult = -0.05
		category_industry_research_speed_mult = 0.05
		category_materials_research_speed_mult = 0.05
	}

	allow = {
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

super_sensors = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		cost = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
		upkeep = {
			unity = @Edict2Cost
			multiplier = value:edict_size_effect
		}
	}

	potential = {
		has_country_flag = edict_super_sensors
	}

	modifier = {
		ship_sensor_range_add = 1
		ship_hyperlane_range_add = 2
	}

	allow = {
	}

	ai_weight = {
		weight = 0
	}
}

nuumismatic_visualization = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"

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

	potential = {
		has_country_flag = nuumismatic_visualization
	}

	modifier = {
		planet_pops_consumer_goods_upkeep_mult = -0.05
		category_statecraft_research_speed_mult = 0.05
		country_trade_produces_mult = 0.10
	}

	allow = {
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}

automated_disinfection = {
	length = @EdictDuration
	icon = "GFX_edict_type_time"
	resources = {
		category = edicts
		upkeep = {
			energy = @campaignCost
			multiplier = value:edict_size_effect
		}
	}

	modifier = {
		pop_amenities_usage_mult = -0.05
		pop_environment_tolerance = 0.05
	}

	potential = {
		has_astral_planes_dlc = yes
		has_country_flag = edict_automated_disinfection
	}

	ai_weight = {
		weight = @EdictHighPrio
	}
}
