
### Cultural trigger list

# drinks_alcohol_trigger - Would this person drink alcohol?
# holder_or_above_is_player_of_culture - Is this county's holder or anyone above them in the de facto hierarchy a player with the same culture?


######################
# Cultural triggers  #
######################

drinks_alcohol_trigger = {
	is_adult = yes
	custom_tooltip = {
		text = drinks_alcohol
		OR = {
			has_trait = drunkard
			faith_forbids_alcohol_trigger = no
		}
	}
}

faith_forbids_alcohol_trigger = {
	OR = {
		religion = religion:islam_religion # Prohibited by khamr, a prohibition against intoxicants
		religion = religion:jainism_religion # Prohibited along with the consumption of any fermented food
		AND = {
			has_trait = zealous
			religion = religion:buddhism_religion # Discouraged as it disrupts progress along the eightfold path
		}
#		faith = faith:mandeaism # Whoever drinks wine in a tavern, he will be torn to pieces with toothed saws
	}
}

# If you need to check if a county drinks alcohol.
faith_only_forbids_alcohol_trigger = {
	OR = {
		religion = religion:islam_religion # Prohibited by khamr, a prohibition against intoxicants
		religion = religion:jainism_religion # Prohibited along with the consumption of any fermented food
		religion = religion:buddhism_religion # Discouraged as it disrupts progress along the eightfold path
#		faith = faith:mandeaism # Whoever drinks wine in a tavern, he will be torn to pieces with toothed saws
	}
}

holder_or_above_is_player_of_culture = {
	culture = {
		save_temporary_scope_as = this_culture
	}
	OR = {
		holder = {
			AND = {
				is_ai = no
				culture = scope:this_culture
			}
			any_liege_or_above = {
				is_ai = no
				culture = scope:this_culture
			}
		}
	}
}

culture_in_winter_geographical_region_trigger = {
	custom_description = {
		text = culture_in_winter_geographical_region_trigger_desc
		any_culture_county = {
			any_county_province = {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west
					geographical_region = world_europe_east
					geographical_region = world_steppe
					geographical_region = world_tibet
					geographical_region = world_asia_china
					geographical_region = world_asia_japan
					geographical_region = world_asia_sakhalin_hokkaido
					geographical_region = world_asia_korea
					geographical_region = world_asia_north_east
				}
			}
		}
	}
}

culture_in_non_sedentary_geographical_region_trigger = {
	custom_description = {
		text = culture_in_non_sedentary_geographical_region_trigger_desc
		any_culture_county = {
			any_county_province = {
				geographical_region = world_steppe
			}
		}
	}
}

culture_not_pacifistic_trigger = {
	custom_description = {
		text = culture_not_pacifist_trigger_desc
		NOT = {
			culture_tradition:tradition_pacifism = { is_in_list = traits }
		}
	}
}

culture_not_warlike_trigger = {
	custom_description = {
		text = culture_not_warlike_trigger_desc
		NOR = {
			culture_tradition:tradition_winter_warriors = { is_in_list = traits }
			culture_tradition:tradition_forest_fighters = { is_in_list = traits }
			culture_tradition:tradition_mountaineers = { is_in_list = traits }
			culture_tradition:tradition_warriors_of_the_dry = { is_in_list = traits }
			culture_tradition:tradition_highland_warriors = { is_in_list = traits }
			culture_tradition:tradition_jungle_warriors = { is_in_list = traits }
			culture_tradition:tradition_quarrelsome = { is_in_list = traits }
			culture_tradition:tradition_malleable_invaders = { is_in_list = traits }
			culture_tradition:tradition_hunters = { is_in_list = traits }
			culture_tradition:tradition_warrior_culture = { is_in_list = traits }
			culture_tradition:tradition_martial_admiration = { is_in_list = traits }
			culture_tradition:tradition_tgp_bushido = { is_in_list = traits }
			culture_tradition:tradition_tgp_defiant_ambushers = { is_in_list = traits }
			culture_tradition:tradition_tgp_warrior_monks = { is_in_list = traits }
			culture_tradition:tradition_tgp_art_of_war = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_winter_warriors_desc
		NOT = {
			culture_tradition:tradition_winter_warriors = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_forest_fighter_desc
		NOT = {
			culture_tradition:tradition_forest_fighters = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_mountaineers_desc
		NOT = {
			culture_tradition:tradition_mountaineers = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_warriors_of_the_dry_desc
		NOT = {
			culture_tradition:tradition_warriors_of_the_dry = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_highland_warriors_desc
		NOT = {
			culture_tradition:tradition_highland_warriors = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_jungle_warriors_desc
		NOT = {
			culture_tradition:tradition_jungle_warriors = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_quarrelsome_desc
		NOT = {
			culture_tradition:tradition_quarrelsome = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_malleable_invaders_desc
		NOT = {
			culture_tradition:tradition_malleable_invaders = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_hunters_desc
		NOT = {
			culture_tradition:tradition_hunters = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_warrior_culture_desc
		NOT = {
			culture_tradition:tradition_warrior_culture = { is_in_list = traits }
		}
	}
	custom_description = {
		text = culture_has_martial_admiration_desc
		NOT = {
			culture_tradition:tradition_martial_admiration = { is_in_list = traits }
		}
	}
}

should_have_same_faith_succession_trigger = {
	culture = {
		has_cultural_parameter = same_faith_inheritance_only
	}
	NOR = {
		government_has_flag = government_is_theocracy # Handled separately
		government_has_flag = government_is_holy_order # Handled separately
		government_has_flag = government_is_mercenary # Irrelevant
	}
}

not_tribal_raid_trigger = {
	culture = {
		has_cultural_parameter = not_tribal_raiding_malus
	}
	NOT = { government_has_flag = government_is_tribal }
}

culture_is_not_historical_hybrid_trigger = {
	#Used to tell if a hybrid culture is one of the historical hybrids or not, mainly in checks for AI hybridization checks related to game rules.
	#Expects to be used in culture scope
	NOR = {
#		this = culture:norman
		this = culture:maghrebi
		this = culture:gaelic
		this = culture:anglo_saxon
		this = culture:scottish
		this = culture:NEOW_andalusian
		this = culture:catalan
		this = culture:english
		this = culture:sicilian
		this = culture:cisalpine
	}
}

# Cultural MAA triggers - Used in various places for triggers, AI weights, etc.
culture_has_skirmisher_maa = {
	OR = {
		has_cultural_parameter = unlock_maa_horn_warrior
		has_cultural_parameter = unlock_maa_shomer
		has_cultural_parameter = unlock_maa_abudrar
		has_cultural_parameter = unlock_maa_guinea_warrior
		has_cultural_parameter = unlock_maa_pesilat
		has_innovation = innovation_adaptive_militia #Goedendag - Later Era MAA
		has_cultural_parameter = unlock_maa_akritai
	}
}

culture_has_archer_maa = {
	OR = {
		has_cultural_parameter = unlock_maa_archers_of_the_nile
		has_cultural_parameter = unlock_maa_bush_hunter
		has_cultural_parameter = unlock_maa_metsanvartija
		has_cultural_parameter = unlock_maa_maturkan_warriors
		has_cultural_parameter = unlock_maa_longbowmen
		has_innovation = innovation_repeating_crossbow #Chu-ko-nu Archers
		has_innovation = innovation_bamboo_bows #Paiks
	}
}

culture_has_improved_crossbowmen = {
	OR = {
		has_innovation = innovation_repeating_crossbow #Chu-ko-nu Archers
	}
}

culture_has_heavy_infantry_maa = {
	OR = {
		has_cultural_parameter = unlock_maa_ayyar
		has_cultural_parameter = unlock_maa_mubarizun
		has_cultural_parameter = unlock_maa_druzhina
		has_cultural_parameter = unlock_maa_khandayat
		has_cultural_parameter = unlock_maa_garudas
		has_cultural_parameter = unlock_maa_palace_guards
		has_cultural_parameter = unlock_maa_huscarls
		has_cultural_parameter = unlock_maa_mountaineer
		has_cultural_parameter = unlock_maa_zbrojnosh
		has_cultural_parameter = unlock_infantry_samurai_units
		has_cultural_parameter = unlock_zhanmadao
		has_cultural_parameter = unlock_burenjia

		has_innovation = innovation_sarawit #Sarawit - Later Era MAA
		has_innovation = innovation_legionnaires #Praetorian
		has_cultural_parameter = unlock_maa_varangian_guards
	}
}

culture_has_pikemen_maa = { #I.e. Spearmen
	OR = {
		has_cultural_parameter = unlock_maa_zupin_warrior
		has_cultural_parameter = unlock_warrior_monk_units
		has_innovation = innovation_rectilinear_schiltron #Schiltron - Later Era MAA
		has_innovation = innovation_pike_columns #Picchieri - Later Era MAA
		has_innovation = innovation_zweihanders #Later Era MAA
		has_cultural_parameter = unlock_maa_skoutatoi
	}
}

culture_has_light_cavalry_maa = {
	OR = {
		has_cultural_parameter = unlock_maa_mulaththamun
		has_cultural_parameter = unlock_maa_hussar #Konni
		has_cultural_parameter = unlock_maa_tawashi #Tawashi
		has_cultural_parameter = unlock_maa_ayrudzi
		has_innovation = innovation_desert_tactics #Chasseur
		has_innovation = innovation_caballeros #Caballero
		has_innovation = innovation_hobbies #Hobelar
		has_innovation = innovation_sahel_horsemen #Sahel Horsemen
	}
}

culture_has_heavy_cavalry_maa = {
	OR = {
		has_cultural_parameter = unlock_maa_cataphract
		has_cultural_parameter = unlock_maa_monaspa
		has_cultural_parameter = unlock_maa_tarkhan
		has_cultural_parameter = unlock_maa_conrois
		has_cultural_parameter = unlock_maa_cataphract_archers
		has_innovation = innovation_tiefutu
		has_cultural_parameter = unlock_maa_black_armor_cavalry
		has_innovation = innovation_valets #Gendarme - Later Era MAA
	}
}

culture_has_archer_cavalry_maa = {
	OR = {
		has_cultural_parameter = unlock_maa_horse_archers
		has_cultural_parameter = unlock_maa_mangudai
		has_cultural_parameter = unlock_emishi_horse_archers_units
		has_cultural_parameter = unlock_mounted_samurai_units


		culture_head ?= {
			mpo_can_recruit_nomad_maa_trigger = yes
		}
		any_player = {
			culture = prev
			mpo_can_recruit_nomad_maa_trigger = yes
		}
	}
}

#Culture specialized in maa type
culture_specializes_in_skirmisher_maa = {
	OR = {
		has_cultural_tradition = tradition_forest_folk
		has_cultural_tradition = tradition_jungle_dwellers
		has_cultural_tradition = tradition_polders
		has_cultural_tradition = tradition_adaptive_skirmishing
		has_cultural_tradition = tradition_hit_and_run
		has_cultural_tradition = tradition_forest_wardens
		has_cultural_tradition = tradition_hussar
		has_cultural_tradition = tradition_fp3_pragmatic_creed
		culture_has_skirmisher_maa = yes
	}
}

culture_specializes_in_archer_maa = {
	OR = {
		has_cultural_tradition = tradition_forest_folk
		has_cultural_tradition = tradition_jungle_dwellers
		has_cultural_tradition = tradition_adaptive_skirmishing
		has_cultural_tradition = tradition_formation_fighting
		culture_has_archer_maa = yes
	}
}

culture_specializes_in_heavy_infantry_maa = {
	OR = {
		has_cultural_tradition = tradition_roman_legacy
		has_cultural_tradition = tradition_metal_craftsmanship
		has_cultural_tradition = tradition_mountain_homes
		has_cultural_tradition = tradition_stand_and_fight
		has_cultural_tradition = tradition_mobile_guards
		has_cultural_tradition = tradition_mountaineer_ruralism
		has_cultural_tradition = tradition_tgp_art_of_war
		has_cultural_tradition = tradition_tgp_bushido
		culture_has_heavy_infantry_maa = yes
	}
}

culture_specializes_in_pikemen_maa = {
	OR = {
		has_cultural_tradition = tradition_mountaineer_ruralism
		has_cultural_tradition = tradition_metal_craftsmanship
		has_cultural_tradition = tradition_mountain_homes
		has_cultural_tradition = tradition_formation_fighting
		has_cultural_tradition = tradition_stand_and_fight
		has_cultural_tradition = tradition_mobile_guards
		has_cultural_tradition = tradition_tgp_warrior_monks
		culture_has_pikemen_maa = yes
	}
}

culture_specializes_in_light_cavalry_maa = {
	OR = {
		has_cultural_tradition = tradition_dryland_dwellers
		has_cultural_tradition = tradition_pastoralists
		has_cultural_tradition = tradition_hit_and_run
		has_cultural_tradition = tradition_horse_breeder
		has_cultural_tradition = tradition_saharan_nomads
		culture_has_light_cavalry_maa = yes
	}
}

culture_specializes_in_heavy_cavalry_maa = {
	OR = {
		has_cultural_tradition = tradition_roman_legacy
		has_cultural_tradition = tradition_mountain_homes
		has_cultural_tradition = tradition_horse_breeder
		has_cultural_tradition = tradition_stand_and_fight
		has_cultural_tradition = tradition_mobile_guards
		has_cultural_tradition = tradition_ep3_indomitable_azatani
		has_cultural_tradition = tradition_mountaineer_ruralism
		has_cultural_tradition = tradition_tgp_art_of_war
		culture_has_heavy_cavalry_maa = yes
	}
}

culture_specializes_in_archer_cavalry_maa = {
	OR = {
		has_cultural_tradition = tradition_ep3_indomitable_azatani
		has_cultural_tradition = tradition_horse_breeder
		has_cultural_tradition = tradition_mpo_iron_cavalry
		has_cultural_tradition = tradition_devoted_horsemanship
		has_cultural_tradition = tradition_tgp_bushido
		has_cultural_tradition = tradition_tgp_defiant_ambushers
		culture_has_archer_cavalry_maa = yes
	}
}

# Language trigger - Makes languages available when you diverge your culture
language_is_shown_trigger = {
	scope:character = {
		OR = {
			AND = {
				exists = var:legendary_culture
				var:legendary_culture = { has_cultural_pillar = $LANGUAGE$ }
			}
			AND = {
				# The target language needs to fulfill ALL of the following:
				any_sub_realm_county = { # Language needs to be well-represented within your realm
					percent >= 0.1
					culture = { has_cultural_pillar = $LANGUAGE$ }
				}
				any_sub_realm_county = { # Language needs to border your own culture
					culture = { has_cultural_pillar = $LANGUAGE$ }
					any_neighboring_county = {
						culture = { this = scope:character.culture }
					}
				}
				any_sub_realm_county = { # You need a minimum acceptance with any culture speaking the language
					culture = {
						has_cultural_pillar = $LANGUAGE$
						cultural_acceptance = {
							target = scope:character.culture
							value >= 25
						}
					}
				}
			}
		}
	}
}

# Language trigger - Makes heritages available when you diverge your culture
heritage_is_shown_trigger = {
	scope:character = {
		OR = {
			AND = {
				exists = var:legendary_culture
				var:legendary_culture = { has_cultural_pillar = $HERITAGE$ }
			}
			culture = { has_cultural_pillar = $HERITAGE$ }
		}
	}
}

# Checks if you could Hybridise with the culture without checking for acceptance
is_valid_for_hybridising_trigger = {
	$CHARACTER$ = {
		culture = {
			NOT = { has_same_culture_heritage = $CULTURE$ }
			culture_age >= culture_hybrid_cooldown
		}
		trigger_if = {
			limit = {
				NAND = {
					exists = var:special_culture
					var:special_culture = $CULTURE$
				}
			}
			custom_description = {
				text = culture_present_in_realm_for_hybridization
				any_sub_realm_county = {
					culture = $CULTURE$
				}
			}
		}
		custom_description = {
			text = culture_is_not_parent_culture
			culture = {
				NOT = {
					any_parent_culture = {
						this = $CULTURE$
					}
				}
			}
		}
		custom_description = {
			text = culture_is_not_child_culture
			$CULTURE$ = {
				NOT = {
					any_parent_culture = {
						this = $CHARACTER$.culture
					}
				}
			}
		}
	}
}

# Checks if you can currently hybridise with the culture
can_hybridize_culture_trigger = {
	is_valid_for_hybridising_trigger = {
		CHARACTER = $CHARACTER$
		CULTURE = $CULTURE$
	}
	$CHARACTER$ = {
		culture = {
			cultural_acceptance = { target = $CULTURE$ value >= hybridization_threshold_value }
		}
	}
}


# Uses current scope and scope:culture
cultures_share_relevant_region_trigger = {
	OR = {
		AND = {
			culture_overlaps_geographical_region = world_europe
			scope:culture = {
				culture_overlaps_geographical_region = world_europe
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_asia_minor
			scope:culture = {
				culture_overlaps_geographical_region = world_asia_minor
			}
		}
		AND = {
			OR = {
				culture_overlaps_geographical_region = world_middle_east
				culture_overlaps_geographical_region = world_middle_east_persia
			}
			scope:culture = {
				OR = {
					culture_overlaps_geographical_region = world_middle_east
					culture_overlaps_geographical_region = world_middle_east_persia
				}
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_steppe
			scope:culture = {
				culture_overlaps_geographical_region = world_steppe
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_tibet
			scope:culture = {
				culture_overlaps_geographical_region = world_tibet
			}
		}
		AND = {
			OR = {
				culture_overlaps_geographical_region = world_india
				culture_overlaps_geographical_region = world_burma
			}
			scope:culture = {
				OR = {
					culture_overlaps_geographical_region = world_india
					culture_overlaps_geographical_region = world_burma
				}
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_africa
			scope:culture = {
				culture_overlaps_geographical_region = world_africa
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_asia_china
			scope:culture = {
				culture_overlaps_geographical_region = world_asia_china
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_asia_china
			scope:culture = {
				culture_overlaps_geographical_region = world_asia_korea
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_asia_china
			scope:culture = {
				culture_overlaps_geographical_region = world_asia_southeast
			}
		}
		AND = {
			culture_overlaps_geographical_region = world_asia_japan
			scope:culture = {
				culture_overlaps_geographical_region = world_asia_japan
			}
		}
	}
}

is_vegetarian_trigger = {
	OR = {
		culture = {
			has_cultural_parameter = cannot_hunt
		}
		faith_is_vegetarian_trigger = yes
	}
}

faith_is_vegetarian_trigger = {
	faith = {
		OR = {
			religion = religion:buddhism_religion
			religion = religion:jainism_religion
#			religion = religion:bon_religion
#			this = faith:mazdakism
#			this = faith:manichean
		}
	}
}

culture_tradition_reduction_trigger = {
	scope:character = {
		has_variable_list = culture_tradition_reduction
		is_target_in_variable_list = {
			name = culture_tradition_reduction
			target = culture_tradition:$TRADITION$
		}
	}
}

culture_is_or_has_ancestor_trigger = {
	OR = {
		this = $CULTURE$
		any_parent_culture_or_above = { this = $CULTURE$ }
	}
}
