﻿namespace = culture_notification

# Culture Notification Events

#########################################################################################
# Tradition Removed from Culture 														#
# by Sean Hughes																		#
# culture_notification.0010																#
#########################################################################################

culture_notification.0010 = {
	hidden = yes

	immediate = {
		save_scope_as = this_player
		send_interface_toast = {
			type = msg_culture_tradition_change
			title = culture_notification.0010.t
			custom_tooltip = culture_notification.0010.desc
		}
	}
}

#########################################################################################
# Tradition Added to Culture 	 														#
# by Sean Hughes																		#
# culture_notification.0011																#
#########################################################################################

culture_notification.0011 = {
	hidden = yes

	immediate = {
		save_scope_as = this_player
		send_interface_toast = {
			type = msg_culture_tradition_change
			title = culture_notification.0011.t
			custom_tooltip = culture_notification.0011.desc
		}
	}
}


#########################################################################################
# Culture Hybridized 	 																#
# by Sean Hughes																		#
# culture_notification.1010																#
#########################################################################################

culture_notification.1001 = {
	hidden = yes

	immediate = {
		save_scope_as = this_player
		send_interface_toast = {
			type = msg_culture_hybridized
			title = culture_notification.1001.t
			left_icon = scope:founder
			custom_tooltip = culture_notification.1001.desc
		}
	}
}

culture_notification.1011 = {
	type = character_event
	title = culture_notification.1011.t
	desc = {
		desc = culture_notification.1011.intro
		first_valid = {
			triggered_desc = {
				trigger = { scope:dominant_culture = flag:parent_1 }
				desc = culture_notification.1011.hybrid_primary_1
			}
			triggered_desc = {
				trigger = { scope:dominant_culture = flag:parent_2 }
				desc = culture_notification.1011.hybrid_primary_2
			}
			desc = culture_notification.1011.hybrid_no_primary
		}
		first_valid = {
			triggered_desc = {
				trigger = { this = scope:founder }
				desc = culture_notification.1011.outro.founder
			}
			desc = culture_notification.1011.outro.other
		}
	}
	theme = culture_change
	major = yes
	left_portrait = scope:founder

	immediate = {
		scope:new_culture = {
			if = {
				limit = {
					calc_true_if = {
						amount >= 3
						has_same_culture_ethos = scope:parent_1
						has_same_culture_heritage = scope:parent_1
						has_same_culture_language = scope:parent_1 
						has_same_culture_martial_tradition = scope:parent_1
					}
				}
				save_scope_value_as = { name = dominant_culture value = flag:parent_1 }
			}
			else_if = {
				limit = {
					calc_true_if = {
						amount >= 3
						has_same_culture_ethos = scope:parent_2
						has_same_culture_heritage = scope:parent_2
						has_same_culture_language = scope:parent_2 
						has_same_culture_martial_tradition = scope:parent_2
					}
				}
				save_scope_value_as = { name = dominant_culture value = flag:parent_2 }
			}
			else = {
				save_scope_value_as = { name = dominant_culture value = flag:none }
			}
		}
	}

	option = {
		trigger = { this = scope:founder }
		name = culture_notification.1011.a.founder
		custom_tooltip = culture_notification_hybrid_tooltip
	}

	option = {
		trigger = { this != scope:founder }
		name = culture_notification.1011.a.other
		custom_tooltip = culture_notification_hybrid_tooltip
	}
}

#########################################################################################
# Culture Diverged			 	 														#
# by Sean Hughes																		#
# culture_notification.1101																#
#########################################################################################

culture_notification.1101 = {
	hidden = yes

	immediate = {
		save_scope_as = this_player
		send_interface_toast = {
			type = msg_culture_hybridized
			title = culture_notification.1101.t
			left_icon = scope:founder
			custom_tooltip = culture_notification.1101.desc
		}
	}
}

culture_notification.1111 = {
	type = character_event
	title = culture_notification.1111.t
	desc = {
		desc = culture_notification.1111.intro
		first_valid = {
			triggered_desc = {
				trigger = { NOT = { exists = scope:ethos } }
				desc = culture_notification.1111.ethos.unchanged
			}
			triggered_desc = {
				trigger = { scope:ethos = flag:bellicose }
				desc = culture_notification.1111.ethos.bellicose
			}
			triggered_desc = {
				trigger = { scope:ethos = flag:bureaucratic }
				desc = culture_notification.1111.ethos.bureaucratic
			}
			triggered_desc = {
				trigger = { scope:ethos = flag:courtly }
				desc = culture_notification.1111.ethos.courtly
			}
			triggered_desc = {
				trigger = { scope:ethos = flag:communal }
				desc = culture_notification.1111.ethos.communal
			}
			triggered_desc = {
				trigger = { scope:ethos = flag:stoic }
				desc = culture_notification.1111.ethos.stoic
			}
			triggered_desc = {
				trigger = { scope:ethos = flag:spiritual }
				desc = culture_notification.1111.ethos.spiritual
			}
			triggered_desc = {
				trigger = { scope:ethos = flag:egalitarian }
				desc = culture_notification.1111.ethos.egalitatian
			}
			desc = culture_notification.1111.ethos.unchanged
		}
		first_valid = {
			triggered_desc = {
				trigger = { this = scope:founder }
				desc = culture_notification.1111.outro.founder
			}
			desc = culture_notification.1111.outro.other
		}
	}
	theme = culture_change
	major = yes
	left_portrait = scope:founder

	immediate = {
		scope:new_culture = {
			if = {
				limit = {
					NOT = { has_same_culture_ethos = scope:parent_1 }
				}
				if = {
					limit = { has_cultural_pillar = ethos_bellicose }
					save_scope_value_as = { name = ethos value = flag:bellicose }
				}
				else_if = {
					limit = { has_cultural_pillar = ethos_stoic }
					save_scope_value_as = { name = ethos value = flag:stoic }
				}
				else_if = {
					limit = { has_cultural_pillar = ethos_bureaucratic }
					save_scope_value_as = { name = ethos value = flag:bureaucratic }
				}
				else_if = {
					limit = { has_cultural_pillar = ethos_spiritual }
					save_scope_value_as = { name = ethos value = flag:spiritual }
				}
				else_if = {
					limit = { has_cultural_pillar = ethos_courtly }
					save_scope_value_as = { name = ethos value = flag:courtly }
				}
				else_if = {
					limit = { has_cultural_pillar = ethos_egalitarian }
					save_scope_value_as = { name = ethos value = flag:egalitarian }
				}
				else_if = {
					limit = { has_cultural_pillar = ethos_communal }
					save_scope_value_as = { name = ethos value = flag:communal }
				}
			}
		}
	}

	option = {
		trigger = { this = scope:founder }
		name = culture_notification.1111.a.founder
		custom_tooltip = culture_notification_tooltip
	}

	option = {
		trigger = { this != scope:founder }
		name = culture_notification.1111.a.other
		custom_tooltip = culture_notification_tooltip
	}
}
