# Supported types: character
#
# Note: if 'chance' evaluates to 0, an AI character will also abandon the focus
#


###############
# FOCUSES
###############

focus_rulership = {
	type = character
	
	modifier_name = "RULERSHIP_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		prisoner = no
		NOT = { trait = incapable }
	}
	
	# AI Pick chance - based on personality, not needs!
	chance = {
		factor = 100
		modifier = {
			factor = 0
			trait = stressed
		}
		modifier = {
			factor = 0.25
			trait = depressed
		}
		modifier = {
			factor = 0.5
			OR = {
				is_republic = yes
				is_patrician = yes
			}
		}
		modifier = {
			factor = 0.5
			trait = arbitrary
		}
		modifier = {
			factor = 0.5
			trait = slothful
		}
		modifier = {
			factor = 2.0
			trait = diligent
		}
		modifier = {
			factor = 3.0
			trait = just
		}
		modifier = {
			factor = 2.0
			OR = {
				has_job_title = job_treasurer
				has_ambition = obj_become_treasurer
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			prisoner = yes
			trait = incapable
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	stewardship = 3
	intrigue = -1
}

focus_business = {
	type = character
	
	modifier_name = "BUSINESS_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		prisoner = no
		NOT = { trait = incapable }
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		modifier = {
			factor = 0.2
			trait = stressed
		}
		modifier = {
			factor = 0.5
			trait = depressed
		}
		modifier = {
			factor = 0.5
			trait = slothful
		}
		modifier = {
			factor = 0.5
			trait = charitable
		}
		modifier = {
			factor = 2.0
			trait = diligent
		}
		modifier = {
			factor = 3.0
			trait = greedy
		}
		modifier = {
			factor = 2.0
			OR = {
				is_republic = yes
				is_patrician = yes
			}
		}
		modifier = {
			factor = 0.5
			NOR = {
				is_republic = yes
				is_patrician = yes
				has_job_title = job_treasurer
				has_ambition = obj_become_treasurer
			}
		}
		modifier = {
			factor = 0.5
			NOT = { wealth = 100 }
			NOR = {
				has_job_title = job_treasurer
				has_ambition = obj_become_treasurer
			}
		}
		modifier = {
			factor = 2.0
			OR = {
				has_job_title = job_treasurer
				has_ambition = obj_become_treasurer
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			prisoner = yes
			trait = incapable
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	stewardship = 2
	town_opinion = 20
	martial = -1
}

focus_seduction = {
	type = character
	
	modifier_name = "SEDUCTION_FOCUS"
	
	potential = {
		OR = {
			NAND = {
				is_theocracy = yes
				religion_group = christian
			}
			trait = bad_priest_christian
		}
	}
	
	allow = {
		is_adult = yes
		prisoner = no
		NOT = { trait = incapable }
		NOT = { trait = celibate }
		NOT = { trait = eunuch }
		NOT = { is_ascetic_trigger = yes }
		NOT = { trait = perfecti }
		NOT = { religion = cathar }
		NOT = { has_ambition = obj_become_saint }
		custom_tooltip = {
			text = is_not_ascetic
			hidden_tooltip = {
				NOT = { has_character_modifier = messalian_prayer }
				NOT = { has_character_modifier = hindu_ascetic }
				NOT = { has_character_modifier = buddhist_ascetic }
				NOT = { has_character_modifier = jain_naked_ascetic }
			}
		}
	}
	
	# AI Pick chance
	chance = {
		factor = 75
		
		modifier = {
			factor = 0
			trait = chaste
		}
		modifier = {
			factor = 0
			has_game_rule = {
				name = ai_seduction
				value = off
			}
		}
		modifier = {
			factor = 0 # Faithful spouse/consort
			OR = {
				AND = {
					is_married = yes
					any_spouse = { is_lover = ROOT }
				}
				AND = {
					is_consort = yes
					any_consort = { is_lover = ROOT }
				}
			}
		}
		modifier = {
			factor = 0 # Faithful consort
			any_consort = { is_lover = ROOT }
		}
		modifier = {
			factor = 0.1 # Likes spouse/consort
			OR = {
				any_spouse = { reverse_opinion = { who = ROOT value = 0 } }
				any_consort = { reverse_opinion = { who = ROOT value = 25 } }
			}
			NOR = {
				trait = deceitful
				trait = lustful
				trait = hedonist
			}
		}
		modifier = {
			factor = 0.1
			has_lover = yes
			NOR = {
				trait = seducer
				trait = seductress
				trait = lustful
				trait = hedonist
			}
		}
		modifier = {
			factor = 0.75
			is_female = yes
			NOT = { age = 30 }
		}
		modifier = {
			factor = 0.75
			is_female = no
			age = 40
		}
		modifier = {
			factor = 0.1
			trait = content
		}
		modifier = {
			factor = 0.1
			trait = craven
		}
		modifier = {
			factor = 0.1
			trait = paranoid
		}
		modifier = {
			factor = 0.5
			trait = zealous
		}
		modifier = {
			factor = 0.5
			trait = ugly
		}
		modifier = {
			factor = 0.25
			trait = shy
		}
		modifier = {
			factor = 0.5
			trait = humble
		}
		modifier = {
			factor = 0.5
			trait = honest
		}
		modifier = {
			factor = 0.75
			trait = temperate
		}
		modifier = {
			factor = 0.75
			trait = just
		}
		modifier = {
			factor = 0.75
			trait = slothful
		}
		modifier = {
			factor = 1.5
			trait = gregarious
		}
		modifier = {
			factor = 1.5
			trait = cruel
		}
		modifier = {
			factor = 1.5
			trait = ambitious
		}
		modifier = {
			factor = 1.5
			trait = deceitful
		}
		modifier = {
			factor = 2.0
			trait = hedonist
		}
		modifier = {
			factor = 2.0
			trait = fair
		}
		modifier = {
			factor = 5.0
			trait = lustful
		}
		modifier = {
			factor = 4.0
			OR = {
				AND = {
					OR = {
						is_female = yes
						AND = {
							has_polygamy = no
							has_concubinage = no
						}
					}
					any_spouse = {
						trait = homosexual
					}
				}
				AND = {
					OR = {
						is_married = yes
						is_consort = yes
					}
					trait = homosexual
				}
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			trait = incapable
			trait = eunuch
			trait = celibate
			trait = monk
			trait = nun
			is_playable = no
			AND = {
				is_theocracy = yes
				religion_group = christian
				NOT = { trait = bad_priest_christian }
			}
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	intrigue = 2
	fertility = 0.25
	sex_appeal_opinion = 10
	learning = -1
}

focus_intrigue = {
	type = character
	
	modifier_name = "INTRIGUE_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		NOT = { trait = incapable }
		NOT = { has_ambition = obj_become_saint }
		prisoner = no
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		
		modifier = {
			factor = 0
			has_game_rule = {
				name = ai_intrigue
				value = off
			}
		}
		modifier = {
			factor = 0
			trait = honest
		}
		modifier = {
			factor = 0.25
			NOR = {
				trait = amateurish_plotter
				trait = flamboyant_schemer
				trait = intricate_webweaver
				trait = elusive_shadow
			}
		}
		modifier = {
			factor = 10
			any_close_relative = {
				prisoner = yes
				reverse_opinion = { who = ROOT value = 75 }
				liege = { character = ROOT }
				host = { NOT = { character = ROOT } }
			}
		}
		modifier = {
			factor = 10
			any_close_relative = {
				prisoner = no
				reverse_opinion = { who = ROOT value = 75 }
				is_female = yes
				is_consort = yes
				consort = {
					NOT = { character = ROOT }
					reverse_has_opinion_modifier = {
						who = PREV
						modifier = opinion_forced_consort
					}
				}
			}
		}
		modifier = {
			factor = 0.25
			trait = kind
		}
		modifier = {
			factor = 0.5
			trait = trusting
		}
		modifier = {
			factor = 0.5
			trait = content
		}
		modifier = {
			factor = 0.5
			trait = wroth
		}
		modifier = {
			factor = 1.5
			trait = envious
		}
		modifier = {
			factor = 1.5
			trait = patient
		}
		modifier = {
			factor = 1.5
			trait = ambitious
		}
		modifier = {
			factor = 2.0
			trait = cruel
		}
		modifier = {
			factor = 5.0
			trait = paranoid
		}
		modifier = {
			factor = 4.0
			trait = deceitful
		}
		modifier = {
			factor = 0.75
			has_plot = no
		}
		modifier = {
			factor = 5.0
			OR = {
				has_job_title = job_spymaster
				has_ambition = obj_become_spymaster
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			prisoner = yes
			trait = incapable
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	intrigue = 3
	stewardship = -1
	plot_power_modifier = 0.05
}

focus_hunting = {
	type = character
	
	modifier_name = "HUNTING_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		prisoner = no
		NOT = { religion = jain }
		NOT = { religion = cathar }
		NOT = { trait = perfecti }
		NOT = { trait = incapable }
		NOT = { trait = infirm }
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		
		modifier = {
			factor = 0.2
			is_female = yes
		}
		modifier = {
			factor = 0.5
			trait = craven
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 2.0
			trait = hunter
		}
		modifier = {
			factor = 2.0
			trait = falconer
		}
		modifier = {
			factor = 1.25
			OR = {
				trait = misguided_warrior
				trait = tough_soldier
				trait = skilled_tactician
				trait = brilliant_strategist
			}
		}
		modifier = {
			factor = 2.0
			OR = {
				has_job_title = job_marshal
				has_ambition = obj_become_marshal
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			prisoner = yes
			trait = incapable
			trait = infirm
			religion = jain
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	martial = 2
	health = 1
	intrigue = -1
}

focus_war = {
	type = character
	
	modifier_name = "WAR_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		NOT = { trait = incapable }
		prisoner = no
		NOT = { trait = infirm }
		NOT = { has_ambition = obj_become_saint }
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		
		modifier = {
			factor = 0
			OR = {
				religion = cathar
				religion = jain
				trait = perfecti
			}
			NOT = { trait = cynical }
		}
		modifier = {
			factor = 0.1
			is_female = yes
		}
		modifier = {
			factor = 0.2
			trait = craven
		}
		modifier = {
			factor = 0.25
			NOT = {
				OR = {
					trait = misguided_warrior
					trait = tough_soldier
					trait = skilled_tactician
					trait = brilliant_strategist
				}
			}
		}
		modifier = {
			factor = 1.25
			OR = {
				trait = misguided_warrior
				trait = tough_soldier
				trait = skilled_tactician
				trait = brilliant_strategist
			}
		}
		modifier = {
			factor = 0.5
			trait = kind
		}
		modifier = {
			factor = 1.5
			trait = brave
		}
		modifier = {
			factor = 1.5
			is_feudal = yes
		}
		modifier = {
			factor = 3.0
			is_nomadic = yes
		}
		modifier = {
			factor = 3.0
			is_tribal = yes
		}
		modifier = {
			factor = 2.0
			trait = wroth
		}
		modifier = {
			factor = 2.0
			trait = duelist
		}
		modifier = {
			factor = 5.0
			OR = {
				has_job_title = job_marshal
				has_ambition = obj_become_marshal
				has_character_modifier = planning_claimant_adventure
				trait = adventurer
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			prisoner = yes
			trait = incapable
			trait = infirm
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	martial = 3
	diplomacy = -1
}

focus_carousing = {
	type = character
	
	modifier_name = "CAROUSING_FOCUS"
	
	potential = {
		is_playable = yes
		OR = {
			NAND = {
				is_theocracy = yes
				religion_group = christian
			}
			trait = bad_priest_christian
		}
	}
	
	allow = {
		OR = {
			NOT = { religion_group = muslim }
			trait = decadent
			trait = hedonist
			trait = drunkard
		}
		custom_tooltip = {
			text = is_not_ascetic
			hidden_tooltip = {
				NOT = { has_character_modifier = messalian_prayer }
				NOT = { has_character_modifier = hindu_ascetic }
				NOT = { has_character_modifier = buddhist_ascetic }
				NOT = { has_character_modifier = jain_naked_ascetic }
			}
		}
		is_adult = yes
		NOT = { trait = incapable }
		prisoner = no
		NOT = { has_ambition = obj_become_saint }
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		modifier = {
			factor = 0.25
			trait = shy
		}
		modifier = {
			factor = 0.25
			trait = temperate
		}
		modifier = {
			factor = 0.5
			trait = diligent
		}
		modifier = {
			factor = 2.0
			trait = slothful
		}
		modifier = {
			factor = 2.0
			trait = gluttonous
		}
		modifier = {
			factor = 3.0
			trait = hedonist
		}
		modifier = {
			factor = 3.0
			trait = drunkard
		}
		modifier = {
			factor = 2.0
			OR = {
				has_job_title = job_chancellor
				has_ambition = obj_become_chancellor
				has_character_modifier = planning_claimant_adventure
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			prisoner = yes
			trait = incapable
			is_playable = no
			AND = {
				is_theocracy = yes
				religion_group = christian
				NOT = { trait = bad_priest_christian }
			}
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	diplomacy = 3
	learning = -1
}

focus_family = {
	type = character
	
	modifier_name = "FAMILY_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		prisoner = no
		NOT = { trait = incapable }
		NOT = { religion = cathar }
		NOT = { trait = perfecti }
		NOT = { has_character_modifier = messalian_prayer }
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		modifier = {
			factor = 0.01
			NOT = {
				any_sibling = {
					always = yes
				}
			}
			NOT = {
				any_child = {
					always = yes
				}
			}
		}
		modifier = {
			factor = 0.25
			trait = ambitious
		}
		modifier = {
			factor = 0.5
			NOT = { age = 25 }
		}
		modifier = {
			factor = 0.75
			is_female = no
		}
		modifier = {
			factor = 0.75
			trait = gregarious
		}
		modifier = {
			factor = 0.75
			trait = proud
		}
		modifier = {
			factor = 1.25
			trait = humble
		}
		modifier = {
			factor = 1.5
			trait = gardener
		}
		modifier = {
			factor = 1.5
			trait = craven
		}
		modifier = {
			factor = 1.5
			trait = shy
		}
		modifier = {
			factor = 2.0
			trait = content
		}
		modifier = {
			factor = 2.0
			trait = infirm
		}
		modifier = {
			factor = 2.0
			trait = kind
		}
		modifier = {
			factor = 3.0
			is_female = yes
		}
		modifier = {
			factor = 1.5
			is_married = yes
			NOT = { num_of_children = 1 }
		}
		modifier = {
			factor = 2.0
			OR = {
				has_job_title = job_chancellor
				has_ambition = obj_become_chancellor
				has_character_modifier = planning_claimant_adventure
			}
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			prisoner = yes
			trait = incapable
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	diplomacy = 2
	health = 1
	fertility = 0.25
	martial = -1
}

focus_scholarship = {
	type = character
	
	modifier_name = "SCHOLARSHIP_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		NOT = { trait = incapable }
		prisoner = no
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		modifier = {
			factor = 0
			trait = imbecile
		}
		modifier = {
			factor = 0
			trait = inbred
		}
		modifier = {
			factor = 0.25
			trait = wroth
		}
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 0.5
			trait = brave
		}
		modifier = {
			factor = 1.5
			trait = craven
		}
		modifier = {
			factor = 1.5
			trait = content
		}
		modifier = {
			factor = 2.0
			trait = patient
		}
		modifier = {
			factor = 0.75
			NOR = {
				trait = detached_priest
				trait = martial_cleric
				trait = scholarly_theologian
				trait = mastermind_theologian
			}
		}
		modifier = {
			factor = 5.0
			trait = cynical
			OR = {
				trait = detached_priest
				trait = martial_cleric
				trait = scholarly_theologian
				trait = mastermind_theologian
			}
		}
		modifier = {
			factor = 2.0
			NOT = { trait = cynical }
			OR = {
				trait = detached_priest
				trait = martial_cleric
				trait = scholarly_theologian
				trait = mastermind_theologian
			}
		}
		modifier = {
			factor = 5.0
			trait = scholar
		}
		modifier = {
			factor = 3.0
			is_theocracy = yes
		}
		modifier = {
			factor = 2.0
			OR = {
				has_job_title = job_spiritual
				has_ambition = obj_become_spiritual
			}
		}
		modifier = {
			factor = 3.0
			religion = hurufi
			NOT = { trait = cynical }
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	
	abort = {
		OR = {
			trait = incapable
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	learning = 3
	diplomacy = -1
}

focus_theology = {
	type = character
	
	modifier_name = "THEOLOGY_FOCUS"
	
	potential = {
		is_playable = yes
	}
	
	allow = {
		is_adult = yes
		NOT = { trait = incapable }
		prisoner = no
	}
	
	# AI Pick chance
	chance = {
		factor = 100
		
		modifier = {
			factor = 0
			trait = imbecile
		}
		modifier = {
			factor = 0
			trait = inbred
		}
		modifier = {
			factor = 0
			trait = cynical
		}
		modifier = {
			factor = 0.5
			trait = wroth
		}
		modifier = {
			factor = 0.5
			trait = ambitious
		}
		modifier = {
			factor = 0.5
			trait = brave
		}
		modifier = {
			factor = 1.5
			trait = craven
		}
		modifier = {
			factor = 1.5
			trait = content
		}
		modifier = {
			factor = 2.0
			trait = patient
		}
		modifier = {
			factor = 1.5
			NOT = { piety = 0 }
		}
		modifier = {
			factor = 1.5
			NOT = { piety = 100 }
		}
		modifier = {
			factor = 0.75
			NOR = {
				trait = detached_priest
				trait = martial_cleric
				trait = scholarly_theologian
				trait = mastermind_theologian
			}
		}
		modifier = {
			factor = 2.0
			OR = {
				trait = detached_priest
				trait = martial_cleric
				trait = scholarly_theologian
				trait = mastermind_theologian
			}
		}
		modifier = {
			factor = 3.0
			trait = mystic
		}
		modifier = {
			factor = 3.0
			trait = zealous
		}
		modifier = {
			factor = 3.0
			is_theocracy = yes
		}
		modifier = {
			factor = 5.0
			OR = {
				has_job_title = job_spiritual
				has_ambition = obj_become_spiritual
			}
		}
		modifier = {
			factor = 10
			has_ambition = obj_become_saint
		}
	}
	
	# Focuses have no success conditions
	success = {
		always = no
	}
	creation_effect = {
		if = {
			limit = { has_quest = quest_monastic_order_theology_focus }
			character_event = { id = MNM.4016 }
		}
	}
	abort = {
		OR = {
			trait = incapable
			is_playable = no
		}
	}
	
	abort_effect = {
	}
	
	# MODIFIERS
	learning = 2
	church_opinion = 20
	stewardship = -1 
	health = 1.0
}
