code:
namespace = carn_abortion

# 0001. Clear carn_block_aborting_next_normal_pregnancy after pregnancy ends

carn_abortion.0001 = {
	hidden = yes

	trigger = {
	}

	immediate = {
		remove_character_flag = carn_block_aborting_next_normal_pregnancy
	}
}


code:
namespace = carn_absolute_birth_control

carn_absolute_birth_control.0001 = {
	hidden = yes

	trigger = {
		carn_has_absolute_birth_control_trigger = yes
		is_pregnant = yes
	}

	immediate = {
		end_pregnancy = yes
		trigger_event = {
			on_action = carn_on_absolute_birth_control_end_pregnancy
		}
	}
}

repo_name: Synthael/carnalitas

license: mit


code:
namespace = carn_arousal

#
# 0001. Character stress increases due to arousal
#

carn_arousal.0001 = {
	hidden = yes

	trigger = {
		is_ai = no
		is_adult = yes
		has_game_rule = carn_arousal_stress_enabled
		carn_has_low_arousal_trigger = no
	}

	immediate = {

		send_interface_message = {
			type = carn_event_arousal
			right_icon = this
			# custom_tooltip = carn_msg_arousal_desc
			add_stress = {
				# Using -1 * minor_stress_impact_loss as the base value instead of something more straightforward so as to balance the effect of carn_sex_interaction.
				value = minor_stress_impact_loss
				multiply = -1
				if = {
					limit = {
						carn_has_high_arousal_trigger = yes
					}
					multiply = 2
				}
			}
		}
	}
}


code:
namespace = carn_character_initialization

carn_character_initialization.0001 = {
	scope = none
	hidden = yes

	immediate = {
		every_living_character = {
			trigger_event = { on_action = carn_character_initialization_pulse }
		}
	}
}


code:
namespace = carn_childhood

carn_childhood.0001 = {
	type = character_event
	title = child_personality.0008.t
	desc = {
		desc = child_personality.0008.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:boy
				}
				desc = child_personality.0008.servant_boy
			}
			triggered_desc = {
				trigger = {
					exists = scope:girl
				}
				desc = child_personality.0008.serving_wench
			}
			desc = child_personality.0008.desc_not_server
		}
	}
	theme = default
	left_portrait = root

	trigger = {
		is_available_child = yes
		age >= 13 #Because chaste/lustful are only given at age 13
		NAND = {
			OR = {
				has_trait = greedy
				has_trait = generous
			}
			OR = {
				has_trait = gregarious
				has_trait = shy
			}
			OR = {
				has_trait = lustful
				has_trait = chaste
			}
		}
	}

	weight_multiplier = {
		base = 0
		modifier = {
			add = 5
			culture = {
				has_cultural_parameter = lustful_trait_more_common
			}
			NOR = {
				has_trait = lustful
				has_trait = chaste
			}
		}
	}

	immediate = {
		save_scope_as = child
		hidden_effect = {
			if = {
				limit = {
					NOR = {
						has_sexuality = asexual
						has_trait = lustful
					}
				}
				random = {
					chance = 30
					add_character_flag = {
						flag = become_lustful
						days = 10
					}
				}
			}
			if = {
				limit = {
					has_character_flag = become_lustful
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = no
						}
						AND = {
							is_female = yes
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = boy
					value = yes
				}
			}
			else_if = {
				limit = {
					has_character_flag = become_lustful
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = yes
						}
						AND = {
							is_female = no
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = girl
					value = yes
				}
			}
			else_if = {
				limit = {
					has_sexuality = bisexual
					has_character_flag = become_lustful
				}
				random_list = {
					10 = {
						save_scope_value_as = {
							name = boy
							value = yes
						}
					}
					10 = {
						save_scope_value_as = {
							name = girl
							value = yes
						}
					}
				}
			}
		}
	}

	option = {
		name = child_personality.0008.a
		trigger = {
			NOR = {
				has_trait = greedy
				has_trait = generous
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = greedy
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = generous
				}
			}
		}
		add_trait = greedy
		if = {
			limit = {
				is_ai = yes
			}
			random_relation = {
				type = guardian
				trigger_event = child_personality.1081
			}
		}
	}

	option = {
		name = child_personality.0008.b
		trigger = {
			NOR = {
				has_trait = gregarious
				has_trait = shy
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = gregarious
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = shy
				}
			}
		}
		add_trait = gregarious
		if = {
			limit = {
				is_ai = yes
			}
			random_relation = {
				type = guardian
				trigger_event = child_personality.1082
			}
		}
	}

	option = {
		name = child_personality.0008.c
		trigger = {
			has_character_flag = become_lustful
			NOR = {
				has_trait = lustful
				has_trait = chaste
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = lustful
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = chaste
				}
			}
			modifier = {
				add = 100
				culture = {
					has_cultural_parameter = lustful_trait_more_common
				}
			}
		}
		add_trait = lustful
		if = {
			limit = {
				is_ai = yes
			}
			random_relation = {
				type = guardian
				trigger_event = child_personality.1083
			}
		}
	}

	after = {
		remove_character_flag = become_lustful
	}
}


code:
#greedy, gregarious or lustful
child_personality.0008 = {
	type = character_event
	title = child_personality.0008.t
	desc = {
		desc = child_personality.0008.desc
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:boy
				}
				desc = child_personality.0008.servant_boy
			}
			triggered_desc = {
				trigger = {
					exists = scope:girl
				}
				desc = child_personality.0008.serving_wench
			}
			desc = child_personality.0008.desc_not_server
		}
	}
	theme = default
	left_portrait = root

	trigger = {
		is_available_child = yes
		age >= 13 #Because chaste/lustful are only given at age 13
		NAND = {
			OR = {
				has_trait = greedy
				has_trait = generous
			}
			OR = {
				has_trait = gregarious
				has_trait = shy
			}
			OR = {
				has_trait = lustful
				has_trait = chaste
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			add = 2
			any_relation = {
				type = guardian
				OR = {
					has_trait = greedy
					has_trait = gregarious
					has_trait = lustful
				}
			}
		}
	}

	immediate = {
		save_scope_as = child
		hidden_effect = {
			if = {
				limit = {
					NOR = {
						has_sexuality = asexual
						has_trait = lustful
					}
				}
				random = {
					chance = 30
					add_character_flag = {
						flag = become_lustful
						days = 10
					}
				}
			}
			if = {
				limit = {
					has_character_flag = become_lustful
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = no
						}
						AND = {
							is_female = yes
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = boy
					value = yes
				}
			}
			else_if = {
				limit = {
					has_character_flag = become_lustful
					OR = {
						AND = {
							has_sexuality = homosexual
							is_female = yes
						}
						AND = {
							is_female = no
							has_sexuality = heterosexual
						}
					}
				}
				save_scope_value_as = {
					name = girl
					value = yes
				}
			}
			else_if = {
				limit = {
					has_sexuality = bisexual
					has_character_flag = become_lustful
				}
				random_list = {
					10 = {
						save_scope_value_as = {
							name = boy
							value = yes
						}
					}
					10 = {
						save_scope_value_as = {
							name = girl
							value = yes
						}
					}
				}
			}
		}
	}

	option = {
		name = child_personality.0008.a
		trigger = {
			NOR = {
				has_trait = greedy
				has_trait = generous
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = greedy
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = generous
				}
			}
		}
		add_trait = greedy
		if = {
			limit = {
				is_ai = yes
			}
			random_relation = {
				type = guardian
				trigger_event = child_personality.1081
			}
		}
	}

	option = {
		name = child_personality.0008.b
		trigger = {
			NOR = {
				has_trait = gregarious
				has_trait = shy
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = gregarious
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = shy
				}
			}
		}
		add_trait = gregarious
		if = {
			limit = {
				is_ai = yes
			}
			random_relation = {
				type = guardian
				trigger_event = child_personality.1082
			}
		}
	}

	option = {
		name = child_personality.0008.c
		trigger = {
			has_character_flag = become_lustful
			NOR = {
				has_trait = lustful
				has_trait = chaste
			}
		}
		ai_chance = {
			base = 1
			modifier = {
				add = 4
				any_relation = {
					type = guardian
					has_trait = lustful
				}
			}
			modifier = {
				add = -0.5
				any_relation = {
					type = guardian
					has_trait = chaste
				}
			}
		}
		add_trait = lustful
		if = {
			limit = {
				is_ai = yes
			}
			random_relation = {
				type = guardian
				trigger_event = child_personality.1083
			}
		}
	}

	after = {
		remove_character_flag = become_lustful
	}
}


code:
namespace = carn_custom_pregnancy

# 0001. If a custom pregnancy exists, advance custom pregnancy stage and fire on_action
carn_custom_pregnancy.0001 = {
	hidden = yes

	trigger = {
		is_alive = yes
		carn_has_any_custom_pregnancy_trigger = yes
	}

	immediate = {
		trigger_event = {
			on_action = carn_on_custom_pregnancy_stage_change
		}
	}
}


code:
namespace = carn_dt

# written by Luther Slade and Cheri

#
# 0001. seed dt traits for this character
# 0002. turn off dt traits for newborns
# 0003. activate gender appropriate dt traits when a child comes of age
#

#
# 0001. seed dt traits for this character
#

carn_dt.0001 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_dt_enabled
		NOT = { has_character_flag = carn_dt_traits_seeded }
		is_alive = yes
	}

	immediate = {
		carn_flip_ruler_designed_dt_traits_to_game_rule_effect = yes
		carn_make_all_dt_traits_inactive_effect = yes
		carn_seed_dt_traits_effect = yes
		if = {
			limit = { is_adult = yes }
			carn_activate_gender_specific_dt_traits_effect = yes
		}
	}
}

#
# 0002. turn off dt traits for newborns

carn_dt.0002 = {
	hidden = yes

	immediate = {
		scope:child = {
			carn_make_all_dt_traits_inactive_effect = yes
		}
	}
}

#
# 0003. activate gender appropriate dt traits when a child comes of age
#

carn_dt.0003 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_dt_enabled
	}

	immediate = {
		carn_activate_gender_specific_dt_traits_effect = yes
	}
}


code:
namespace = carn_error_suppression

carn_error_suppression.0001 = {
  hidden = yes
  orphan = yes
  trigger = {
    exists = global_var:carn_active
  }
}

carn_error_suppression.0002 = {
  hidden = yes
  orphan = yes
  immediate = {
    if = {
      limit = {
        has_character_flag = carn_seed_tits_big_1
        has_character_flag = carn_cannot_be_prostitute
        has_character_flag = carn_wants_to_be_a_slave
        has_character_flag = carn_seed_dick_small_3
        has_character_flag = carn_seed_dick_small_2
        has_character_flag = carn_slave_cannot_be_sold
        has_character_flag = carn_seed_dick_small_1
        has_character_flag = carn_no_consequences_for_extramarital_sex_with_others
        has_character_flag = carn_seed_tits_small_2
        has_character_flag = carn_seed_tits_small_1
        has_character_flag = immune_to_std
        has_character_flag = carn_suppress_all_on_birth_notification
        has_character_flag = carn_seed_dick_big_3
        has_character_flag = carn_cannot_have_sex
        has_character_flag = carn_seed_tits_big_3
        has_character_flag = carn_block_send_sex_interaction
        has_character_flag = carn_seed_futa
        has_character_flag = carn_seed_tits_big_2
        has_character_flag = carn_has_high_arousal
        has_character_flag = carn_suppress_next_on_pregnancy_maintenance
        has_character_flag = carn_cannot_use_birth_control
        has_character_flag = carn_slave_cannot_be_freed
        has_character_flag = carn_seed_tits_small_3
        has_character_flag = carn_cannot_be_raped
        has_character_flag = can_not_be_granted_titles
        has_character_flag = carn_personality_replacement_excluded_traits
        has_character_flag = can_use_abduct_scheme
        has_character_flag = carn_can_always_have_sex
        has_character_flag = carn_no_pregnancy_complications
        has_character_flag = carn_no_consequences_for_extramarital_sex_with_me
        has_character_flag = carn_block_aborting_any_custom_pregnancy
        has_character_flag = carn_suppress_all_on_pregnancy_notification
        has_character_flag = carn_blocked_from_leaving
        has_character_flag = carn_absolute_birth_control
        has_character_flag = carn_is_prostitute
        has_character_flag = carn_cannot_stop_work_as_prostitute
        has_character_flag = carn_suppress_all_on_pregnancy_maintenance
        has_character_flag = carn_block_yearly_milk_production_decrease
        has_character_flag = carn_block_aborting_next_custom_pregnancy
        has_character_flag = carn_block_aborting_next_normal_pregnancy
        has_character_flag = carn_custom_pregnancy_stage
        has_character_flag = carn_cannot_be_enslaved
        has_character_flag = carn_custom_pregnancy
        has_character_flag = carn_suppress_next_on_birth_notification
        has_character_flag = carn_block_aborting_any_normal_pregnancy
        has_character_flag = carn_block_receive_sex_interaction
        has_character_flag = carn_block_aborting_any_pregnancy
        has_character_flag = carn_seed_dick_big_2
        has_character_flag = carn_suppress_next_on_pregnancy_notification
        has_character_flag = carn_lactation_ignores_effective_age
        has_character_flag = carn_seed_dick_big_1
        has_character_flag = carn_has_low_arousal
      }
      add_character_flag = carn_seed_tits_big_1
      add_character_flag = carn_cannot_be_prostitute
      add_character_flag = carn_wants_to_be_a_slave
      add_character_flag = carn_seed_dick_small_3
      add_character_flag = carn_seed_dick_small_2
      add_character_flag = carn_slave_cannot_be_sold
      add_character_flag = carn_seed_dick_small_1
      add_character_flag = carn_no_consequences_for_extramarital_sex_with_others
      add_character_flag = carn_seed_tits_small_2
      add_character_flag = carn_seed_tits_small_1
      add_character_flag = immune_to_std
      add_character_flag = carn_suppress_all_on_birth_notification
      add_character_flag = carn_seed_dick_big_3
      add_character_flag = carn_cannot_have_sex
      add_character_flag = carn_seed_tits_big_3
      add_character_flag = carn_block_send_sex_interaction
      add_character_flag = carn_seed_futa
      add_character_flag = carn_seed_tits_big_2
      add_character_flag = carn_has_high_arousal
      add_character_flag = carn_suppress_next_on_pregnancy_maintenance
      add_character_flag = carn_cannot_use_birth_control
      add_character_flag = carn_slave_cannot_be_freed
      add_character_flag = carn_seed_tits_small_3
      add_character_flag = carn_cannot_be_raped
      add_character_flag = can_not_be_granted_titles
      add_character_flag = carn_personality_replacement_excluded_traits
      add_character_flag = can_use_abduct_scheme
      add_character_flag = carn_can_always_have_sex
      add_character_flag = carn_no_pregnancy_complications
      add_character_flag = carn_no_consequences_for_extramarital_sex_with_me
      add_character_flag = carn_block_aborting_any_custom_pregnancy
      add_character_flag = carn_suppress_all_on_pregnancy_notification
      add_character_flag = carn_blocked_from_leaving
      add_character_flag = carn_absolute_birth_control
      add_character_flag = carn_is_prostitute
      add_character_flag = carn_cannot_stop_work_as_prostitute
      add_character_flag = carn_suppress_all_on_pregnancy_maintenance
      add_character_flag = carn_block_yearly_milk_production_decrease
      add_character_flag = carn_block_aborting_next_custom_pregnancy
      add_character_flag = carn_block_aborting_next_normal_pregnancy
      add_character_flag = carn_custom_pregnancy_stage
      add_character_flag = carn_cannot_be_enslaved
      add_character_flag = carn_custom_pregnancy
      add_character_flag = carn_suppress_next_on_birth_notification
      add_character_flag = carn_block_aborting_any_normal_pregnancy
      add_character_flag = carn_block_receive_sex_interaction
      add_character_flag = carn_block_aborting_any_pregnancy
      add_character_flag = carn_seed_dick_big_2
      add_character_flag = carn_suppress_next_on_pregnancy_notification
      add_character_flag = carn_lactation_ignores_effective_age
      add_character_flag = carn_seed_dick_big_1
      add_character_flag = carn_has_low_arousal
    }
  }
}


code:
namespace = carn_fetish

# Seeding Events
# 0001: seed fetish variable_list for this character

carn_fetish.0001 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_fetishes_enabled
		NOT = { has_character_flag = carn_fetishes_seeded }
		is_adult = yes
		is_deviant_trigger = yes
	}

	immediate = {
		carn_add_random_fetish_effect = yes
	}
}


code:
namespace = carn_fetish

# 1000. Anal
# 1001. Sadism
# 1002. Masochism
# 1003. Bestiality
# 1004. Watersports
# 1005. Scat
# 1006. Gore
# 1007. Foot play
# 1008. Bondage
# 1009. Domination
# 1010. Submission
# 1011. Raping
# 1012. Being raped
# 1013. Lactation

# 1000. Anal

carn_fetish.1000 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_fetishes_enabled
		has_game_rule = carn_content_anal_enabled
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = anal
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male & Futa
			factor = 2
			carn_gender_can_impregnate_trigger = yes
		}
		modifier = { # Male Gay
			factor = 2
			is_male = yes
			is_attracted_to_men = yes
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = anal
		}
	}
}

# 1001. Sadism

carn_fetish.1001 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_painful_enabled
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = sadism
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male & Futa
			factor = 2
			carn_gender_can_impregnate_trigger = yes
		}
		modifier = { # Callous
			factor = 2
			has_trait = callous
		}
		modifier = { # Sadistic
			factor = 10
			has_trait = sadistic
		}
		modifier = { # Compassionate
			factor = 0.5
			has_trait = compassionate
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = sadism
		}
	}
}

# 1002. Masochism

carn_fetish.1002 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_painful_enabled
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = masochism
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male
			factor = 0.5
			is_male = yes
		}
		modifier = { # Paranoid
			factor = 0.5
			has_trait = paranoid
		}
		modifier = { # Trusting
			factor = 1.5
			has_trait = trusting
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = masochism
		}
	}
}

# 1003. Bestiality

carn_fetish.1003 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_bestiality_enabled
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = bestiality
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = bestiality
		}
	}
}

# 1004. Watersports

carn_fetish.1004 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_watersports_enabled
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = watersports
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male
			factor = 2
			is_male = yes
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = watersports
		}
	}
}

# 1005. Scat

carn_fetish.1005 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_scat_enabled
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = scat
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male
			factor = 2
			is_male = yes
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = scat
		}
	}
}

# 1006. Gore

carn_fetish.1006 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_gore_enabled
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = gore
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male
			factor = 2.5
			is_male = yes
		}
		modifier = { # Compassionate
			factor = 0
			has_trait = compassionate
		}
		modifier = { # Callous
			factor = 2
			has_trait = callous
		}
		modifier = { # Sadistic
			factor = 2
			has_trait = sadistic
		}
		modifier = { # Wrathful
			factor = 2
			has_trait = wrathful
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = gore
		}
	}
}

# 1007. Foot play

carn_fetish.1007 = {
	hidden = yes

	trigger = {
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = foot_play
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male
			factor = 10
			is_male = yes
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = foot_play
		}
	}
}

# 1008. Bondage

carn_fetish.1008 = {
	hidden = yes

	trigger = {
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = bondage
			}
		}
	}

	weight_multiplier = {
		base = 1
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = bondage
		}
	}
}

# 1009. Domination

carn_fetish.1009 = {
	hidden = yes

	trigger = {
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = domination
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male & Futa
			factor = 1.3
			carn_gender_can_impregnate_trigger = yes
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = domination
		}
	}
}

# 1010. Submission

carn_fetish.1010 = {
	hidden = yes

	trigger = {
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = submission
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Male & Futa
			factor = 0.7
			is_male = yes
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = submission
		}
	}
}

# 1011. Raping

carn_fetish.1011 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_consent_noncon
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = raping
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Compassionate
			factor = 0
			has_trait = compassionate
		}
		modifier = { # Callous
			factor = 2
			has_trait = callous
		}
		modifier = { # Sadistic
			factor = 4
			has_trait = sadistic
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = raping
		}
	}
}

# 1012. Being raped

carn_fetish.1012 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_content_consent_noncon
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = being_raped
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = { # Female
			factor = 2
			is_female = yes
		}
		modifier = { # Craven
			factor = 0.5
			has_trait = craven
		}
		modifier = { # Paranoid
			factor = 0.5
			has_trait = paranoid
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = being_raped
		}
	}
}

# 1013. Lactation

carn_fetish.1013 = {
	hidden = yes

	trigger = {
		has_game_rule = carn_fetishes_enabled
		NOT = { has_game_rule = carn_lactation_disabled }
		NOT = {
			carn_has_fetish_trigger = {
				FETISH = lactation
			}
		}
	}

	weight_multiplier = {
		base = 1
		modifier = {
			factor = 1.25
			has_trait = greedy
		}
		modifier = {
			factor = 0.75
			has_trait = temperate
		}
	}

	immediate = {
		carn_add_fetish_effect = {
			FETISH = lactation
		}
	}
}


code:
namespace = carn_futa

#
# 0001. Seed futa trait for this character
# 0010. Yearly pulse for futas to impregnate wives, concubines, lovers (WIP, NOT TRIGGERED, UNTESTED)
#

#
# 0001. Seed futa trait for this character
#

carn_futa.0001 = {
	hidden = yes

	trigger = {
		NOR = {
			has_game_rule = carn_futa_content_disabled
			has_character_flag = carn_futa_trait_seeded
		}
		is_alive = yes
	}

	immediate = {
		carn_flip_ruler_designed_futa_trait_to_game_rule_effect = yes
		carn_seed_futa_trait_effect = yes
	}
}

###################################################################################
# 0010. Yearly pulse for futas to impregnate wives, concubines, lovers
# meant to fire from yearly pulse, currently not linked to on_actions
# because paradox hates fun and wont let women impregnate each other
###################################################################################

carn_futa.0010 = {
	hidden = yes

	trigger = {
		carn_is_futa_trigger = yes
	}

	immediate = {
		every_spouse = {
			add_to_list = futa_sex_buddies
		}
		every_consort = {
			add_to_list = futa_sex_buddies
		}
		every_relation = {
			type = lover
			add_to_list = futa_sex_buddies
		}
		save_scope_as = father
		every_in_list = {
			list = futa_sex_buddies
			save_scope_as = mother
			# Use carn_had_sex_with_effect to be able to set the pregnancy chances
			carn_had_sex_with_effect = {
				CHARACTER_1 = scope:father
				CHARACTER_2 = scope:mother
				C1_PREGNANCY_CHANCE = 100
				C2_PREGNANCY_CHANCE = 100
				STRESS_EFFECTS = no
				DRAMA = no
			}
		}
	}
}


code:
namespace = carn_lactation

# 0001. Yearly milk production decrease
# 0002. Gain milk production on pregnancy
# 0003. Seed lactation from pregnancy on character initialization pulse

# 0001. Yearly milk production decrease
carn_lactation.0001 = {
	hidden = yes

	trigger = {
		is_alive = yes # To increase performance somewhat
		carn_is_lactating_trigger = yes
		carn_milk_production_decreases_yearly_trigger = yes
	}

	immediate = {
		carn_create_milk_production_change_effect = yes
		carn_change_milk_production_effect = {
			VALUE = carn_yearly_milk_production_change
		}
		carn_resolve_milk_production_change_effect = {
			SEND_NOTIFICATION = yes
		}
	}
}

# 0002. Gain milk production on pregnancy
carn_lactation.0002 = {
	hidden = yes

	trigger = {
		carn_can_lactate_trigger = yes
	}

	immediate = {
		carn_create_milk_production_change_effect = yes
		carn_change_milk_production_effect = {
			VALUE = carn_on_pregnancy_milk_production_increase
		}
		carn_set_milk_production_maximum_effect = {
			MAXIMUM = carn_on_pregnancy_milk_production_cap
		}
		carn_resolve_milk_production_change_effect = {
			SEND_NOTIFICATION = yes
		}
	}
}

# 0003. Seed lactation from pregnancy on character initialization pulse
carn_lactation.0003 = {
	hidden = yes

	trigger = {
		carn_can_lactate_trigger = yes
		is_female = yes
		OR = {
			carn_is_visibly_pregnant_trigger = yes
			any_child = {
				age < 5
			}
		}
		carn_is_lactating_trigger = no
	}

	immediate = {
		carn_create_milk_production_change_effect = yes
		carn_change_milk_production_effect = {
			VALUE = carn_on_pregnancy_milk_production_increase
		}
		carn_resolve_milk_production_change_effect = {
			SEND_NOTIFICATION = no
		}
	}
}


code:
namespace = carn_pregnancy_suppression

# 0001. When pregnancy maintenance event is suppressed
# 0002. When notification event is suppressed
# 0003. Clear next_on_pregnancy_* flags when pregnancy is aborted

carn_pregnancy_suppression.0001 = {
	hidden = yes

	trigger = {
		carn_should_suppress_on_pregnancy_maintenance_trigger = yes
	}

	immediate = {
		remove_character_flag = carn_suppress_next_on_pregnancy_maintenance
		trigger_event = {
			on_action = carn_on_pregnancy_maintenance_suppressed
		}
	}
}

carn_pregnancy_suppression.0002 = {
	hidden = yes

	trigger = {
		carn_should_suppress_on_pregnancy_notification_trigger = yes
	}

	immediate = {
		remove_character_flag = carn_suppress_next_on_pregnancy_notification
		trigger_event = {
			on_action = carn_on_pregnancy_notification_suppressed
		}
	}
}

carn_pregnancy_suppression.0003 = {
	hidden = yes

	immediate = {
		remove_character_flag = carn_suppress_next_on_pregnancy_maintenance
		remove_character_flag = carn_suppress_next_on_pregnancy_notification
	}
}


code:
namespace = carn_prostitution_doctrine_seeding

# Event chain for seeding default religions with prostitution doctrines
# 0001. Activate the game rule effect for default prostitution religious doctrines
# 0002. Add default prostitution religious doctrines to newly created religions if they don't have them
#

#
# 0001. Activate the game rule effect for default prostitution religious doctrines
#

carn_prostitution_doctrine_seeding.0001 = {
	scope = none
	hidden = yes

	immediate = {
		every_religion_global = {
			every_faith = {
				carn_seed_prostitution_doctrines_effect = yes
			}
		}
	}
}

#
# 0002. Add default prostitution religious doctrines to newly created religions if they don't have them
#

carn_prostitution_doctrine_seeding.0002 = {
	hidden = yes

	immediate = {
		root.faith = {
			carn_seed_prostitution_doctrines_effect = yes
		}
	}
}


code:
namespace = carn_prostitution_random_events

#
# we don't need to check that the character is a prostitute/able to have sex, because it's already checked in the on_action
#
# 0001. Leveled up prostitute trait
# 0002. Lost prestige
# 0003. Lost piety (shunned)
# 0004. Got STD
# 0005. Big tipper
#
# 0010-11. Someone notable lays with you
#

# 0001. Leveled up prostitute trait
carn_prostitution_random_events.0001 = {
	hidden = yes

	immediate = {
		send_interface_message = {
			title = carn_prostitution_random_events.0001.notification
			type = carn_prostitute_random_event_good
			right_icon = this
			carn_upgrade_lifestyle_prostitute_effect = yes
		}
	}
}

# 0002. Lost prestige
carn_prostitution_random_events.0002 = {
	hidden = yes

	weight_multiplier = {
		base = 1
		carn_prostitution_bad_event_modifier = yes
	}

	immediate = {
		send_interface_message = {
			title = carn_prostitution_random_events.0002.notification
			type = carn_prostitute_random_event_bad
			right_icon = this
			add_prestige = minor_prestige_loss
		}
	}
}

# 0003. Lost piety (shunned)
carn_prostitution_random_events.0003 = {
	hidden = yes

	weight_multiplier = {
		base = 1
		carn_prostitution_bad_event_modifier = yes

		modifier = {
			factor = 0
			faith = {
				has_doctrine = carn_doctrine_prostitution_accepted
			}
		}
	}

	immediate = {
		send_interface_message = {
			title = carn_prostitution_random_events.0003.notification
			type = carn_prostitute_random_event_bad
			right_icon = this
			add_piety = medium_piety_loss
		}
	}
}

# 0004. Got STD
carn_prostitution_random_events.0004 = {
	hidden = yes

	weight_multiplier = {
		base = 1
		carn_prostitution_bad_event_modifier = yes

		modifier = {
			factor = 0
			has_game_rule = carn_std_disabled
		}
	}

	immediate = {
		random_list = {
			20 = {
				contract_disease_notify_effect = { DISEASE = lovers_pox }
			}
			5 = {
				contract_disease_notify_effect = { DISEASE = great_pox }
			}
		}
	}
}

# 0005. Big tipper
carn_prostitution_random_events.0005 = {
	hidden = yes

	weight_multiplier = {
		base = 1
		carn_prostitution_good_event_modifier = yes
	}

	immediate = {
		send_interface_message = {
			title = carn_prostitution_random_events.0005.notification
			type = carn_prostitute_random_event_good
			right_icon = this
			add_gold = minor_gold_value
		}
	}
}

scripted_trigger carn_possible_prostitute_random_events_0010_client_trigger = {
	is_ai = yes
	carn_can_have_sex_trigger = yes
	is_busy_in_events_localised = yes
	possibly_interested_in_character_trigger = { CHARACTER = root }
	root = { possibly_interested_in_character_trigger = { CHARACTER = prev } }
	gold >= minor_gold_value
	NOR = {
		this = root
		is_consort_of = root
		has_relation_lover = root
		has_relation_rival = root
		is_at_war_with = root
	}
}

# 0010. Someone notable lays with you - setup event
carn_prostitution_random_events.0010 = {
	hidden = yes

	weight_multiplier = {
		base = 1
		# characters are less likely to be into you if you're a bad prostitute
		carn_prostitution_good_event_modifier = yes
	}

	immediate = {

		# first, populate a list with various important landed characters
		every_vassal = {
			add_to_list = potential_clients
		}
		if = {
			limit = { exists = liege }
			liege = { every_vassal = { add_to_list = characters } }
		}
		every_neighboring_and_across_water_realm_same_rank_owner = {
			add_to_list = potential_clients
		}

		# now get one of them to be our client, preferably someone with a personality lewd enough that it makes sense for them to be coming to us
		random_in_list = {
			list = potential_clients
			limit = {
				carn_possible_prostitute_random_events_0010_client_trigger = yes
				OR = {
					has_trait = lustful
					has_trait = seducer
					has_trait = rakish
					has_trait = deviant
				}
			}
			weight = {
				base = 30
				modifier = {
					add = 10
					has_trait = lustful
				}
				modifier = {
					add = 10
					has_trait = seducer
				}
				modifier = {
					add = 10
					has_trait = rakish
				}
				modifier = {
					add = -10
					might_cheat_on_every_partner_trigger = no
				}
				modifier = {
					add = -30
					NOT = { freely_accepts_sodomy_with_trigger = { CHARACTER = root } }
				}
				modifier = {
					add = -30
					has_trait = chaste
				}
			}
			save_scope_as = client
		}

		if = {
			limit = { exists = scope:client }
			trigger_event = { id = carn_prostitution_random_events.0011 }
		}
	}
}

# 0011. Someone notable lays with you - displayed event
carn_prostitution_random_events.0011 = {
	type = character_event
	title = carn_prostitution_random_events.0011.t
	desc = carn_prostitution_random_events.0011.desc

	theme = seduction

	override_background = {
		reference = bedchamber
	}

	left_portrait = {
		character = scope:client
		animation = flirtation
	}

	option = { # let's fuck
		name = carn_prostitution_random_events.0011.a
		scope:client = {
			pay_short_term_gold = {
				target = root
				gold = minor_gold_value
			}
		}
		show_as_tooltip = {
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:client
            }
		}
		hidden_effect = {
			carn_sex_scene_character_is_giving_player_effect = yes
			carn_sex_scene_is_consensual_effect = yes
			carn_sex_scene_is_vaginal_effect = yes
			carn_sex_scene_is_cum_inside_effect = yes
			carn_sex_scene_effect_v2 = {
				PARTNER = scope:client
			}
		}
		reverse_add_opinion = {
			target = scope:client
			modifier = impressed_opinion
			opinion = 10
		}
	}

	option = { # decline
		name = carn_prostitution_random_events.0011.b
		add_prestige = minor_prestige_loss
		reverse_add_opinion = {
			target = scope:client
			modifier = disappointed_opinion
			opinion = -10
		}
		stress_impact = {
			lustful = medium_stress_impact_gain
		}
	}

	option = { # oho, let's ruin their reputation
		name = carn_prostitution_random_events.0011.c
		trigger = {
			NOT = { has_relation_friend = scope:client }
			scope:client = {
				OR = {
					# this is cheating on their spouse
					AND = {
						is_married = yes
						trait_is_shunned_or_criminal_in_my_or_lieges_faith_trigger = { TRAIT = adulterer GENDER_CHARACTER = root }
					}
					# this is sodomy
					relation_with_character_is_sodomy_in_my_or_lieges_faith_trigger = { CHARACTER = root }
				}
			}
		}
		scope:client = {
			extramarital_sex_attempt_exposure_consequences_with_target_effect = {
				TARGET = root
				SPOUSE_EVENT = yes
			}
		}
		scope:client = {
			add_opinion = {
				modifier = humiliated_opinion
				target = root
				opinion = -30
			}
			progress_towards_rival_effect = {
				REASON = rival_humiliated
				CHARACTER = root
				OPINION = 0
			}
		}
	}
}


code:
namespace = carn_sex_scene_cleanup

carn_sex_scene_cleanup.0001 = {
	type = character_event
	hidden = yes

	immediate = {
		#debug_log = "Cleaning up sex scene flags"
		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}


code:
namespace = carn_sex_scene

#This is the main sex scene, it redirect to other event according to flags
carn_sex_scene.001 = {
	hidden = yes
	immediate = {
		#giving_player vaginal cum_inside consensual
		if = {
			limit = {
				carn_sex_scene_character_is_giving_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_inside_trigger = yes
				carn_sex_scene_is_consensual_trigger = yes
			}
			trigger_event = carn_sex_scene.002
		}
		#giving_player vaginal cum_outside consensual
		else_if = {
			limit = {
				carn_sex_scene_character_is_giving_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_outside_trigger = yes
				carn_sex_scene_is_consensual_trigger = yes
			}
			trigger_event = carn_sex_scene.003
		}
		#giving_player anal consensual
		else_if = {
			limit = {
				carn_sex_scene_character_is_giving_player_trigger = yes
				carn_sex_scene_is_anal_trigger = yes
				carn_sex_scene_is_consensual_trigger = yes
			}
			trigger_event = carn_sex_scene.004
		}
		#giving_player oral consensual
		else_if = {
			limit = {
				carn_sex_scene_character_is_giving_player_trigger = yes
				carn_sex_scene_is_oral_trigger = yes
				carn_sex_scene_is_consensual_trigger = yes
			}
			trigger_event = carn_sex_scene.005
		}
		#giving_player dom vaginal cum_inside noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_inside_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.006
		}
		#giving_player dom vaginal cum_outside noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_outside_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.007
		}
		#giving_player dom anal noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_anal_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.008
		}
		#giving_player dom oral noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_oral_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.009
		}
		#giving_player dom vaginal cum_inside dubcon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_inside_trigger = yes
				carn_sex_scene_is_dubcon_trigger = yes
			}
			trigger_event = carn_sex_scene.010
		}
		#giving_player dom vaginal cum_outside dubcon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_outside_trigger = yes
				carn_sex_scene_is_dubcon_trigger = yes
			}
			trigger_event = carn_sex_scene.011
		}
		#giving_player dom anal dubcon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_anal_trigger = yes
				carn_sex_scene_is_dubcon_trigger = yes
			}
			trigger_event = carn_sex_scene.012
		}
		#giving_player dom oral dubcon
		else_if = {
			limit = {
				carn_sex_scene_character_is_dom_player_trigger = yes
				carn_sex_scene_is_oral_trigger = yes
				carn_sex_scene_is_dubcon_trigger = yes
			}
			trigger_event = carn_sex_scene.013
		}
		#receiving_player sub vaginal cum_inside noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_sub_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_inside_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.014
		}
		#receiving_player sub vaginal cum_outside noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_sub_player_trigger = yes
				carn_sex_scene_is_vaginal_trigger = yes
				carn_sex_scene_is_cum_outside_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.015
		}
		#receiving_player sub anal noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_sub_player_trigger = yes
				carn_sex_scene_is_anal_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.016
		}
		#receiving_player sub oral noncon
		else_if = {
			limit = {
				carn_sex_scene_character_is_sub_player_trigger = yes
				carn_sex_scene_is_oral_trigger = yes
				carn_sex_scene_is_noncon_trigger = yes
			}
			trigger_event = carn_sex_scene.017
		}
		#Fallback
		else = {
			trigger_event = carn_sex_scene.999
		}
	}
}

carn_sex_scene.002 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.002_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.002_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.002_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.002_fm_desc
			}
			desc = carn_sex_scene.002_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.003 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.003_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.003_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.003_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.003_fm_desc
			}
			desc = carn_sex_scene.003_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.004 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.004_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.004_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.004_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.004_fm_desc
			}
			desc = carn_sex_scene.004_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.005 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.005_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.005_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.005_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.005_fm_desc
			}
			desc = carn_sex_scene.005_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.006 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.006_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.006_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.006_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.006_fm_desc
			}
			desc = carn_sex_scene.006_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = beg
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.007 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.007_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.007_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.007_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.007_fm_desc
			}
			desc = carn_sex_scene.007_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = beg
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.008 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.008_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.008_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.008_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.008_fm_desc
			}
			desc = carn_sex_scene.008_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = beg
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.009 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.009_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.009_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.009_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.009_fm_desc
			}
			desc = carn_sex_scene.009_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = beg
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.010 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.010_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.010_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.010_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.010_fm_desc
			}
			desc = carn_sex_scene.010_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = shame
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.011 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.011_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.011_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.011_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.011_fm_desc
			}
			desc = carn_sex_scene.011_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = shame
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.012 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.012_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.012_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.012_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.012_fm_desc
			}
			desc = carn_sex_scene.012_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = shame
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.013 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.013_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.013_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.013_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.013_fm_desc
			}
			desc = carn_sex_scene.013_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = shame
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.014 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.014_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.014_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.014_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.014_fm_desc
			}
			desc = carn_sex_scene.014_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = beg
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.015 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.015_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.015_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.015_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.015_fm_desc
			}
			desc = carn_sex_scene.015_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = beg
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.016 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.016_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.016_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.016_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.016_fm_desc
			}
			desc = carn_sex_scene.016_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = beg
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.017 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = {
		first_valid = {
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.017_mf_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_male = yes
					scope:carn_sex_partner = { is_female = yes}
				}
				desc = carn_sex_scene.017_mf_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
					scope:carn_sex_partner = {is_close_or_extended_family_of = root}
				}
				desc = carn_sex_scene.017_fm_relative_desc
			}
			triggered_desc = {
				trigger = {
					is_female = yes
					scope:carn_sex_partner = { is_male = yes}
				}
				desc = carn_sex_scene.017_fm_desc
			}
			desc = carn_sex_scene.017_generic_desc
		}
	}

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = beg
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}

carn_sex_scene.999 = {
	type = character_event
	title = carn_sex_scene.002.t
	desc = carn_sex_scene.999_generic_desc

	theme = seduction
	override_background = { reference = bedchamber }

	left_portrait = {
		character = scope:carn_sex_partner
		animation = flirtation_left
	}

	right_portrait = {
		character = root
		animation = flirtation
	}

	immediate = {
		carn_undress_character_effect = yes
		scope:carn_sex_partner = {carn_undress_character_effect = yes}
		hidden_effect = {
			#Sex Effects
			carn_had_sex_with_effect_v2 = {
				PARTNER = scope:carn_sex_partner
            }
		}
	}

	option = {
		name = carn_sex_scene.002.a

		carn_dress_character_effect = yes
		scope:carn_sex_partner = {carn_dress_character_effect = yes}

		carn_sex_scene_clean_up_flags_effect = yes
		carn_sex_scene_clean_up_character_flags_effect = yes
		scope:carn_sex_partner = { carn_sex_scene_clean_up_character_flags_effect = yes }
	}
}


code:
namespace = carn_slave

#
# 0001. You have been enslaved
# 0002. Slaves are freed when they gain land for any reason
# 0003. Slave newborns get their owner relation
#

#
# 0001. You have been enslaved
#

carn_slave.0001 = {
	type = character_event
	title = carn_slave.0001.t
	desc = carn_slave.0001.desc
	theme = death
	override_background = {
		reference = gallows
	}
	immediate = {
		play_music_cue = mx_cue_stress
	}
	option = {
		name = carn_slave.0001.a
		if = {
			limit = {
				scope:actor = { is_ai = yes }
			}
			carn_enslave_effect = {
				SLAVE = scope:recipient
				OWNER = scope:actor
				DRAMA = yes
			}
		}
		else = {
			show_as_tooltip = {
				carn_enslave_effect = {
					SLAVE = scope:recipient
					OWNER = scope:actor
					DRAMA = yes
				}
			}
		}
	}
}

#
# 0002. Slaves are freed when they gain land for any reason
#

carn_slave.0002 = {
	hidden = yes
	trigger = {
		has_trait = slave
	}
	immediate = {
		carn_free_slave_effect = yes
	}
}

#
# 0003. Slave newborns get their owner relation
#

carn_slave.0003 = {
	hidden = yes

	trigger = {
		scope:child = {
			has_trait = slave
		}
	}

	immediate = {
		scope:mother = {
			random_relation = {
				type = slave_owner
				save_scope_as = mother_owner
			}
		}
		scope:child = {
			set_relation_slave_owner = scope:mother_owner
		}
	}
}


code:
namespace = carn_slave_prostitution

# 0001. Owners get earnings from their slave-prostitutes

carn_slave_prostitution.0001 = {
	hidden = yes

	trigger = {
		any_relation = {
			type = slave
			carn_is_working_as_prostitute_trigger = yes
		}
	}

	immediate = {
		set_variable = {
			name = carn_slave_prostitution_earnings
			value = 0
		}
		set_variable = {
			name = carn_slave_prostitution_piety_lost
			value = 0
		}
		every_relation = {
			type = slave
			hidden_effect = {
				# unlanded characters don't actually earn money, so we have to generate money out of nothing in script
				root = {
					change_variable = {
						name = carn_slave_prostitution_earnings
						add = prev.carn_slave_prostitution_income_value
					}
				}
				if = {
					limit = {
						root.faith = {
							NOT = { has_doctrine = carn_doctrine_prostitution_accepted }
						}
					}
					root = {
						change_variable = {
							name = carn_slave_prostitution_piety_lost
							add = miniscule_piety_loss
						}
					}
				}
				if = {
					limit = {
						OR = {
							root.faith = {
								NOT = { has_doctrine = carn_doctrine_same_slavery_accepted }
								faith_hostility_level = {
									target = prev.faith
									value < faith_hostile_level
								}
							}
							root.faith = {
								NOT = { has_doctrine = carn_doctrine_other_slavery_accepted }
								faith_hostility_level = {
									target = prev.faith
									value >= faith_hostile_level
								}
							}
						}
					}
					root = {
						change_variable = {
							name = carn_slave_prostitution_piety_lost
							add = miniscule_piety_loss
						}
					}
				}
			}
		}
		send_interface_message = {
			type = carn_prostitute_random_event_good
			title = carn_slave_prostitution.0001.t
			add_gold = var:carn_slave_prostitution_earnings
			add_piety = var:carn_slave_prostitution_piety_lost
			stress_impact = {
				generous = medium_stress_impact_gain
				compassionate = major_stress_impact_gain
			}
		}
	}
}


code:
namespace = carn_slavery_doctrine

#
# 0001. A vassal agrees to emancipate illegal slaves they may hold.
# 0002. A vassal agrees to emancipate illegal slaves they may hold in exchange for gold.
# 0003. A vassal agrees to emancipate illegal slaves they may hold in exchange for a weak hook.
# 0004. A vassal refuses to emancipate illegal slaves.

#
# 0001. A vassal agrees to emancipate illegal slaves they may hold.
#

carn_slavery_doctrine.0001 = {
	type = letter_event
	opening = {
		desc = religious_interaction.1.opening
	}
	desc = carn_slavery_doctrine.0001.desc
	sender = scope:recipient

	immediate = {
		show_as_tooltip = { carn_free_illegal_slaves_effect = yes }
	}

	option = {
		name = carn_slavery_doctrine.0001.a
	}
}

#
# 0002. A vassal agrees to emancipate illegal slaves they may hold in exchange for gold.
#

carn_slavery_doctrine.0002 = {
	type = letter_event
	opening = {
		desc = religious_interaction.1.opening
	}
	desc = carn_slavery_doctrine.0002.desc
	sender = scope:recipient

	immediate = {
		scope:recipient = {
			add_opinion = {
				modifier = carn_demanded_manumission_opinion
				target = root
				opinion = -10
			}
		}
	}

	#Accept
	option = {
		name = carn_slavery_doctrine.0002.a
		pay_short_term_gold = {
			target = scope:recipient
			gold = demand_conversion_bribe_size
		}

		carn_free_illegal_slaves_effect = yes
		stress_impact = {
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_greed = -1
				ai_zeal = 0.5
			}
			modifier = {
				factor = 0.2
				gold <= 0
			}
		}
	}

	#Refuse
	option = {
		name = carn_slavery_doctrine.0002.b
		add_opinion = {
			target = scope:recipient
			modifier = carn_illegal_refused_manumission_demand_opinion
			years = 15
		}
		ai_chance = {
			base = 25
			modifier = {
				add = 100
				gold < demand_conversion_bribe_size
			}
		}
	}

	#Use a Hook to force it through
	option = {
		name = carn_slavery_doctrine.0002.c
		trigger = {
			has_strong_usable_hook = scope:recipient
		}
		use_hook = scope:recipient

		carn_free_illegal_slaves_effect = yes
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

#
# 0003. A vassal agrees to emancipate illegal slaves they may hold in exchange for a weak hook.
#

carn_slavery_doctrine.0003 = {
	type = letter_event
	opening = {
		desc = religious_interaction.1.opening
	}
	desc = carn_slavery_doctrine.0003.default.desc
	sender = scope:recipient

	immediate = {
		scope:recipient = {
			add_opinion = {
				modifier = carn_demanded_manumission_opinion
				target = root
				opinion = -10
			}
		}
	}

	#Accept
	option = {
		name = carn_slavery_doctrine.0003.a
		scope:recipient = {
			add_hook = {
				target = root
				type = favor_hook
			}
		}
		carn_free_illegal_slaves_effect = yes

		stress_impact = {
			greedy = medium_stress_impact_gain
		}
		ai_chance = {
			base = 100
		}
	}

	#Refuse
	option = {
		name = carn_slavery_doctrine.0003.b
		add_opinion = {
			target = scope:recipient
			modifier = carn_illegal_refused_manumission_demand_opinion
			years = 15
		}
		ai_chance = {
			base = 25
		}
	}

	#Use a Hook to force it through
	option = {
		name = carn_slavery_doctrine.0003.c
		trigger = {
			has_strong_usable_hook = scope:recipient
		}
		use_hook = scope:recipient
		carn_free_illegal_slaves_effect = yes
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}

#
# 0004. A vassal refuses to emancipate illegal slaves.
#

carn_slavery_doctrine.0004 = {
	type = letter_event
	opening = {
		desc = religious_interaction.1.opening
	}
	desc = {
		desc = carn_slavery_doctrine.0004.desc
		triggered_desc = {
			trigger = { exists = scope:hooking_out_of_conversion }
			desc = carn_slavery_doctrine.0004.hooking_out
		}
	}
	sender = {
		character = scope:recipient
		animation = dismissal
	}

	immediate = {
		scope:recipient = {
			add_opinion = {
				modifier = carn_demanded_manumission_opinion
				target = root
				opinion = -10
			}
		}
		if = {
			limit = {
				scope:recipient = {
					has_strong_usable_hook = root
				}
			}
			save_scope_value_as = {
				name = hooking_out_of_conversion
				value = yes
			}
		}
	}

	#It's a Crime to refuse
	option = {
		name = carn_slavery_doctrine.0004.b
		trigger = {
			NOT = { exists = scope:hooking_out_of_conversion }
		}

		add_opinion = {
			target = scope:recipient
			modifier = carn_refused_manumission_demand_opinion
			years = 10
		}
		ai_chance = {
			base = 100
		}
	}

	#It's a Crime, but the target has a Hook on you
	option = {
		name = carn_slavery_doctrine.0004.c
		trigger = {
			exists = scope:hooking_out_of_conversion
		}
		exclusive = yes
		scope:recipient = {
			use_hook = root
		}
		hidden_effect = {
			add_opinion = {
				target = scope:recipient
				modifier = carn_illegal_refused_manumission_demand_opinion
				years = 20
			}
		}
		ai_chance = {
			base = 100
		}
	}

	#Player uses a Hook to force it through
	option = {
		name = carn_slavery_doctrine.0004.d
		trigger = {
			NOT = { exists = scope:hooking_out_of_conversion }
			has_usable_hook = scope:recipient
		}
		use_hook = scope:recipient

		carn_free_illegal_slaves_effect = yes
		ai_chance = {
			base = 100
			ai_value_modifier = {
				ai_rationality = 1
			}
		}
	}
}


code:
namespace = carn_slavery_doctrine_seeding

# Event chain for seeding default religions with slavery doctrines
# 0001. Activate the game rule effect for default slavery religious doctrines
# 0002. Add default slavery religious doctrines to newly created religions if they don't have them
#

#
# 0001. Activate the game rule effect for default slavery religious doctrines
#

carn_slavery_doctrine_seeding.0001 = {
	scope = none
	hidden = yes

	immediate = {
		every_religion_global = {
			every_faith = {
				carn_seed_slavery_doctrines_effect = yes
			}
		}
	}
}

#
# 0002. Add default slavery religious doctrines to newly created religions if they don't have them
#

carn_slavery_doctrine_seeding.0002 = {
	hidden = yes

	immediate = {
		root.faith = {
			carn_seed_slavery_doctrines_effect = yes
		}
	}
}