﻿# action_lay_with_woman_interaction = {
# 	combine_into_one = yes
# 	check_create_action = {
# 		if = {
# 			limit = {
# 				has_game_rule = LWYR_actions_on
# 				is_ai = no
# 			    is_adult = yes
# 				is_imprisoned = no
# 				is_commanding_army = no
# 				NOR = {
# 					# has_trait = innocent #ZGC
# 					has_trait = chaste
# 					has_trait = celibate
# 					has_trait = incapable
# 					has_trait = infirm
# 					has_trait = eunuch_1
# 				}
# 				OR = {
# 					AND = {
# 						has_character_modifier = faithfulness_modifier
# 						OR = {
# 							is_married = yes
# 							any_relation = {
# 								type = lover
# 							}
# 							any_relation = {
# 								type = soulmate
# 							}
# 						}
# 					}
# 					NOT = {	has_character_modifier = faithfulness_modifier }
# 				}
# 				fertility > 0
# 				NOT = {
# 					has_character_flag = has_attempted_sex
# 				}
# 			}
# 			every_living_character = {
# 				limit = {
# 					OR = {
# 						AND = {
# 							root = { has_character_modifier = faithfulness_modifier	}
# 							OR = {
# 								is_consort_of = root
# 								is_spouse_of = root
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 							}
# 						}
# 						AND = {
# 							root = { NOT = { has_character_modifier = faithfulness_modifier	} }
# 							is_female = yes
# 							OR = {
# 								age <= root.age_plus_20
# 								AND = {
# 									age > root.age_plus_20
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 									}
# 								}
# 								root = {
# 									has_trait = lustful
# 									has_trait = seducer
# 								}
# 							}
# 							NOR = {
# 								# has_trait = innocent #ZGC
# 								has_trait = chaste
# 								has_trait = celibate
# 								has_trait = incapable
# 								has_trait = infirm
# 								has_trait = eunuch_1
# 								any_relation = {
# 									type = soulmate
# 									NOT = { this = root }
# 								}
# 								has_relation_rival = root
# 								has_relation_nemesis = root
# 								opinion = {
# 									value <= 0 #was -25
# 									target = root
# 								}
# 							}
# 							OR = {
# 								is_married = no
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 								is_spouse_of = root 
# 								is_consort_of = root
# 								AND = {
# 									OR = {
# 										is_married = yes
# 										any_relation = {
# 											type = lover
# 										}
# 										any_relation = {
# 											type = soulmate
# 										}
# 									}
# 									NOT = {	has_character_modifier = faithfulness_modifier }
# 									NOT = { has_trait = loyal }
# 									opinion = {
# 										value >= 0
# 										target = root
# 									}
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 										has_trait = deceitful
# 										has_trait = fickle
# 										has_trait = sadistic
# 										has_trait = eccentric
# 										has_trait = deviant
# 										has_trait = rakish
# 										has_focus = intrigue_temptation_focus
# 										accepts_adultery_without_penalty_trigger = no
# 									}
# 								}
# 							}
# 						}
# 					}
# 					AND = {
# 						is_at_same_location = root
# 						OR = {
# 							exists = liege
# 							is_pool_guest_of = root
# 							is_pool_guest_of = root.location.county.holder
# 						}
# 					}
#                     root = { is_attracted_to_gender_of = prev }
# 					NOR = {
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_led_on
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_success_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_midsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_unsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_OD_opinion
# 						}
# 					}
# 					OR = {
# 						is_adult = yes
# 						AND = {
# 							is_adult = no
# 							is_consort_of = root
# 						}
# 					}
# 					is_imprisoned = no
# 					is_commanding_army = no

# 					NOT = { has_trait = pregnant }
# 					fertility > 0
# 				}
# 				add_to_list = potential_partners
# 			}

# 			every_in_list = {
# 				list = potential_partners
# 				limit = {
# 					#NEW
# 					root = {
# 						is_character_interaction_valid = {
# 							interaction = lay_with_woman_interaction
# 							recipient = prev
# 						}
# 					}
# 					root = {
# 						is_character_interaction_potentially_accepted = {
# 							interaction = lay_with_woman_interaction
# 							recipient = prev
# 						}
# 					}
# 					#/NEW
# 				}
# 				try_create_important_action = {
# 					important_action_type = action_lay_with_woman_interaction
# 					actor = root
# 					recipient = this
# 				}
# 			}
# 		}
# 	}

# 	effect = {
# 		open_interaction_window = {
# 			interaction = lay_with_woman_interaction
# 			actor = scope:actor
# 			recipient = scope:recipient
# 		}
# 	}
# }

# action_lay_with_woman_nopregnancy_interaction = {
# 	combine_into_one = yes
# 	check_create_action = {
# 		if = {
# 			limit = {
# 				has_game_rule = LWYR_actions_on
# 				is_ai = no
# 			    is_adult = yes
# 				is_imprisoned = no
# 				is_commanding_army = no
# 				NOR = {
# 					# has_trait = innocent #ZGC
# 					has_trait = chaste
# 					has_trait = celibate
# 					has_trait = incapable
# 					has_trait = infirm
# 					has_trait = eunuch_1
# 				}
# 				OR = {
# 					AND = {
# 						has_character_modifier = faithfulness_modifier
# 						OR = {
# 							is_married = yes
# 							any_relation = {
# 								type = lover
# 							}
# 							any_relation = {
# 								type = soulmate
# 							}
# 						}
# 					}
# 					NOT = {	has_character_modifier = faithfulness_modifier }
# 				}
# 				NOT = {
# 					has_character_flag = has_attempted_sex
# 				}
# 			}
# 			every_living_character = {
# 				limit = {
# 					OR = {
# 						AND = {
# 							root = { has_character_modifier = faithfulness_modifier	}
# 							OR = {
# 								is_consort_of = root
# 								is_spouse_of = root
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 							}
# 						}
# 						AND = {
# 							root = { NOT = { has_character_modifier = faithfulness_modifier	} }
# 							is_female = yes
# 							OR = {
# 								age <= root.age_plus_20
# 								AND = {
# 									age > root.age_plus_20
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 									}
# 								}
# 								root = {
# 									has_trait = lustful
# 									has_trait = seducer
# 								}
# 							}
# 							NOR = {
# 								# has_trait = innocent #ZGC
# 								has_trait = chaste
# 								has_trait = celibate
# 								has_trait = incapable
# 								has_trait = infirm
# 								has_trait = eunuch_1
# 								any_relation = {
# 									type = soulmate
# 									NOT = { this = root }
# 								}
# 								has_relation_rival = root
# 								has_relation_nemesis = root
# 								opinion = {
# 									value <= 0 #was -25
# 									target = root
# 								}
# 							}
# 							OR = {
# 								is_married = no
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 								is_spouse_of = root 
# 								is_consort_of = root
# 								AND = {
# 									OR = {
# 										is_married = yes
# 										any_relation = {
# 											type = lover
# 										}
# 										any_relation = {
# 											type = soulmate
# 										}
# 									}
# 									NOT = {	has_character_modifier = faithfulness_modifier }
# 									NOT = { has_trait = loyal }
# 									opinion = {
# 										value >= 0
# 										target = root
# 									}
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 										has_trait = deceitful
# 										has_trait = fickle
# 										has_trait = sadistic
# 										has_trait = eccentric
# 										has_trait = deviant
# 										has_trait = rakish
# 										has_focus = intrigue_temptation_focus
# 										accepts_adultery_without_penalty_trigger = no
# 									}
# 								}
# 							}
# 						}
# 					}
# 					AND = {
# 						is_at_same_location = root
# 						OR = {
# 							exists = liege
# 							is_pool_guest_of = root
# 							is_pool_guest_of = root.location.county.holder
# 						}
# 					}
#                     root = { is_attracted_to_gender_of = prev }
# 					NOR = {
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_led_on
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_success_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_midsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_unsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_OD_opinion
# 						}
# 					}
# 					OR = {
# 						is_adult = yes
# 						AND = {
# 							is_adult = no
# 							is_consort_of = root
# 						}
# 					}
# 					is_imprisoned = no
# 					is_commanding_army = no

#                     OR = {
# 						OR = {
# 							has_trait = pregnant
# 							AND = {
# 								NOT = { has_game_rule = LWYR_restrictions_off }
# 								any_child = {
# 									is_alive = yes
# 									age < 1
# 								}
#                             }
# 							fertility <= 0
# 						}
# 						root = {
# 							OR = {
# 								is_female = yes
# 								fertility <= 0
# 							}
# 						}
# 					}

# 				}
# 				add_to_list = potential_partners
# 			}

# 			every_in_list = {
# 				list = potential_partners
# 				limit = {
# 					#NEW
# 					root = {
# 						is_character_interaction_valid = {
# 							interaction = lay_with_woman_nopregnancy_interaction
# 							recipient = prev
# 						}
# 					}
# 					root = {
# 						is_character_interaction_potentially_accepted = {
# 							interaction = lay_with_woman_nopregnancy_interaction
# 							recipient = prev
# 						}
# 					}
# 					#/NEW
# 				}
# 				try_create_important_action = {
# 					important_action_type = action_lay_with_woman_nopregnancy_interaction
# 					actor = root
# 					recipient = this
# 				}
# 			}
# 		}
# 	}

# 	effect = {
# 		open_interaction_window = {
# 			interaction = lay_with_woman_nopregnancy_interaction
# 			actor = scope:actor
# 			recipient = scope:recipient
# 		}
# 	}
# }

# action_lay_with_man_interaction = {
# 	combine_into_one = yes
# 	check_create_action = {
# 		if = {
# 			limit = {
# 				has_game_rule = LWYR_actions_on
# 				is_ai = no
# 			    is_adult = yes
# 				fertility > 0
# 				is_imprisoned = no
# 				is_commanding_army = no

# 				NOT = { has_trait = pregnant }
# 				NOR = {
# 					# has_trait = innocent #ZGC
# 					has_trait = chaste
# 					has_trait = celibate
# 					has_trait = incapable
# 					has_trait = infirm
# 					has_trait = eunuch_1
# 				}
# 				OR = {
# 					AND = {
# 						has_character_modifier = faithfulness_modifier
# 						OR = {
# 							is_married = yes
# 							any_relation = {
# 								type = lover
# 							}
# 							any_relation = {
# 								type = soulmate
# 							}
# 						}
# 					}
# 					NOT = {	has_character_modifier = faithfulness_modifier }
# 				}
# 				NOT = {
# 					has_character_flag = has_attempted_sex
# 				}
# 			}
# 			every_living_character = {
# 				limit = {
# 					OR = {
# 						AND = {
# 							root = { has_character_modifier = faithfulness_modifier	}
# 							OR = {
# 								is_consort_of = root
# 								is_spouse_of = root
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 							}
# 						}
# 						AND = {
# 							root = { NOT = { has_character_modifier = faithfulness_modifier	} }
# 							is_female = no
# 							OR = {
# 								age <= root.age_plus_20
# 								AND = {
# 									age > root.age_plus_20
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 									}
# 								}
# 								root = {
# 									has_trait = lustful
# 									has_trait = seducer
# 								}
# 							}
# 							NOR = {
# 								# has_trait = innocent #ZGC
# 								has_trait = chaste
# 								has_trait = celibate
# 								has_trait = incapable
# 								has_trait = infirm
# 								has_trait = eunuch_1
# 								any_relation = {
# 									type = soulmate
# 									NOT = { this = root }
# 								}
# 								has_relation_rival = root
# 								has_relation_nemesis = root
# 								opinion = {
# 									value <= 0 #was -25
# 									target = root
# 								}
# 							}
# 							OR = {
# 								is_married = no
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 								is_spouse_of = root 
# 								is_consort_of = root
# 								AND = {
# 									OR = {
# 										is_married = yes
# 										any_relation = {
# 											type = lover
# 										}
# 										any_relation = {
# 											type = soulmate
# 										}
# 									}
# 									NOT = {	has_character_modifier = faithfulness_modifier }
# 									NOT = { has_trait = loyal }
# 									opinion = {
# 										value >= 0
# 										target = root
# 									}
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 										has_trait = deceitful
# 										has_trait = fickle
# 										has_trait = sadistic
# 										has_trait = eccentric
# 										has_trait = deviant
# 										has_trait = rakish
# 										has_focus = intrigue_temptation_focus
# 										accepts_adultery_without_penalty_trigger = no
# 									}
# 								}
# 							}
# 						}
# 					}
# 					AND = {
# 						is_at_same_location = root
# 						OR = {
# 							exists = liege
# 							is_pool_guest_of = root
# 							is_pool_guest_of = root.location.county.holder
# 						}
# 					}
#                     root = { is_attracted_to_gender_of = prev }
# 					NOR = {
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_led_on
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_success_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_midsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_unsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_OD_opinion
# 						}
# 					}
# 					OR = {
# 						is_adult = yes
# 						AND = {
# 							is_adult = no
# 							is_consort_of = root
# 						}
# 					}
# 					is_imprisoned = no
# 					is_commanding_army = no

# 					fertility > 0
# 				}
# 				add_to_list = potential_partners
# 			}

# 			every_in_list = {
# 				list = potential_partners
# 				limit = {
# 					#NEW
# 					root = {
# 						is_character_interaction_valid = {
# 							interaction = lay_with_man_interaction
# 							recipient = prev
# 						}
# 					}
# 					root = {
# 						is_character_interaction_potentially_accepted = {
# 							interaction = lay_with_man_interaction
# 							recipient = prev
# 						}
# 					}
# 					#/NEW
# 				}
# 				try_create_important_action = {
# 					important_action_type = action_lay_with_man_interaction
# 					actor = root
# 					recipient = this
# 				}
# 			}
# 		}
# 	}

# 	effect = {
# 		open_interaction_window = {
# 			interaction = lay_with_man_interaction
# 			actor = scope:actor
# 			recipient = scope:recipient
# 		}
# 	}
# }

# action_lay_with_man_nopregnancy_interaction = {
# 	combine_into_one = yes
# 	check_create_action = {
# 		if = {
# 			limit = {
# 				has_game_rule = LWYR_actions_on
# 				is_ai = no
# 			    is_adult = yes
# 				is_imprisoned = no
# 				is_commanding_army = no
# 				NOR = {
# 					# has_trait = innocent #ZGC
# 					has_trait = chaste
# 					has_trait = celibate
# 					has_trait = incapable
# 					has_trait = infirm
# 					has_trait = eunuch_1
# 				}
# 				OR = {
# 					AND = {
# 						has_character_modifier = faithfulness_modifier
# 						OR = {
# 							is_married = yes
# 							any_relation = {
# 								type = lover
# 							}
# 							any_relation = {
# 								type = soulmate
# 							}
# 						}
# 					}
# 					NOT = {	has_character_modifier = faithfulness_modifier }
# 				}
# 				NOT = {
# 					has_character_flag = has_attempted_sex
# 				}
# 			}
# 			every_living_character = {
# 				limit = {
# 					OR = {
# 						AND = {
# 							root = { has_character_modifier = faithfulness_modifier	}
# 							OR = {
# 								is_consort_of = root
# 								is_spouse_of = root
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 							}
# 						}
# 						AND = {
# 							root = { NOT = { has_character_modifier = faithfulness_modifier	} }
# 							is_female = no
# 							OR = {
# 								age <= root.age_plus_20
# 								AND = {
# 									age > root.age_plus_20
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 									}
# 								}
# 								root = {
# 									has_trait = lustful
# 									has_trait = seducer
# 								}
# 							}
# 							NOR = {
# 								# has_trait = innocent #ZGC
# 								has_trait = chaste
# 								has_trait = celibate
# 								has_trait = incapable
# 								has_trait = infirm
# 								has_trait = eunuch_1
# 								any_relation = {
# 									type = soulmate
# 									NOT = { this = root }
# 								}
# 								has_relation_rival = root
# 								has_relation_nemesis = root
# 								opinion = {
# 									value <= 0 #was -25
# 									target = root
# 								}
# 							}
# 							OR = {
# 								is_married = no
# 								has_relation_lover = root
# 								has_relation_soulmate = root
# 								is_spouse_of = root 
# 								is_consort_of = root
# 								AND = {
# 									OR = {
# 										is_married = yes
# 										any_relation = {
# 											type = lover
# 										}
# 										any_relation = {
# 											type = soulmate
# 										}
# 									}
# 									NOT = {	has_character_modifier = faithfulness_modifier }
# 									NOT = { has_trait = loyal }
# 									opinion = {
# 										value >= 0
# 										target = root
# 									}
# 									OR = {
# 										has_trait = lustful
# 										has_trait = seducer
# 										has_trait = deceitful
# 										has_trait = fickle
# 										has_trait = sadistic
# 										has_trait = eccentric
# 										has_trait = deviant
# 										has_trait = rakish
# 										has_focus = intrigue_temptation_focus
# 										accepts_adultery_without_penalty_trigger = no
# 									}
# 								}
# 							}
# 						}
# 					}
# 					AND = {
# 						is_at_same_location = root
# 						OR = {
# 							exists = liege
# 							is_pool_guest_of = root
# 							is_pool_guest_of = root.location.county.holder
# 						}
# 					}
#                     root = { is_attracted_to_gender_of = prev }
# 					NOR = {
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_led_on
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_success_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_midsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_unsuccess_opinion
# 						}
# 						has_opinion_modifier = {
# 							target = root
# 							modifier = laid_with_OD_opinion
# 						}
# 					}
# 					OR = {
# 						is_adult = yes
# 						AND = {
# 							is_adult = no
# 							is_consort_of = root
# 						}
# 					}
# 					is_imprisoned = no
# 					is_commanding_army = no

# 					OR = {
# 						fertility <= 0
# 						root = {
# 							OR = {
# 								is_female = no
# 								has_trait = pregnant
# 								fertility <= 0
# 							}
# 						}
# 					}
# 				}
# 				add_to_list = potential_partners
# 			}

# 			every_in_list = {
# 				list = potential_partners
# 				limit = {
# 					#NEW
# 					root = {
# 						is_character_interaction_valid = {
# 							interaction = lay_with_man_nopregnancy_interaction
# 							recipient = prev
# 						}
# 					}
# 					root = {
# 						is_character_interaction_potentially_accepted = {
# 							interaction = lay_with_man_nopregnancy_interaction
# 							recipient = prev
# 						}
# 					}
# 					#/NEW
# 				}
# 				try_create_important_action = {
# 					important_action_type = action_lay_with_man_nopregnancy_interaction
# 					actor = root
# 					recipient = this
# 				}
# 			}
# 		}
# 	}

# 	effect = {
# 		open_interaction_window = {
# 			interaction = lay_with_man_nopregnancy_interaction
# 			actor = scope:actor
# 			recipient = scope:recipient
# 		}
# 	}
# }
