# Various music triggers

# Trigger that blocks generic music groups for specific cultures/governments that should only use their own
should_not_use_bespoke_music_trigger = {
	trigger_if = {
		limit = {
			has_tgp_dlc_trigger = yes
			should_use_chinese_music_trigger = yes
		}
		always = no
	}
	trigger_else_if = {
		limit = {
			has_mpo_dlc_trigger = yes
			should_use_nomadic_music_trigger = yes
		}
		always = no
	}
	trigger_else = {
		always = yes
	}
}

should_not_be_valid_if_asian_music_is_valid_trigger = {
	trigger_if = {
		limit = {
			has_tgp_dlc_trigger = yes
			should_use_asian_music_trigger = yes
		}
		always = no
	}
	trigger_else = {
		always = yes
	}
}

should_use_asian_music_trigger = {
	OR = {
		AND = {
			culture = {
				has_building_gfx = steppe_building_gfx
			}
			OR = {
				culture = { has_cultural_pillar = heritage_mongolic }
				culture = { any_parent_culture_or_above = { has_cultural_pillar = heritage_mongolic } }
				culture = { has_cultural_pillar = heritage_tungusic }
				culture = { any_parent_culture_or_above = { has_cultural_pillar = heritage_tungusic } }
				capital_province ?= {
					OR = {
						geographical_region = world_asia_north_east
						geographical_region = world_steppe_east
						geographical_region = world_siberia
					}
				}
			}
		}
		culture = {
			OR = {
				has_building_gfx = chinese_building_gfx
				has_building_gfx = indian_building_gfx
				has_building_gfx = southeast_asian_building_gfx
				has_building_gfx = tibetan_building_gfx
				has_building_gfx = japanese_building_gfx
			}
		}
		religion = { is_in_family = rf_sinitic }
		religion = religion:buddhism_religion
		religion = religion:hinduism_religion
		religion = religion:shintoism_religion
		any_character_situation = { situation_type = dynastic_cycle }
	}
}

should_use_chinese_music_trigger = {
	OR = {
		culture = { has_cultural_pillar = heritage_chinese }
		culture = { any_parent_culture_or_above = { has_cultural_pillar = heritage_chinese } }
		any_character_situation = { situation_type = dynastic_cycle }
		religion = { is_in_family = rf_sinitic }
	}
}

should_use_byzantine_music_trigger = {
	OR = {
		culture = { has_cultural_pillar = heritage_greek }
		religion = religion:eastern_orthodox_religion
	}
}

should_use_nomadic_music_trigger = {
	OR = {
		culture = {
			has_cultural_pillar = heritage_mongolic
		}
		culture = {
			has_cultural_pillar = heritage_turkic
		}
		culture = { any_parent_culture_or_above = { has_cultural_pillar = heritage_mongolic } }
		culture = { any_parent_culture_or_above = { has_cultural_pillar = heritage_turkic } }
#		faith.religion = faith:tengri_pagan.religion
		AND = {
			government_has_flag = government_is_nomadic
#			any_character_situation = {
#				this = situation:the_great_steppe
#			}
		}
	}
}

should_use_sami_music_trigger = {
	OR = {
		culture = {
			OR = {
				has_cultural_pillar = heritage_ugro_permian
				has_cultural_pillar = heritage_balto_finnic
				has_cultural_pillar = heritage_nivkh
			}
		}
		culture = {
			OR = {
				any_parent_culture_or_above = { has_cultural_pillar = heritage_ugro_permian }
				any_parent_culture_or_above = { has_cultural_pillar = heritage_balto_finnic }
				any_parent_culture_or_above = { has_cultural_pillar = heritage_nivkh }
			}
		}
		AND = {
			exists = capital_province
			capital_province = { geographical_region = cp4_music_area }
		}
	}
}

should_use_norse_music_trigger = {
	OR = {
		culture = { has_cultural_pillar = heritage_north_germanic }
		religion = religion:germanic_religion
	}
}

should_use_iberian_music_trigger = {
	OR = {
		culture = {
			has_cultural_pillar = heritage_iberian
		}
		culture = {
			any_parent_culture_or_above = { has_cultural_pillar = heritage_iberian }
		}
		AND = {
			exists = capital_province
			capital_province = { geographical_region = world_europe_west_iberia }
		}
	}
}

should_use_iranian_music_trigger = {
	OR = {
		culture = {
			has_cultural_pillar = heritage_iranian
		}
		culture = {
			any_parent_culture_or_above = { has_cultural_pillar = heritage_iranian }
		}
		AND = {
			religion = religion:islam_religion
			NAND = {
				government_has_flag = government_is_nomadic
				any_character_situation = {
					this = situation:the_great_steppe
				}
			}
		}
		religion = religion:zoroastrianism_religion
		AND = {
			exists = capital_province
			capital_province = { geographical_region = world_persian_empire }
		}
	}
}

should_use_specifically_persian_music_trigger = {
	OR = {
		culture = {
			has_cultural_pillar = heritage_iranian
		}
		culture = {
			any_parent_culture_or_above = { has_cultural_pillar = heritage_iranian }
		}
		AND = {
			exists = capital_province
			capital_province = { geographical_region = world_persian_empire }
		}
	}
}

should_use_european_christian_music_trigger = {
	NOT = { government_has_flag = government_is_nomadic }
	OR = {
		religion = religion:eastern_orthodox_religion
		religion = religion:protestant_religion
		AND = {
			exists = capital_province
			capital_province = {
				OR = {
					geographical_region = world_europe_west
					geographical_region = world_europe_north
					geographical_region = world_europe_south
				}
			}
		}
	}
}

should_use_broadly_european_music_trigger = {
	NOT = { government_has_flag = government_is_nomadic }
	OR = {
		AND = {
			exists = capital_province
			capital_province = {
				OR = {
					geographical_region = world_europe_west
					geographical_region = world_europe_north
					geographical_region = world_europe_south
				}
			}
			religion != religion:islam_religion
		}
		culture = {
			OR = {
				has_cultural_pillar = heritage_iberian
				has_cultural_pillar = heritage_north_germanic
				has_cultural_pillar = heritage_west_germanic
				has_cultural_pillar = heritage_central_germanic
				has_cultural_pillar = heritage_frankish
				has_cultural_pillar = heritage_latin
				has_cultural_pillar = heritage_south_slavic
				has_cultural_pillar = heritage_west_slavic
				has_cultural_pillar = heritage_vlach
				has_cultural_pillar = heritage_magyar
				has_cultural_pillar = heritage_goidelic
				has_cultural_pillar = heritage_brythonic
				any_parent_culture_or_above = {
					OR = {
						has_cultural_pillar = heritage_iberian
						has_cultural_pillar = heritage_north_germanic
						has_cultural_pillar = heritage_west_germanic
						has_cultural_pillar = heritage_central_germanic
						has_cultural_pillar = heritage_frankish
						has_cultural_pillar = heritage_latin
						has_cultural_pillar = heritage_south_slavic
						has_cultural_pillar = heritage_west_slavic
						has_cultural_pillar = heritage_vlach
						has_cultural_pillar = heritage_magyar
						has_cultural_pillar = heritage_goidelic
						has_cultural_pillar = heritage_brythonic
					}
				}
			}
		}
	}
}
