﻿###################
# MARTIAL CUSTOMS #
###################
# The conditions for each martial custom depends on the active game rules.

martial_custom_male_only = {
	is_valid = {
		trigger_if = {
			limit = {
				has_game_rule = default_gender_equality
			}
			always = yes
		}
		custom_tooltip = {
			text = martial_customs_trigger_maleonly_malepref_or_equal
			
			trigger_if = {
				limit = {
					has_game_rule = full_gender_equality
				}
				OR = {
					scope:character ?= { has_realm_law = male_only_law }
					scope:character ?= { has_realm_law = male_preference_law }
					scope:character ?= { has_realm_law = equal_law }
				}
			}
		}
		custom_tooltip = {
			text = martial_customs_trigger_maleonly_or_male_pref
			
			trigger_if = {
				limit = {
					has_game_rule = inversed_gender_equality
				}
				OR = {
					scope:character ?= { has_realm_law = male_only_law }
					scope:character ?= { has_realm_law = male_preference_law }
				}
			}
		}
	}
}

martial_custom_equal = {
	is_valid = {
		custom_tooltip = {
			text = martial_customs_trigger_femaleonly_femalepref_or_equal
			
			trigger_if = {
				limit = {
					has_game_rule = default_gender_equality
				}
				OR = {
					scope:character ?= { has_realm_law = female_only_law }
					scope:character ?= { has_realm_law = female_preference_law }
					scope:character ?= { has_realm_law = equal_law }
				}
			}
		}
		custom_tooltip = {
			text = martial_customs_trigger_malepref_felamepref_or_equal
			
			trigger_if = {
				limit = {
					has_game_rule = full_gender_equality
				}
				OR = {
					scope:character ?= { has_realm_law = male_preference_law }
					scope:character ?= { has_realm_law = female_preference_law }
					scope:character ?= { has_realm_law = equal_law }
				}
			}
		}
		custom_tooltip = {
			text = martial_customs_trigger_maleonly_malepref_or_equal
			
			trigger_if = {
				limit = {
					has_game_rule = inversed_gender_equality
				}
				OR = {
					scope:character ?= { has_realm_law = male_only_law }
					scope:character ?= { has_realm_law = male_preference_law }
					scope:character ?= { has_realm_law = equal_law }
				}
			}
		}
	}
}

martial_custom_female_only = {
	is_valid = {
		custom_tooltip = {
			text = martial_customs_trigger_femaleonly
			
			trigger_if = {
				limit = {
					has_game_rule = default_gender_equality
				}
				scope:character ?= { has_realm_law = female_only_law }
			}
		}
		custom_tooltip = {
			text = martial_customs_trigger_femaleonly_femalepref_or_equal
			
			trigger_if = {
				limit = {
					has_game_rule = full_gender_equality
				}
				OR = {
					scope:character ?= { has_realm_law = female_only_law }
					scope:character ?= { has_realm_law = female_preference_law }
					scope:character ?= { has_realm_law = equal_law }
				}
			}
		}
		trigger_if = {
			limit = {
				has_game_rule = inversed_gender_equality
			}
			always = yes
		}
	}
}
