﻿ddm_habsburg_candidate_value = {
    value = ddm_quality_trait_value
    add = { value = diplomacy multiply = 2 }
    add = { value = stewardship multiply = 2 }
    add = { value = learning multiply = 2 }
    if = { limit = { has_trait = fecund } add = 250 }
    if = { limit = { has_trait = pure_blooded } add = 600 }

    # Dynasty First: genetic quality matters, but kinship itself is only a modest tiebreaker.
    if = { limit = { is_close_family_of = scope:ddm_habsburg_subject } add = 50 }
    if = { limit = { is_close_or_extended_family_of = scope:ddm_habsburg_subject } add = 100 }

    # Close Blood and Absolute Creed deliberately pull the family tree inward.
    if = { limit = { OR = { scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 2 scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 4 } is_close_or_extended_family_of = scope:ddm_habsburg_subject } add = 1200 }
    if = { limit = { OR = { scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 2 scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 4 } is_close_family_of = scope:ddm_habsburg_subject } add = 2000 }

    # Pure Blood is the selective-breeding doctrine: preserve the dynasty, but choose the strongest
    # congenital match rather than simply the nearest relative.
    if = { limit = { scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 3 } add = { value = ddm_quality_trait_value multiply = 4 } }
    if = { limit = { scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 3 has_trait = pure_blooded } add = 2400 }
    if = { limit = { scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 3 has_trait = fecund } add = 600 }
    if = { limit = { scope:ddm_habsburg_actor.var:ddm_habsburg_mode = 3 has_trait = inbred } add = -2500 }

    if = { limit = { age > 45 } add = -300 }
}
