############################################
# Skaa Allomancer Recruitment Events
# Discovering and recruiting hidden Allomancers
############################################

namespace = mistborn_skaa_allomancer

# ============================================================
# RECRUIT SKAA ALLOMANCER - A hidden gem joins your court
# Triggered by recruit_skaa_allomancer_decision
# ============================================================
mistborn_skaa_allomancer.0001 = {
	type = character_event
	title = mistborn_skaa_allomancer.0001.t
	desc = mistborn_skaa_allomancer.0001.desc
	theme = intrigue

	left_portrait = {
		character = root
		animation = scheme
	}

	immediate = {
		# Generate a skaa Allomancer courtier
		create_character = {
			location = root.capital_province
			template = pool_repopulate_prowess
			culture = culture:skaa
			faith = root.faith
			gender_female_chance = 50
			dynasty = none
			trait = trait_misting_coinshot
			save_scope_as = skaa_recruit
		}
	}

	# Option A: Welcome them as a secret agent
	option = {
		name = mistborn_skaa_allomancer.0001.a
		scope:skaa_recruit = {
			# Join the court
			set_employer = root
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 40
			}
		}
		add_intrigue_lifestyle_xp = 50
		custom_tooltip = mistborn_skaa_allomancer.0001.a.tt
		ai_chance = {
			base = 60
		}
	}

	# Option B: Train them properly as a Hazekiller commander
	option = {
		name = mistborn_skaa_allomancer.0001.b
		add_gold = -100
		scope:skaa_recruit = {
			set_employer = root
			add_trait = brave
			add_opinion = {
				target = root
				modifier = grateful_opinion
				opinion = 50
			}
		}
		add_martial_lifestyle_xp = 50
		ai_chance = {
			base = 30
		}
	}

	# Option C: Hide them among the servants
	option = {
		name = mistborn_skaa_allomancer.0001.c
		scope:skaa_recruit = {
			set_employer = root
		}
		# Safest option - less chance of discovery
		add_prestige = -25
		ai_chance = {
			base = 10
		}
	}
}

# ============================================================
# STEEL MINISTRY INVESTIGATES SKAA ALLOMANCER
# Triggered when recruiting is discovered
# ============================================================
mistborn_skaa_allomancer.0002 = {
	type = character_event
	title = mistborn_skaa_allomancer.0002.t
	desc = mistborn_skaa_allomancer.0002.desc
	theme = intrigue

	left_portrait = {
		character = root
		animation = worry
	}

	immediate = {
		# Lord Ruler attention increases
		if = {
			limit = { has_variable = lord_ruler_attention }
			change_variable = {
				name = lord_ruler_attention
				add = 15
			}
		}
		else = {
			set_variable = {
				name = lord_ruler_attention
				value = 15
			}
		}
	}

	# Option A: Hand over the skaa Allomancer to the Inquisitors
	option = {
		name = mistborn_skaa_allomancer.0002.a
		# Find and sacrifice the recruit
		random_courtier = {
			limit = {
				culture = culture:skaa
				OR = {
					has_trait = trait_misting_coinshot
					has_trait = trait_misting_lurcher
					has_trait = trait_misting_thug
					has_trait = trait_misting_tineye
					has_trait = trait_misting_soother
					has_trait = trait_misting_rioter
					has_trait = trait_misting_smoker
					has_trait = trait_misting_seeker
				}
			}
			death = {
				death_reason = death_execution
				killer = root
			}
		}
		# Reduces attention
		change_variable = {
			name = lord_ruler_attention
			add = -10
		}
		add_piety = 50
		stress_impact = {
			compassionate = 40
			just = 20
			callous = -10
		}
		ai_chance = {
			base = 40
		}
	}

	# Option B: Deny everything and hide them better
	option = {
		name = mistborn_skaa_allomancer.0002.b
		trigger = {
			intrigue >= 14
		}
		random_list = {
			50 = {
				# Successfully hidden
				custom_tooltip = mistborn_skaa_allomancer.0002.b.success
				add_intrigue_lifestyle_xp = 75
			}
			50 = {
				# Ministry not convinced - more trouble
				custom_tooltip = mistborn_skaa_allomancer.0002.b.fail
				add_character_modifier = {
					modifier = steel_ministry_displeasure
					years = 3
				}
			}
		}
		ai_chance = {
			base = 30
			modifier = {
				add = 20
				intrigue >= 18
			}
		}
	}

	# Option C: Claim ignorance and pay a fine
	option = {
		name = mistborn_skaa_allomancer.0002.c
		add_gold = -200
		add_prestige = -100
		# Moderate reduction
		change_variable = {
			name = lord_ruler_attention
			add = -5
		}
		ai_chance = {
			base = 30
		}
	}
}
