﻿succession_crisis_ancestry_check = {
	set_variable = {
		name = crisis_ancestry_score
		value = 0
	}
	if = {
		limit = {
			father = {
				has_title = scope:crisis_title
			}
		}
		change_variable = {
			name = crisis_ancestry_score
			add = 3
		}
	}
	else_if = {
		limit = {
			mother = {
				has_title = scope:crisis_title
			}
		}
		change_variable = {
			name = crisis_ancestry_score
			add = 2
		}
	}
	else_if = {
		limit = {
			father = {
				father = {
					has_title = scope:crisis_title
				}
			}
		}
		change_variable = {
			name = crisis_ancestry_score
			add = 2
		}
	}
	else_if = {
		limit = {
			OR = {
				father = {
					mother = {
						has_title = scope:crisis_title
					}
				}
				mother = {
					father = {
						has_title = scope:crisis_title
					}
				}
			}
		}
		change_variable = {
			name = crisis_ancestry_score
			add = 1
		}
	}
	else_if = {
		limit = {
			father = {
				father = {
					father = {
						has_title = scope:crisis_title
					}
				}
			}
		}
		change_variable = {
			name = crisis_ancestry_score
			add = 1
		}
	}
}