﻿je_oregon = {
	icon = "gfx/interface/icons/event_icons/event_map.dds"

	group = je_group_historical_content

	is_shown_when_inactive = {
		exists = c:USA
		exists = c:GBR
		c:USA = ROOT
		s:STATE_WASHINGTON = {
			any_scope_state = {
				owner = {
					OR = {
						c:GBR = THIS
						is_subject_of = c:GBR
					}
				}
			}
		}
		s:STATE_OREGON = {
			any_scope_state = {
				owner = {
					OR = {
						c:GBR = THIS
						is_subject_of = c:GBR
					}
				}
			}
		}
		s:STATE_IDAHO = {
			any_scope_state = {
				owner = {
					OR = {
						c:GBR = THIS
						is_subject_of = c:GBR
					}
				}
			}
		}
	}

	possible = { 
		OR = {
			has_interest_marker_in_region = region_pacific_coast
			custom_tooltip = {
				text = oregon_tt
				has_global_variable = oregon_trail_mapped
			}
			owns_entire_state_region = STATE_MONTANA
			owns_entire_state_region = STATE_WYOMING
		}
	}

	complete = {
		OR = {
			AND = {
				has_interest_marker_in_region = region_pacific_coast
				custom_tooltip = {
					text = oregon_tt
					has_global_variable = oregon_trail_mapped
				}
				owns_entire_state_region = STATE_MONTANA
				owns_entire_state_region = STATE_WYOMING
				c:GBR = {
					relations:ROOT >= relations_threshold:cordial
				}
			}
			AND = {
				owns_entire_state_region = STATE_WASHINGTON
				owns_entire_state_region = STATE_IDAHO
				owns_entire_state_region = STATE_OREGON
			}
		}
	}

	on_complete = {
		if = {
			limit = {
				s:STATE_WASHINGTON = {
					any_scope_state = {
						owner = {
							OR = {
								c:GBR = THIS
								is_subject_of = c:GBR
							}
						}
					}
				}
				s:STATE_OREGON = {
					any_scope_state = {
						owner = {
							OR = {
								c:GBR = THIS
								is_subject_of = c:GBR
							}
						}
					}
				}
				s:STATE_IDAHO = {
					any_scope_state = {
						owner = {
							OR = {
								c:GBR = THIS
								is_subject_of = c:GBR
							}
						}
					}
				}
			}
			c:GBR = { trigger_event = { id = oregon.2 } }
		}
		else = {
			s:STATE_IDAHO = {
				add_homeland = cu:yankee
			}
			s:STATE_WASHINGTON = {
				add_homeland = cu:yankee
			}
			s:STATE_OREGON = {
				add_homeland = cu:yankee
			}
			add_modifier = {
				name = oregon_resolved
				months = normal_modifier_time
			}
		}
	}

	weight = 100
}

je_conquer_oregon = {
	icon = "gfx/interface/icons/event_icons/event_military.dds"

	group = je_group_historical_content

	complete = {
		c:USA = {
			owns_entire_state_region = STATE_WASHINGTON
			owns_entire_state_region = STATE_IDAHO
			owns_entire_state_region = STATE_OREGON
		}
	}

	weight = 100

	transferable = no
}
