namespace = dvg_manifest_destiny

# Completed Qingqiu's JE
dvg_manifest_destiny.1 = {
	type = country_event
	placement = ROOT

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_military.dds"
	
	title = dvg_manifest_destiny.1.t
	desc = dvg_manifest_destiny.1.d
	flavor = dvg_manifest_destiny.1.f
	
	duration = 3
	
	trigger = {
	}
	
	option = {
		name = manifest_destiny.1.a
		default_option = yes

		s:STATE_YICHENG = { 
			add_homeland = qingqiuan
		}
		s:STATE_HAIKOU = { 
			add_homeland = qingqiuan
		}
		s:STATE_LAOFENG = { 
			add_homeland = qingqiuan
		}
		s:STATE_YULIN = { 
			add_homeland = qingqiuan
		}
		s:STATE_BAIZEHU = { 
			add_homeland = qingqiuan
		}
		set_global_variable = manifested_destiny_qingqiu_complete
	}
}

# Completed Plantagenia's JE
dvg_manifest_destiny.2 = {
	type = country_event
	placement = ROOT

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.2.t
	desc = dvg_manifest_destiny.2.d
	flavor = dvg_manifest_destiny.2.f
	
	duration = 3
	
	trigger = {
	}
	
	option = {
		name = manifest_destiny.1.a
		default_option = yes

		s:STATE_MESSIPPI_SUPERIEURE = { 
			add_homeland = plantagenian
		}
		s:STATE_NOUVEAU_LANCASTRE = { 
			add_homeland = plantagenian
		}
		s:STATE_TERRES_CAU = { 
			add_homeland = plantagenian
		}
		s:STATE_TERRES_ROUGES = { 
			add_homeland = plantagenian
		}
		s:STATE_TERRES_MAHA = { 
			add_homeland = plantagenian
		}
		set_global_variable = manifested_destiny_plantagenia_complete
	}
}

# Completed Plantagenia's JE
dvg_manifest_destiny.3 = {
	type = country_event
	placement = ROOT

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.3.t
	desc = dvg_manifest_destiny.3.d
	flavor = dvg_manifest_destiny.3.f
	
	duration = 3
	
	trigger = {
	}
	
	option = {
		name = manifest_destiny.1.a
		default_option = yes
		s:STATE_TJORNIN = { 
			add_homeland = vinlander
		}
		s:STATE_GYLHENVIK = { 
			add_homeland = vinlander
		}
		s:STATE_ODENSMARK = { 
			add_homeland = vinlander
		}
		set_global_variable = manifested_destiny_vinland_complete
	}
}

# Completed Rohnnst JE
dvg_manifest_destiny.4 = {
	type = country_event
	placement = ROOT

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.4.t
	desc = dvg_manifest_destiny.4.d
	flavor = dvg_manifest_destiny.4.f
	
	duration = 3
	
	trigger = {
	}
	
	option = {
		name = manifest_destiny.1.a
		default_option = yes

		if = {
			limit = { country_has_primary_culture = cu:qingqiuan }
			s:STATE_ROHNNST = { 
				add_homeland = qingqiuan
			}
		}
		else = {
			s:STATE_ROHNNST = { 
				add_homeland = vinlander
			}
		}
	}
}

dvg_manifest_destiny.11 = {
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.11.t
	desc = dvg_manifest_destiny.11.d
	flavor = dvg_manifest_destiny.11.f

	duration = 3

	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		country_has_primary_culture = cu:qingqiuan
		exists = c:NVJ
		ROOT = {
			has_technology_researched = atmospheric_engine
			any_scope_state = {
				state_region = s:STATE_LAOFENG
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_LAOFENG
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.11.a
		default_option = yes

		annex = c:NVJ
	}
}

dvg_manifest_destiny.12 = { #Haikou
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.12.t
	desc = dvg_manifest_destiny.12.d
	flavor = dvg_manifest_destiny.12.f

	duration = 3

	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		country_has_primary_culture = cu:qingqiuan
		exists = c:ABS
		ROOT = {
			has_technology_researched = railways
			any_scope_state = {
				state_region = s:STATE_HAIKOU
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_HAIKOU
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.12.a
		default_option = yes

		annex = c:ABS
	}
}

dvg_manifest_destiny.13 = { #Baizehu
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.13.t
	desc = dvg_manifest_destiny.13.d
	flavor = dvg_manifest_destiny.13.f

	duration = 3

	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		country_has_primary_culture = cu:qingqiuan
		exists = c:BLF
		ROOT = {
			has_technology_researched = railways
			has_technology_researched = pharmaceuticals
			any_scope_state = {
				state_region = s:STATE_BAIZEHU
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_BAIZEHU
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.13.a
		default_option = yes

		annex = c:BLF
	}
}

dvg_manifest_destiny.14 = { #Yulin
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.14.t
	desc = dvg_manifest_destiny.14.d
	flavor = dvg_manifest_destiny.14.f

	duration = 3

	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		country_has_primary_culture = cu:qingqiuan
		exists = c:ARP
		ROOT = {
			has_technology_researched = railways
			has_technology_researched = pharmaceuticals
			any_scope_state = {
				state_region = s:STATE_YULIN
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_YULIN
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.14.a
		default_option = yes

		annex = c:ARP
	}
}

dvg_manifest_destiny.21 = {
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.21.t
	desc = dvg_manifest_destiny.21.d
	flavor = dvg_manifest_destiny.21.f

	duration = 3
	
	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		exists = c:COM
		country_has_primary_culture = cu:plantagenian
		ROOT = {
			has_technology_researched = railways
			has_technology_researched = nationalism
			any_scope_state = {
				state_region = s:STATE_NOUVEAU_LANCASTRE
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_NOUVEAU_LANCASTRE
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.12.a
		default_option = yes

		annex = c:COM
	}
}

dvg_manifest_destiny.22 = {
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.22.t
	desc = dvg_manifest_destiny.22.d
	flavor = dvg_manifest_destiny.22.f

	duration = 3
	
	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		exists = c:PWN
		country_has_primary_culture = cu:plantagenian
		ROOT = {
			has_technology_researched = railways
			any_scope_state = {
				state_region = s:STATE_TERRES_CAU
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_TERRES_CAU
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.22.a
		default_option = yes

		annex = c:PWN
	}
}

dvg_manifest_destiny.23 = {
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.23.t
	desc = dvg_manifest_destiny.23.d
	flavor = dvg_manifest_destiny.23.f

	duration = 3
	
	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		exists = c:LKT
		country_has_primary_culture = cu:plantagenian
		ROOT = {
			has_technology_researched = railways
			any_scope_state = {
				state_region = s:STATE_TERRES_MAHA
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_TERRES_MAHA
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.23.a
		default_option = yes

		annex = c:LKT
	}
}

dvg_manifest_destiny.31 = {
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.31.t
	desc = dvg_manifest_destiny.31.d
	flavor = dvg_manifest_destiny.31.f

	duration = 3
	
	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		exists = c:ANI
		country_has_primary_culture = cu:vinlander
		ROOT = {
			has_technology_researched = railways
			any_scope_state = {
				state_region = s:STATE_GYLHENVIK
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_GYLHENVIK
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.31.a
		default_option = yes

		annex = c:ANI
	}
}

dvg_manifest_destiny.32 = {
	type = country_event
	placement = scope:claimed_state

	event_image = {
		video = "gfx/event_pictures/europenorthamerica_native_american.bk2"
	}

	on_created_soundeffect = "event:/SFX/UI/Alerts/event_appear"
	on_opened_soundeffect = "event:/SFX/Events/europenorthamerica/native_american"

	icon = "gfx/interface/icons/event_icons/event_map.dds"
	
	title = dvg_manifest_destiny.32.t
	desc = dvg_manifest_destiny.32.d
	flavor = dvg_manifest_destiny.32.f

	duration = 3
	
	trigger = {
		NOT = { has_variable = manifest_colonize_var }
		exists = c:DKT
		country_has_primary_culture = cu:vinlander
		ROOT = {
			has_technology_researched = railways
			has_technology_researched = watertube_boiler
			any_scope_state = {
				state_region = s:STATE_TJORNIN
				count > 0
			}
		}
	}
	
	immediate = {
		set_variable = {
			name = manifest_colonize_var
			months = 12
		}
		random_scope_state = {
			limit = {
				state_region = s:STATE_TJORNIN
			}
			save_scope_as = claimed_state
		}
	}

	option = {
		name = dvg_manifest_destiny.32.a
		default_option = yes

		annex = c:DKT
	}
}
