﻿##Drunkard crimes doctrine
doctrine_me_intoxication = {
	group = "crimes"
	doctrine_me_intoxication_crime = {
		can_pick = {
			custom_description = {
				text = must_not_select_hedonistic
				NOT = { doctrine:tenet_hedonistic = { is_in_list = selected_doctrines } }
			}
		}
		name = {
			first_valid = {
				triggered_desc = {
				
					trigger = { religion_tag = islam_religion }
	  
					desc = doctrine_me_intoxication_crime_islamic_name
				}
				desc = doctrine_me_intoxication_crime_name
			}
		}
		desc = {
			first_valid = {
				triggered_desc = {
				
					trigger = { religion_tag = islam_religion }
	  
					desc = doctrine_me_intoxication_crime_islamic_desc
				}
				desc = doctrine_me_intoxication_crime_desc
			}
		}
		piety_cost = {
			value = faith_doctrine_cost_mid
			if = {
				limit = { has_doctrine = doctrine_me_intoxication_crime }
				multiply = faith_unchanged_doctrine_cost_mult
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_intoxication_accepted }
				multiply = faith_changed_doctrine_cost_mult_two_step
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_intoxication_virtuous }
				multiply = faith_changed_doctrine_cost_mult_three_step
			}
		}
		traits = {
			sins = {
				drunkard
			}
		}
		parameters = {
			me_intoxication_illegal = yes
		}
	}
	doctrine_me_intoxication_shunned = {
		can_pick = {
			custom_description = {
				text = must_not_select_hedonistic
				NOT = { doctrine:tenet_hedonistic = { is_in_list = selected_doctrines } }
			}
		}
		name = {
			first_valid = {
				triggered_desc = {
				
					trigger = { religion_tag = islam_religion }
	  
					desc = doctrine_me_intoxication_shunned_islamic_name
				}
				desc = doctrine_me_intoxication_shunned_name
			}
		}
		desc = {
			first_valid = {
				triggered_desc = {
				
					trigger = { religion_tag = islam_religion }
	  
					desc = doctrine_me_intoxication_shunned_islamic_desc
				}
				desc = doctrine_me_intoxication_shunned_desc
			}
		}
		piety_cost = {
			value = faith_doctrine_cost_low
			if = {
				limit = { has_doctrine = doctrine_me_intoxication_shunned }
				multiply = faith_unchanged_doctrine_cost_mult
			}
			else_if = {
				limit = { religion_tag = islam_religion }
				value = faith_doctrine_cost_low
			}
			else_if = { #This doesn't work
				limit = { doctrine:tenet_islamic_syncretism = { is_in_list = selected_doctrines } }
				value = faith_doctrine_cost_low
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_intoxication_crime }
				multiply = faith_changed_doctrine_cost_mult_two_step
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_intoxication_virtuous }
				multiply = faith_changed_doctrine_cost_mult_two_step
			}
		}
		traits = {
			sins = {
				drunkard
			}
		}
		parameters = {
			me_intoxication_shunned = yes
		}
	}
#	doctrine_me_intoxication_temperance = { #########################################
#		piety_cost = {
#			value = faith_doctrine_cost_low
#			if = {
#				limit = { has_doctrine = doctrine_deviancy_crime }
#				multiply = faith_unchanged_doctrine_cost_mult
#			}
#			else_if = {
#				limit = { has_doctrine = doctrine_deviancy_accepted }
#				multiply = faith_changed_doctrine_cost_mult_two_step
#			}
#			else_if = {
#				limit = { has_doctrine = doctrine_deviancy_virtuous }
#				multiply = faith_changed_doctrine_cost_mult_three_step
#			}
#		}
#		parameters = {
#			me_intoxication_temperance = yes
#		}
#	}
	doctrine_me_intoxication_accepted = {
		is_shown = {
			custom_description = { # Only Ghulat can refuse to do Wudhu
				text = islamic_must_be_ghulat
				OR = {
					NOT = { religion_tag = islam_religion }
					AND = {
						religion_tag = islam_religion
						doctrine:muhammad_succession_zandaqa_doctrine = { is_in_list = selected_doctrines }
					}
				}
			}
		}
		can_pick = {
			custom_description = { # Only Ghulat can refuse to do Wudhu
				text = islamic_must_be_ghulat
				OR = {
					NOT = { religion_tag = islam_religion }
					AND = {
						religion_tag = islam_religion
						doctrine:muhammad_succession_zandaqa_doctrine = { is_in_list = selected_doctrines }
					}
				}
			}
		}
		piety_cost = {
			value = faith_doctrine_cost_mid
			if = {
				limit = { has_doctrine = doctrine_me_intoxication_accepted }
				multiply = faith_unchanged_doctrine_cost_mult
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_intoxication_crime }
				multiply = faith_changed_doctrine_cost_mult_two_step
			}
			else_if = {
				limit = {
					NOT = {
						has_doctrine = doctrine_me_intoxication_crime
						has_doctrine = doctrine_me_intoxication_shunned
						has_doctrine = doctrine_me_intoxication_accepted
						has_doctrine = doctrine_me_intoxication_virtuous
					}
				}
				value = faith_doctrine_cost_low
			}
		}
		parameters = {
			me_intoxication_accepted = yes
		}
	}
	doctrine_me_intoxication_virtuous = {
		is_shown = {
			custom_description = { # Only Ghulat can refuse to do Wudhu
				text = islamic_must_be_ghulat
				OR = {
					NOT = { religion_tag = islam_religion }
					AND = {
						religion_tag = islam_religion
						doctrine:muhammad_succession_zandaqa_doctrine = { is_in_list = selected_doctrines }
					}
				}
			}
		}
		can_pick = {
			custom_description = { # Only Ghulat can refuse to do Wudhu
				text = islamic_must_be_ghulat
				OR = {
					NOT = { religion_tag = islam_religion }
					AND = {
						religion_tag = islam_religion
						doctrine:muhammad_succession_zandaqa_doctrine = { is_in_list = selected_doctrines }
					}
				}
			}
			custom_description = {
				text = must_select_hedonistic
				doctrine:tenet_hedonistic = { is_in_list = selected_doctrines }
			}
		}
		piety_cost = {
			value = faith_doctrine_cost_massive
			if = {
				limit = { has_doctrine = doctrine_me_intoxication_virtuous }
				multiply = faith_unchanged_doctrine_cost_mult
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_intoxication_shunned }
				multiply = faith_changed_doctrine_cost_mult_two_step
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_intoxication_crime }
				multiply = faith_changed_doctrine_cost_mult_three_step
			}
		}
		traits = {
			virtues = {
				drunkard
				lifestyle_reveler
			}
		}
		parameters = {
			me_intoxication_accepted = yes
			allows_brewery = yes		   
		}
	}
}

##Ablution doctrine - (Wudhu/Water Rituals)
doctrine_me_ablution = {
	group = "clergy"
	doctrine_me_ablution_none = {
		can_pick = {
			custom_description = { # Only Ghulat can refuse to do Wudhu
				text = must_select_ghulat_succession
				OR = {
					NOT = { religion_tag = islam_religion }
					AND = {
						religion_tag = islam_religion
						doctrine:muhammad_succession_zandaqa_doctrine = { is_in_list = selected_doctrines }
					}
				}
			}
		}
		piety_cost = {
			value = faith_doctrine_cost_low
			if = {
				limit = { has_doctrine = doctrine_me_ablution_handwashing }
				multiply = faith_unchanged_doctrine_cost_mult
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_ablution_full }
				multiply = faith_unchanged_doctrine_cost_mult
			}
		}
		parameters = {
			me_ablution_none = yes
		}
	}
	doctrine_me_ablution_handwashing = {
		can_pick = {
			custom_description = { # Only Ghulat can refuse to do Wudhu
				text = islamic_must_be_ghulat
				OR = {
					NOT = { religion_tag = islam_religion }
					AND = {
						religion_tag = islam_religion
						doctrine:muhammad_succession_zandaqa_doctrine = { is_in_list = selected_doctrines }
					}
				}
			}
		}
		piety_cost = {
			value = faith_doctrine_cost_low
			if = {
				limit = { has_doctrine = doctrine_me_ablution_none }
				multiply = faith_changed_doctrine_cost_mult_two_step
			}
			else_if = {
				limit = { religion_tag = judaism_religion }
				value = faith_doctrine_cost_low
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_ablution_full }
				multiply = faith_unchanged_doctrine_cost_mult
			}
		}
		parameters = {
			me_ablution_handwashing = yes
		}
	}
	doctrine_me_ablution_full = {
		name = {
			first_valid = {
				triggered_desc = {
					trigger = { religion_tag = islam_religion }
					desc = doctrine_me_ablution_wudhu_name
				}
				desc = doctrine_me_ablution_full_name
			}
		}
		desc = {
			first_valid = {
				triggered_desc = {
					trigger = { religion_tag = islam_religion }
					desc = doctrine_me_ablution_wudhu_desc
				}
				desc = doctrine_me_ablution_full_desc
			}
		}
		piety_cost = {
			value = faith_doctrine_cost_mid
			if = {
				limit = { has_doctrine = doctrine_me_ablution_none }
				multiply = faith_changed_doctrine_cost_mult_three_step
			}
			else_if = {
				limit = { has_doctrine = doctrine_me_ablution_handwashing }
				multiply = faith_changed_doctrine_cost_mult_two_step
			}
		}
		parameters = {
			me_ablution_full = yes
		}
	}
}