﻿# Purveyor of Progress JE
je_india_railway = {
	icon = "gfx/interface/icons/event_icons/event_industry.dds"
	
	group = je_group_historical_content

	is_shown_when_inactive = {
		has_dlc_feature = ip2_content
		is_player = yes
		NOT = { has_global_variable = india_railway_done }
		any_scope_state = {
			OR = {
				region = sr:region_bengal
				region = sr:region_bombay
				region = sr:region_central_india
				region = sr:region_madras
				region = sr:region_punjab
			}
		}
	}

	possible = {
		has_technology_researched = railways
		# Country has all state regions for the line
		OR = {
			custom_tooltip = {
				text = delhi_calcutta_line_possible_tt
				AND = { # Delhi-Calcutta line
					any_scope_state = {
						state_region = s:STATE_WEST_BENGAL
					}
					any_scope_state = {
						state_region = s:STATE_BIHAR
					}
					any_scope_state = {
						state_region = s:STATE_AWADH
					}
					any_scope_state = {
						state_region = s:STATE_AGRA
					}
					any_scope_state = {
						state_region = s:STATE_DELHI
					}
				}
			}
			custom_tooltip = {
				text = allahabad_bombay_line_possible_tt
				AND = { # Allahabad-Bombay line
					any_scope_state = {
						state_region = s:STATE_AGRA
					}
					any_scope_state = {
						state_region = s:STATE_BUNDELKHAND
					}
					any_scope_state = {
						state_region = s:STATE_CENTRAL_PROVINCES
					}
					any_scope_state = {
						state_region = s:STATE_MALWA
					}
					any_scope_state = {
						state_region = s:STATE_BOMBAY
					}	
				}
			}
			custom_tooltip = {
				text = bombay_madras_line_possible_tt
				AND = { # Bombay-Madras line
					any_scope_state = {
						state_region = s:STATE_BOMBAY
					}
					any_scope_state = {
						state_region = s:STATE_HYDERABAD
					}
					any_scope_state = {
						state_region = s:STATE_KURNOOL
					}
					any_scope_state = {
						state_region = s:STATE_MADRAS
					}
				}
			}
			custom_tooltip = {
				text = gujarat_bombay_line_possible_tt
				AND = { # Gujarat-Bombay line
					any_scope_state = {
						state_region = s:STATE_BOMBAY
					}
					any_scope_state = {
						state_region = s:STATE_GUJARAT
					}
				}
			}
		}
	}

	complete = {
		# Completed the line
		AND = {
			custom_tooltip = {
				text = delhi_calcutta_line_complete_tt
				AND = { # Delhi-Calcutta line
					any_scope_state = {
						state_region = s:STATE_WEST_BENGAL
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_BIHAR
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_AWADH
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_AGRA
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_DELHI
						has_building = building_railway
					}
				}
			}
			custom_tooltip = {
				text = allahabad_bombay_line_complete_tt
				AND = { # Allahabad-Bombay line
					any_scope_state = {
						state_region = s:STATE_AGRA
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_BUNDELKHAND
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_CENTRAL_PROVINCES
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_MALWA
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_BOMBAY
						has_building = building_railway
					}	
				}
			}
			custom_tooltip = {
				text = bombay_madras_line_complete_tt
				AND = { # Bombay-Madras line
					any_scope_state = {
						state_region = s:STATE_BOMBAY
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_HYDERABAD
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_KURNOOL
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_MADRAS
						has_building = building_railway
					}
				}
			}
			custom_tooltip = {
				text = gujarat_bombay_line_complete_tt
				AND = { # Gujarat-Bombay line
					any_scope_state = {
						state_region = s:STATE_BOMBAY
						has_building = building_railway
					}
					any_scope_state = {
						state_region = s:STATE_GUJARAT
						has_building = building_railway
					}
				}
			}
		}
	}
	
	on_complete = {
		set_global_variable = india_railway_done
		trigger_event = { id = india_railway.5 }
	}

	on_yearly_pulse = {
		effect = {
			
		}
		random_events = {
			100 = 0
			10 = india_railway.1
			10 = india_railway.2
			10 = india_railway.3
			10 = india_railway.4
		}
	}

	invalid = {
	}
	
	weight = 50
}