namespace = hshuajia
character_event = {
	id = hshuajia.100
	hide_window = yes # Nothing to see here
	is_triggered_only = yes # triggered by marriage on_action
	trigger = {
		OR = {
			FROM = {
				hs_hero_havehuajia_trigger = yes
			}
			new_character = {
				hs_hero_havehuajia_trigger = yes
			}
		}
	}
	immediate = {
		# We identify the bride and groom
		if = {
			limit = {
				FROM = { 
					hs_hero_havehuajia_trigger = yes
				} # The woman was a member of our court
			}
			FROM = {
				add_trait = hs_huajiatriggered
				hs_huajia_effect = yes
			}
		}
		if = {
			limit = {
				new_character = { 
					hs_hero_havehuajia_trigger = yes
				} # The woman was a member of our court
			}
			new_character = {
				add_trait = hs_huajiatriggered
				hs_huajia_effect = yes 
			}
		}
	}
}

character_event = { #横刀夺爱事件
	id = hshuajia.110
	hide_window = yes # Nothing to see here
	is_triggered_only = yes # triggered by marriage on_action
	trigger = {
		OR = {
			FROM = {#相关者减好感
				
				OR = {
					any_opinion_modifier_target = {
						hs_is_Netorareda_trigger = yes
						NOT = { character = new_character}
					}
					any_realm_character	= {
						hs_is_Netorareda_trigger = yes
						NOT = { character = new_character}
					}				
				}				
			}
			new_character = {
				
				OR = {
					any_opinion_modifier_target = {
						hs_is_Netorareda_trigger = yes
						NOT = { character = ROOT_FROM}
					}	
					any_realm_character	= {
						hs_is_Netorareda_trigger = yes
						NOT = { character = ROOT_FROM}
					}				
				}
			}
			FROM = {#执行者减好感
				is_ruler = no
				NOR = {
					is_lover = new_character
					has_opinion_modifier = {
						who = new_character
						modifier = opinion_hs_koikokoro
					}
				}
				any_opinion_modifier_target = {
					reverse_has_opinion_modifier = {
						who = ROOT_FROM
						modifier = opinion_hs_koikokoro
					}
					NOT = { character = new_character}
				}
				
			}
			new_character = {
				is_ruler = no
				NOR = {
					is_lover = FROM
					has_opinion_modifier = {
						who = FROM
						modifier = opinion_hs_koikokoro
					}
				}
				any_opinion_modifier_target = {
					reverse_has_opinion_modifier = {
						who = new_character
						modifier = opinion_hs_koikokoro
					}
					NOT = { character = ROOT_FROM}
				}
			}
		}
	}
	immediate = {
		# We identify the bride and groom
		if = {
			limit = {
				FROM = {
					OR = {
						any_opinion_modifier_target = {
							hs_is_Netorareda_trigger = yes
							NOT = { character = new_character}
						}	
						any_realm_character	= {
							hs_is_Netorareda_trigger = yes
							NOT = { character = new_character}
						}					
					}				
				}
			}
			FROM = {
				any_opinion_modifier_target = {
					limit = { 
						hs_is_Netorareda_trigger = yes 
						NOT = { character = new_character}
					}
					opinion = {
						who = ROOT
						modifier = opinion_hs_netorareda
					}
					if = {
						limit = {
							OR = {
								trait = envious
								trait = hs_trait_bingjiao
								trait = zealous
							}
						}
						opinion = {
							who = ROOT
							modifier = opinion_hs_netorareda
							years = 20
						}
					}
				}
				any_realm_character	= {
					limit = { 
						hs_is_Netorareda_trigger = yes
						NOT = { character = new_character}
						NOT = {
							has_opinion_modifier = {
								who = ROOT
								modifier = opinion_hs_netorareda
							}
						}
					}
					opinion = {
						who = ROOT
						modifier = opinion_hs_netorareda
					}
					if = {
						limit = {
							OR = {
								trait = envious
								trait = hs_trait_bingjiao
								trait = zealous
							}
						}
						opinion = {
							who = ROOT
							modifier = opinion_hs_netorareda
							years = 20
						}
					}
				}	
			}
		}
		if = {
			limit = {
				new_character = {
					OR = {
						any_opinion_modifier_target = {
							hs_is_Netorareda_trigger = yes
							NOT = { character = ROOT_FROM}
						}	
						any_realm_character	= {
							hs_is_Netorareda_trigger = yes
							NOT = { character = ROOT_FROM}
						}				
					}				
				}
			}
			new_character = {
				any_opinion_modifier_target = {
					limit = { 
						hs_is_Netorareda_trigger = yes
						NOT = { character = ROOT_FROM}
					}
					opinion = {
						who = ROOT
						modifier = opinion_hs_netorareda
					}
					if = {
						limit = {
							OR = {
								trait = envious
								trait = hs_trait_bingjiao
								trait = zealous
							}
						}
						opinion = {
							who = ROOT
							modifier = opinion_hs_netorareda
							years = 20
						}
					}
				}
				any_realm_character	= {
					limit = { 
						hs_is_Netorareda_trigger = yes
						NOT = { character = ROOT_FROM}
						NOT = {
							has_opinion_modifier = {
								who = ROOT
								modifier = opinion_hs_netorareda
							}
						}
					}
					opinion = {
						who = ROOT
						modifier = opinion_hs_netorareda
					}
					if = {
						limit = {
							OR = {
								trait = envious
								trait = hs_trait_bingjiao
								trait = zealous
							}
						}
						opinion = {
							who = ROOT
							modifier = opinion_hs_netorareda
							years = 20
						}
					}
				}	
			}
		}
		if = {
			limit = {
				FROM = {
					NOR = {
						is_lover = new_character
						has_opinion_modifier = {
							who = new_character
							modifier = opinion_hs_koikokoro
						}
					}
					is_ruler = no
					any_opinion_modifier_target = {
						reverse_has_opinion_modifier = {
							who = ROOT_FROM
							modifier = opinion_hs_koikokoro
						}
						NOT = { character = new_character}
					}			
				}
			}
			FROM = {
				opinion = {
					who = ROOT
					modifier = opinion_hs_netorareda
				}				
			}
		}
		if = {
			limit = {
				new_character = {
					NOR = {
						is_lover = ROOT_FROM
						has_opinion_modifier = {
							who = ROOT_FROM
							modifier = opinion_hs_koikokoro
						}
					}
					is_ruler = no
					any_opinion_modifier_target = {
						reverse_has_opinion_modifier = {
							who = new_character
							modifier = opinion_hs_koikokoro
						}
						NOT = { character = ROOT_FROM}
					}
				}
			}
			new_character = {
				opinion = {
					who = ROOT
					modifier = opinion_hs_netorareda
				}				
			}
		}

	}
}

character_event = { #成人之美
	id = hshuajia.120
	hide_window = yes # Nothing to see here
	is_triggered_only = yes # triggered by marriage on_action
	trigger = {
		OR = {
			FROM = {
				has_opinion_modifier = {
					who = new_character
					modifier = opinion_hs_koikokoro
				}							
			}
			new_character = {
				has_opinion_modifier = {
					who = FROM
					modifier = opinion_hs_koikokoro
				}							
			}
			FROM = {
				is_lover = new_character						
			}
			new_character = {
				is_lover = FROM						
			}
		}
	}
	immediate = {
		# We identify the bride and groom
		if = {
			limit = {
				FROM = {
					OR = {
						has_opinion_modifier = {
							who = new_character
							modifier = opinion_hs_koikokoro
						}		
						is_lover = new_character			
					}				
				}
			}
			FROM = {				
				opinion = {
					who = ROOT
					modifier = opinion_hs_bring_romance
				}
				remove_opinion = {
					who = ROOT
					modifier = opinion_hs_netorareda
				}
				
			}
		}
		if = {
			limit = {
				new_character = {
					OR = {
						has_opinion_modifier = {
							who = FROM
							modifier = opinion_hs_koikokoro
						}		
						is_lover = FROM			
					}				
				}
			}
			new_character = {				
				opinion = {
					who = ROOT
					modifier = opinion_hs_bring_romance
				}	
				remove_opinion = {
					who = ROOT
					modifier = opinion_hs_netorareda
				}				
			}
		}

	}
}