﻿###Create an Atalantian culture and change this event to transform into that.
###Don't see how this is actually changing culture. Gonna have to figure that out.
###Figure out how to set up breaking free and starting the new empire using the burgundian secession event.

namespace = everpreg_atalantian_culture

everpreg_atalantian_culture.001 = {
	type = character_event
	title = everpreg_atalantian_culture.001.t
	desc = everpreg_atalantian_culture.001.desc
	theme = culture_change
	left_portrait = {
		character = scope:founder
		animation = personality_bold
	}
	
	immediate = {
		save_scope_as = founder
		culture = { save_scope_as = founder_former_culture }
		play_music_cue = "mx_cue_epic_sacral_moment"
	}
	
	option = {
		name = everpreg_atalantian_culture.001.a
		embrace_everpreg_atalantian_culture_effect = yes
		establish_everpreg_atalantea_empire_effect = yes
		set_character_faith_with_conversion = faith:everpreg_antideleuvianism		
		set_culture = culture:everpreg_atalantean
		capital_county = { set_county_culture = culture:everpreg_atalantean }		
		culture:everpreg_atalantean = {
			custom_tooltip = decision_embrace_english_culture_get_innovations
			hidden_effect = {
			get_all_innovations_from = scope:founder_former_culture			
			get_random_innovation_from = culture:russian
			add_innovation = innovation_everpreg_atalanteans1
			add_innovation = innovation_longboats
			}
		}		
		add_character_flag = converted_culture_this_lifetime		
		every_vassal = {
			#random = {
				#			chance = 15
				#			modifier = {
				#				add = 15
				#				has_trait_rank = {
				#					trait = education_diplomacy
				#					rank > 1
				#				}
				#			}
				#			modifier = {
				#				add = 25
				#				has_trait_rank = {
				#					trait = education_diplomacy
				#					rank > 2
				#				}
				#			}
				#			modifier = {
				#				add = 35
				#				has_trait_rank = {
				#					trait = education_diplomacy
				#					rank > 3
				#				}
				#			}
				#	set_culture = culture:everpreg_atalantean
				#	add_character_flag = converted_culture_this_lifetime									
				#}
		}
	}
}

everpreg_atalantian_culture.1002 = {
	type = character_event
	title = everpreg_atalantian_culture.1002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					has_culture = scope:founder.culture
				}
				desc = everpreg_atalantian_culture.1002.desc_same_culture
			}
			desc = everpreg_atalantian_culture.1002.desc
		}
	}
	theme = realm
	left_portrait = {
		character = scope:founder
		animation = personality_honorable
	}

	option = { # outsider
		name = everpreg_atalantian_culture.1002.a
		trigger = {
			NOT = { has_culture = founder.culture }
		}
	}

	option = { # friendly
		name = everpreg_atalantian_culture.1002.b
		trigger = {
			has_culture = scope:founder.culture
		}
	}

	option = { # Give players close to founder a chance to convert
		name = everpreg_atalantian_culture.1002.c
		trigger = {
			NOT = { root.culture = culture:everpreg_atalantean }
			OR = {
				is_close_family_of = scope:founder
				is_vassal_of = scope:founder
			}
		}
		set_culture = culture:everpreg_atalantean
		hidden_effect = {
			if = {
				limit = { any_spouse = { is_landed = no } }
				every_spouse = {
					set_culture = culture:everpreg_atalantean
				}
			}
			if = {
				limit = {
					any_close_family_member = {
						is_landed = no
						NOT = { is_spouse_of = prev }
					}
				}
				every_close_family_member = {
					limit = {
						is_landed = no
						NOT = { is_spouse_of = prev }
					}
					set_culture = culture:everpreg_atalantean
				}
			}
		}


	}
}