
######################################################################
# OUTCOME EFFECTS
######################################################################

fascinare_block_character_effect = {
	if = {
		limit = { root = scope:target }
		custom_tooltip = fascinare_outcome.permanent_block

		hidden_effect = {
			add_opinion = {
				target = $CHARACTER$
				modifier = fascinare_permanent_blocker_opinion
			}
		}
	}
	else = {
		add_opinion = {
			target = $CHARACTER$
			modifier = fascinare_permanent_blocker_opinion
		}
	}
}

fascinare_cooldown_for_character_effect = {
	if = {
		limit = { root = scope:target }
		custom_tooltip = seduce_outcome.cooldown

		hidden_effect = {
			add_opinion = {
				target = $CHARACTER$
				modifier = fascinare_regular_cooldown_opinion
			}
		}
	}
	else = {
		add_opinion = {
			target = $CHARACTER$
			modifier = fascinare_regular_cooldown_opinion
		}
	}
}

fascinare_outcome_publicised_attempted_crimes_or_nothing_effect = {
	$TARGET$ = {
		#Grab everyone relevant who might be interested in the attempt.
		every_close_family_member = { add_to_list = relevant_parties }
		every_consort = {
			limit = {
				NOT = { is_in_list = relevant_parties }
			}
			add_to_list = relevant_parties
		}
		if = {
			limit = {
				exists = liege
				liege = {
					NOT = { is_in_list = relevant_parties }
				}
			}
			add_to_list = relevant_parties
		}
		if = {
			limit = {
				exists = court_owner
				court_owner = {
					NOT = { is_in_list = relevant_parties }
				}
			}
			add_to_list = relevant_parties
		}
		every_vassal = {
			limit = {
				NOT = { is_in_list = relevant_parties }
			}
			add_to_list = relevant_parties
		}
		every_relation = {
			type = friend
			limit = {
				NOT = { is_in_list = relevant_parties }
			}
			add_to_list = relevant_parties
		}
		every_relation = {
			type = lover
			limit = {
				NOT = { is_in_list = relevant_parties }
			}
			add_to_list = relevant_parties
		}
		$OWNER$ = {
			every_close_family_member = {
				limit = {
					NOT = { is_in_list = relevant_parties }
				}
				add_to_list = relevant_parties
			}
		}
	}
}

fascinare_success_effect = {
	add_trait = mulsa
	set_character_faith = global_var:magister_character.faith
	hidden_effect = { # No take-backs.
		add_character_flag = {
			flag = converted_by_forced_conversion_interaction
			years = 10
		}
	}
	root = {
		change_variable = {
			name = regula_fascinare_tally
			add = 1
		}
	}
	if = {
		limit = { # Scope is the target  ### UPDATE - Add code restricting it to the magister.
			age >= 16
			is_male = no
			$CHARACTER$ = {
				has_trait = magister_trait_group
				faith = {
					controls_holy_site_with_flag = holy_site_regula_virus_flag
				}
			}
		}
		add_trait = regula_virus
		save_scope_as = regula_patient_zero

		global_var:magister_character = {
			create_story = story_regula_infecta_chain
			random_owned_story = {
				limit = {
					story_type = story_regula_infecta_chain
					NOT = { has_variable = patient_zero }
				}
				set_variable = {
					name = patient_zero 
					value = scope:regula_patient_zero
				}
				add_to_variable_list = {
					name = new_converts
					target = scope:regula_patient_zero
				}
			}
		}


		trigger_event = {
			id = regula_virus.1000
			days = { 15 60 }
		}
	}
}