﻿je_trans_siberian_railway = {
	icon = "gfx/interface/icons/event_icons/event_industry.dds"
	
	group = je_group_historical_content

	is_shown_when_inactive = {
		is_player = yes
		NOT = { has_global_variable = trans_siberian_done }
		owns_entire_state_region = STATE_MOSCOW
		any_state = {
			filter = {
				OR = {
					region = sr:region_east_siberia
					region = sr:region_west_siberia
				}
			}
			percent > 0.8
			owner = ROOT
		}
	}

	possible = {
		has_technology_researched = railways
	}

	complete = {
		any_scope_state = {
			filter = {
				OR = {
					state_region = s:STATE_MOSCOW
					state_region = s:STATE_YAROSLAVL
					state_region = s:STATE_NIZHNY_NOVGOROD
					state_region = s:STATE_CHUVASHIA
					state_region = s:STATE_KAZAN
					state_region = s:STATE_UFA
					state_region = s:STATE_CHELYABINSK
					state_region = s:STATE_URAL
					state_region = s:STATE_TOBOLSK
					state_region = s:STATE_TOMSK
					state_region = s:STATE_KRASNOYARSK
					state_region = s:STATE_IRKUTSK
					state_region = s:STATE_BURYATIA
					state_region = s:STATE_TRANS_BAIKAL
				}
			}
			has_building = building_railway
			percent = 1
		}
		OR = {
			AND = {
				any_scope_state = {
					state_region = s:STATE_YAKUTSK
					has_building = building_railway
				}
				any_scope_state = {
					state_region = s:STATE_OKHOTSK
					has_building = building_railway
				}
			}
			AND = {
				any_scope_state = {
					state_region = s:STATE_AMUR
					has_building = building_railway
				}
				any_scope_state = {
					state_region = s:STATE_OUTER_MANCHURIA
					has_building = building_railway
				}
			}
		}
	}

	on_complete = {
		set_global_variable = trans_siberian_done
		trigger_event = { id = major_railways.1 }
	}

	weight = 50
}

je_trans_continental_railway = {
	icon = "gfx/interface/icons/event_icons/event_industry.dds"
	
	group = je_group_historical_content

	is_shown_when_inactive = {
		is_player = yes
		NOT = { has_global_variable = trans_continental_done }
		owns_entire_state_region = STATE_NEW_YORK
		any_scope_state = {
			state_region = s:STATE_NEBRASKA
		}
	}

	possible = {
		has_technology_researched = railways
		owns_entire_state_region = STATE_NEBRASKA
		owns_entire_state_region = STATE_CALIFORNIA
	}

	complete = {
		any_scope_state = {
			state_region = s:STATE_NEBRASKA
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_WYOMING
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_UTAH
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_NEVADA
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_CALIFORNIA
			has_building = building_railway
		}
	}

	on_complete = {
		set_global_variable = trans_continental_done
		trigger_event = { id = major_railways.2 }
	}

	weight = 50
}

je_canada_pacific_railway = {
	icon = "gfx/interface/icons/event_icons/event_industry.dds"
	
	group = je_group_historical_content

	is_shown_when_inactive = {
		is_player = yes
		NOT = { has_global_variable = canada_pacific_done }
		OR = {
			any_scope_state = {
				state_region = s:STATE_QUEBEC
			}
			any_scope_state = {
				state_region = s:STATE_BRITISH_COLUMBIA
			}
			any_scope_state = {
				state_region = s:STATE_ONTARIO
			}
			any_scope_state = {
				state_region = s:STATE_ALBERTA
			}
			any_scope_state = {
				state_region = s:STATE_SASKATCHEWAN
			}
			any_scope_state = {
				state_region = s:STATE_MANITOBA
			}
		}
	}

	possible = {
		has_technology_researched = railways
		any_scope_state = {
			state_region = s:STATE_QUEBEC
		}
		any_scope_state = {
			state_region = s:STATE_BRITISH_COLUMBIA
		}
		any_scope_state = {
			state_region = s:STATE_ONTARIO
		}
		any_scope_state = {
			state_region = s:STATE_ALBERTA
		}
		any_scope_state = {
			state_region = s:STATE_SASKATCHEWAN
		}
		any_scope_state = {
			state_region = s:STATE_MANITOBA
		}
	}

	complete = {
		any_scope_state = {
			state_region = s:STATE_QUEBEC
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_BRITISH_COLUMBIA
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_ONTARIO
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_ALBERTA
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_SASKATCHEWAN
			has_building = building_railway
		}
		any_scope_state = {
			state_region = s:STATE_MANITOBA
			has_building = building_railway
		}
	}
	
	on_complete = {
		set_global_variable = canada_pacific_done
		trigger_event = { id = major_railways.3 }
	}
	
	weight = 50
}