bspm_proroctwo_zmija_CB = {
	name = CB_NAME_BSPM_PROROCTWO_ZMIJA
	war_name = WAR_NAME_BSPM_PROROCTWO_ZMIJA
	sprite = 9
	truce_days = 3650
	is_permanent = yes
	is_holy_war = yes
	can_ask_to_join_war = yes
	check_de_jure_tier = DUKE

	allowed_to_target_tributaries = no
	allowed_to_target_suzerains = no
	

	infamy_modifier = 0.85
	
	can_use = {
		ROOT = {
			religion = chram_vales
			independent = yes
			higher_tier_than = COUNT
			NOT = { same_realm = FROM }
		}
		has_global_flag = bspm_proroctwo_zmija_flaga
		mercenary = no
	}
	
	can_use_title = {
		owner = {
			NOT = { religion = chram_vales }
		}
		title = d_moskva
	}

	is_valid = {
		ROOT = {
			religion = chram_vales
			independent = yes
			higher_tier_than = COUNT
			NOT = { same_realm = FROM }
		}
	}

	on_success = {
		any_attacker = {
			limit = { character = ROOT }
			participation_scaled_piety = 100
			
		}
		any_attacker = {
			limit = { NOT = { character = ROOT } }
			hidden_tooltip = { 
				participation_scaled_piety = 100
			}
		}
		ROOT = { 
			religion_authority = {
				modifier = won_holy_war
				years = 20
			}
		}
		FROM = { 
			religion_authority = {
				modifier = lost_holy_war
				years = 20
			}		
		}
		
		FROM = { piety = -100 }
		FROM = { prestige = -50 }
	}
	on_success_title = {
		custom_tooltip = {
			text = religious_cb_succ_tip
			ROOT = {
				vassalize_or_take_under_title = {
					title = PREV
					enemy = FROM
					same_religion = yes # Only vassalize rulers of my religion
					is_religious = yes
					type = holy_war
				}
			}
		}
	}
	
	on_fail = {
		ROOT = { 
			piety = -50 
			prestige = -100
		}
	}

	on_reverse_demand = {
		ROOT = {
			transfer_scaled_wealth = {
				to = FROM
				value = 4.0
			}
			piety = -75
			prestige = -150
		}
		any_defender = {
			limit = { character = FROM }
			participation_scaled_piety = 200
			participation_scaled_prestige = 100
			if = {
				limit = {
					uses_decadence = yes
				}
				participation_scaled_decadence = -10
			}
		}
		any_defender = {
			limit = { NOT = { character = FROM } }
			hidden_tooltip = { 
				participation_scaled_piety = 200
				participation_scaled_prestige = 100
				if = {
					limit = {
						uses_decadence = yes
					}
					participation_scaled_decadence = -10
				}
			}
		}
		ROOT = { 
			religion_authority = {
				modifier = lost_holy_war
				years = 20
			}
		}
		FROM = { 
			religion_authority = {
				modifier = won_holy_war
				years = 20
			}		
		}
	}

	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
	}
	
	ai_will_do = { 
		factor = 1
	}
}