﻿#############################################
# Lead a Separatist Uprising
#############################################

### Champion the [ROOT.Char.GetCulture.GetNameNoTooltip] Culture ###
separatist_uprising_decision = {
	picture = { reference = "gfx/interface/illustrations/decisions/decision_culture.dds" }
	desc = separatist_uprising_decision_desc
	decision_group_type = adventurer
	selection_tooltip = separatist_uprising_decision_tooltip

	cooldown = { months = 1 }

	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 12
		kingdom = 0
		empire = 0
		hegemony = 0
	}
	sort_order = 350

	is_shown = {
		has_ep3_dlc_trigger = yes
		has_government = landless_adventurer_government
		NOT = { has_trait = populist_leader }
		NOT = { has_variable = separatist_uprising_decision_var }
	}
	
	is_valid = {
		custom_tooltip = {
			text = separatist_uprising_culture_duchy_check_tt
			exists = location.county
			exists = location.duchy
			exists = location.duchy.holder.liege
		}
		custom_tooltip = {
			text = separatist_uprising_culture_county_tt
			location.county.culture = root.culture
		}
		custom_tooltip = {
			text = separatist_uprising_capital_county_tt
			location.county != location.duchy.holder.top_liege.capital_county
		}
		NOT = {
			location.duchy.holder.culture = root.culture
		}
		prestige_level >= 3
	}

	is_valid_showing_failures_only = {
		NOR = {
			is_available = no
			has_trait = infirm
			is_incapable = yes
			top_liege != this
		}
	}
	
	cost = {
		prestige = 2000
		gold = 500
	}

	effect = {
		show_as_tooltip = {
			add_pressed_claim = location.duchy
		}
		custom_tooltip = separatist_uprising_decision_war_tt
		if = {
			limit = {
				OR = {
					can_set_relation_potential_lover_trigger = { CHARACTER = location.duchy.holder.liege }
					can_set_relation_lover_trigger = { CHARACTER = location.duchy.holder.liege }
				}
			}
			custom_tooltip = separatist_uprising_decision_pacifist_option_friend_lover_tt
		}
		else = {
			custom_tooltip = separatist_uprising_decision_pacifist_option_friend_tt
		}
		trigger_event = ep3_decisions_event.6001
	}

	ai_will_do = {
		base = 50
		modifier = { # More likely to do it if they can actually win
			add = 100
			root_military_strength_higher_than_recipient_value > recipient_strength_root_value
		}
		modifier = { # They should never take it if they don't have enough Prestige and a bit more
			add = -200
			prestige <= 300
			gold <= 150
		}
#		modifier = { # Asen and Peter always try to do this
#			add = 1000
#			primary_title = title:d_laamp_asen
#		}
	}
}
