
namespace = FemRule
#reserved: FemRule.200 to FemRule.299

#######################################
# INTEGRATION OF WOMEN INTO TOURNAMENTS
# Written by Rylock
#######################################

# Female character invited to the tourney
character_event = {
	id = FemRule.200 #formerly 1000182583
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_200
	picture = GFX_evt_tournament_gallery
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_200 #Of course, I MUST be there!
		ai_chance = { 
			factor = 75
			modifier = {
				factor = 0.1
				is_pregnant = yes
			}
			modifier = {
				factor = 1.25
				trait = slothful
			}
			modifier = {
				factor = 1.25
				trait = fair
			}
			modifier = {
				factor = 1.25
				trait = gregarious
			}
			modifier = {
				factor = 1.25
				trait = gluttonous
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = hedonist
					trait = poet
				}
			}
			modifier = {
				factor = 1.25
				NOT = { age = 30 }
			}
			modifier = {
				factor = 0.5
				NOT = { health = 3.1 }
			}
			modifier = {
				factor = 0.75
				age = 40
			}
			modifier = {
				factor = 0.5
				age = 50
			}
		}
		set_character_flag = spectating_tournament
		hidden_tooltip = {
			character_event = { id = 70999 days = 180 } # Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 150
				hidden = yes
			}
		}
		end_inaccessibility_effect = yes
	}
	
	option = {
		name = EVTOPTB_FemRule_200 #My faithful champion will represent me
		trigger = {
			OR = {
				any_vassal = {
					OR = {
						has_minor_title = title_ladys_champion
						has_minor_title = title_champion
					}
					prisoner = no
					NOT = { trait = incapable }
					NOT = { is_inaccessible_trigger = yes }
				}
				any_courtier = {
					OR = {
						has_minor_title = title_ladys_champion
						has_minor_title = title_champion
					}
					prisoner = no
					NOT = { trait = incapable }
					NOT = { is_inaccessible_trigger = yes }
				}
			}
		}
		ai_chance = { 
			factor = 100
			modifier = {
				factor = 0.1
				is_pregnant = yes
			}
			modifier = {
				factor = 0.5
				NOT = { health = 3.1 }
			}
			modifier = {
				factor = 1.25
				NOT = { martial = 12 }
			}
			modifier = {
				factor = 1.25
				NOT = { martial = 8 }
			}
			modifier = {
				factor = 1.25
				NOT = { martial = 5 }
			}
			modifier = {
				factor = 2
				primary_title = { tier = DUKE }
			}
			modifier = {
				factor = 4
				primary_title = { tier = KING }
			}
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 0.5
				trait = content
			}
			modifier = { # women warriors should consider participating themselves
				factor = 0.5
				martial = 12
				OR = {
					trait = martial_lady_pagan
					trait = martial_lady
					trait = martial_lady_tengri
				}
			}
		}
		prestige = 25
		set_character_flag = spectating_tournament
		hidden_tooltip = {
			character_event = { id = 70999 days = 180 } # Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 150
				hidden = yes
			}
			any_vassal = {
				limit = {
					OR = {
						has_minor_title = title_ladys_champion
						has_minor_title = title_champion
					}
					prisoner = no
					NOT = { trait = incapable }
					NOT = { is_inaccessible_trigger = yes }
				}
				letter_event = { id = FemRule.201 days = 1 }
			}
			any_courtier = {
				limit = {
					OR = {
						has_minor_title = title_ladys_champion
						has_minor_title = title_champion
					}
					prisoner = no
					NOT = { trait = incapable }
					NOT = { is_inaccessible_trigger = yes }
				}
				letter_event = { id = FemRule.201 days = 1 }
			}
		}
		end_inaccessibility_effect = yes
	}
	
	option = {
		name = EVTOPTC_FemRule_200 #Watch? I will show them my mettle!
		trigger = {
			NOT = { religion_group = muslim }
			OR = {
				trait = martial_lady_pagan
				trait = martial_lady
				trait = martial_lady_tengri
			}
		}
		ai_chance = {
			factor = 20
			modifier = {
				factor = 0
				is_pregnant = yes
			}
			modifier = {
				factor = 0
				NOT = { health = 3.1 }
			}
			modifier = {
				factor = 0.1
				NOT = { trait = brave }
			}
			modifier = {
				factor = 0
				OR = {
					trait = craven
					trait = humble
					trait = content
					is_weak_trigger = yes
					NOT = { martial = 8 }
					age = 40
				}
			}
			modifier = {
				factor = 0.5
				NOT = { martial = 12 }
			}
			modifier = {
				factor = 2
				martial = 15
			}
			modifier = {
				factor = 2
				martial = 20
			}
			modifier = {
				factor = 2
				martial = 25 # only JoA should have this much
			}
			modifier = {
				factor = 1.25
				is_strong_trigger = yes
			}
			modifier = {
				factor = 1.25
				trait = ambitious
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = skilled_tactician
					trait = brilliant_strategist
				}
			}
		}
		prestige = 100
		IF = {
			limit = {
				OR = {
					religion_group = christian
					religion_group = jewish_group
				}
			}
			piety = -25
		}		
		set_character_flag = attending_tournament
		hidden_tooltip = {
			character_event = { id = 70999 days = 180 } # Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 150
				hidden = yes
			}
		}
		end_inaccessibility_effect = yes
	}
	
	option = {
		name = EVTOPTD_FemRule_200 #No, I will not attend
		ai_chance = { 
			factor = 50
			modifier = {
				factor = 10
				is_inaccessible_trigger = yes
			}
			modifier = {
				factor = 3
				is_pregnant = yes
			}
			modifier = {
				factor = 3
				health_traits = 1
			}
			modifier = {
				factor = 3
				OR = {
					trait = paranoid
					trait = depressed
				}
			}
			modifier = {
				factor = 2
				OR = {
					trait = ugly
					trait = shy
					trait = clubfooted
					trait = hunchback
					trait = dwarf
				}
			}
			modifier = {
				factor = 0.5
				trait = gregarious
			}
		}
		prestige = -10
	}
}

### LADY'S CHAMPION EVENTS

# Champion informed they must come
letter_event = {
	id = FemRule.201
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_201

	is_triggered_only = yes

	option = {
		name = EVTOPTA_FemRule_201
		prestige = 50
		set_character_flag = attending_tournament
		set_character_flag = championing_liege_lady
		hidden_tooltip = {
			remove_do_not_disturb_effect = yes
			character_event = { id = 70999 days = 180 } # Safety catch flag clearing
			add_character_modifier = {
				name = do_not_disturb
				days = 150
				hidden = yes
			}
		}
	}
}

# Champion killed
character_event = {
	id = FemRule.202 #formerly 1000182585
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_202
	picture = GFX_evt_death

	is_triggered_only = yes

	option = {
		name = SHEDATEAR
		prestige = -50
	}
}

# Champion maimed
character_event = {
	id = FemRule.203 #formerly 1000182586
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_203	
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = SHEDATEAR
		prestige = -25
	}
}

# Champion injured
character_event = {
	id = FemRule.204 #formerly 1000182587
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_204
	picture = GFX_evt_melee

	is_triggered_only = yes

	option = {
		name = SHEDATEAR
		prestige = -25
	}
}

# Champion victorious
character_event = {
	id = FemRule.205 #formerly 1000182588
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_205	
	picture = GFX_evt_joust

	is_triggered_only = yes

	option = {
		trigger = {
			scaled_wealth = 0.2
		}
		name = EVTOPTA_FemRule_205
		prestige = 150
		scaled_wealth = -0.2
		opinion = { who = FROM modifier = opinion_tournament_winner years = 20 }
		FROM = { opinion = { who = ROOT modifier = opinion_impressed years = 20 } }
	}
	
	option = {
		name = EVTOPTB_FemRule_205
		prestige = 75
		opinion = { who = FROM modifier = opinion_tournament_winner years = 20 }
		FROM = { opinion = { who = ROOT modifier = opinion_upset years = 20 } }
	}
}

# Champion runner-up
character_event = {
	id = FemRule.206 #formerly 1000182589
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_206
	picture = GFX_evt_joust

	is_triggered_only = yes

	option = {
		name = EVTOPTA_FemRule_205
		trigger = {
			scaled_wealth = 0.15
		}
		prestige = 125
		scaled_wealth = -0.15
		opinion = { who = FROM modifier = opinion_tournament_second_place years = 15 } 
		FROM = { opinion = { who = ROOT modifier = opinion_impressed years = 15 } }
	}
	
	option = {
		name = EVTOPTB_FemRule_205
		prestige = 65
		opinion = { who = FROM modifier = opinion_tournament_second_place years = 15 } 
		FROM = { opinion = { who = ROOT modifier = opinion_upset years = 15 } }
	}
}

# Champion third place
character_event = {
	id = FemRule.207 #formerly 1000182590
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_207	
	picture = GFX_evt_joust

	is_triggered_only = yes

	option = {
		name = EVTOPTA_FemRule_205
		trigger = {
			scaled_wealth = 0.10
		}
		prestige = 100
		scaled_wealth = -0.10
		opinion = { who = FROM modifier = opinion_tournament_third_place years = 10 }
		FROM = { opinion = { who = ROOT modifier = opinion_impressed years = 10 } }
	}
	
	option = {
		name = EVTOPTB_FemRule_205
		prestige = 50
		opinion = { who = FROM modifier = opinion_tournament_third_place years = 10 } 
		FROM = { opinion = { who = ROOT modifier = opinion_upset years = 10 } } 
	}
}

### EVENTS FOR WOMEN AT THE TOURNAMENT

# Lady becomes proud
character_event = {
	id = FemRule.210
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_210
	picture = GFX_evt_grazia

	is_triggered_only = yes

	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_pride
			has_character_flag = tournament_has_ended
			trait = proud
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_pride
	}
	
	option = {
		name = EVTOPTA_FemRule_210
		add_trait = proud
	}
}

# Lady becomes humble
character_event = {
	id = FemRule.211
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_211
	picture = GFX_evt_grazia

	is_triggered_only = yes
	
	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_pride
			has_character_flag = tournament_has_ended
			trait = humble
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_pride
	}
	
	option = {
		name = EVTOPTA_FemRule_211
		add_trait = humble
	}
}

# Lady becomes gregarious
character_event = {
	id = FemRule.212
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_212
	picture = GFX_evt_grazia

	is_triggered_only = yes
	
	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_shyness
			has_character_flag = tournament_has_ended
			trait = gregarious
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_shyness
	}
	
	option = {
		name = OK
		add_trait = gregarious
	}
}

# Lady becomes shy
character_event = {
	id = FemRule.213
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_213
	picture = GFX_evt_grazia
	
	is_triggered_only = yes
	
	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_shyness
			has_character_flag = tournament_has_ended
			trait = shy
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_shyness
	}
	
	option = {
		name = EVTOPTA_FemRule_213
		add_trait = shy
	}
}

# Lady becomes honest
character_event = {
	id = FemRule.214
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_214	
	picture = GFX_evt_grazia
	
	is_triggered_only = yes

	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_honesty
			has_character_flag = tournament_has_ended
			trait = honest
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_honesty
	}
	
	option = {
		name = EVTOPTA_FemRule_214
		add_trait = honest
		
	}
}

# Lady becomes deceitful
character_event = {
	id = FemRule.215
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_215
	picture = GFX_evt_grazia

	is_triggered_only = yes

	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_honesty
			has_character_flag = tournament_has_ended
			trait = deceitful
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_honesty
	}
	
	option = {
		name = EVTOPTA_FemRule_215
		add_trait = deceitful
		
	}
}

# Lady becomes lustful
character_event = {
	id = FemRule.216
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_216
	picture = GFX_evt_courtly_love

	is_triggered_only = yes

	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_lust
			has_character_flag = tournament_has_ended
			trait = lustful
			trait = celibate
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_lust
	}
	
	option = {
		name = EVTOPTA_FemRule_216
		add_trait = lustful
	}
}

# Lady becomes chaste
character_event = {
	id = FemRule.217
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_217	
	picture = GFX_evt_courtly_love

	is_triggered_only = yes

	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_character_flag = lady_lust
			has_character_flag = tournament_has_ended
			trait = chaste
			trait = hedonist
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
		}
	}
	
	immediate = {
		set_character_flag = lady_lust
	}
	
	option = {
		name = EVTOPTA_FemRule_217
		add_trait = chaste
	}
}

# Men react poorly to lady contestant
character_event = {
	id = FemRule.218
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_218	
	picture = GFX_evt_girl_with_sword

	is_triggered_only = yes
	
	min_age = 16
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = attending_tournament

	trigger = {
		NOR = {
			has_character_flag = attending_tournament_sexism
			has_character_flag = tournament_has_ended
		}
		top_liege = {
			has_character_flag = tournament_begins
			NOT = { has_character_flag = tournament_has_ended }
			NOT = { religion_group = muslim }
		}
	}
	
	immediate = {
		set_character_flag = attending_tournament_sexism
	}
	
	option = {
		name = EVTOPTA_FemRule_218 #RAGE
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.5
				trait = patient
			}
			modifier = {
				factor = 0.5
				trait = slothful
			}
			modifier = {
				factor = 0.5
				trait = humble
			}
			modifier = {
				factor = 1.5
				trait = wroth
			}
			modifier = {
				factor = 1.5
				trait = diligent
			}
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 1.5
				trait = honest
			}
		}
		piety = -25
		add_trait = wroth
		if = {
			limit = {
				NOR = {
					trait = diligent
					trait = slothful
				}
			}
			random = {
				chance = 30
				add_trait = diligent
			}
		}
		if = {
			limit = {
				NOR = {
					trait = proud
					trait = humble
				}
			}
			random = {
				chance = 50
				add_trait = proud
			}
		}
	}
	option = {
		name = EVTOPTB_FemRule_218 #zen
		ai_chance = {
			factor = 50
			modifier = {
				factor = 0.5
				trait = proud
			}
			modifier = {
				factor = 0.5
				trait = wroth
			}
			modifier = {
				factor = 0.5
				trait = diligent
			}
			modifier = {
				factor = 1.5
				trait = patient
			}
			modifier = {
				factor = 1.5
				trait = slothful
			}
			modifier = {
				factor = 1.5
				trait = humble
			}
			modifier = {
				factor = 1.5
				trait = craven
			}
		}
		prestige = -50
		add_trait = patient
		if = {
			limit = {
				NOR = {
					trait = diligent
					trait = slothful
				}
			}
			random = {
				chance = 30
				add_trait = slothful
			}
		}
		if = {
			limit = {
				NOR = {
					trait = humble
					trait = proud
				}
			}
			random = {
				chance = 50
				add_trait = humble
			}
		}
	}
}

### BEAUTY CONTEST EVENTS

# Character wins beauty pageant
character_event = {
	id = FemRule.220
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_220
	picture = GFX_evt_grazia

	min_age = 16
	max_age = 30
	only_women = yes
	capable_only = yes
	prisoner = no
	has_character_flag = spectating_tournament

	trigger = {
		NOR = {
			has_unattractive_trait_trigger = yes			
			religion_group = muslim
			has_character_flag = tournament_has_ended
		}
		top_liege = {
			had_character_flag = { flag = tournament_begins days = 50 }
			NOR = {
				religion_group = muslim
				has_character_flag = beauty_winner
				has_character_flag = tournament_has_ended
			}
		}
	}

	mean_time_to_happen = {
		months = 10
		modifier = {
			factor = 0.5
			top_liege = {
				had_character_flag = { flag = tournament_begins days = 60 }
			}
		}
		modifier = {
			factor = 0.5
			top_liege = {
				had_character_flag = { flag = tournament_begins days = 70 }
			}
		}
		modifier = {
			factor = 0.5
			top_liege = {
				had_character_flag = { flag = tournament_begins days = 80 }
			}
		}
		modifier = {
			factor = 0.5
			top_liege = {
				had_character_flag = { flag = tournament_begins days = 90 }
			}
		}
		modifier = {
			factor = 0.5
			top_liege = {
				had_character_flag = { flag = tournament_begins days = 100 }
			}
		}
		modifier = {
			factor = 0.1
			trait = fair
		}
		modifier = {
			factor = 0.25
			trait = beauty
		}
		modifier = {
			factor = 2.0
			NOT = { trait = fair }
		}
		modifier = {
			factor = 0.75
			OR = {
				trait = lustful
				trait = hedonist
				trait = poet
			}
		}
		modifier = {
			factor = 0.75
			trait = tall
		}
		modifier = {
			factor = 0.75
			trait = temperate
		}
		modifier = {
			factor = 0.75
			trait = gregarious
		}
		modifier = {
			factor = 0.75
			trait = ambitious
		}
		modifier = {
			factor = 5.0
			OR = {
				trait = gluttonous
				trait = imbecile
				trait = inbred
				trait = blinded
			}
		}
		modifier = {
			factor = 1.25
			trait = shy
		}
		modifier = {
			factor = 1.25
			trait = content
		}
		modifier = {
			factor = 0.9
			diplomacy = 12
		}
		modifier = {
			factor = 0.9
			diplomacy = 14
		}
		modifier = {
			factor = 0.9
			diplomacy = 16
		}
		modifier = {
			factor = 0.9
			diplomacy = 18
		}
		modifier = {
			factor = 0.9
			diplomacy = 20
		}
		modifier = {
			factor = 0.9
			intrigue = 12
		}
		modifier = {
			factor = 0.9
			intrigue = 14
		}
		modifier = {
			factor = 0.9
			intrigue = 16
		}
		modifier = {
			factor = 0.9
			intrigue = 18
		}
		modifier = {
			factor = 0.9
			intrigue = 20
		}
		modifier = {
			factor = 0.5
			is_ruler = yes
		}
	}

	immediate = {
		top_liege = { set_character_flag = beauty_winner }
	}

	option = {
		name = EXCELLENT
		prestige = 300
		add_trait = beauty
		hidden_tooltip = {
			top_liege = {
				any_realm_character = {
					limit = {
						is_female = yes
						has_character_flag = spectating_tournament
						NOT = { character = ROOT }
					}
					character_event = { id = FemRule.221 days = 1 }
				}
			}
			hidden_tooltip = {
				if = {
					limit = {
						top_liege = {
							NOT = { character = ROOT }
						}
					}
					top_liege = { character_event = { id = FemRule.222 } }
				}
			}
		}
	}
}

# Other women attending the tournament become jealous of the winner
character_event = {
	id = FemRule.221
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_221	
	picture = GFX_evt_grazia

	is_triggered_only = yes

	option = {
		name = EVTOPTA_FemRule_221 #How dare they!
		trigger = {
			NOR = {
				has_unattractive_trait_trigger = yes
				religion_group = muslim
			}
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 3
				trait = envious
			}
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.5
				trait = wroth
			}
			modifier = {
				factor = 0.5
				trait = shy
			}
			modifier = {
				factor = 0.5
				trait = content
			}
		}
		if = {
			limit = { trait = kind }
			random = {
				chance = 20
				remove_trait = kind
			}
		}
		if = {
			limit = { NOT = { trait = kind } }
			random = {
				chance = 20
				add_trait = envious
			}
		}
		piety = -10
		opinion = { who = FROM modifier = jealous years = 5 } 
	}
	option = {
		name = EVTOPTC_FemRule_221 #They would never pick me.
		trigger = {
			OR = {
				has_unattractive_trait_trigger = yes
			}
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 3
				trait = envious
			}
			modifier = {
				factor = 1.5
				trait = proud
			}
			modifier = {
				factor = 1.5
				trait = ambitious
			}
			modifier = {
				factor = 1.5
				trait = wroth
			}
		}
		if = {
			limit = { trait = kind }
			random = {
				chance = 20
				remove_trait = kind
			}
		}
		if = {
			limit = { NOT = { trait = kind } }
			random = {
				chance = 20
				add_trait = envious
			}
		}
		piety = -10
		opinion = { who = FROM modifier = jealous years = 5 } 
	}
	option = {
		name = EVTOPTB_FemRule_221 #She deserves it
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.5
				trait = kind
			}
			modifier = {
				factor = 3
				trait = humble
			}
			modifier = {
				factor = 1.5
				trait = content
			}
			modifier = {
				factor = 1.5
				trait = patient
			}
		}
		if = {
			limit = { trait = proud }
			random = {
				chance = 20
				remove_trait = proud
			}
		}
		if = {
			limit = { NOT = { trait = proud } }
			random = {
				chance = 20
				add_trait = humble
			}
		}
		prestige = -25
		opinion = { who = FROM modifier = opinion_impressed years = 5 } 
	}
}

# Notify liege of the beauty contest winner
character_event = {
	id = FemRule.222
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_222	
	picture = GFX_evt_grazia

	is_triggered_only = yes

	option = {
		name = OK
		if = {
			limit = {
				OR = {
					has_character_flag = beauty_winner
					religion_group = muslim
				}
				has_character_flag = winner
				has_character_flag = second_place 
				has_character_flag = third_place
			}
			character_event = { id = 70002 days = 5 }
		}
	}
}

### TOURNAMENT ROMANCE EVENTS

# Male knight is at the tournament and available
character_event = {
	id = FemRule.225

	hide_window = yes
	
	#only_men = yes
	min_age = 16
	max_age = 50
	only_capable = yes
	prisoner = no
	is_triggered_only = yes
	has_character_flag = attending_tournament
	
	trigger = {
		NOT = { has_character_flag = tournament_romance }
	}
	
	immediate = {
		if = {
			limit = {
				NOT = { trait = homosexual }
			}
			set_character_flag = tournament_romance
			top_liege = {
				random_realm_character = {
					limit = {
						is_opposite_sex = ROOT
						is_adult = yes
						has_lover = no
						is_consort = no
						is_pregnant = no
						is_ill = no
						OR = {
							has_character_flag = spectating_tournament
							has_character_flag = attending_tournament 
						}
						NOR = {
							age = 40
							trait = celibate
							has_unattractive_trait_trigger = yes
							trait = imbecile							
							trait = infirm
							trait = homosexual
							is_close_relative = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							any_spouse = { character = ROOT }
							has_character_flag = tournament_romance 
						}					
					}
					if = {
						limit = { is_female = yes }
						character_event = { id = FemRule.226 days = 1 random = 3 }
					}
					if = {
						limit = { is_female = no }
						character_event = { id = FemRule.227 days = 1 random = 3 }
					}
				}
			}
		}
		if = {
			limit = {
				trait = homosexual
			}
			set_character_flag = tournament_romance
			top_liege = {
				random_realm_character = {
					limit = {
						same_sex = ROOT
						NOT = { character = ROOT }
						is_adult = yes
						has_lover = no
						is_ill = no
						trait = homosexual
						OR = {
							has_character_flag = spectating_tournament 
							has_character_flag = attending_tournament 
						}
						NOR = {
							age = 40
							trait = celibate
							has_unattractive_trait_trigger = yes
							trait = imbecile							
							trait = infirm
							is_close_relative = ROOT
							is_former_lover = ROOT
							is_rival = ROOT
							has_character_flag = tournament_romance 
						}					
					}
					character_event = { id = FemRule.226 days = 1 random = 3 }
				}
			}
		}
	}
}

# A knight catches your eye
character_event = {
	id = FemRule.226
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_226	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_226 #Send him a signal
		ai_chance = {
			factor = 60
			modifier = {
				factor = 5
				trait = hedonist
			}
			modifier = {
				factor = 3
				has_ambition = obj_find_lover
			}
			modifier = {
				factor = 3
				trait = lustful
			}
			modifier = {
				factor = 3
				FROM = { trait = fair }
			}
			modifier = {
				factor = 2
				FROM = { is_smart_trigger = yes }
			}
			modifier = {
				factor = 2
				FROM = {
					is_female = no
					is_strong_trigger = yes
				}
			}
			modifier = {
				factor = 1.5
				FROM = { trait = gregarious }
			}
			modifier = {
				factor = 2
				trait = trusting
			}
			modifier = {
				factor = 2
				trait = ambitious
				liege = { character = FROM }
			}
			modifier = {
				factor = 1.5
				is_married = yes
				spouse = { has_lover = yes }
			}			
			modifier = {
				factor = 1.5
				trait = poet
			}
			modifier = {
				factor = 1.5
				FROM = { trait = poet }
			}
			modifier = {
				factor = 1.5
				FROM = { trait = tall }
			}
			modifier = {
				factor = 1.25
				trait = brave
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.25
				trait = chaste
			}
			modifier = {
				factor = 0.75
				FROM = { is_married = yes }
			}
			modifier = {
				factor = 0.8
				trait = shy
			}
			modifier = {
				factor = 0.8
				trait = craven
			}
			modifier = {
				factor = 0.8
				trait = temperate
			}
			modifier = {
				factor = 0.8
				trait = patient
			}
			modifier = {
				factor = 0.8
				trait = paranoid
			}
			modifier = {
				factor = 0.8
				FROM = {
					OR = {
						trait = slow
						trait = dull
					}
				}
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -40 } }
			}
		}
		set_character_flag = tournament_romance
		FROM = {
			character_event = { id = FemRule.227 days = 1 random = 3 }
		}
	}
	option = {
		name = EVTOPTB_FemRule_226 #Do nothing
		ai_chance = {
			factor = 40
			modifier = {
				factor = 2
				is_married = yes
				NOT = {
					trait = lustful
					trait = hedonist
				}
			}
			modifier = {
				factor = 0
				has_ambition = obj_find_lover
			}
		}
		FROM = {
			character_event = { id = FemRule.228 }
		}	
	}
}

# A lord/lady beckons to you
character_event = {
	id = FemRule.227
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_227
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_227 #Respond favourably
		ai_chance = {
			factor = 80
			modifier = {
				factor = 5
				trait = hedonist
			}
			modifier = {
				factor = 3
				has_ambition = obj_find_lover
			}
			modifier = {
				factor = 3
				trait = lustful
			}
			modifier = {
				factor = 3
				FROM = { trait = fair }
			}
			modifier = {
				factor = 2
				FROM = { is_smart_trigger = yes }
			}
			modifier = {
				factor = 2
				FROM = {
					is_female = no
					is_strong_trigger = yes
				}
			}
			modifier = {
				factor = 2
				trait = homosexual
			}
			modifier = {
				factor = 1.5
				FROM = { trait = gregarious }
			}
			modifier = {
				factor = 2
				trait = trusting
			}
			modifier = {
				factor = 2
				trait = ambitious
				liege = { character = FROM }
			}
			modifier = {
				factor = 1.5
				is_married = yes
				spouse = { has_lover = yes }
			}			
			modifier = {
				factor = 1.5
				trait = poet
			}
			modifier = {
				factor = 1.5
				FROM = { trait = poet }
			}
			modifier = {
				factor = 1.5
				FROM = { trait = tall }
			}
			modifier = {
				factor = 1.25
				trait = brave
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.25
				trait = chaste
			}
			modifier = {
				factor = 0.75
				FROM = { is_married = yes }
			}
			modifier = {
				factor = 0.8
				trait = shy
			}
			modifier = {
				factor = 0.8
				trait = craven
			}
			modifier = {
				factor = 0.8
				trait = temperate
			}
			modifier = {
				factor = 0.8
				trait = patient
			}
			modifier = {
				factor = 0.8
				trait = paranoid
			}
			modifier = {
				factor = 0.8
				FROM = {
					OR = {
						trait = slow
						trait = dull
					}
				}
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -40 } }
			}
		}
		if = {
			limit = { is_female = no }
			FROM = {
				character_event = { id = FemRule.235 days = 1 random = 3 }
			}
		}
		if = {
			limit = { is_female = yes }
			FROM = {
				character_event = { id = FemRule.229 days = 1 random = 3 }
			}
		}
	}
	option = {
		name = EVTOPTB_FemRule_226 #Rebuff him/her
		ai_chance = {
			factor = 20
			modifier = {
				factor = 2
				is_married = yes
				NOR = {
					trait = lustful
					trait = hedonist
				}
			}
			modifier = {
				factor = 0
				has_ambition = obj_find_lover
			}
		}
		FROM = {
			character_event = { id = FemRule.230 }
		}	
		clr_character_flag = tournament_romance
	}
}

# Clear flag from rejected knight
character_event = {
	id = FemRule.228
	
	is_triggered_only = yes
	hide_window = yes
	
	immediate = {
		clr_character_flag = tournament_romance
	}
}

# The knight comes to you
character_event = {
	id = FemRule.229
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_229	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_229 #Offer him your favour for the jousting
		ai_chance = {
			factor = 40
			modifier = {
				factor = 1.25
				trait = brave
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = martial_lady_pagan
					trait = martial_lady
					trait = martial_lady_tengri
				}
			}
			modifier = {
				factor = 1.25
				religion = catholic
			}
			modifier = {
				factor = 1.25
				trait = honest
			}
			modifier = {
				factor = 1.25
				trait = slothful
			}
			modifier = {
				factor = 1.25
				trait = shy
			}
		}
		FROM = { character_event = { id = FemRule.231 } }
	}
	option = {
		name = EVTOPTB_FemRule_229 #Mention your love of minstrels
		ai_chance = {
			factor = 25
			modifier = {
				factor = 1.25
				trait = poet
			}
			modifier = {
				factor = 1.25
				trait = hedonist
			}
			modifier = {
				factor = 1.25
				culture = occitan
			}
			modifier = {
				factor = 1.25
				trait = gregarious
			}
			modifier = {
				factor = 1.25
				trait = fair
			}
		}
		FROM = { character_event = { id = FemRule.232 } }
	}
	option = {
		name = EVTOPTC_FemRule_229 #Ask him to show you how to shoot the bow
		ai_chance = {
			factor = 25
			modifier = {
				factor = 1.25
				is_strong_trigger = yes
			}
			modifier = {
				factor = 1.25
				trait = tall
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = martial_lady_pagan
					trait = martial_lady
					trait = martial_lady_tengri
				}
			}
			modifier = {
				factor = 1.25
				trait = diligent
			}
			modifier = {
				factor = 1.25
				trait = hunter
			}
		}
		FROM = { character_event = { id = FemRule.233 } }
	}
	option = {
		name = EVTOPTD_FemRule_229 #Reject him
		ai_chance = {
			factor = 10
			modifier = {
				factor = 1.25
				trait = cruel
			}
			modifier = {
				factor = 1.25
				trait = impaler
			}
			modifier = {
				factor = 1.25
				trait = arbitrary
			}
			modifier = {
				factor = 1.25
				trait = paranoid
			}
			modifier = {
				factor = 1.25
				trait = zealous
			}
			modifier = {
				factor = 1.25
				trait = chaste
			}
		}
		FROM = { character_event = { id = FemRule.234 } }
		FROM = { opinion = { who = ROOT modifier = insulted } }
		clr_character_flag = tournament_romance
	}
}

# The knight snubs you
character_event = {
	id = FemRule.230
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_230	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_230 #Oh no!
		prestige = -25
		opinion = { who = FROM modifier = insulted }
		clr_character_flag = tournament_romance
	}
}

# Jousting for your lady--pure martial 'date'
character_event = {
	id = FemRule.231
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_231	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_231 #Joust successfully
		trigger = {
			OR = {
				AND = {
					martial = 7
					OR = {	
						is_strong_trigger = yes
						trait = tough_soldier
						trait = fair
					}
				}
				AND = {
					martial = 9
					OR = {
						trait = tall
						trait = misguided_warrior
						trait = duelist
						trait = brave
					}
				}
				AND = {
					martial = 11
					OR = {
						trait = skilled_tactician
						trait = brilliant_strategist
					}
				}
				martial = 12
			}
		}
		prestige = 50
		FROM = { character_event = { id = FemRule.235 } }
		FROM = { opinion = { who = ROOT modifier = opinion_impressed years = 1 } }
	}
	option = {
		name = EVTOPTB_FemRule_231 #Joust unsuccessfully
		trigger = {
			NOT = {
				OR = {
					AND = {
						martial = 7
						OR = {	
							is_strong_trigger = yes
							trait = tough_soldier
							trait = fair
						}
					}
					AND = {
						martial = 9
						OR = {
							trait = tall
							trait = misguided_warrior
							trait = duelist
							trait = brave
						}
					}
					AND = {
						martial = 11
						OR = {
							trait = skilled_tactician
							trait = brilliant_strategist
						}
					}
					martial = 12
				}
			}
		}
		prestige = -25
		FROM = { character_event = { id = FemRule.236 } }
		FROM = { opinion = { who = ROOT modifier = opinion_disappointed years = 1 } }
	}
}

# The minstrel's show--diplomacy 'date'
character_event = {
	id = FemRule.232
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_232	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_232 # Improvise a love song
		trigger = {
			OR = {
				AND = {
					diplomacy = 5
					OR = {
						trait = poet
						trait = genius
						trait = grey_eminence
					}
				}
				AND = {
					diplomacy = 7
					OR = {
						trait = quick
						trait = shrewd
						trait = charismatic_negotiator
						trait = scholar
						trait = trusting
						trait = detached_priest
					}
				}
				AND = {
					diplomacy = 9
					OR = {
						trait = underhanded_rogue
						trait = brilliant_strategist
						trait = mastermind_theologian
						trait = elusive_shadow
						trait = midas_touched
						trait = deceitful
						trait = gregarious
					}
				}
				diplomacy = 12
			}
		}
		prestige = 50
		FROM = { character_event = { id = FemRule.235 } }
		FROM = { opinion = { who = ROOT modifier = opinion_impressed years = 1 } }
	}
	option = {
		name = EVTOPTB_FemRule_232 #Embarass yourself dancing
		trigger = {
			NOT = {
				OR = {
					AND = {
						diplomacy = 5
						OR = {
							trait = poet
							trait = genius
							trait = grey_eminence
						}
					}
					AND = {
						diplomacy = 7
						OR = {
							trait = quick
							trait = shrewd
							trait = charismatic_negotiator
							trait = scholar
							trait = trusting
							trait = detached_priest
						}
					}
					AND = {
						diplomacy = 9
						OR = {
							trait = underhanded_rogue
							trait = brilliant_strategist
							trait = mastermind_theologian
							trait = elusive_shadow
							trait = midas_touched
							trait = deceitful
							trait = gregarious
						}
					}
					diplomacy = 12
				}
			}
		}
		prestige = -25
		FROM = { character_event = { id = FemRule.236 } }
		FROM = { opinion = { who = ROOT modifier = opinion_disappointed years = 1 } }
	}
}

# The archery range--intrigue/martial 'date'
character_event = {
	id = FemRule.233
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_233	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_233 # Show her a bullseye, then split her arrow
		trigger = {
			OR = {
				AND = {
					trait = hunter
					martial = 4
					intrigue = 4
				}
				AND = {
					is_strong_trigger = yes
					martial = 5
					intrigue = 5
				}
				AND = {
					martial = 6
					intrigue = 6
					OR = {
						trait = patient
						trait = diligent
					}
				}
				AND = {
					martial = 7
					intrigue = 7
					OR = {
						trait = cynical
						trait = kind
					}
				}
				AND = {
					martial = 8
					intrigue = 8
				}
			}
		}
		prestige = 25
		FROM = {
			IF = {
				limit = { NOT = { lifestyle_traits = 1 } }
				random = {
					chance = 33
					add_trait = hunter
				}
			}	
		}	
		FROM = { character_event = { id = FemRule.235 } }
		FROM = { opinion = { who = ROOT modifier = opinion_impressed years = 2 } }
	}
	option = {
		name = EVTOPTB_FemRule_233 #Embarass yourself
		trigger = {
			NOT = {
				OR = {
					AND = {
						trait = hunter
						martial = 4
						intrigue = 4
					}
					AND = {
						is_strong_trigger = yes
						martial = 5
						intrigue = 5
					}
					AND = {
						martial = 6
						intrigue = 6
						OR = {
							trait = patient
							trait = diligent
						}
					}
					AND = {
						martial = 7
						intrigue = 7
						OR = {
							trait = cynical
							trait = kind
						}
					}
					AND = {
						martial = 8
						intrigue = 8
					}
				}
			}
		}
		prestige = -25
		FROM = { character_event = { id = FemRule.236 } }
		FROM = { opinion = { who = ROOT modifier = opinion_disappointed years = 1 } }
	}
}	

# The lady snubs you
character_event = {
	id = FemRule.234
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_234
	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_234 #Oh no!
		prestige = -50
		clr_character_flag = tournament_romance
	}
}

# Successful 'date'
character_event = {
	id = FemRule.235
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_235	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_235 # Continue the romance
		trigger = {
			is_female = yes
		}
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.25
				trait = patient
			}
			modifier = {
				factor = 1.25
				trait = scholar
			}
			modifier = {
				factor = 1.25
				trait = shy
			}
			modifier = {
				factor = 1.25
				trait = just
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = mastermind_theologian
					trait = scholarly_theologian
					trait = martial_cleric
				}
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = grey_eminence
					trait = charismatic_negotiator
				}
			}
			modifier = {
				factor = 1.25
				is_smart_trigger = yes
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.75
				trait = lustful
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
		}
		prestige = 25
		FROM = { character_event = { id = FemRule.239 days = 1 random = 2 } }
	}
	option = {
		name = EVTOPTB_FemRule_235 # Leave the bedroom door ajar....
		trigger = {
			NOT = { trait = chaste }
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 4
				is_female = no
				trait = homosexual
			}
			modifier = {
				factor = 2
				trait = hedonist
			}
			modifier = {
				factor = 2
				trait = lustful
			}
			modifier = {
				factor = 1.25
				trait = wroth
			}
			modifier = {
				factor = 1.25
				trait = gluttonous
			}
			modifier = {
				factor = 1.25
				trait = arbitrary
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = elusive_shadow
					trait = intricate_webweaver
					trait = flamboyant_schemer
					trait = amateurish_plotter
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					trait = fair
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					is_strong_trigger = yes
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					trait = tall
				}
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 20 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
		}
		prestige = 25
		FROM = { character_event = { id = FemRule.238 days = 1 random = 2 } }
	}
	option = {
		name = EVTOPTB_FemRule_226 # He's not right for me
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				is_married = yes
			}
			modifier = {
				factor = 1.25
				trait = slothful
			}
			modifier = {
				factor = 1.25
				trait = cynical
			}
			modifier = {
				factor = 1.25
				trait = zealous
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = brilliant_strategist
					trait = skilled_tactician
					trait = tough_soldier
					trait = misguided_warrior
				}
			}
			modifier = {
				factor = 1.25
				is_smart_trigger = yes
			}
			modifier = {
				factor = 0.5
				trait = lustful
			}
			modifier = {
				factor = 0.5
				trait = hedonist
			}
		}
		prestige = 10
		FROM = { character_event = { id = FemRule.237 days = 1 random = 2 } }
	}
}

# Failed 'date'
character_event = {
	id = FemRule.236
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_236
	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_236 # He's not right for me
		ai_chance = {
			factor = 50
			modifier = {
				factor = 1.25
				trait = slothful
			}
			modifier = {
				factor = 1.25
				trait = cynical
			}
			modifier = {
				factor = 1.25
				trait = zealous
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = brilliant_strategist
					trait = skilled_tactician
					trait = tough_soldier
					trait = misguided_warrior
				}
			}
			modifier = {
				factor = 1.25
				is_smart_trigger = yes
			}
			modifier = {
				factor = 0.5
				trait = lustful
			}
		}
		prestige = -10
		FROM = { character_event = { id = FemRule.237 days = 1 random = 2 } }
	}
	option = {
		name = EVTOPTB_FemRule_236 # Continue the romance
		ai_chance = {
			factor = 25
			modifier = {
				factor = 1.25
				trait = patient
			}
			modifier = {
				factor = 1.25
				trait = scholar
			}
			modifier = {
				factor = 1.25
				trait = shy
			}
			modifier = {
				factor = 1.25
				trait = just
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = mastermind_theologian
					trait = scholarly_theologian
					trait = martial_cleric
				}
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = grey_eminence
					trait = charismatic_negotiator
				}
			}
			modifier = {
				factor = 1.25
				is_smart_trigger = yes
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.5
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.75
				trait = lustful
			}
			modifier = {
				factor = 0.75
				trait = hedonist
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
		}
		prestige = -25
		FROM = { character_event = { id = FemRule.239 days = 1 random = 2 } }
	}
	option = {
		name = EVTOPTC_FemRule_236 # Leave the bedroom door ajar....
		trigger = {
			NOT = { trait = chaste }
		}
		ai_chance = {
			factor = 25
			modifier = {
				factor = 2
				trait = hedonist
			}
			modifier = {
				factor = 2
				trait = lustful
			}
			modifier = {
				factor = 1.25
				trait = wroth
			}
			modifier = {
				factor = 1.25
				trait = gluttonous
			}
			modifier = {
				factor = 1.25
				trait = arbitrary
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = elusive_shadow
					trait = intricate_webweaver
					trait = flamboyant_schemer
					trait = amateurish_plotter
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					trait = fair
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					is_strong_trigger = yes
				}
			}
			modifier = {
				factor = 1.25
				FROM = {
					trait = tall
				}
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 30 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 50 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 70 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 80 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 90 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 100 }
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 20 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
		}
		prestige = -25
		FROM = { character_event = { id = FemRule.238 days = 1 random = 2 } }
	}	
}

# The lady breaks it off
character_event = {
	id = FemRule.237
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_237	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_237 #Oh no!
		prestige = -25
		clr_character_flag = tournament_romance
		opinion = { who = FROM modifier = opinion_angry years = 999 }
		reverse_opinion = { who = FROM modifier = opinion_angry years = 999 }
	}
}

# A trip to the bedroom?
character_event = {
	id = FemRule.238
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_238	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_238 #Hubba Hubba
		ai_chance = {
			factor = 80
			modifier = {
				factor = 3
				trait = lustful
			}
			modifier = {
				factor = 3
				trait = hedonist
			}
			modifier = {
				factor = 1.25
				trait = cynical
			}
			modifier = {
				factor = 1.25
				trait = diligent
			}
			modifier = {
				factor = 1.25
				trait = wroth
			}
			modifier = {
				factor = 1.25
				trait = greedy
			}
			modifier = {
				factor = 1.25
				trait = gluttonous
			}
			modifier = {
				factor = 1.5
				FROM = { trait = fair }
			}
			modifier = {
				factor = 1.25
				FROM = { trait = tall }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 0.25
				trait = chaste
			}
			modifier = {
				factor = 0
				trait = homosexual
				FROM = { is_female = yes }
			}
			modifier = {
				factor = 3
				trait = homosexual
				FROM = { is_female = no }
			}
			modifier = {
				factor = 0.5
				trait = zealous
			}
			modifier = {
				factor = 0.8
				trait = slothful
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -40 } }
			}
		}
		add_lover = FROM
		prestige = 10
		FROM = { character_event = { id = FemRule.241 days = 1 random = 2 } }
		if = {
			limit = { NOT = { trait = chaste } }
			random = {
				chance = 50
				add_trait = lustful
			}
		}
		if = {
			limit = { trait = chaste }
			remove_trait = chaste
		}
		if = {
			limit = { trait = temperate }
			random = {
				chance = 30
				remove_trait = temperate
			}
		}
		if = {
			limit = {
				trait = patient
				FROM = { is_female = yes }
			}
			random = {
				chance = 50
				remove_trait = patient
			}
		}
	}
	option = {
		name = EVTOPTB_FemRule_238 #rebuff him/her
		ai_chance = {
			factor = 20
			modifier = {
				factor = 3
				trait = homosexual
				FROM = { is_female = yes }
			}
			modifier = {
				factor = 1.25
				trait = chaste
			}
			modifier = {
				factor = 1.25
				trait = scholar
			}
			modifier = {
				factor = 1.25
				trait = zealous
			}
			modifier = {
				factor = 1.25
				OR = {
					trait = mastermind_theologian
					trait = scholarly_theologian
					trait = martial_cleric
				}
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -40 } }
			}
			modifier = {
				factor = 0.8
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 0.8
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.8
				opinion = { who = FROM value = 60 }
			}
		}
		FROM = { character_event = { id = FemRule.240 days = 1 random = 2 } }
		clr_character_flag = tournament_romance
		if = {
			limit = { NOT = { trait = lustful } }
			random = {
				chance = 20
				add_trait = chaste
			}
		}
		if = {
			limit = { trait = lustful }
			random = {
				chance = 50
				remove_trait = lustful
			}
		}
		piety = 25
	}
	option = {
		name = EVTOPTC_FemRule_238 # This is too soon...
		ai_chance = { factor = 100 }
		trigger = {
			learning = 16
			FROM = { is_female = yes }
		}
		prestige = 25
		piety = 25
		add_trait = patient
		add_trait = temperate
		add_lover = FROM
		FROM = { character_event = { id = FemRule.242 days = 1 random = 2 } }
	}	
}

# Keep it up?
character_event = {
	id = FemRule.239
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_239
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_239 # Courtly love
		ai_chance = {
			factor = 50
			modifier = {
				factor = 2
				trait = lustful
			}
			modifier = {
				factor = 2
				trait = hedonist
			}
			modifier = {
				factor = 1.25
				trait = diligent
			}
			modifier = {
				factor = 1.25
				trait = patient
			}
			modifier = {
				factor = 1.25
				trait = honest
			}
			modifier = {
				factor = 2
				trait = poet
			}
			modifier = {
				factor = 1.25
				FROM = { trait = fair }
			}
			modifier = {
				factor = 1.25
				FROM = { trait = tall }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 1.25
				opinion = { who = FROM value = 60 }
			}
			modifier = {
				factor = 0
				trait = homosexual
			}
			modifier = {
				factor = 0.8
				trait = zealous
			}
			modifier = {
				factor = 0.8
				trait = slothful
			}
			modifier = {
				factor = 0.75
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 0.5
				NOT = { opinion = { who = FROM value = -40 } }
			}
		}
		add_lover = FROM
		prestige = 25
		FROM = { character_event = { id = FemRule.242 days = 1 random = 2 } }
		random = {
			chance = 25
			add_trait = chaste
		}
		IF = {
			limit = { NOT = { lifestyle_traits = 1 } }
			random = {
				chance = 50
				add_trait = poet
			}
		}
	}
	option = {
		name = EVTOPTB_FemRule_239 #Break up
		ai_chance = {
			factor = 25
			modifier = {
				factor = 1.25
				trait = arbitrary
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = 0 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -20 } }
			}
			modifier = {
				factor = 1.25
				NOT = { opinion = { who = FROM value = -40 } }
			}
			modifier = {
				factor = 0.8
				opinion = { who = FROM value = 20 }
			}
			modifier = {
				factor = 0.8
				opinion = { who = FROM value = 40 }
			}
			modifier = {
				factor = 0.8
				opinion = { who = FROM value = 60 }
			}
		}
		FROM = { character_event = { id = FemRule.240 days = 1 random = 2 } }
		clr_character_flag = tournament_romance
		random = {
			chance = 25
			add_trait = arbitrary
		}
		prestige = 10
	}
	option = {
		name = EVTOPTC_FemRule_239 # I'd rather just be friends
		ai_chance = { 
			factor = 25
			modifier = {
				factor = 2
				is_married = yes
			}
			modifier = {
				factor = 4
				trait = chaste
			}
			modifier = {
				factor = 1.25
				trait = slothful
			}
			modifier = {
				factor = 1.25
				trait = temperate
			}
			modifier = {
				factor = 1.25
				trait = just
			}
			modifier = {
				factor = 2
				trait = zealous
			}
		}
		prestige = 25
		piety = 25
		random = {
			chance = 25
			add_trait = chaste
		}
		FROM = { character_event = { id = FemRule.243 days = 1 random = 2 } }
	}	
}

# Knight breaks it off
character_event = {
	id = FemRule.240
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_240
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_240 #Oh no!
		prestige = -25
		clr_character_flag = tournament_romance
		if = {
			limit = { trait = kind }
			random = {
				chance = 25
				remove_trait = kind
			}
		}
		random = {
			chance = 25
			add_trait = shy
		}
		opinion = { who = FROM modifier = opinion_angry years = 50 }
		reverse_opinion = { who = FROM modifier = opinion_disappointed years = 50 }
	}
}

# Nocturnal gymnastics
character_event = {
	id = FemRule.241
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_241	
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_241 # heavy breathing
		if = {
			limit = { NOT = { trait = chaste } }
			random = {
				chance = 50
				add_trait = lustful
			}
		}
		if = {
			limit = { trait = chaste }
			remove_trait = chaste
		}
		prestige = 10
		clr_character_flag = tournament_romance
		if = {
			limit = {
				is_female = yes
				fertility = 0.33
				FROM = { fertility = 0.33 }
			}
			if = {
				limit = { is_married = no }
				random = {
					chance = 50
					FROM = { impregnate = ROOT }
				}
			}
			if = {
				limit = { is_married = yes }
				random = {
					chance = 50
					FROM = { impregnate_cuckoo = ROOT }
				}
			}
		}
	}	
}

# Romance continues
character_event = {
	id = FemRule.242
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_242
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_242 # sickeningly sweet
		prestige = 25
		clr_character_flag = tournament_romance
		random = {
			chance = 25
			add_trait = chaste
		}
		IF = {
			limit = { NOT = { lifestyle_traits = 1 } }
			random = {
				chance = 50
				add_trait = poet
			}
		}
	}	
}

# Just friends?
character_event = {
	id = FemRule.243
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_243
	picture = GFX_evt_courtly_love
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_243 # I've made a friend
		prestige = 25
		clr_character_flag = tournament_romance
		add_friend = FROM
	}	
	
	option = {
		name = EVTOPTB_FemRule_243 # I wanted more � player-only
		prestige = 10
		random = {
			chance = 25
			add_trait = wroth
		}
		clr_character_flag = tournament_romance
		opinion = { who = FROM modifier = opinion_angry years = 50 }
		reverse_opinion = { who = FROM modifier = opinion_disappointed years = 50 }
	}
}

### TOURNAMENT END EVENTS

# Tournament is over
character_event = {
	id = FemRule.245 #formerly 1000182626
	title = TOURNAMENTTITLE
	desc = EVTDESC_FemRule_245
	picture = GFX_evt_tournament_gallery
	
	is_triggered_only = yes
	
	option = {
		name = EVTOPTA_FemRule_245 # it was fun
		prestige = 25
		opinion = {
			modifier = opinion_tournament_spectator
			who = FROM
			years = 2
		}
		remove_do_not_disturb_effect = yes
		clr_character_flag = attending_tournament
		clr_character_flag = attending_tournament_sexism 		
 		clr_character_flag = attending_tournament_fear  		
 		clr_character_flag = attending_tournament_MartialEd 		
 		clr_character_flag = attending_tournament_gay 
 		clr_character_flag = attending_tournament_syph 
 		clr_character_flag = attending_tournament_drunk 
 		clr_character_flag = attending_tournament_duelist 
 		clr_character_flag = attending_tournament_intrigue 
		clr_character_flag = attending_tournament_event
 		clr_character_flag = attending_tournament_stew 
 		clr_character_flag = attending_tournament_dip
		clr_character_flag = lady_pride  		
 		clr_character_flag = lady_shyness 
 		clr_character_flag = lady_honesty  		
 		clr_character_flag = lady_lust 
		clr_character_flag = tournament_third_place
		clr_character_flag = tournament_second_place
		clr_character_flag = tournament_winner
		clr_character_flag = tournament_romance
		clr_character_flag = spectating_tournament
		clr_character_flag = attending_tournament_wound
		clr_character_flag = championing_liege_lady
	}
}

