shattered_conquest = {
	name = shattered_conquest
	war_name = shattered_conquest_war
	sprite = 16
	truce_days = 1825
	hostile_against_others = yes
	is_permanent = yes
	check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles
	can_ask_to_join_war = yes
	infamy_modifier = 0

	can_use_title = {
		tier = COUNT
		location = {
			any_neighbor_province = {
				owner = {
					OR = {
						character = ROOT
						is_vassal_or_below_of = ROOT
					}
				}
			}
		}
	}
	can_use = {
		has_global_flag = shattered_conquest_flag
		FROM = {
			tier = COUNT
		}
		ROOT = {
			tier = COUNT
			independent = yes
			is_patrician = no
		}
	}
	is_valid_title = {
		FROM = {
			has_landed_title = PREV
		}
	}
	on_success = {
		ROOT = {
			participation_scaled_prestige = 50
		}
	}
	on_success_title = {
		usurp_title = {
			target = ROOT
			type = invasion
		}
	}
	on_fail = {
		ROOT = {
			prestige = -25
		}
		FROM = {
			participation_scaled_prestige = 25
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 25 }
		}
	}
	on_reverse_demand = {
		ROOT = {
			prestige = -50
			transfer_scaled_wealth = {to = FROM value = 2}
		}
		FROM = {
			participation_scaled_prestige = 50
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 50 }
		}
	}
	attacker_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	attacker_ai_defeat_worth = {
		factor = 100
	}

	defender_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	defender_ai_defeat_worth = {
		factor = 100
	}
}
shattered_subjugation = {
	name = shattered_subjugation
	war_name = shattered_subjugation_war
	sprite = 34
	truce_days = 1825
	hostile_against_others = yes
	is_permanent = yes
	check_all_titles = yes # if permanent, setting this to true will check against all of someones titles, including vassal held titles
	can_ask_to_join_war = yes
	infamy_modifier = 0

	can_use_title = {
		tier = DUKE
		any_direct_de_jure_vassal_title = {
			location = {
				any_neighbor_province = {
					owner = {
						OR = {
							character = ROOT
							is_vassal_or_below_of = ROOT
						}
					}
				}
			}
		}
	}
	can_use = {
		has_global_flag = shattered_conquest_flag
		FROM = {
			tier = DUKE
		}
		ROOT = {
			tier = DUKE
			independent = yes
			is_patrician = no
		}
	}
	can_use_gui = {
		ROOT = {
			prestige = 100
		}
	}
	is_valid_title = { FROM = { has_landed_title = PREV } }
	on_add = {
		ROOT = {
			prestige = -100
		}
	}
	on_success = {
		ROOT = {
			participation_scaled_prestige = 200
		}
		FROM = {
			prestige = -200
		}
	}
	on_success_title = {
		usurp_title = {
			target = ROOT
			type = invasion
		}
		custom_tooltip = {
			text = pagan_subjugation_tip
			hidden_tooltip = {
				ROOT = {
					subjugate_or_take_under_title = { # If the target only has territory within the kingdom, he is simply vassalized
						title = PREV
						enemy = FROM
					}
				}
			}
		}
	}
	on_fail = {
		ROOT = {
			prestige = -50
		}
		FROM = {
			participation_scaled_prestige = 100
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 100 }
		}
	}
	on_reverse_demand = {
		ROOT = {
			prestige = -100
			transfer_scaled_wealth = {to = FROM value = 3}
		}
		FROM = {
			participation_scaled_prestige = 200
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 200 }
		}
	}
	attacker_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	attacker_ai_defeat_worth = {
		factor = 100
	}

	defender_ai_victory_worth = {
		factor = -1 # always accept
	}
	
	defender_ai_defeat_worth = {
		factor = 100
	}
}