hungary_austria_relations = {
	
	type = country

	allow = {
		tag = HUN
		exists = HAB
		not = { war_with = HAB }
		not = { marriage_with = HAB }
		is_lesser_in_union = no
		is_subject = no
		government = monarchy
		HAB = {
			government = monarchy
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			war_with = HAB
			is_lesser_in_union = yes
			is_subject = yes
			not = { government = monarchy }
			HAB = {
				or = {
					not = { government = monarchy }
					is_lesser_in_union = yes
					is_subject = yes
				}
			}
		}
	}
	success = {
		marriage_with = HAB
		relation = { who = HAB value = 100 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = HAB value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = HAB value = -100 } }
		}
	}
	effect = {
		stability = 1
	}
}

hungary_transylvania_relations = {
	
	type = country

	allow = {
		tag = HUN
		exists = TRA
		not = { war_with = TRA }
		not = { marriage_with = TRA }
		is_lesser_in_union = no
		is_subject = no
		government = monarchy
		TRA = {
			government = monarchy
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			war_with = TRA
			is_lesser_in_union = yes
			is_subject = yes
			not = { government = monarchy }
			TRA = {
				or = {
					not = { government = monarchy }
					is_lesser_in_union = yes
					is_subject = yes
				}
			}
		}
	}
	success = {
		marriage_with = TRA
		relation = { who = TRA value = 100 }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = TRA value = 0 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = TRA value = -100 } }
		}
	}
	effect = {
		infamy = -1
	}
}

vassalize_transylvania_hun = {
	
	type = country

	allow = {
		tag = HUN
		is_subject = no
		is_lesser_in_union = no
		exists = TRA
		TRA = {
			neighbour = this
			not = { vassal_of = HUN }
			not = { num_of_cities = this }
			is_lesser_in_union = no
			is_subject = no
		}
	}
	abort = {
		or = {
			not = { exists = TRA }
			TRA = { is_lesser_in_union = yes }
			is_subject = yes
			is_lesser_in_union = yes
		}
	}
	success = {
		TRA = { vassal_of = HUN }
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			not = { relation = { who = TRA value = 100 } }
		}
		modifier = {
			factor = 2
			not = { relation = { who = TRA value = 200 } }
		}
	}
	immediate = {
		casus_belli = {
			type = cb_vassalize_mission
			months = 120
			target = TRA
		}
	}
	abort_effect = {
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = TRA
		}
	}
	effect = {
		prestige = 0.1
		remove_casus_belli = {
			type = cb_vassalize_mission
			target = TRA
		}
	}
}

conquer_the_banat = {
	
	type = country

	allow = {
		tag = HUN
		exists = TRA
		is_subject = no
		is_lesser_in_union = no
		not = { relation = { who = TRA value = 0 } }
		TRA = {
			not = { vassal_of = HUN }
			is_lesser_in_union = no
			owns = 156		# Banat
		}
	}
	abort = {
		or = {
			is_subject = yes
			is_lesser_in_union = yes	
		}
	}
	success = {
		owns = 156
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 2
			adm = 7
		}
	}
	immediate = {
		add_temp_claim = 156
	}
	abort_effect = {
		remove_temp_claim = 156
	}
	effect = {
		prestige = 0.05
	}
}

retake_croatia = {
	
	type = country

	allow = {
		tag = HUN
		is_subject = no
		is_lesser_in_union = no	
		exists = TUR
		TUR = {
			neighbour = this
			owns = 131				# Croatia
		}
	}
	abort = {
		or = {
			is_subject = yes
			is_lesser_in_union = yes	
		}	
	}
	success = {
		owns = 131
	}
	chance = {
		factor = 1000
		modifier = {
			factor = 2
			mil = 7
		}
		modifier = {
			factor = 2
			adm = 7
		}
	}
	immediate = {
		add_temp_claim = 131
	}
	abort_effect = {
		remove_temp_claim = 131
	}
	effect = {
		army_tradition = 0.3
		stability = 1
	}
}
