N3OW/common/decisions/00_dynasty_decisions.txt
2026-10-09 20:41:46 -03:00

324 lines
7.7 KiB
Text

### Create Cadet Branch ###
create_cadet_branch_decision = {
picture = {
trigger = {
government_is_japanese_trigger = yes
}
reference = "gfx/interface/illustrations/decisions/tgp_poet.dds"
}
picture = {
reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds"
}
decision_group_type = major
ai_check_interval_by_tier = {
barony = 0
county = 12
duchy = 6
kingdom = 1
empire = 1
hegemony = 1
}
is_shown = {
highest_held_title_tier > tier_barony
government_allows = rulers_should_have_dynasty
is_house_head = no
NOR = {
AND = {
has_council_position = councillor_court_chaplain
rite ?= { rite_has_doctrine = doctrine_theocracy_temporal }
}
AND = {
tgp_is_in_ceremonial_house_trigger = yes
has_tgp_dlc_trigger = yes
}
}
exists = house.house_head
is_playable_character = yes
}
is_valid = {
is_adult = yes
government_allows = create_cadet_branches
# Must have living children of same house
custom_tooltip = {
text = create_cadet_branch_decision_living_children
any_child = {
count >= 1
is_alive = yes
house ?= root.house
}
}
# No direct descendant is liege or above
custom_tooltip = {
text = create_cadet_branch_decision_liege_is_descendant
any_liege_or_above_is_descendant = no
}
# If you are Clan, you cannot be in the same realm as your House Head. For simplicity, we'll just force you to be independent.
trigger_if = {
limit = {
government_has_flag = government_is_clan
}
top_liege = this
}
# If you are Administrative, we let the player create a new House much easier, as to have easy access to their own Family Title and Estate.
trigger_else_if = {
limit = { government_allows = noble_families }
trigger_if = {
limit = {
is_ai = yes # We don't want the AI to create cadet branches willy nilly, so they have additional restrictions.
top_liege = house.house_head.top_liege # But we do want the AI to create a cadet branch ASAP if the house head is in a different realm
}
NOT = { is_close_or_extended_family_of = house.house_head }
custom_description = {
text = create_cadet_branch_decision_succession_line
house.house_head = {
NOT = {
any_held_title = {
place_in_line_of_succession = {
target = root
value <= 3
}
}
}
}
}
highest_held_title_tier >= main_administrative_tier
}
# No triggers for players.
}
# For everyone else, you cannot be too close in the line of succession.
trigger_else = {
custom_description = {
text = create_cadet_branch_decision_succession_line
house.house_head = {
NOT = {
any_held_title = {
place_in_line_of_succession = {
target = root
value <= 3
}
}
}
}
}
}
# only feudal or japanese ruler create branch when liege is househead.
trigger_if = {
limit = {
government_is_japanese_trigger = no
NOT = { government_has_flag = government_is_feudal }
}
NOT = { target_is_liege_or_above = house.house_head }
}
# Marriage restrictions
trigger_if = {
limit = { is_male = yes }
trigger_if = {
limit = {
OR = {
is_married = yes
rite = { rite_has_doctrine = doctrine_gender_female_dominated }
}
}
patrilinear_marriage = yes
}
}
trigger_else = {
trigger_if = {
limit = {
OR = {
is_married = yes
rite = { rite_has_doctrine = doctrine_gender_male_dominated }
}
}
matrilinear_marriage = yes
}
}
# Monks need not apply
trigger_if = {
limit = { has_trait = devoted }
NOT = { has_trait = devoted }
}
trigger_if = {
limit = { has_trait = bastard }
NOT = { has_trait = bastard }
}
}
is_valid_showing_failures_only = {
is_available_adult = yes
is_playable_character = yes
}
effect = {
house.house_head ?= { save_scope_as = old_head }
if = {
limit = {
has_tgp_dlc_trigger = yes
culture = {
OR = {
has_cultural_pillar = language_japonic
has_name_list = name_list_yamato
}
}
}
add_character_flag = found_cadet_branch
trigger_event = tgp_japan_decision.9001
show_as_tooltip = {
create_cadet_branch = { save_scope_as = new_house }
if = {
limit = { government_allows = create_cadet_branches }
create_noble_family_effect = { GOVERNMENT_GIVER = scope:old_head }
}
}
}
else = {
found_cadet_house_decision_effect = {
CHARACTER = root
PRESTIGE = major_prestige_gain
}
}
}
ai_potential = {
any_child = { is_alive = yes } # move it beforehand for performance reason
trigger_if = {
limit = {
# always allow branch if in different realm, they need the estate.
NAND = {
government_allows = noble_families
trigger_if = {
limit = { exists = house.house_head.liege }
house.house_head.liege != root
}
}
}
# Childless rulers should not found houses
any_child = {
is_alive = yes
count >= 3
}
NOR = {
# Stop stealing player's house members
any_player = {
OR = {
any_child = {
OR = {
is_child_of = root
is_grandchild_of = root
is_great_grandchild_of = root
}
}
any_child = {
even_if_dead = yes
any_child = {
OR = {
is_child_of = root
is_grandchild_of = root
is_great_grandchild_of = root
}
}
}
any_child = {
even_if_dead = yes
any_child = {
even_if_dead = yes
any_child = {
OR = {
is_child_of = root
is_grandchild_of = root
is_great_grandchild_of = root
}
}
}
}
}
}
}
years_from_game_start >= 5
}
}
ai_will_do = {
base = 30
modifier = { # Dukes and above are more keen
add = {
value = primary_title.tier
subtract = tier_county
multiply = 20
}
}
# we don't want AI to split from their House unless they dislike their house head
modifier = {
add = {
value = 0
subtract = "opinion(house.house_head)"
}
}
# If an admin top liege ever ends up having their house head in a different realm, they should create a cadet branch ASAP
modifier = {
add = 1000
government_allows = noble_families
liege = this
trigger_if = {
limit = { exists = house.house_head.liege }
house.house_head.liege != root
}
}
### TGP
modifier = { # Prefer not to branch away from ruling close family
government_is_japanese_trigger = yes
top_liege.primary_title = {
any_past_holder = { is_close_family_of = root }
}
add = -20
}
modifier = { # Prefer to branch away from leading house if distant to split up blocs
government_is_japanese_trigger = yes
is_landed = yes
top_liege.house = root.house
NOT = { is_close_or_extended_family_of = top_liege }
add = 50
}
modifier = { # Prefer to branch away from house head
government_is_japanese_trigger = yes
NOT = { is_close_or_extended_family_of = house.house_head }
add = 50
}
modifier = { # Ruler should not break family apart
government_is_japanese_trigger = yes
is_independent_ruler = yes
house.house_head ?= { is_vassal_or_below_of = root }
add = -1000
}
modifier = { # Close and extended family prefer to stay with Ritsuryo house heads
government_is_japanese_trigger = yes
government_allows = noble_families
OR = {
is_close_or_extended_family_of = house.house_head
AND = {
top_liege.house ?= house
is_close_or_extended_family_of = top_liege
}
house.house_head = {
any_held_title = {
is_noble_family_title = yes
any_past_holder = { is_close_or_extended_family_of = root }
}
}
}
add = -1000
}
}
}