﻿namespace = orgy_main_servants

############################
# The Curious Servants
# by Ban10
############################

# A group of female servants crash into your bedroom
# Choose how to punish them
# Punish them personaly - Gain piety, lose stress, consort is annoyed
# Let your wife punish them - Effects depend on her personality traits
# Let them go - Consort likes you more, gain prestige

####
# Weight and Setup Event
####
orgy_main_servants.0001 = {
	type = activity_event
	hidden = yes

	trigger = {
		# Make sure this wasn't triggered last time
		trigger_if = {
			limit = { scope:activity.activity_host = { has_variable = last_orgy_was } }
			NOT = { scope:activity.activity_host.var:last_orgy_was = flag:servants }
		}

		# Make sure we have a non-pregnant devoted character to fug
		scope:activity = {
			any_attending_character = {
				AND = {
					has_trait = devoted_trait_group
					NOT = { is_pregnant = yes }
				}
			}
		}
	}

	immediate = {
		# Choose our devoted
		scope:activity = {
			random_attending_character = {
				limit = {
					has_trait = devoted_trait_group
					NOT = { is_pregnant = yes }
				}
				save_scope_as = consort
			}
		}

		scope:activity = {
			activity_host = {
				# Set this as last main orgy activity
				set_variable = {
					name = last_orgy_was
					value = flag:servants
				}
				trigger_event = orgy_main_servants.0002
			}
		}
	}
}

###
# Event for Host (Magister)
###
orgy_main_servants.0002 = {
	type = activity_event
	title = orgy_main_servants.0002.t
	desc = {
		desc = orgy_main_servants.0002.intro
		first_valid = {
			triggered_desc = {
				trigger = {
					scope:consort = {
						OR = {
							has_trait = calm
							has_trait = content
							has_trait = forgiving
							has_trait = generous
							has_trait = humble
							has_trait = temperate
							has_trait = compassionate
						}
					}
				}
				desc = orgy_main_servants.0002.consort_response_kind
			}
			triggered_desc = {
				trigger = {
					scope:consort ={
						OR = {
							has_trait = wrathful
							has_trait = vengeful
							has_trait = arrogant
							has_trait = impatient
							has_trait = callous
							has_trait = sadistic
						}
					}
				}
				desc = orgy_main_servants.0002.consort_response_angry
			}
			triggered_desc = {
				trigger = {
					scope:consort = {
						NOT = {
							has_trait = calm
							has_trait = content
							has_trait = forgiving
							has_trait = generous
							has_trait = humble
							has_trait = temperate
							has_trait = compassionate
							has_trait = wrathful
							has_trait = vengeful
							has_trait = arrogant
							has_trait = impatient
							has_trait = callous
							has_trait = sadistic
						}
					}
				}
				desc = orgy_main_servants.0002.consort_response_neutral
			}
		}
		desc =  orgy_main_servants.0002.intro_2
	}

	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = scope:consort
		outfit_tags = { no_cloak no_hat no_pants no_clothes }


		# Consort is nice to servants
		scripted_animation = {
			triggered_animation = {
				trigger = {
					OR = {
						has_trait = calm
						has_trait = content
						has_trait = forgiving
						has_trait = generous
						has_trait = humble
						has_trait = temperate
						has_trait = compassionate
					}
				}
				animation = { personality_compassionate love happiness }
			}
		}

		# Consort is angry
		scripted_animation = {
			triggered_animation = {
				trigger = {
					OR = {
						has_trait = wrathful
						has_trait = vengeful
						has_trait = arrogant
						has_trait = impatient
						has_trait = callous
						has_trait = sadistic
					}
				}
				animation = { anger rage }
			}
		}

		# Consort finds servants amusing
		scripted_animation = {
			triggered_animation = {
				trigger = {
					OR = {
						has_trait = lustful
						has_trait = gregarious
						has_trait = brave
					}
				}
				animation = { laugh }
			}
		}

		# Default, Consort doesn't mind
		animation = personality_content
	}

	right_portrait = {
		character = scope:servant
		animation = shame
	}

	immediate = {
		hidden_effect = {
			# Create the main servant character
			create_character = {
				save_scope_as = servant
				location = root.capital_province
				culture = root.culture
				faith = root.faith
				gender = female
				template = regula_orgy_servant_character
			}
		}
	}

	# Punish them personally
	option = {
		name = orgy_main_servants.0002.a
		flavor = orgy_main_servants.0002.a.tt

		show_as_tooltip = {
			add_piety = 300

			stress_impact = {
				base = medium_stress_impact_loss
				lustful = major_stress_impact_loss
				just = minor_stress_impact_loss
				forgiving = minor_stress_impact_loss
				vengeful = minor_stress_impact_gain
				compassionate = minor_stress_impact_loss
				diligent = minor_stress_impact_loss
				lazy = minor_stress_impact_gain
				gregarious = minor_stress_impact_loss
				shy = medium_stress_impact_gain
				temperate = minor_stress_impact_gain
			}
		}


		# Move on to sexy times
		scope:activity = {
			activity_host = {
				trigger_event = orgy_main_servants.0003
			}
		}
	}
	# Let your consort punish them
	option = {
		name = orgy_main_servants.0002.b
		flavor = orgy_main_servants.0002.b.tt

		add_piety = 100

		scope:consort = {
			add_opinion = {
				target = scope:host
				modifier = respect_opinion
				opinion = 20
			}
		}

		if = {
			limit = {
				scope:consort = {
					OR = {
						is_regula_leader_devoted_trigger = yes
						has_trait = lustful
						has_trait = gregarious
						has_trait = brave
					}
				}
			}
			scope:activity = {
				activity_host = {
					trigger_event = orgy_main_servants.1001
				}
			}
		}
		else_if ={
			limit = {
				scope:consort = {
					OR = {
						has_trait = wrathful
						has_trait = vengeful
						has_trait = arrogant
						has_trait = impatient
						has_trait = callous
						has_trait = sadistic
					}
				}
			}
			scope:activity = {
				activity_host = {
					trigger_event = orgy_main_servants.1003
				}
			}
		}
		else = {
			scope:activity = {
				activity_host = {
					trigger_event = orgy_main_servants.1002
				}
			}
		}

	}
	# Let them off with a warning
	option = {
		name = orgy_main_servants.0002.c
		flavor = orgy_main_servants.0002.c.tt

		add_prestige = 75

		stress_impact = {
			just = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			forgiving = minor_stress_impact_loss
			lazy = minor_stress_impact_loss
		}

		regula_sex_with_target_no_stress = { TARGET = scope:consort }

		# Lay with her
		scope:consort = {
			add_opinion = {
				target = scope:host
				modifier = love_opinion
				opinion = 20
			}
		}
	}
}

# Personal punish
orgy_main_servants.0003 = {
	type = activity_event
	title = orgy_main_servants.0003.t
	desc = orgy_main_servants.0003.desc
	theme = regula_orgy_theme
	override_background = {
		reference = regula_bedchamber
	}

	left_portrait = {
		character = root
		outfit_tags = { no_cloak no_hat no_pants no_clothes }
		animation = flirtation
	}

	right_portrait = {
		character = scope:servant
		outfit_tags = { no_cloak no_hat no_pants no_clothes }
		animation = admiration
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_servants_log
					tags = { good }
					score = 25
					character = root
					target = scope:consort
				}
			}
		}
	}

	option = {
		name = orgy_main_servants.0003.a
		flavor = orgy_main_servants.0003.a.tt

		add_piety = 300

		stress_impact = {
			base = medium_stress_impact_loss
			lustful = major_stress_impact_loss
			just = minor_stress_impact_loss
			forgiving = minor_stress_impact_loss
			vengeful = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			diligent = minor_stress_impact_loss
			lazy = minor_stress_impact_gain
			gregarious = minor_stress_impact_loss
			shy = medium_stress_impact_gain
			temperate = minor_stress_impact_gain
		}

		# Get rid of the servants after
		hidden_effect = {
			scope:servant = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}
}

# Let Wife punish - aftermath
# Wife is kind, teachs servant how to "service" you
orgy_main_servants.1001 = {
	type = activity_event
	title = orgy_main_servants.1001.t
	desc = orgy_main_servants.1001.desc
	theme = regula_orgy_theme
	override_background = {
		reference = corridor_night
	}

	left_portrait = {
		character = root
		outfit_tags = { no_pants }
		animation = flirtation
	}

	right_portrait = {
		character = scope:servant
		animation = love
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_servants_log
					tags = { good }
					score = 25
					character = root
					target = scope:consort
				}
			}
		}
	}

	option = {
		name = orgy_main_servants.1001.a
		flavor = orgy_main_servants.1001.a.tt

		add_piety = 100

		stress_impact = {
			base = medium_stress_impact_loss
			lustful = major_stress_impact_loss
			forgiving = minor_stress_impact_loss
			vengeful = minor_stress_impact_gain
			compassionate = minor_stress_impact_loss
			shy = minor_stress_impact_gain
		}

		# Get rid of the servants after
		hidden_effect = {
			scope:servant = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}
}

# Wife is normal, servant is polite
orgy_main_servants.1002 = {
	type = activity_event
	title = orgy_main_servants.1002.t
	desc = orgy_main_servants.1002.desc
	theme = regula_orgy_theme
	override_background = {
		reference = corridor_night
	}

	left_portrait = {
		character = root
		animation = steward
	}

	right_portrait = {
		character = scope:servant
		animation = personality_content
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_servants_log
					tags = { good }
					score = 25
					character = root
					target = scope:consort
				}
			}
		}
	}

	option = {
		name = orgy_main_servants.1002.a
		flavor = orgy_main_servants.1002.a.tt

		stress_impact = {
			base = minor_stress_impact_loss
			forgiving = medium_stress_impact_loss
			compassionate = medium_stress_impact_loss
		}


		# Get rid of the servants after
		hidden_effect = {
			scope:servant = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}
}

# Wife is harsh, servant is hurt
orgy_main_servants.1003 = {
	type = activity_event
	title = orgy_main_servants.1003.t
	desc = orgy_main_servants.1003.desc
	theme = regula_orgy_theme
	override_background = {
		reference = corridor_night
	}

	left_portrait = {
		character = root
		scripted_animation = {
			triggered_animation = {
				trigger = {
					OR = {
						has_trait = wrathful
						has_trait = vengeful
						has_trait = arrogant
						has_trait = impatient
						has_trait = callous
						has_trait = sadistic
					}
				}
				animation = { dismissal }
			}
		}
		animation = worry
	}

	right_portrait = {
		character = scope:servant
		animation = grief
	}

	immediate = {
		scope:servant = {
			add_trait = scarred
		}
	}

	after = {
		hidden_effect = {
 			scope:activity = {
				add_activity_log_entry = {
					key = regula_orgy_servants_log
					tags = { bad }
					score = 25
					character = root
					target = scope:consort
				}
			}
		}
	}

	option = {
		name = orgy_main_servants.1003.a
		flavor = orgy_main_servants.1003.a.tt

		stress_impact = {
			just = minor_stress_impact_gain
			compassionate = minor_stress_impact_gain
			forgiving = minor_stress_impact_gain
		}

		# Get rid of the servant after
		hidden_effect = {
			scope:servant = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}

	option = {
		name = orgy_main_servants.1003.b
		flavor = orgy_main_servants.1003.b.tt
		exclusive = yes
		trigger = {
			OR = {
				has_trait = wrathful
				has_trait = vengeful
				has_trait = arrogant
				has_trait = impatient
				has_trait = callous
				has_trait = sadistic
			}
		}

		stress_impact = {
			wrathful = minor_stress_impact_loss
			vengeful = medium_stress_impact_loss
			arrogant = minor_stress_impact_loss
			impatient = minor_stress_impact_loss
			callous = medium_stress_impact_loss
			sadistic = medium_stress_impact_loss
		}

		# Get rid of the servant after
		hidden_effect = {
			scope:servant = {
				death = {
					death_reason = death_disappearance
				}
			}
		}
	}
}
