#########################################################################
# Estonia Flavor Mod: New Decisions
# Decisions use the tag EST. Add to the vanilla decision structure.
#########################################################################

political_decisions = {

	# ----- pre-existing decisions (unchanged) -----
	integrate_baltic_germans = {
		picture = "integrate_baltic_germans"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			ai = no
			NOT = { accepted_culture = north_german }
		}

		allow = {
		}

		effect = {
			add_accepted_culture = north_german
			set_country_flag = baltic_germans_integrated
			plurality = 0.05

			# Estonian majority feels betrayed by the compromise
			any_pop = {
				limit = {
					culture = estonian
				}
				militancy = 3
				consciousness = 2.0
			}

			# Baltic German elite solidifies loyalty to the state
			any_pop = {
				limit = {
					culture = north_german
				}
				militancy = -4
				consciousness = -2
			}

			# Diplomatic realignment
			any_country = {
				limit = {
					OR = {
						tag = PRU
						tag = NGF
						tag = GER
					}
				}
				relation = {
					who = THIS
					value = 75
				}
			}
		}

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				NOT = { average_militancy = 7 }
			}
		}
	}

	# The song festival tradition: after the first festival, the republic
	# gathers again in Tartu every five years.
	hold_laulupidu = {
		picture = "laulupidu"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			has_country_flag = laulupidu_organized
			not = { has_country_modifier = laulupidu_tradition }
		}
		allow = {
			owns = 352 # Tartu
			money = 5000
		}
		effect = {
			money = -5000
			add_country_modifier = {
				name = laulupidu_tradition
				duration = 1825 # five years until the next festival
			}
			prestige = 5
			any_pop = {
				limit = { culture = estonian }
				consciousness = 2
				militancy = -1
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	organize_laulupidu = {
		picture = "laulupidu"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = laulupidu_organized }
		}

		allow = {
			nationalism_n_imperialism = 1
			owns = 352 # Tartu
		}

		effect = {
			set_country_flag = laulupidu_organized
			prestige = 10
			# The first festival founds the tradition: the five-year
			# cycle counts from this day (blocks the rehold meanwhile)
			add_country_modifier = {
				name = laulupidu_tradition
				duration = 1825 # five years until the next festival
			}
			any_pop = {
				limit = { culture = estonian }
				consciousness = 2
				militancy = -1
			}
		}
	}

	publish_kalevipoeg = {
		picture = "kalevipoeg"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = kalevipoeg_published }
			romanticism = 1
		}

		allow = {
			romanticism = 1
		}

		effect = {
			set_country_flag = kalevipoeg_published
			prestige = 10
			any_pop = {
				limit = { culture = estonian }
				consciousness = 2
			}
		}
	}

	found_eus = {
		picture = "eus"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = eus_founded }
			state_n_government = 1
		}

		allow = {
			state_n_government = 1
		}

		effect = {
			set_country_flag = eus_founded
			prestige = 10
			research_points = 2000
			any_pop = {
				limit = { 
					culture = estonian 
					type = clerks 
				}
				consciousness = 2
			}
			any_pop = {
				limit = { 
					culture = estonian 
					type = clergymen 
				}
				consciousness = 2
			}
		}
	}

	# Plevkivi ("burning stone"): the oil shale beds of Ida-Viru.
	# With the chemistry of clean coal, the shale near Narva can first be
	# worked as a low-grade coal - fuel for the railways and the mills.
	exploit_polevkivi = {
		picture = "polevkivi"
		potential = {
			owns = 350 # Narva / Ida-Viru
			NOT = { has_global_flag = polevkivi_worked_as_coal }
			clean_coal = 1
		}
		allow = {
			clean_coal = 1
		}
		effect = {
			prestige = 5
			set_global_flag = polevkivi_worked_as_coal
			350 = {
				trade_goods = coal
				life_rating = 2
				# Turn local farmers into miners to staff the new shale pits
				any_pop = {
					limit = { type = farmers }
					pop_type = labourers
					factor = 0.25
				}
				# Bonus to the mining population
				any_pop = {
					limit = { type = labourers }
					money = 100
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# Shale oil: retorting the plevkivi into crude is a separate, later
	# enterprise for the age of inorganic chemistry, building on the pits
	# opened when the reserves were first worked as coal.
	retort_polevkivi_shale_oil = {
		picture = "polevkivi"
		potential = {
			owns = 350 # Narva / Ida-Viru
			has_global_flag = polevkivi_worked_as_coal
			NOT = { has_global_flag = polevkivi_retorted }
			inorganic_chemistry = 1
		}
		allow = {
			inorganic_chemistry = 1
		}
		effect = {
			prestige = 5
			set_global_flag = polevkivi_retorted
			350 = {
				trade_goods = oil
				# The retorts foul the air and water of Ida-Viru
				life_rating = -2
				# Ash heaps and stench: the locals grumble
				any_pop = {
					limit = { type = labourers }
					militancy = 1
					consciousness = 1
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# Maardu phosphorite: the fertilizer beds of Tallinn's doorstep.
	# Historically mined from the Soviet era (the Phosphorite Wars of 1987
	# began as protests against open-pit mining near Maardu); here the
	# organic chemistry of the 1870s unlocks superphosphate for the fields.
	mine_maardu_phosphorite = {
		picture = "polevkivi"

		potential = {
			owns = 349 # Reval / Tallinn - the Maardu deposit
			NOT = { has_global_flag = maardu_phosphorite_mined }
			organic_chemistry = 1
		}

		allow = {
			organic_chemistry = 1
		}

		effect = {
			prestige = 5
			set_global_flag = maardu_phosphorite_mined
			349 = {
				trade_goods = sulphur
				# The open pits scar the land and poison the wells
				life_rating = -2
				# Turn local farmers into labourers to work the open pits
				any_pop = {
					limit = { type = farmers }
					pop_type = labourers
					factor = 0.20
				}
				any_pop = {
					limit = { type = labourers }
					money = 100
				}
				# The dust and the blasting rile the parish: the first
				# murmurs of the Phosphorite Wars
				any_pop = {
					limit = { type = farmers }
					militancy = 1
					consciousness = 1
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}
	radical_land_reform = {
		picture = "land_reform"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = radical_land_reform }
		}

		allow = {
			civilized = yes
			OR = {
				ruling_party_ideology = liberal
				ruling_party_ideology = socialist
				ruling_party_ideology = anarcho_liberal
				ruling_party_ideology = communist
			}
		}

		effect = {
			set_country_flag = radical_land_reform

			any_pop = {
				limit = { type = aristocrats }
				militancy = 8
				consciousness = 5
			}
			any_pop = {
				limit = { type = farmers }
				militancy = -4
			}
			any_pop = {
				ideology = {
					factor = -0.15
					value = reactionary
				}
				ideology = {
					factor = -0.10
					value = conservative
				}
			}

			relation = {
				who = GER
				value = -100
			}
			relation = {
				who = NGF
				value = -100
			}
			relation = {
				who = RUS
				value = -50
			}
		}
	}

	expand_baltic_railway = {
		picture = "baltic_railway"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			owns = 349 # Tallinn / Reval
			NOT = { has_country_flag = baltic_railway }
			early_railroad = 1
		}

		allow = {
			early_railroad = 1
			money = 10000
		}

		effect = {
			set_country_flag = baltic_railway
			money = -10000
			prestige = 5

			349 = { infrastructure = 2 } # Tallinn (Connects main port)
			350 = { infrastructure = 1 } # Narva (Links toward St. Petersburg)
			352 = { infrastructure = 1 } # Tartu / Dorpat
		}

		ai_will_do = {
			factor = 1
		}
	}

	found_kaitseliit = {
		picture = "kaitseliit"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
				owns = 349 # Reval
			not = { has_country_flag = kaitseliit_founded }
		}

		allow = {
			OR = {
				war = yes
				average_militancy = 4
			}
		}

		effect = {
			set_country_flag = kaitseliit_founded
			leadership = 20
			349 = {
				sub_unit = {
					type = irregular
					value = current
				}
			}
			any_pop = {
				limit = { type = soldiers }
				militancy = -2
			}
		}
	}

	treaty_of_tartu = {
		picture = "treaty_of_tartu"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = treaty_of_tartu }
			exists = RUS
			is_vassal = no
		}

		allow = {
			not = { war_with = RUS }
			not = { has_country_flag = treaty_of_tartu }
			RUS = {
				OR = {
					war_exhaustion = 10
					revolt_percentage = 0.3
					NOT = { is_greater_power = yes }
				}
			}
			prestige = 50
		}

		effect = {
			set_country_flag = treaty_of_tartu
			prestige = 20
			money = 100000 
			any_core = {
				remove_core = RUS
			}
		}
	}

	vaikiv_ajastu = {
		picture = "vaikiv_ajastu"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			government = democracy
			not = { has_country_flag = vaikiv_ajastu }
		}

		allow = {
			OR = {
				has_country_flag = vaps_movement_rising
				has_country_flag = vaps_suppressed
			}
			average_militancy = 5
			reactionary = .20
			war = no
		}

		effect = {
			set_country_flag = vaikiv_ajastu
			clr_country_flag = vaps_movement_rising
			government = presidential_dictatorship
			prestige = -10
			plurality = -0.10
			money = -50000
			administrative_efficiency = 0.05
			leadership = 20
			political_parties = underground_parties
			press_rights = censored_press
			public_meetings = no_meeting
			ruling_party_ideology = conservative
			remove_accepted_culture = north_german
			clr_country_flag = baltic_germans_integrated
			any_pop = {
				militancy = -4
				consciousness = -2
			}
			any_pop = {
				limit = { culture = estonian }
				militancy = -1
				consciousness = -2
			}
		}
	}

	propose_baltic_entente = {
		picture = "baltic_entente"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			is_secondary_power = yes
			exists = LAT
			exists = LIT
			not = { has_country_flag = baltic_entente }
		}

		allow = {
			LAT = { in_sphere = no }
			LIT = { in_sphere = no }
		}

		effect = {
			set_country_flag = baltic_entente
			badboy = -3
			diplomatic_influence = {
				who = LAT
				value = 400
			}
			diplomatic_influence = {
				who = LIT
				value = 400
			}
			create_alliance = LAT
			create_alliance = LIT
		}
	}

	#########################################################################
	# NEW DECISIONS
	#########################################################################


	# Land reform follow-up: settling the Veterans of the War of Independence
	found_soomusrong_corps = {
		picture = "soomusrong_corps"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			has_country_flag = soomusrong_deployed
			not = { has_country_flag = soomusrong_corps_founded }
		}

		allow = {
			money = 25000
		}

		effect = {
			set_country_flag = soomusrong_corps_founded
			money = -25000
			prestige = 5
			add_country_modifier = {
				name = soomusrong_corps
				duration = 3650
			}
			leadership = 50
		}

		ai_will_do = {
			factor = 1
		}
	}

	# Tartu Peace Treaty aftermath: rebuilding the republic's finances
	establish_estonian_mark = {
		picture = "estonian_mark"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = estonian_mark_established }
			nationalism_n_imperialism = 1
		}

		allow = {
			money = 20000
			nationalism_n_imperialism = 1
		}

		effect = {
			set_country_flag = estonian_mark_established
			money = -20000
			research_points = 200
			add_country_modifier = {
				name = baltic_handelsvertrag
				duration = 3650
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	# Cultural sphere: Sakala and the network of rural libraries
	found_sakala_society = {
		picture = "sakala"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			has_country_flag = national_awakening_begun
			not = { has_country_flag = sakala_founded }
			positivism = 1
		}

		allow = {
			positivism = 1
			owns = 352 # Tartu
		}

		effect = {
			set_country_flag = sakala_founded
			prestige = 3
			research_points = 500
			add_country_modifier = {
				name = baltic_student_body
				duration = 3650
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	# Seto minorities and the south-eastern frontier
	organize_setomaa = {
		picture = "setomaa"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = setomaa_organized }
			nationalism_n_imperialism = 1
		}

		allow = {
			owns = 352 # Tartu region includes Setomaa
			nationalism_n_imperialism = 1
		}

		effect = {
			set_country_flag = setomaa_organized
			prestige = 3
			plurality = 0.03
			352 = {
				any_pop = {
					limit = { is_primary_culture = yes }
					consciousness = 1
					militancy = -2
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	# Youth and scouting movement - the Young Eagles (Noored Kotkad)
	found_noored_kotkad = {
		picture = "noored_kotkad"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = noored_kotkad_founded }
			has_country_flag = kaitseliit_founded
		}

		allow = {
			has_country_flag = kaitseliit_founded
			government = democracy
		}

		effect = {
			set_country_flag = noored_kotkad_founded
			leadership = 15
			add_country_modifier = {
				name = estonian_volunteer_spirit
				duration = 3650
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	# Home Guards expansion - equipping the Defence League as an army reserve
	expand_kaitseliit = {
		picture = "kaitseliit_expansion"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			has_country_flag = kaitseliit_founded
			not = { has_country_flag = kaitseliit_expanded }
		}

		allow = {
			money = 30000
			war = no
		}

		effect = {
			set_country_flag = kaitseliit_expanded
			money = -30000
			add_country_modifier = {
				name = defence_league_hq
				duration = 3650
			}
			leadership = 20
		}

		ai_will_do = {
			factor = 1
		}
	}

	# The Narva line - fortifying the eastern approaches
	fortify_narva_line = {
		picture = "narva_line"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			owns = 350
			not = { has_country_flag = narva_line_fortified }
		}

		allow = {
			has_country_flag = soomusrong_deployed
			war = no
			money = 40000
		}

		effect = {
			set_country_flag = narva_line_fortified
			money = -40000
			350 = { fort = 3 }
			349 = { fort = 1 }
			prestige = 3
		}

		ai_will_do = {
			factor = 1
		}
	}

	# Coastal defence - protecting Tallinn's harbor
	build_coastal_defence = {
		picture = "coastal_defence"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			owns = 349
			not = { has_country_flag = coastal_defence_built }
			battleship_column_doctrine = 1
		}

		allow = {
			money = 25000
			battleship_column_doctrine = 1
			NOT = {
				349 = { naval_base = 3 }
			}
		}

		effect = {
			set_country_flag = coastal_defence_built
			money = -25000
			add_country_modifier = {
				name = estonian_shipyards
				duration = 3650
			}
			349 = { naval_base = 3 }
		}

		ai_will_do = {
			factor = 1
		}
	}

	# The Kreenholm Manufacture - a giant of the Baltic textile industry
	expand_kreenholm = {
		picture = "kreenholm"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			owns = 350 # Narva - site of the Kreenholm works
			not = { has_country_flag = kreenholm_expanded }
			mechanical_production = 1
		}

		allow = {
			mechanical_production = 1
			money = 15000
		}

		effect = {
			set_country_flag = kreenholm_expanded
			money = -15000
			prestige = 3
			350 = {
				add_province_modifier = {
					name = kreenholm_boom
					duration = -1 # permanent: the works transformed Narva
				}
				any_pop = {
					limit = { type = craftsmen }
					money = 50
				}
			}
		}

		ai_will_do = {
			factor = 1
		}
	}

	# University of Tartu Estification - Estonian becomes the language of instruction
	estify_tartu_university = {
		picture = "estification"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = tartu_estified }
		}

		allow = {
			has_country_flag = mother_tongue_schools
			owns = 352
		}

		effect = {
			set_country_flag = tartu_estified
			prestige = 5
			research_points = 1000
			# The Estonian names return to the map
			349 = { change_province_name = "Tallinn" }
			352 = { change_province_name = "Tartu" }
			353 = { change_province_name = "Saaremaa ja Hiiumaa" }
			add_country_modifier = {
				name = estonian_folk_high_schools
				duration = 3650
			}
			any_pop = {
				limit = {
					culture = estonian
					type = clergymen
				}
				consciousness = 1
			}
			# The Baltic German estates read the new signposts with cold fury
			any_pop = {
				limit = {
					culture = north_german
					OR = {
						type = aristocrats
						type = officers
					}
				}
				militancy = 2
				consciousness = 1
			}
		}

		ai_will_do = {
			factor = 1
		}
	}


	# Eesti Pank - the national bank and a stable currency
	found_eesti_pank = {
		picture = "eesti_pank"

		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = eesti_pank_founded }
			has_country_flag = estonian_mark_established
		}

		allow = {
			has_country_flag = estonian_mark_established
			money = 15000
		}

		effect = {
			set_country_flag = eesti_pank_founded
			money = -15000
			add_country_modifier = {
				name = central_bank_established
				duration = 3650
			}
			add_tax_relative_income = 1
		}

		ai_will_do = {
			factor = 1
		}
	}

# Vanemuine: the national theatre society (1865)
	found_vanemuine = {
		picture = "vanemuine"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			has_country_flag = national_awakening_begun
			not = { has_country_flag = vanemuine_founded }
			realism = 1
		}
		allow = {
			realism = 1
			owns = 352 # Tartu
			average_consciousness = 2
		}
		effect = {
			set_country_flag = vanemuine_founded
			prestige = 5
			any_pop = {
				limit = {
					culture = estonian
					type = clerks
				}
				consciousness = 2
			}
			add_country_modifier = {
				name = estonian_national_stage
				duration = 3650
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# The loan-and-savings societies: capital in peasant hands (1882)
	found_credit_union = {
		picture = "credit_union"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = credit_union_founded }
			business_banks = 1
		}
		allow = {
			business_banks = 1
		}
		effect = {
			set_country_flag = credit_union_founded
			money = 5000
			any_pop = {
				limit = {
					culture = estonian
					type = farmers
				}
				consciousness = 1
				militancy = -1
			}
			add_country_modifier = {
				name = peasant_credit_unions
				duration = 3650
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	# The constitutional settlement: separation of church and state (1925)
	enact_state_atheism = {
		picture = "state_atheism"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			has_country_flag = secular_schools
			not = { has_country_flag = state_atheism_declared }
		}
		allow = {
		}
		effect = {
			set_country_flag = state_atheism_declared
			religion = atheist
			# The state no longer pays the church: its employees go with the state
			any_pop = {
				limit = {
					culture = estonian
					type = clergymen
				}
				militancy = 2
			}
			# The emboldened freethinkers carry the message into the parishes:
			# conscious POPs convert faster, and the state religion is now atheist
			any_pop = {
				limit = {
					culture = estonian
					not = { has_pop_religion = atheist }
				}
				consciousness = 2
			}
			any_pop = {
				limit = {
					has_pop_religion = atheist
				}
				consciousness = 1
				militancy = -1
			}
			# Secular schooling in every province we own: the conversion
			# engine works per province, so blanket the whole country
			any_owned = {
				add_province_modifier = {
					name = secular_schools_mod
					duration = -1
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# Sign the concordat: restore the church settlement (reversal)
	sign_concordat = {
		picture = "concordat"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			religion = atheist
			not = { has_country_flag = concordat_signed }
		}
		allow = {
		}
		effect = {
			set_country_flag = concordat_signed
			religion = protestant
			prestige = 2
			# The pews refill; the unbelievers keep quiet again
			any_pop = {
				limit = {
					culture = estonian
					type = clergymen
				}
				militancy = -3
			}
			any_pop = {
				limit = {
					has_pop_religion = atheist
				}
				consciousness = -2
				militancy = 1
			}
			any_owned = {
				limit = {
					has_province_modifier = secular_schools_mod
				}
				remove_province_modifier = secular_schools_mod
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# Patronize the freethinkers' press: pamphlets, journals and lecture
	# circuits for the unbelievers - pushes POPs toward atheism
	patronize_freethought_press = {
		picture = "state_atheism"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			religion = atheist
			not = { has_country_flag = freethought_press_patronized }
		}
		allow = {
			biologism = 1
			money = 10000
		}
		effect = {
			set_country_flag = freethought_press_patronized
			money = -10000
			# Pamphlets circulate where the unbelievers already are: the
			# province modifiers raise consciousness, which speeds the
			# vanilla conversion engine
			any_owned = {
				limit = {
					any_pop = { has_pop_religion = atheist }
				}
				add_province_modifier = {
					name = quiet_congregations
					duration = 3650
				}
			}
			# The convinced become preachers of the new outlook
			any_pop = {
				limit = {
					has_pop_religion = atheist
				}
				consciousness = 2
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	# Volunteer fire brigades: the first schools of self-government (1862)
	found_fire_brigades = {
		picture = "fire_brigades"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = fire_brigades_founded }
			time_saving_measures = 1
		}
		allow = {
			time_saving_measures = 1
		}
		effect = {
			set_country_flag = fire_brigades_founded
			any_pop = {
				limit = {
					culture = estonian
					type = farmers
				}
				militancy = -1
				consciousness = 1
			}
			add_country_modifier = {
				name = volunteer_fire_brigades
				duration = -1
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# Eesti Kirjameeste Selts: the association of Estonian writers (1872)
	found_kirjameeste_selts = {
		picture = "kirjameeste_selts"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			has_country_flag = national_awakening_begun
			not = { has_country_flag = kirjameeste_selts_founded }
			realism = 1
		}
		allow = {
			realism = 1
			owns = 352 # Tartu
			average_consciousness = 4
		}
		effect = {
			set_country_flag = kirjameeste_selts_founded
			prestige = 3
			research_points = 300
			any_pop = {
				limit = {
					culture = estonian
					type = clergymen
				}
				consciousness = 2
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# The co-operative creameries: Estonian butter for the world (1908)
	found_dairy_coops = {
		picture = "dairy_coops"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = dairy_coops_founded }
			electricity = 1
		}
		allow = {
			electricity = 1
		}
		effect = {
			set_country_flag = dairy_coops_founded
			money = 5000
			add_country_modifier = {
				name = cooperative_creameries
				duration = -1
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# Kunda cement: the first modern cement works (1868... historically; here as investment)
	build_kunda_cement = {
		picture = "kunda_cement"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = kunda_cement_built }
			inorganic_chemistry = 1
		}
		allow = {
			inorganic_chemistry = 1
			money = 10000
			owns = 350 # Narva - the Viru coast
		}
		effect = {
			set_country_flag = kunda_cement_built
			money = -10000
			350 = {
				add_province_modifier = {
					name = kunda_cement_works
					duration = -1
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}

	# Luther's furniture factory: plywood and world markets (1877)
	expand_luther_factory = {
		picture = "luther_factory"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { has_country_flag = luther_factory_expanded }
			interchangeable_parts = 1
		}
		allow = {
			interchangeable_parts = 1
			money = 15000
			owns = 349 # Tallinn
		}
		effect = {
			set_country_flag = luther_factory_expanded
			money = -15000
			349 = {
				add_province_modifier = {
					name = luther_furniture_works
					duration = -1
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	# Integrate the Duchy of Lithuania: the duchy reaches south.
	# The United Baltic Duchy holding the Lithuanian heartlands may
	# claim Lithuania's crown lands and accept its people.
	integrate_duchy_of_lithuania = {
		picture = "treaty_of_tartu"
		potential = {
			tag = UBD
			not = { has_country_flag = lithuania_integrated }
			not = { accepted_culture = lithuanian }
		}
		allow = {
			war = no
			owns = 360
			owns = 361
			prestige = 40
			average_militancy = 4
		}
		effect = {
			set_country_flag = lithuania_integrated
			prestige = 25
			LIT = {
				all_core = {
					add_core = UBD
				}
			}
			698 = { add_core = UBD }
			add_accepted_culture = lithuanian
			any_pop = {
				limit = {
					culture = lithuanian
				}
				militancy = -2
			}
			698 = {
				owner = {
					relation = {
						who = THIS
						value = -50
					}
				}
			}
			any_country = {
				limit = {
					OR = {
						tag = GER
						tag = NGF
						tag = PRU
					}
				}
				relation = {
					who = THIS
					value = -50
				}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
	# Send arms to the Finnish nationalists: kindred peoples' struggle.
	# Swedish as an accepted culture: the coastal Swedish communities
	# (Aiboland) have fished and traded beside the Estonians for centuries.
	accept_swedish_culture = {
		picture = "estonian_mark"
		potential = {
			OR = {
				tag = EST
				tag = UBD
			}
			not = { accepted_culture = swedish }
			# a coastal Swedish population is required; has_pop_culture
			# is the province-scope trigger (see vanilla AUS.txt potential)
			any_owned_province = {
				has_pop_culture = swedish
			}
		}
		allow = {
			civilized = yes
			OR = {
				government = democracy
				vote_franschise = universal_voting
			}
			prestige = 20
		}
		effect = {
			add_accepted_culture = swedish
			set_country_flag = swedish_culture_accepted
			prestige = 5
			any_pop = {
				limit = {
					culture = swedish
				}
				militancy = -3
				consciousness = 1
			}
			SWE = {
				limit = { exists = yes }
				relation = {
					who = THIS
					value = 75
			}
			}
		}
		ai_will_do = {
			factor = 1
		}
	}
}
