
obran_osh_cb = {
	name = CB_NAME_COUNTY_CONQUEST
	war_name = WAR_NAME_COUNTY_CONQUEST
	sprite = 22
	truce_days = 800
	hostile_against_others = yes
	is_permanent = no
	can_ask_to_join_war = no
	
	allow_distant = yes
	allowed_to_target_tributaries = no
	
	can_use = {
	}

	can_use_title = {
		OR = {
			FROM = {
				has_landed_title = c_nizhny_novgorod
			}
			holder_scope = {
				is_liege_or_above = FROM
			}
		}
	}

	is_valid_title = {
		OR = {
			FROM = {
				has_landed_title = PREV
			}
			holder_scope = {
				is_liege_or_above = FROM
			}
		}
	}

	on_add = {
		hidden_tooltip = { fire_haruspicy_event_effect = yes }
	}

	on_success_title = { #winning the war
		usurp_title_plus_barony_if_unlanded = { target = ROOT type = invasion }
		
		any_de_jure_vassal_title = { # take all baronies too
			limit = {
				has_holder = yes
				holder_scope = {
					OR = {
						character = FROM
						is_liege_or_above = FROM
						AND = {
							is_liege_or_above = ROOT
							NOT = { culture = ROOT }
							NOT = { religion = ROOT }
						}
					}
				}
			}
			show_scope_change = no
			usurp_title = ROOT
		}
		
		ROOT = {
			show_scope_change = no
			participation_scaled_prestige = 100
			participation_scaled_piety = 50
		}
		any_attacker = {
			limit = { NOT = { character = ROOT } }
			hidden_tooltip = { 
				participation_scaled_prestige = 100 
				participation_scaled_piety = 50
			}
		}
		hidden_tooltip = {
			c_nizhny_novgorod = {
				culture = russian
				religion = orthodox
			}
			584 = {
				culture = russian
				religion = orthodox
			}
		}
	}

	on_fail_title = { #white peace
		ROOT = {
			show_scope_change = no
			prestige = -100
		}
	
		FROM = {
			show_scope_change = no
			participation_scaled_prestige = 50
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { participation_scaled_prestige = 50 }
		}
	}

	on_reverse_demand = { #losing the war
		ROOT = {
			show_scope_change = no
			prestige = -200
			transfer_scaled_wealth = {
				to = FROM
				value = 4.0
			}
		}
		
		FROM = {
			show_scope_change = no
			participation_scaled_prestige = 100
			participation_scaled_piety = 50
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = {
				participation_scaled_prestige = 100 
				participation_scaled_piety = 50
			}
		}
	}
	on_reverse_demand_title = {
		
	}

	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
	}
}