﻿# Feast activities
# You could try to seduce your relative during the feast

# feast_familyromance.1001 Your relative wants explore the castle together
# feast_familyromance.1002 You end up in the private rooms together.

# feast_familyromance.1003 The unknown dancer dances during the feast, she caught your eye. (only for m/f)
# feast_familyromance.1004 The dancer is actually your relative. Nice coincidence.

# feast_familyromance.1005 You want to find a pretty maid or manservant to have some fun with
# feast_familyromance.1006 It's turns out to be your relative in disguise.



# Continuation events:
# feast_familyromance.1100 Your relative gifts you an artifact
# feast_familyromance.1101 Your relative gives you a modifier


namespace = feast_familyromance

# ------------------------------------


# One of your relatives persuade you to show the realm to him/her
# Actually, only to stay with you in some private place.

scripted_trigger familyromance_feast_relative_1001_trigger =
{
	feast_default_participant_trigger = yes # This trigger doesn't mean, that the person is actually present on the feast.
	# It shows, that someone could _possibly_ be here.
	
	AND = {
		is_sibling_of = root
		familyromance_feast_seduce_valid_relative = yes
	}
}


# Your relative wants explore the castle together
feast_familyromance.1001 = {
	type = activity_event
	title = fr_feast_familyromance.1001.t
	desc = fr_feast_familyromance.1001.desc
	theme = feast_activity
	left_portrait = {
		character = scope:familiromance_feast_possible_lover
		animation = admiration
	}
	#cooldown = { years = 1 }
	
	trigger = {
		familyromance_feast_player_suitable_to_attraction = yes
		is_ai = no
		
		OR = {
			scope:activity = {
				any_attending_character = {
					familyromance_feast_relative_1001_trigger = yes
				}
			}

			any_sibling = {
				familyromance_feast_seduce_valid_relative = yes
			}
		}
		
		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}
	
	immediate = {
		scope:activity = {
			random_attending_character = {
				#is_ai = yes
				limit = {
					familyromance_feast_relative_1001_trigger = yes
				}
				save_scope_as = familiromance_feast_possible_lover
			}
		}
		if = {
			limit = {
				NOT = { exists = scope:familiromance_feast_possible_lover }
			}

			random_sibling = {
				limit = {
					familyromance_feast_seduce_valid_relative = yes
				}
				save_scope_as = familiromance_feast_possible_lover
			}				
		}

	}


	option = { # Go ahead with your relative to the private room
		name = fr_feast_familyromance.1001.a
		
		stress_impact = {
			paranoid = minor_stress_impact_gain
			arrogant = minor_stress_impact_gain
		}		
		
		had_sex_with_effect = {
			CHARACTER = scope:familiromance_feast_possible_lover
			PREGNANCY_CHANCE = pregnancy_chance		
	    }
		
		trigger_event = {
			id = feast_familyromance.1002
		}
		
	}

	option = { # No
		name = fr_feast_familyromance.1001.b
		custom_tooltip = fr_feast_familyromance.1001.b.tt
		
		reverse_add_opinion = {
			target = scope:familiromance_feast_possible_lover
			modifier = rude_opinion
			opinion = -20
		}
		
		scope:familiromance_feast_possible_lover = {
			add_character_flag = {
				flag = block_relative_seduce_attempts
				years = 20
			}
		}
		
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
		
	}
	
	option = { # No to all attempts for 10 years
		name = fr_feast_familyromance.1001.c
		custom_tooltip = fr_random_familymember_love.0001.d.tt
		
		reverse_add_opinion = {
			target = scope:familiromance_feast_possible_lover
			modifier = rude_opinion
			opinion = -20
		}
		
		add_character_flag = {
			flag = block_family_relation_seduce_attempts
			years = 10
		}
		
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
	}
	
	
}



feast_familyromance.1002 = {
	type = activity_event
	title = fr_feast_familyromance.1001.t
	desc = fr_feast_familyromance.1002.desc
	theme = feast_activity
	override_background = {		
		reference = relaxing_room
	}
	override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_seduction" }
	
	left_portrait = {
		character = scope:familiromance_feast_possible_lover
		animation = love
	}
		
	trigger = {
		
		is_ai = no
				
		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}
	
	option = {
		# Become lovers
		trigger = {
			can_set_relation_lover_trigger = { CHARACTER = scope:familiromance_feast_possible_lover }
		}
		set_relation_lover = scope:familiromance_feast_possible_lover
		
		name = fr_feast_familyromance.1002.a
		
		add_character_flag = {
			flag = had_recent_family_relation_seduce_feast
			days = 30
		}
		
	}
		 
	option = {
		# Abandon the idea
		name = fr_feast_familyromance.1002.b
		
		scope:familiromance_feast_possible_lover = {
			add_character_flag = {
				flag = block_relative_seduce_attempts
				years = 20
			}			
		}
		
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
		
	}
}


# ------------------------------------
# Your relative dances during the feast, she caught your eye.
# (only for m/f)

scripted_trigger familyromance_feast_relative_1003_trigger =
{
	feast_default_participant_trigger = yes
		
	AND = {
		is_sibling_of = root
		familyromance_feast_seduce_valid_relative = yes
		
		is_female = yes # Only for females
		is_ruler = no # Isn't it strange for rulers or councillors to dance like this?
		is_councillor = no #
	}

}


feast_familyromance.1003 = {
	type = activity_event
	title = fr_feast_familyromance.1003.t
	desc = fr_feast_familyromance.1003.desc
	theme = feast_activity
	left_portrait = {
		character = scope:familiromance_feast_possible_lover
		animation = flirtation
	}
	#cooldown = { years = 1 }
	
	trigger = {
		familyromance_feast_player_suitable_to_attraction = yes
		is_ai = no
		
		OR = {
			scope:activity = {
				any_attending_character = {
					familyromance_feast_relative_1003_trigger = yes
				}
			}

			any_sibling = {
				familyromance_feast_relative_1003_trigger = yes
			}
		}
		
		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}
	
	immediate = {
		scope:activity = {
			random_attending_character = {
				
				limit = {
					familyromance_feast_relative_1003_trigger = yes
				}
				save_scope_as = familiromance_feast_possible_lover
			}
		}
		if = {
			limit = {
				NOT = { exists = scope:familiromance_feast_possible_lover }
			}

			random_sibling = {
				limit = {
					familyromance_feast_relative_1003_trigger = yes	
				}
				save_scope_as = familiromance_feast_possible_lover
			}				
		}
	}
	
	option = { # Go with her and dance
		name = fr_feast_familyromance.1003.a

		add_prestige = minor_prestige_loss

		had_sex_with_effect = {
			CHARACTER = scope:familiromance_feast_possible_lover
			PREGNANCY_CHANCE = pregnancy_chance		
	    }
		
		trigger_event = {
			id = feast_familyromance.1004
		}
	}
	
	option = { # No
		name = fr_feast_familyromance.1003.b
		custom_tooltip = fr_feast_familyromance.1001.b.tt
		
		add_prestige = minor_prestige_gain
		scope:familiromance_feast_possible_lover = {
			add_prestige = minor_prestige_loss
		}
		
		reverse_add_opinion = {
			target = scope:familiromance_feast_possible_lover
			modifier = refusal_opinion
			opinion = -20
		}

		scope:familiromance_feast_possible_lover = {
			add_character_flag = {
				flag = block_relative_seduce_attempts
				years = 20
			}
		}
		
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
		
	}
	
	option = { # No to all attempts for 10 years
		name = fr_feast_familyromance.1003.c
		custom_tooltip = fr_random_familymember_love.0001.d.tt
		
		add_prestige = minor_prestige_gain
		
		reverse_add_opinion = {
			target = scope:familiromance_feast_possible_lover
			modifier = refusal_opinion
			opinion = -20
		}

		add_character_flag = {
			flag = block_family_relation_seduce_attempts
			years = 10
		}
		
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
	}	
}


# The dancer is actually your relative.
feast_familyromance.1004 = {
	type = activity_event
	title = fr_feast_familyromance.1003.t
	desc = fr_feast_familyromance.1004.desc
	theme = feast_activity
	override_background = {		
		reference = corridor_night
	}
	override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_love" }
	
	left_portrait = {
		character = scope:familiromance_feast_possible_lover
		animation = love
	}
	
	right_portrait = {
		character = root
		animation = disbelief
	}
		
	trigger = {
		familyromance_feast_player_suitable_to_attraction = yes
		is_ai = no
				
		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}
	
	immediate = {
		play_music_cue = "mx_cue_seduction"
	}

	option = {
		# Become lovers
		trigger = {
			can_set_relation_lover_trigger = { CHARACTER = scope:familiromance_feast_possible_lover }
		}
		set_relation_lover = scope:familiromance_feast_possible_lover
		
		name = fr_feast_familyromance.1004.a
		hidden_effect = {
			random_list = {
					80 = {
						trigger_event = {
							id = feast_familyromance.1100
						}
					}
					20 = {
						trigger_event = {
							id = feast_familyromance.1101
						}					
					}
			}
		}
	}
		 
	option = {
		# Abandon the idea
		name = fr_feast_familyromance.1004.b
		
		reverse_add_opinion = {
			target = scope:familiromance_feast_possible_lover
			modifier = insult_opinion
			opinion = -20
		}
		
		scope:familiromance_feast_possible_lover = {
			add_character_flag = {
				flag = block_relative_seduce_attempts
				years = 20
			}			
		}
		
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
		
	}
}


# You want to find a pretty maid or manservant
feast_familyromance.1005 = {
	type = activity_event
	title = fr_feast_familyromance.1005.t
	desc = fr_feast_familyromance.1005.desc
	theme = feast_activity
	right_portrait = {
		character = root
		animation = flirtation
	}
	
	override_background = {
		reference = corridor_night
	}
	override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_intrigue" }
	#cooldown = { years = 1 }
	
	trigger = {
		familyromance_feast_player_suitable_to_attraction = yes
		is_ai = no
		
		OR = {
			scope:activity = {
				any_attending_character = {
					familyromance_feast_relative_1001_trigger = yes
				}
			}

			any_sibling = {
				familyromance_feast_seduce_valid_relative = yes
			}
		}
		
		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}
	
	immediate = {
		
		scope:activity = {
			random_attending_character = {
				#is_ai = yes
				limit = {
					familyromance_feast_relative_1001_trigger = yes
				}
				save_scope_as = familiromance_feast_possible_lover
			}
		}
		if = {
			limit = {
				NOT = { exists = scope:familiromance_feast_possible_lover }
			}

			random_sibling = {
				limit = {
					familyromance_feast_seduce_valid_relative = yes
				}
				save_scope_as = familiromance_feast_possible_lover
			}				
		}
	}
	
	option = { # Yes, follow
		name = fr_feast_familyromance.1005.a

		# Add hidden effect?
		had_sex_with_effect = {
			CHARACTER = scope:familiromance_feast_possible_lover
			PREGNANCY_CHANCE = pregnancy_chance		
	    }

		add_character_flag = {
			flag = had_recent_family_relation_seduce_feast
			days = 30
		}
		
		trigger_event = {
			id = feast_familyromance.1006
		}
	}
	
	option = { # No
		name = fr_feast_familyromance.1005.b		
		
		stress_impact = {
			paranoid = medium_stress_impact_loss
		}
		
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
	}

}


# And this servant turns out to be your relative.
feast_familyromance.1006 = {
	type = activity_event
	title = fr_feast_familyromance.1005.t
	desc = fr_feast_familyromance.1006.desc
	theme = feast_activity
	override_background = {
		reference = corridor_night
	}
	override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_seduction" }
	
	left_portrait = {
		character = scope:familiromance_feast_possible_lover
		animation = happiness
	}	

	right_portrait = {
		character = root
		animation = shame
	}
		
	trigger = {
		
		is_ai = no
				
		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}

	immediate = {
		play_music_cue = "mx_cue_seduction"
	}
	
	option = {
		# Become lovers
		trigger = {
			can_set_relation_lover_trigger = { CHARACTER = scope:familiromance_feast_possible_lover }
		}
		set_relation_lover = scope:familiromance_feast_possible_lover
		
		name = fr_feast_familyromance.1006.a
		hidden_effect = {
			random_list = {
					80 = {
						trigger_event = {
							id = feast_familyromance.1100
						}
					}
					20 = {
						trigger_event = {
							id = feast_familyromance.1101
						}					
					}
			}
		}
	}
		 
	option = {
		# Abandon the idea
		name = fr_feast_familyromance.1006.b
		
		stress_impact = {
			paranoid = medium_stress_impact_loss
			craven = medium_stress_impact_loss
		}
		
		scope:familiromance_feast_possible_lover = {
			add_character_flag = {
				flag = block_relative_seduce_attempts
				years = 20
			}
			
		}
		
	}
}









# -----------------------------------

# Your lover gives an artifact
feast_familyromance.1100 = {
	type = activity_event
	title = feast_familyromance.1100.t
	desc = feast_familyromance.1100.desc
	theme = feast_activity
	override_background = {
		reference = bp1_wine_cellar
	}
	override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_love" }
	
	artifact = {
		target = scope:familyromance_romantic_trinket_feast
		position = lower_center_portrait
	}

	left_portrait = {
		character = scope:familiromance_feast_possible_lover
		animation = love
	}
	
	right_portrait = {
		character = root
		animation = happiness
	}
	
	cooldown = { years = 30 }
	
	trigger = {
		
		is_ai = no

		NOT = { has_character_flag = familyromance_got_artifact_during_feast }

		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}
	
	on_trigger_fail = {
		hidden_effect = {
			trigger_event = {
				id = feast_familyromance.1101
			}			
		}
	}


	immediate = {
		play_music_cue = "mx_cue_touching_moment"

		hidden_effect_new_object = {
			familyromance_generate_trinket_feast_effect = { OWNER = scope:familiromance_feast_possible_lover }			
			#if = {
			#	# Checks required for error suppression
			#	limit = { exists = scope:familyromance_romantic_trinket_feast }
			#	scope:familyromance_romantic_trinket_feast = {
			#		save_scope_as = familiromance_generated_artifact					
			#	}
			#}
		}
	}

	option = {
		# Take an artifact, thank you
		name = feast_familyromance.1100.a

		add_character_flag = {
			flag = familyromance_got_artifact_during_feast
			years = 30
		}
	}
	
	after = {
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
		
		if = {
			limit = { exists = scope:familyromance_romantic_trinket_feast }
			clear_saved_scope = familyromance_romantic_trinket_feast
		}
		
		add_character_flag = {
			flag = had_recent_family_relation_seduce_feast
			days = 30
		}
	}
}


# Your lover gives you a modifier instead
feast_familyromance.1101 = {
	type = activity_event
	title = feast_familyromance.1101.t
	desc = feast_familyromance.1101.desc
	theme = feast_activity
	override_background = {		
		reference = sitting_room
	}
	override_sound = { reference = "event:/SFX/Events/Themes/sfx_event_theme_type_love" }

	left_portrait = {
		character = scope:familiromance_feast_possible_lover
		animation = flirtation_left
	}
		
	right_portrait = {
		character = root
		animation = happiness
	}	
	
	trigger = {
		
		is_ai = no

		NOT = { has_character_flag = had_random_family_love_event }
		NOT = { has_character_flag = block_family_relation_seduce_attempts }
	}

	immediate = {		
		play_music_cue = "mx_cue_touching_moment"
	}

	option = {
		# Bonus to your skill or positive outcome
		name = feast_familyromance.1101.a

		random_list = {
			50 = {				
				send_interface_toast = {
					title = seduce_bold_start_modifier
					right_icon = root

					add_character_modifier = {
						modifier = seduce_bold_start_modifier
						days = 3650
					}

				}
			}
			
			20 = {
				send_interface_toast = {
						title = feast_familyromance.1101.add_intrigue
						right_icon = root
						
						add_intrigue_skill = 1
					}
			}

			20 = {
				send_interface_toast = {
						title = feast_familyromance.1101.add_martial
						right_icon = root
						
						add_martial_skill = 1
					}
			}
						
			20 = {				
				send_interface_toast = {
						title = seduce_gentle_start_modifier
						right_icon = root
						
						add_character_modifier = {
							modifier = seduce_gentle_start_modifier
							days = 3650
					    }
					}
			}
		}
	}
	
	after = {
		if = {
			limit = { exists = scope:familiromance_feast_possible_lover }
			clear_saved_scope = familiromance_feast_possible_lover
		}
		
		add_character_flag = {
			flag = had_recent_family_relation_seduce_feast
			days = 30
		}
	}

}