From 3d3b2572773ab570e65d96171093e6549708175a Mon Sep 17 00:00:00 2001 From: Magpie490 Date: Mon, 2 Jun 2025 20:39:49 +0100 Subject: [PATCH] fix --- common/domiciles/types/00_domicile_types.txt | 4 +- common/governments/00_government_types.txt | 2 +- common/on_action/title_on_actions.txt | 17 +- .../00_administrative_effects.txt | 155 ++++++++++++++++++ .../00_available_for_events_triggers.txt | 37 ++++- 5 files changed, 195 insertions(+), 20 deletions(-) create mode 100644 common/scripted_effects/00_administrative_effects.txt diff --git a/common/domiciles/types/00_domicile_types.txt b/common/domiciles/types/00_domicile_types.txt index 5ab6721d..d76d9c84 100644 --- a/common/domiciles/types/00_domicile_types.txt +++ b/common/domiciles/types/00_domicile_types.txt @@ -895,8 +895,8 @@ estate = { allowed_for_character = { OR ={ - has_government = administrative_government - has_government = republic_government + government_has_flag = government_is_special_republic + government_has_flag = government_is_administrative } } diff --git a/common/governments/00_government_types.txt b/common/governments/00_government_types.txt index 14b553c6..fa8053b9 100644 --- a/common/governments/00_government_types.txt +++ b/common/governments/00_government_types.txt @@ -275,7 +275,7 @@ administrative_government = { rulers_should_have_dynasty = yes dynasty_named_realms = no royal_court = yes - #administrative = yes + administrative = yes landless_playable = yes legitimacy = yes #state_faith = yes diff --git a/common/on_action/title_on_actions.txt b/common/on_action/title_on_actions.txt index 6245c36f..742e0d96 100644 --- a/common/on_action/title_on_actions.txt +++ b/common/on_action/title_on_actions.txt @@ -521,23 +521,16 @@ on_title_gain = { # Note: anything that should be run after creation can go in on_noble_family_title_created if = { limit = { - government_has_flag = government_is_administrative - is_house_head = yes - highest_held_title_tier >= tier_duchy + OR = { + government_has_flag = government_is_administrative + government_has_flag = government_is_special_republic + } + highest_held_title_tier >= tier_county liege = { is_independent_ruler = yes government_has_flag = government_is_administrative } - NOR = { - any_held_title = { is_noble_family_title = yes } - house = { - any_house_member = { - any_held_title = { is_noble_family_title = yes } - } - } - } } - create_noble_family_effect = yes domicile ?= { set_up_domicile_estate_effect = yes } } # Apply Law of the Land title succession law if appropriate diff --git a/common/scripted_effects/00_administrative_effects.txt b/common/scripted_effects/00_administrative_effects.txt new file mode 100644 index 00000000..10f18600 --- /dev/null +++ b/common/scripted_effects/00_administrative_effects.txt @@ -0,0 +1,155 @@ + +change_to_administrative_hereditary_effect = { + scope:recipient = { + save_scope_as = petition_vassal + every_held_title = { + limit = { + tier = scope:petition_vassal.highest_held_title_tier + is_landless_type_title = no + is_noble_family_title = no + } + custom_tooltip = { + text = petition_liege_house_governorship_rights_tt + set_variable = { + name = petition_house_rights + value = scope:petition_vassal.house + years = 100 + } + } + } + } +} + +change_to_administrative_effect = { + save_scope_as = governor + if = { + limit = { + NOT = { government_has_flag = government_is_administrative } + } + change_government = administrative_government + save_scope_as = new_admin + } + if = { + limit = { + primary_title.tier >= tier_duchy + liege = { + is_independent_ruler = yes + government_allows = administrative + } + house.house_head = { + NOT = { + any_held_title = { is_noble_family_title = yes } + } + } + } + create_noble_family_effect = yes + } + + hidden_effect = { + if = { + limit = { + is_governor = yes + NOT = { has_trait = governor } + } + add_trait = governor + } + } + if = { + limit = { exists = scope:new_admin } + domicile ?= { + set_up_domicile_estate_effect = yes + } + } +} + +change_to_administrative_interaction_effect = { + scope:actor = { + pay_short_term_gold = { + target = scope:recipient + gold = { + value = 50 + scope:recipient = { + if = { + limit = { highest_held_title_tier >= tier_kingdom } + multiply = 10 + } + else_if = { + limit = { highest_held_title_tier >= tier_duchy } + multiply = 6 + } + else_if = { + limit = { highest_held_title_tier >= tier_county } + multiply = 3 + } + } + if = { + limit = { scope:gold ?= yes } + add = scope:actor.medium_gold_value + } + if = { + limit = { + scope:actor = { has_realm_law_flag = admin_change_vassal_gov_cheaper } + } + multiply = 0.5 + } + } + } + } + scope:recipient = { change_to_administrative_effect = yes } + if = { + limit = { + scope:hook = yes + scope:actor = { has_usable_hook = scope:recipient } + } + scope:actor = { use_hook = scope:recipient } + } + if = { + limit = { scope:hereditary = yes } + scope:recipient = { save_scope_as = petition_vassal } + change_to_administrative_hereditary_effect = yes + } + if = { + limit = { scope:influence = yes } + scope:actor = { + change_influence = { + value = massive_influence_loss + } + } + } +} + +set_up_domicile_estate_effect = { + if = { + limit = { is_domicile_type = estate } + # Intentionally one level lower than what you can get + if = { + limit = { + NOT = { has_domicile_building_or_higher = estate_main_02 } + owner.culture ?= { has_innovation = innovation_city_planning } + } + add_domicile_building = estate_main_02 + } + if = { + limit = { + has_domicile_building = estate_main_02 + NOT = { has_domicile_building_or_higher = estate_main_03 } + owner.culture ?= { has_innovation = innovation_manorialism } + } + add_domicile_building = estate_main_03 + } + switch = { + trigger = has_domicile_building + estate_main_03 = { + while = { + count = 2 + add_random_internal_estate_building = yes + } + } + estate_main_02 = { + add_random_internal_estate_building = yes + } + } + fill_external_estate_building_effect = yes + } +} + diff --git a/common/scripted_triggers/00_available_for_events_triggers.txt b/common/scripted_triggers/00_available_for_events_triggers.txt index 1dfe91bf..c9990fd6 100644 --- a/common/scripted_triggers/00_available_for_events_triggers.txt +++ b/common/scripted_triggers/00_available_for_events_triggers.txt @@ -17,7 +17,7 @@ #can_become_concubine #is_busy_in_events_localised -# For flags that will never be seen by the player and thus don't need to be localised. +# Despite the name, there are rare instances in which these may become visible to the player - if you add to this list, add localization also is_busy_in_events_unlocalised = { OR = { has_character_flag = is_in_diplomacy_foreign_special_event @@ -30,6 +30,7 @@ is_busy_in_events_unlocalised = { has_character_flag = is_in_intrigue_special_event has_character_flag = is_in_learning_special_event has_character_flag = is_in_task_contract_event_chain + has_character_flag = migration_events_1060_rode_ahead } } @@ -318,6 +319,26 @@ is_within_diplo_range = { } } +# This trigger checks if a character is a Nomad +is_nomad = { + government_has_flag = government_is_nomadic + is_ruler = yes +} + +# This trigger checks if a character is a landed Nomad +is_landed_nomad = { + government_has_flag = government_is_nomadic + is_landed = yes + is_ruler = yes +} + +# Checks if a character is a landless nomad with a domicile +is_landless_nomad = { + government_has_flag = government_is_nomadic + is_landed = no + has_domicile = yes +} + # This trigger checks if a character is a landless adventurer is_landless_adventurer = { government_has_flag = government_is_landless_adventurer @@ -327,17 +348,22 @@ is_landless_adventurer = { # This trigger checks if a character is a governor in an admin realm (implying they are landed) is_governor = { - ghas_government = administrative_government + government_has_flag = government_is_administrative is_landed = yes is_independent_ruler = no highest_held_title_tier >= tier_duchy } +is_governor_or_admin_count = { + government_has_flag = government_is_administrative + is_landed = yes + is_independent_ruler = no + highest_held_title_tier >= tier_county +} # Checks if a character is a landless house_head within an admin realm is_landless_administrative = { - has_government = administrative_government + government_has_flag = government_is_administrative is_landed = no - is_house_head = yes has_domicile = yes } @@ -349,12 +375,13 @@ is_landed_or_landless_administrative = { } } -# Checks if a character is either landed, a landless house head within an admin realm, or a landless adventurer +# Checks if a character is either landed, a landless house head within an admin realm, a landless nomad, or a landless adventurer is_playable_character = { OR = { is_landed = yes is_landless_administrative = yes is_landless_adventurer = yes + is_landless_nomad = yes } }