diff --git a/common/factions/00_factions.txt b/common/factions/00_factions.txt index 7b83b1e46..b4cd590ac 100644 --- a/common/factions/00_factions.txt +++ b/common/factions/00_factions.txt @@ -1,6 +1,6 @@ independence_faction = { casus_belli = independence_faction_war - + short_effect_desc = independence_faction_short_effect_desc sort_order = 2 @@ -34,8 +34,8 @@ FACTION_TYPE2 = liberty_faction FACTION_TYPE3 = populist_faction } - } - + } + demand = { save_scope_as = faction @@ -215,7 +215,7 @@ } } add = 0.25 - } + } } } } @@ -281,7 +281,7 @@ liege = { top_liege = this } - + trigger_if = { limit = { faith.religion = religion:islam_religion @@ -296,10 +296,10 @@ } } } - + trigger_if = { limit = { - government_allows = administrative + government_has_mechanic = administrative } custom_tooltip = { text = admin_high_tier_vassal_create_faction @@ -338,7 +338,7 @@ } # Bloc Cohesion requirement japan_faction_cohesion_trigger = yes - + liege = { top_liege = this } @@ -364,7 +364,7 @@ government_has_flag = government_is_nomadic } } - + trigger_if = { limit = { faith.religion = religion:islam_religion @@ -379,10 +379,10 @@ } } } - + trigger_if = { limit = { - government_allows = administrative + government_has_mechanic = administrative } custom_tooltip = { text = admin_high_tier_vassal_create_faction @@ -419,7 +419,7 @@ common_can_character_join_trigger = { FACTION_TARGET = scope:faction.faction_target } - + trigger_if = { limit = { faith.religion = religion:islam_religion @@ -434,10 +434,10 @@ } } } - + trigger_if = { limit = { - government_allows = administrative + government_has_mechanic = administrative } custom_tooltip = { text = admin_high_tier_vassal_join_faction @@ -516,47 +516,9 @@ liberty_faction = { casus_belli = liberty_faction_war - desc = { - first_valid = { - triggered_desc = { - trigger = { - faction_target = { government_has_flag = government_is_administrative } - } - desc = liberty_faction_desc_admin - } - triggered_desc = { - trigger = { - faction_target = { government_has_flag = government_is_tribal } - } - desc = liberty_faction_desc_tribal - } - triggered_desc = { - trigger = { - faction_target = { government_has_flag = government_is_feudal } - } - desc = liberty_faction_desc_feudal - } - desc = liberty_faction_desc - } - } + desc = liberty_faction_desc - short_effect_desc = { - first_valid = { - triggered_desc = { - trigger = { - faction_target = { government_has_flag = government_is_administrative } - } - desc = liberty_faction_short_effect_desc_admin - } - triggered_desc = { - trigger = { - faction_target = { government_has_flag = government_is_tribal } - } - desc = liberty_faction_short_effect_desc_tribal - } - desc = liberty_faction_short_effect_desc - } - } + short_effect_desc = liberty_faction_short_effect_desc sort_order = 4 @@ -702,10 +664,10 @@ liberty_faction = { has_valid_realm_laws_for_liberty_faction_trigger = { TARGET = scope:target } - + trigger_if = { limit = { - scope:target = { government_allows = administrative } + scope:target = { government_has_mechanic = administrative } } is_vassal_of = scope:target.top_liege } @@ -721,10 +683,10 @@ liberty_faction = { has_valid_realm_laws_for_liberty_faction_trigger = { TARGET = scope:target } - + trigger_if = { limit = { - scope:target = { government_allows = administrative } + scope:target = { government_has_mechanic = administrative } } is_vassal_of = scope:target.top_liege } @@ -740,10 +702,10 @@ liberty_faction = { TARGET = scope:faction.faction_target } } - + trigger_if = { limit = { - scope:faction.faction_target = { government_allows = administrative } + scope:faction.faction_target = { government_has_mechanic = administrative } } is_vassal_of = scope:faction.faction_target } @@ -791,7 +753,7 @@ liberty_faction = { culture = { has_cultural_parameter = house_hostility_more_common } factor = 1.25 - } + } } ai_join_score = { @@ -802,7 +764,7 @@ liberty_faction = { common_join_faction_blockers = { FACTION_TARGET = scope:faction.faction_target } - + ####################### # Standard AI Weights # #AI @@ -915,12 +877,12 @@ claimant_faction = { base = 80 modifier = { - add = 20 + add = 20 faction_target = { has_perk = hard_rule_perk } desc = "FACTION_POWER_HARD_RULE" - } + } #Lower the threshold depending on the state of other factions dynamic_power_threshold_scripted_modifier = { @@ -932,7 +894,7 @@ claimant_faction = { is_valid = { # If the FACTION itself is valid # see also invalidate_claimant_factions_on_death_effect for what happens when the claimant dies - + trigger_if = { limit = { OR = { @@ -946,7 +908,7 @@ claimant_faction = { special_character ?= { is_alive = yes #has_claim_on = root.special_title - NOR = { + NOR = { has_trait = incapable this = root.faction_target } @@ -1120,19 +1082,19 @@ claimant_faction = { common_character_validity_trigger = { FACTION_TARGET = scope:faction.faction_target } - + trigger_if = { limit = { - government_allows = administrative + government_has_mechanic = administrative } scope:faction.faction_target ?= { OR = { top_liege ?= this - NOT = { government_allows = administrative } + NOT = { government_has_mechanic = administrative } } } } - + # TGP - Use Coup against Kampaku instead trigger_if = { limit = { @@ -1266,8 +1228,8 @@ claimant_faction = { } claimant_faction_blockers = { - FACTION_TARGET = scope:faction.faction_target - FACTION_CLAIMANT = scope:faction.special_character + FACTION_TARGET = scope:faction.faction_target + FACTION_CLAIMANT = scope:faction.special_character } common_faction_modifiers = { @@ -1287,7 +1249,7 @@ claimant_faction = { admin_faction_modifiers = { FACTION_TARGET = scope:faction.faction_target FACTION_TYPE = claimant_faction - } + } admin_claimant_faction_modifiers = { FACTION_TARGET = scope:faction.faction_target @@ -1296,15 +1258,15 @@ claimant_faction = { # Faction 'Stacking' Factors, attempts to cluster AI rulers into several powerful factions instead of many weak ones. join_faction_stacking_modifiers = yes - + modifier = { # CE1 Divine Mandate perk desc = "FACTION_REASON_LEGITIMACY_LEGACY_4" liege.dynasty = { has_dynasty_perk = ce1_legitimacy_legacy_4 } add = -10 } - + struggle_faction_modifiers = yes - + #EP3 admin legitimacy event modifier = { desc = "FACTION_REASON_LOW_LEGITIMACY_CHALLENGER" @@ -1351,12 +1313,12 @@ claimant_faction = { county_join_score = { base = -80 # Needs to be less than the weight set in 00_populist_faction.txt, or counties will never join a claimant faction over a populist faction. - # Up to +3 join score per negative opinion (+80 at -27 opinion) if different culture. + # Up to +3 join score per negative opinion (+80 at -27 opinion) if different culture. compare_modifier = { desc = "FACTION_REASON_CLAIMANT_COUNTY_SHARED_CULTURE" trigger = { scope:faction.faction_target.culture != this.title_province.culture - scope:faction.special_character.culture = this.title_province.culture + scope:faction.special_character.culture = this.title_province.culture } value = county_opinion multiplier = -2.0 @@ -1423,7 +1385,7 @@ claimant_faction = { add = -200 this.title_province = scope:faction.faction_target.capital_province } - + # More likely to support adult claimants when a child is on the throne. modifier = { desc = "FACTION_REASON_ADULT_CLAIMANT_CHILD_RULER" @@ -1446,10 +1408,10 @@ claimant_faction = { subtract = scope:faction.special_character.ai_vengefulness # Converts the personality score into a percentage between 0% (will never support) and 100% (really wants to support) - divide = 800 + divide = 800 } - # How big the factor is for supporting this claimant over other factions at max support. + # How big the factor is for supporting this claimant over other factions at max support. multiplier = 2 } } diff --git a/common/factions/00_nation_fracturing_faction.txt b/common/factions/00_nation_fracturing_faction.txt index 0ec024c13..95db8b45b 100644 --- a/common/factions/00_nation_fracturing_faction.txt +++ b/common/factions/00_nation_fracturing_faction.txt @@ -1,6 +1,6 @@ nation_fracturing_faction = { casus_belli = nation_fracturing_faction_war - + short_effect_desc = nation_fracturing_faction_short_effect_desc sort_order = 0 @@ -41,8 +41,10 @@ FACTION_TARGET = scope:faction.faction_target } has_valid_faction_members_trigger = yes + + tgp_realm_has_ceremonial_liege_trigger = no } - + demand = { save_scope_as = faction @@ -81,6 +83,8 @@ # Bloc Cohesion requirement japan_faction_cohesion_trigger = yes + tgp_realm_has_ceremonial_liege_trigger = no + liege = { top_liege = this NOT = { government_has_flag = government_is_theocracy } @@ -99,7 +103,7 @@ government_has_flag = government_is_nomadic is_ai = no } - + trigger_if = { limit = { faith.religion = religion:islam_religion @@ -133,7 +137,9 @@ } # Bloc Cohesion requirement japan_faction_cohesion_trigger = yes - + + tgp_realm_has_ceremonial_liege_trigger = no + liege = { top_liege = this NOT = { government_has_flag = government_is_theocracy } @@ -145,13 +151,13 @@ } } } - + # Only powerfull vassals can create such factions and they need to have either another culture or faith OR = { is_powerful_vassal = yes is_ai = no } - + trigger_if = { limit = { faith.religion = religion:islam_religion @@ -225,7 +231,7 @@ common_can_character_join_trigger = { FACTION_TARGET = scope:faction.faction_target } - + trigger_if = { limit = { faith.religion = religion:islam_religion @@ -362,8 +368,8 @@ is_county_valid = { holder = scope:faction.faction_target OR = { - culture != scope:faction.faction_target.culture - faith != scope:faction.faction_target.faith + culture != scope:faction.faction_target.culture + faith != scope:faction.faction_target.faith } } diff --git a/common/factions/00_peasant_faction_new.txt b/common/factions/00_peasant_faction_new.txt index db62eaf35..8f48234cf 100644 --- a/common/factions/00_peasant_faction_new.txt +++ b/common/factions/00_peasant_faction_new.txt @@ -45,7 +45,15 @@ peasant_faction = { is_county_valid = { # Peasants can only join a faction against their direct liege. Unless their liege is Byzantium trying to restore the Roman Empire, then they go for the emperor - holder = scope:faction.faction_target + trigger_if = { + limit = { + scope:faction.faction_target = { + ep3_restored_rome_hard_mode_trigger = yes + } + } + holder.top_liege = scope:faction.faction_target + } + trigger_else = { holder = scope:faction.faction_target } title_province = { NOR = { has_holding_type = nomad_holding @@ -546,8 +554,18 @@ peasant_faction = { can_county_join = { # Peasants can only join a faction against their direct liege. Unless their liege is Byzantium trying to restore the Roman Empire, then they go for the emperor - - holder = scope:faction.faction_target + trigger_if = { + limit = { + scope:faction.faction_target = { + OR = { + ep3_restored_rome_hard_mode_trigger = yes + has_variable = peasant_war_escalates + } + } + } + holder.top_liege = scope:faction.faction_target + } + trigger_else = { holder = scope:faction.faction_target } title_province = { NOR = { @@ -559,8 +577,18 @@ peasant_faction = { can_county_create = { # Peasants can only join a faction against their direct liege. Unless their liege is Byzantium trying to restore the Roman Empire, then they go for the emperor - - holder = scope:target + trigger_if = { + limit = { + scope:target = { + OR = { + ep3_restored_rome_hard_mode_trigger = yes + has_variable = peasant_war_escalates + } + } + } + holder.top_liege = scope:target + } + trigger_else = { holder = scope:target } scope:target = { NAND = { @@ -698,6 +726,7 @@ peasant_faction = { war_keep_on_attacker_victory = yes } } + } } leader_leaves = { diff --git a/common/factions/10_tgp_factions.txt b/common/factions/10_tgp_factions.txt deleted file mode 100644 index 854bf59bc..000000000 --- a/common/factions/10_tgp_factions.txt +++ /dev/null @@ -1,1491 +0,0 @@ -replace_ceremonial_regent_faction = { - casus_belli = replace_ceremonial_regent_faction_war - - name = FACTION_JAPANESE_REPLACE_REGENT_NAME_DYNAMIC - - desc = { - first_valid = { - desc = replace_ceremonial_regent_faction_desc - } - first_valid = { - triggered_desc = { - trigger = { - faction_leader = { tgp_is_ceremonial_liege_trigger = yes } - } - desc = replace_ceremonial_regent_faction_desc_emperor - } - } - } - - short_effect_desc = { - first_valid = { - triggered_desc = { - trigger = { - faction_leader ?= { tgp_is_ceremonial_liege_trigger = yes } - } - desc = replace_ceremonial_regent_faction_short_effect_desc_emperor - } - desc = replace_ceremonial_regent_faction_short_effect_desc_regent - } - } - - special_character_title = "FACTIONS_WINDOW_JAPANESE_REGENT" - - sort_order = 4 - - show_special_title = yes - - multiple_targeting = yes - - discontent_progress = { - base = 0 - common_discontent_progress_modifier = yes - } - - power_threshold = { - base = 80 - # Hard rule perk - modifier = { - add = 20 - faction_target = { has_perk = hard_rule_perk } - desc = "FACTION_POWER_HARD_RULE" - } - #Lower the threshold depending on the state of other factions - dynamic_power_threshold_scripted_modifier = { - FACTION_TYPE1 = claimant_faction - FACTION_TYPE2 = independence_faction - FACTION_TYPE3 = populist_faction - } - } - - demand = { - save_scope_as = faction - faction_leader = { save_scope_as = faction_leader } - faction_target = { save_scope_as = faction_target } - # Let the human players in the faction know that the demand will be sent - every_faction_member = { - limit = { - is_ai = no - NOT = { this = scope:faction.faction_leader } - } - trigger_event = tgp_faction_events.0105 - } - # Send the actual demand in 5 days - faction_target = { - trigger_event = { - id = tgp_faction_events.0101 - days = 5 - } - } - } - - ai_demand_chance = { - base = 0 - # 30% base chance at minimum power (80%), increasing linearly - compare_modifier = { - value = faction_power - multiplier = 0.375 - } - # Once the faction has a good chance to win (10% stronger than liege) demand chance increases much more rapidly. - compare_modifier = { - trigger = { faction_power > 110 } - value = faction_power - multiplier = 0.75 - } - # Less likely if already in a war with an external ruler - the Liberty Faction is pretty sporting - modifier = { - add = -75 - faction_target = { - any_war_enemy = { - NOT = { target_is_liege_or_above = root.faction_target } - } - } - } - } - - on_war_start = { - every_faction_member = { - limit = { var:gathered_support_for_faction ?= root } - spawn_army = { - name = gathered_support_for_faction_army - levies = { - value = this.massive_influence_value - multiply = 3 - } - men_at_arms = { - type = light_footmen - stacks = 2 - } - location = this.location - war = root.faction_war - inheritable = yes - } - } - } - - is_shown = { - tgp_realm_has_ceremonial_liege_trigger = yes - has_dlc_feature = all_under_heaven - NAND = { - tgp_is_ceremonial_liege_trigger = yes - tgp_is_ceremonial_regent_trigger = no - } - } - - is_valid = { - trigger_if = { - limit = { exists = faction_target } - faction_target = { tgp_install_regent_faction_target_valid_trigger = yes } - } - trigger_if = { - limit = { exists = special_character } - special_character = { is_alive = yes } - } - } - - is_character_valid = { - common_character_validity_trigger = { FACTION_TARGET = scope:faction.faction_target } - } - - can_character_create_ui = { - base_faction_trigger = { FACTION_TYPE = replace_ceremonial_regent_faction } - common_can_character_create_trigger = { FACTION_TARGET = scope:target } - tgp_install_regent_faction_can_create_trigger = yes - NOR = { - custom_tooltip = { - text = not_house_head_allied_to_faction_target_trigger # this is correct, keys are swapped in loc - house ?= scope:target.house - } - custom_tooltip = { - text = not_house_member_of_faction_target_trigger # this is correct, keys are swapped in loc - house.house_head ?= { is_allied_to = scope:target } - } - } - } - - can_character_create = { - common_can_character_create_trigger = { FACTION_TARGET = scope:target } - tgp_install_regent_faction_can_create_trigger = yes - trigger_if = { - limit = { - is_ai = yes - is_male = yes - } - faith = { - OR = { - has_doctrine_parameter = male_dominated_law - has_doctrine_parameter = gender_equal_law - } - } - } - trigger_else_if = { - limit = { - is_ai = yes - is_female = yes - } - faith = { - OR = { - has_doctrine_parameter = female_dominated_law - has_doctrine_parameter = gender_equal_law - } - } - } - trigger_else = { - always = yes - } - NOR = { - custom_tooltip = { - text = not_house_head_allied_to_faction_target_trigger # this is correct, keys are swapped in loc - house ?= scope:target.house - } - custom_tooltip = { - text = not_house_member_of_faction_target_trigger # this is correct, keys are swapped in loc - house.house_head ?= { is_allied_to = scope:target } - } - } - } - - can_character_join = { - common_can_character_join_trigger = { FACTION_TARGET = scope:faction.faction_target } - NOR = { - custom_tooltip = { - text = not_house_head_allied_to_faction_target_trigger # this is correct, keys are swapped in loc - house ?= scope:faction.faction_target.house - } - custom_tooltip = { - text = not_house_member_of_faction_target_trigger # this is correct, keys are swapped in loc - house.house_head ?= { is_allied_to = scope:faction.faction_target } - } - } - japan_faction_cohesion_hard_trigger = yes - } - - can_character_become_leader = { - can_become_leader_of_faction_trigger = yes - is_adult = yes - } - - ai_create_score = { - base = 0 # Join Weight is set primarily based on what Crown Laws a realm has. - ############ - # BLOCKERS # - ############ - common_create_faction_blockers = { - FACTION_TARGET = scope:target - FLAG = recent_replace_regent_faction_war - } - ####################### - # Standard AI Weights # - # - # Modifiers for Liberty Factions are inherently small. - # This is because Liberty is the 'Default Faction' that vassals are join if they don't want/can't join any other faction. - # 'Base Join Weight' depends on the current Crown Authority level. - common_faction_modifiers = { - FACTION_TARGET = scope:target - OPINION_MULTIPLIER = -1 - MAX_OPINION = 0 - POWER = 0 - THRESHOLD = 80 - } - replace_ceremonial_regent_faction_modifiers = { FACTION_TARGET = scope:target } - #House Hostility from Armenian tradition - modifier = { - desc = "FACTION_REASON_HOUSE_HOSTILITY" - NOT = { scope:target.house ?= root.house } - culture = { has_cultural_parameter = house_hostility_more_common } - factor = 1.25 - } - modifier = { - house.house_confederation.leading_house.house_head ?= root - add = 50 - } - # TODO_CD_JP_TGP AWAITING CODE SUPPORT - #modifier = { - # confederation.leading_house.house_head ?= root - # tgp_confederation_military_power > scope:target.tgp_confederation_military_power_half - # add = 50 - #} - - # Extra check on leading house - modifier = { - factor = 0 - NOT = { house.house_confederation.leading_house ?= house } - } - } - - ai_join_score = { - base = 0 # Join Weight is set primarily based on what Crown Laws a realm has. - ############ - # BLOCKERS # - common_join_faction_blockers = { FACTION_TARGET = scope:faction.faction_target } - ####################### - # Standard AI Weights # - #AI - # Modifiers for Liberty Factions are inherently small. - # This is because Liberty is the 'Default Faction' that vassals are join if they don't want/can't join any other faction. - common_faction_modifiers = { - FACTION_TARGET = scope:faction.faction_target - OPINION_MULTIPLIER = -1 - MAX_OPINION = 0 - POWER = scope:faction.faction_power - THRESHOLD = scope:faction.faction_power_threshold - } - replace_ceremonial_regent_faction_modifiers = { FACTION_TARGET = scope:faction.faction_target } - struggle_faction_modifiers = yes - modifier = { - is_allied_to = scope:faction.faction_leader - NOT = { is_allied_to = scope:faction.faction_target } - add = 25 - } - modifier = { - house ?= scope:faction.faction_leader.house - add = 15 - desc = "FACTION_REASON_SAME_HOUSE_LEADER" - } - modifier = { - dynasty ?= scope:faction.faction_leader.dynasty - add = 10 - desc = "FACTION_REASON_SAME_DYNASTY_LEADER" - } - modifier = { - house ?= scope:faction.faction_target.house - add = -15 - desc = "FACTION_REASON_SAME_HOUSE_TARGET" - } - modifier = { - dynasty ?= scope:faction.faction_target.dynasty - add = -10 - desc = "FACTION_REASON_SAME_DYNASTY_TARGET" - } - #House Hostility from Armenian tradition - modifier = { - desc = "FACTION_REASON_HOUSE_HOSTILITY" - NOT = { scope:faction.faction_target.house ?= root.house } - culture = { has_cultural_parameter = house_hostility_more_common } - factor = 1.25 - } - #EP3 admin legitimacy event - modifier = { - desc = "FACTION_REASON_LOW_LEGITIMACY_CHALLENGER" - add = 25 - scope:faction = { - any_faction_member = { has_character_flag = low_legitimacy_admin_factions_flag } - } - } - } - - on_creation = { - save_scope_as = faction - set_special_title = scope:faction.faction_leader.top_liege.primary_title - set_special_character = scope:faction.faction_leader - tgp_bloc_members_join_faction_effect = yes - if = { - limit = { - any_player = { - is_landless_adventurer = yes - is_within_diplo_range = { CHARACTER = scope:faction.faction_target } - OR = { - has_contact = scope:faction.faction_leader - NOT = { has_contact = scope:faction.faction_target } - } - any_character_task_contract = { - has_task_contract_type = laamp_join_faction_contract - count <= 3 - } - can_create_task_contract = { - type_name = laamp_join_faction_contract - employer = scope:faction.faction_leader - } - save_temporary_scope_as = player_laamp - } - } - scope:player_laamp = { - create_task_contract = { - task_contract_type = laamp_join_faction_contract - task_contract_tier = scope:faction.faction_leader.task_contract_tier_value - location = scope:faction.faction_leader.primary_title.title_province - task_contract_employer = scope:faction.faction_leader - target = scope:faction.faction_target - } - } - } - } - - county_allow_join = no - county_allow_create = no -} - -restore_ceremonial_liege_faction = { - casus_belli = restore_ceremonial_liege_faction_war - - name = FACTION_JAPANESE_RESTORE_EMPEROR_NAME_DYNAMIC - - desc = { - desc = restore_ceremonial_liege_faction_desc - } - short_effect_desc = restore_ceremonial_liege_faction_short_effect_desc - - special_character_title = "FACTIONS_WINDOW_JAPANESE_RESTORE_EMPEROR" - - sort_order = 4 - - show_special_title = yes - - multiple_targeting = no - - discontent_progress = { - base = 0 - common_discontent_progress_modifier = yes - } - - power_threshold = { - base = 80 - # Hard rule perk - modifier = { - add = 20 - faction_target = { has_perk = hard_rule_perk } - desc = "FACTION_POWER_HARD_RULE" - } - #Lower the threshold depending on the state of other factions - dynamic_power_threshold_scripted_modifier = { - FACTION_TYPE1 = claimant_faction - FACTION_TYPE2 = independence_faction - FACTION_TYPE3 = populist_faction - } - } - - demand = { - save_scope_as = faction - faction_leader = { save_scope_as = faction_leader } - faction_target = { save_scope_as = faction_target } - # Let the human players in the faction know that the demand will be sent - every_faction_member = { - limit = { - is_ai = no - NOT = { this = scope:faction.faction_leader } - } - trigger_event = tgp_faction_events.0205 - } - # Send the actual demand in 5 days - faction_target = { - trigger_event = { - id = tgp_faction_events.0201 - days = 5 - } - } - } - - ai_demand_chance = { - base = 0 - # 30% base chance at minimum power (80%), increasing linearly - compare_modifier = { - value = faction_power - multiplier = 0.375 - } - # Once the faction has a good chance to win (10% stronger than liege) demand chance increases much more rapidly. - compare_modifier = { - trigger = { faction_power > 110 } - value = faction_power - multiplier = 0.75 - } - # Less likely if already in a war with an external ruler - the Liberty Faction is pretty sporting - modifier = { - add = -75 - faction_target = { - any_war_enemy = { - NOT = { target_is_liege_or_above = root.faction_target } - } - } - } - } - - on_war_start = { - every_faction_member = { - limit = { var:gathered_support_for_faction ?= root } - spawn_army = { - name = gathered_support_for_faction_army - levies = { - value = this.massive_influence_value - multiply = 3 - } - men_at_arms = { - type = light_footmen - stacks = 2 - } - location = this.location - war = root.faction_war - inheritable = yes - } - } - } - - is_shown = { - tgp_realm_has_ceremonial_liege_trigger = yes - top_liege = { tgp_has_ceremonial_liege_title_trigger = no } - has_dlc_feature = all_under_heaven - } - - is_valid = { - trigger_if = { - limit = { exists = special_character } - special_character = { is_alive = yes } - } - } - - is_character_valid = { - common_character_validity_trigger = { FACTION_TARGET = scope:faction.faction_target } - trigger_if = { - limit = { - government_is_japanese_trigger = yes - exists = scope:faction.faction_leader - } - scope:faction = { - any_faction_member = { - this = root.house.house_confederation.leading_house.house_head - } - } - house.house_confederation ?= { - OR = { - leading_house.house_head ?= scope:faction.faction_leader - leading_house.house_head ?= { tgp_is_ceremonial_liege_trigger = yes } - } - OR = { - has_cohesion_level_parameter = bloc_leader_unlocks_restore_emperor_faction - root.joined_faction ?= { - faction_is_at_war = yes - } - } - } - } - } - - can_character_become_leader = { - can_become_leader_of_faction_trigger = yes - } - - can_character_create_ui = { - base_faction_trigger = { FACTION_TYPE = restore_ceremonial_liege_faction } - common_can_character_create_trigger = { FACTION_TARGET = scope:target } - restore_ceremonial_liege_faction_can_create_trigger = yes - } - - can_character_create = { - common_can_character_create_trigger = { FACTION_TARGET = scope:target } - restore_ceremonial_liege_faction_can_create_trigger = yes - } - - can_character_join = { - common_can_character_join_trigger = { FACTION_TARGET = scope:faction.faction_target } - NOR = { - house ?= { - this = scope:faction.faction_target.house - house_head ?= { is_allied_to = scope:faction.faction_target } - } - is_allied_to = scope:faction.faction_target - } - scope:faction.faction_target ?= { - is_independent_ruler = yes - tgp_realm_has_ceremonial_liege_trigger = yes - tgp_has_ceremonial_liege_title_trigger = no - } - } - - ai_create_score = { - base = 0 # Join Weight is set primarily based on what Crown Laws a realm has. - ############ - # BLOCKERS # - ############ - common_create_faction_blockers = { - FACTION_TARGET = scope:target - FLAG = recent_restore_ceremonial_liege_faction_war - } - ####################### - # Standard AI Weights # - # 'Base Join Weight' depends on the current Crown Authority level. - common_faction_modifiers = { - FACTION_TARGET = scope:target - OPINION_MULTIPLIER = -1 - MAX_OPINION = 0 - POWER = 0 - THRESHOLD = 80 - } - restore_ceremonial_liege_faction_modifiers = { FACTION_TARGET = scope:target } - #House Hostility from Armenian tradition - modifier = { - desc = "FACTION_REASON_HOUSE_HOSTILITY" - NOT = { scope:target.house ?= root.house } - culture = { has_cultural_parameter = house_hostility_more_common } - factor = 1.25 - } - - # Extra check on leading house - modifier = { - factor = 0 - NOT = { house.house_confederation.leading_house ?= house } - } - } - - ai_join_score = { - base = 0 # Join Weight is set primarily based on what Crown Laws a realm has. - ############ - # BLOCKERS # - common_join_faction_blockers = { FACTION_TARGET = scope:faction.faction_target } - ####################### - # Standard AI Weights # - common_faction_modifiers = { - FACTION_TARGET = scope:faction.faction_target - OPINION_MULTIPLIER = -1 - MAX_OPINION = 0 - POWER = scope:faction.faction_power - THRESHOLD = scope:faction.faction_power_threshold - } - restore_ceremonial_liege_faction_modifiers = { FACTION_TARGET = scope:faction.faction_target } - struggle_faction_modifiers = yes - #House Hostility from Armenian tradition - modifier = { - desc = "FACTION_REASON_HOUSE_HOSTILITY" - NOT = { scope:faction.faction_target.house ?= root.house } - culture = { has_cultural_parameter = house_hostility_more_common } - factor = 1.25 - } - #EP3 admin legitimacy event - modifier = { - desc = "FACTION_REASON_LOW_LEGITIMACY_CHALLENGER" - add = 25 - scope:faction = { - any_faction_member = { has_character_flag = low_legitimacy_admin_factions_flag } - } - } - } - - on_creation = { - save_scope_as = faction - scope:faction ?= { - random_faction_member = { - limit = { - house.house_confederation.leading_house.house_head ?= this - } - save_scope_as = faction_leader_scope - } - } - - if = { # Japanese blocs - limit = { scope:faction_leader_scope.house.house_confederation.leading_house ?= scope:faction_leader_scope.house } - scope:faction_leader_scope.house.house_confederation ?= { - every_confederation_member = { - limit = { can_join_faction = scope:faction } - join_faction = scope:faction - } - } - } - - set_special_title = scope:faction_leader_scope.top_liege.primary_title.var:administrative_ui_special_title - set_special_character = scope:faction_leader_scope.top_liege.primary_title.var:administrative_ui_special_title.holder - - if = { - limit = { - any_player = { - is_landless_adventurer = yes - is_within_diplo_range = { CHARACTER = scope:faction.faction_target } - OR = { - has_contact = scope:faction_leader_scope - NOT = { has_contact = scope:faction.faction_target } - } - any_character_task_contract = { - has_task_contract_type = laamp_join_faction_contract - count <= 3 - } - can_create_task_contract = { - type_name = laamp_join_faction_contract - employer = scope:faction_leader_scope - } - save_temporary_scope_as = player_laamp - } - } - scope:player_laamp = { - create_task_contract = { - task_contract_type = laamp_join_faction_contract - task_contract_tier = scope:faction_leader_scope.task_contract_tier_value - location = scope:faction_leader_scope.primary_title.title_province - task_contract_employer = scope:faction_leader_scope - target = scope:faction.faction_target - } - } - } - } - - county_allow_join = no - county_allow_create = no -} - -ceremonial_claimant_faction = { - casus_belli = ceremonial_claimant_faction_war - - short_effect_desc = claimant_faction_short_effect_desc - - sort_order = 1 - - character_interaction = create_ceremonial_claimant_faction_against_interaction - - show_special_title = yes - name = FACTION_CEREMONIAL_CLAIMANT_DYNAMIC_NAME - - claimant = yes - - discontent_progress = { - base = 0 - - common_discontent_progress_modifier = yes - } - - power_threshold = { - base = 80 - - modifier = { - add = 20 - faction_target = { - has_perk = hard_rule_perk - } - desc = "FACTION_POWER_HARD_RULE" - } - - #Lower the threshold depending on the state of other factions - dynamic_power_threshold_scripted_modifier = { - FACTION_TYPE1 = liberty_faction - FACTION_TYPE2 = independence_faction - FACTION_TYPE3 = populist_faction - } - } - - is_shown = { - tgp_realm_has_ceremonial_liege_trigger = yes - top_liege = { tgp_is_ceremonial_regent_trigger = yes } - has_dlc_feature = all_under_heaven - NAND = { - tgp_is_ceremonial_liege_trigger = yes - tgp_is_ceremonial_regent_trigger = no - } - } - - # Is valid? - # (see also invalidate_claimant_factions_on_death_effect for what happens when the claimant dies) - is_valid = { # If the FACTION itself is valid - trigger_if = { - limit = { - OR = { - exists = special_character - exists = faction_war - } - } - OR = { - special_title.holder ?= faction_target - special_title.holder.top_liege ?= faction_target - } - faction_target = { tgp_realm_has_ceremonial_liege_trigger = yes } - OR = { - special_character ?= { - is_alive = yes - #has_claim_on = root.special_title - NOR = { - has_trait = incapable - this = root.faction_target - } - trigger_if = { #If they're imprisoned by the faction target they can only be so for five years before invalidating - limit = { is_imprisoned_by = root.faction_target } - time_in_prison_type = { years < 5 } - } - } - exists = faction_war - } - } - } - - demand = { # The effect of pressing demand - save_scope_as = faction - faction_leader = { save_scope_as = faction_leader } - faction_target = { save_scope_as = faction_target } - special_character = { save_scope_as = faction_claimant } - special_title = { save_scope_as = faction_targeted_title } - # Let the human players in the faction know that the demand will be sent - every_faction_member = { - limit = { - is_ai = no - this != scope:faction.faction_leader - } - trigger_event = faction_demand.2015 - } - # Send the actual demand in 5 days - faction_target = { - trigger_event = { - id = faction_demand.2011 - days = 5 - } - } - } - - ai_demand_chance = { - base = 0 - - #Won't send ultimatum if the claimant is imprisoned by the faction-target! - modifier = { - add = -500 - special_character = { is_imprisoned_by = root.faction_target } - } - - # Won't start a war is the Realm is fighting against a Dissolution faction or Independent factions: you want to get the best realm possible. Better wait a bit longer - modifier = { - add = -1000 - faction_target = { - any_character_war = { - OR = { - using_cb = independence_faction_war - using_cb = independence_war - using_cb = nation_fracturing_faction_war - } - } - } - } - - # 40% base chance at minimum power (80%), increasing linearly - compare_modifier = { - value = faction_power - multiplier = 0.5 - } - - # Once the faction has a good chance to win (10% stronger than liege) demand chance increases much more rapidly. - compare_modifier = { - trigger = { faction_power > 110 } - value = faction_power - multiplier = 1 - } - - # Less likely if already in a war with an external ruler - modifier = { - add = -50 - faction_target = { - any_war_enemy = { - NOT = { target_is_liege_or_above = root.faction_target } - } - } - } - } - - on_war_start = { - every_faction_member = { - limit = { - has_variable = gathered_support_for_faction - var:gathered_support_for_faction = root - } - spawn_army = { - name = gathered_support_for_faction_army - levies = { - value = this.massive_influence_value - multiply = 3 - } - men_at_arms = { - type = light_footmen - stacks = 2 - } - location = this.location - war = root.faction_war - inheritable = yes - } - } - } - - is_character_valid = { # Is the character valid to stay in the faction? This is also checked when creating it... - common_character_validity_trigger = { - FACTION_TARGET = scope:faction.faction_target - } - tgp_realm_has_ceremonial_liege_trigger = yes - has_valid_faction_members_trigger = yes - } - - can_character_create_ui = { - base_faction_trigger = { FACTION_TYPE = ceremonial_claimant_faction } - - common_can_character_create_trigger = { - FACTION_TARGET = scope:target - } - ceremonial_claimant_faction_can_create_trigger = yes - } - - can_character_create = { # If a character is allowed to create the faction. The 'is_character_valid' block is also checked in conjunction with this when creating a faction. - common_can_character_create_trigger = { - FACTION_TARGET = scope:target - } - ceremonial_claimant_faction_can_create_trigger = yes - } - - can_character_join = { # Can a character join an existing faction? - common_can_character_join_trigger = { - FACTION_TARGET = scope:faction.faction_target - } - japan_faction_cohesion_hard_trigger = yes - } - - can_character_become_leader = { - can_become_leader_of_faction_trigger = yes - } - - ai_create_score = { # How likely is an AI to create a faction? - base = -25 - - #### - # BLOCKERS - #### - common_create_faction_blockers = { - FACTION_TARGET = scope:target - FLAG = recent_ceremonial_claimant_faction_war - } - - ceremonial_claimant_faction_blockers = { - FACTION_TARGET = scope:target.top_liege.primary_title.var:administrative_ui_special_title.holder - FACTION_CLAIMANT = scope:claimant - } - - #### - # AI modifiers - #### - common_faction_modifiers = { - FACTION_TARGET = scope:target - OPINION_MULTIPLIER = -1.5 - MAX_OPINION = 150 - POWER = 0 - THRESHOLD = 80 - } - - ceremonial_claimant_faction_modifiers = { - FACTION_TARGET = scope:target.top_liege.primary_title.var:administrative_ui_special_title.holder - FACTION_CLAIMANT = scope:claimant - FACTION_TITLE = scope:title - } - - # Extra check on leading house - modifier = { - factor = 0 - NOT = { house.house_confederation.leading_house ?= house } - } - } - - ai_join_score = { # How likely is an AI to join an existing faction? - base = -25 - - common_join_faction_blockers = { - FACTION_TARGET = scope:faction.faction_target - } - - ceremonial_claimant_faction_blockers = { - FACTION_TARGET = scope:faction.faction_target - FACTION_CLAIMANT = scope:faction.special_character - } - - common_faction_modifiers = { - FACTION_TARGET = scope:faction.faction_target - OPINION_MULTIPLIER = -1 - MAX_OPINION = 100 - POWER = scope:faction.faction_power - THRESHOLD = scope:faction.faction_power_threshold - } - - ceremonial_claimant_faction_modifiers = { - FACTION_TARGET = scope:target.top_liege.primary_title.var:administrative_ui_special_title.holder - FACTION_CLAIMANT = scope:claimant - FACTION_TITLE = scope:title - } - - admin_faction_modifiers = { - FACTION_TARGET = scope:faction.faction_target - FACTION_TYPE = claimant_faction - } - - admin_claimant_faction_modifiers = { - FACTION_TARGET = scope:faction.faction_target - FACTION_CLAIMANT = scope:faction.special_character - } - - # Faction 'Stacking' Factors, attempts to cluster AI rulers into several powerful factions instead of many weak ones. - join_faction_stacking_modifiers = yes - - modifier = { # CE1 Divine Mandate perk - desc = "FACTION_REASON_LEGITIMACY_LEGACY_4" - liege.dynasty = { has_dynasty_perk = ce1_legitimacy_legacy_4 } - add = -10 - } - - struggle_faction_modifiers = yes - - #EP3 admin legitimacy event - modifier = { - desc = "FACTION_REASON_LOW_LEGITIMACY_CHALLENGER" - add = 25 - scope:faction = { - any_faction_member = { - has_character_flag = low_legitimacy_admin_factions_flag - } - } - } - - #EP3 King of England disgruntled vassals/life threatened modifiers - modifier = { - desc = "FACTION_REASON_CLAIMANT_DISGRUNTLED_VASSALS" - add = 25 - liege = { - has_character_modifier = ep3_disgruntled_vassals_modifier - } - } - modifier = { - desc = "FACTION_REASON_CLAIMANT_DISGRUNTLED_VASSALS" - add = 25 - liege = { - has_character_modifier = ep3_life_threatened_modifier - } - } - } - - is_county_valid = { - scope:faction.faction_target = holder - } - - can_county_join = { - # Counties can only join if the De Jure belong to the title being claimed. - exists = scope:faction.special_title - target_is_de_jure_liege_or_above = scope:faction.special_title - } - - county_join_score = { - base = -80 # Needs to be less than the weight set in 00_populist_faction.txt, or counties will never join a claimant faction over a populist faction. - - # Up to +3 join score per negative opinion (+80 at -27 opinion) if different culture. - compare_modifier = { - desc = "FACTION_REASON_CLAIMANT_COUNTY_SHARED_CULTURE" - trigger = { - scope:faction.faction_target.culture != this.title_province.culture - scope:faction.special_character.culture = this.title_province.culture - } - value = county_opinion - multiplier = -2.0 - } - compare_modifier = { - desc = "FACTION_REASON_CLAIMANT_COUNTY_SHARED_HERITAGE" - trigger = { - NOT = { this.title_province.culture = { has_same_culture_heritage = scope:faction.faction_target.culture } } - this.title_province.culture = { has_same_culture_heritage = scope:faction.special_character.culture } - } - value = county_opinion - multiplier = -2.0 - } - - # If we have better relations with the claimant's faith than our current liege's, gain up to +5 join score per negative opinion (at Righteous) down to +1 join score per negative opinion (at Hostile). - compare_modifier = { - desc = "FACTION_REASON_LIKE_CLAIMANT_FAITH" - trigger = { - faith = { - faith_hostility_level_comparison = { - scope:faction.faction_target.faith > scope:faction.special_character.faith - } - } - } - value = county_opinion - multiplier = { - value = 0.0 - if = { - limit = { - faith = { - faith_hostility_level = { - target = scope:faction.special_character.faith - value = faith_hostile_level - } - } - } - value = -1.0 # Hostile - } - else_if = { - limit = { - faith = { - faith_hostility_level = { - target = scope:faction.special_character.faith - value = faith_astray_level - } - } - } - value = -3.0 # Astray - } - else = { - value = -5.0 # Righteous - } - } - } - - legalism_virtue_and_sin_modifier = { - TARGET = scope:faction.faction_target - SCORE_PER_TRAIT = 50 # Worth ~12 opinion per virtue. - } - - # Greatly reduced chance for a character's capital county to form a faction against them (extra -25 opinion needed). - modifier = { - desc = "FACTION_REASON_CAPITAL_COUNTY" - add = -200 - this.title_province = scope:faction.faction_target.capital_province - } - - # More likely to support adult claimants when a child is on the throne. - modifier = { - desc = "FACTION_REASON_ADULT_CLAIMANT_CHILD_RULER" - add = 10 - exists = scope:faction.faction_target - exists = scope:faction.special_character - scope:faction.faction_target = { is_adult = no } - scope:faction.special_character = { is_adult = yes } - } - - # Peasants perfer magnanimous rulers over harsh or cruel ones. - compare_modifier = { - desc = "FACTION_REASON_CLAIMANT_KINDNESS" - factor = { - # Gets a value between 0 (max greedy/dishonorable/vengeful/cruel) and 800 (max honorable/compassionate/generous/forgiving). - value = 400 - add = scope:faction.special_character.ai_honor - add = scope:faction.special_character.ai_compassion - subtract = scope:faction.special_character.ai_greed - subtract = scope:faction.special_character.ai_vengefulness - - # Converts the personality score into a percentage between 0% (will never support) and 100% (really wants to support) - divide = 800 - } - - # How big the factor is for supporting this claimant over other factions at max support. - multiplier = 2 - } - } - - on_creation = { - save_scope_as = faction - tgp_bloc_members_join_faction_effect = yes - if = { - limit = { - any_player = { - has_government = landless_adventurer_government - is_within_diplo_range = { CHARACTER = scope:faction.faction_target } - OR = { - has_contact = scope:faction.faction_leader - has_contact = scope:faction.special_character - NOT = { has_contact = scope:faction.faction_target } - } - any_character_task_contract = { - task_contract_type = laamp_join_faction_contract - count <= 3 - } - can_create_task_contract = { - type_name = laamp_join_faction_contract - employer = scope:faction.faction_leader - } - save_temporary_scope_as = player_laamp - } - } - scope:player_laamp = { - create_task_contract = { - task_contract_type = laamp_join_faction_contract - task_contract_tier = scope:faction.faction_leader.task_contract_tier_value - location = scope:faction.faction_leader.primary_title.title_province - task_contract_employer = scope:faction.faction_leader - target = scope:faction.faction_target - } - } - } - } - - county_allow_join = yes - county_allow_create = no - county_power = county_levies_to_raise - - character_allow_create = yes - - character_allow_join = yes - - multiple_targeting = yes - - special_character_title = "FACTIONS_WINDOW_CLAIMANT" - - ignore_soft_block = yes -} - -imperial_policy_faction = { - casus_belli = imperial_policy_faction_war - - desc = imperial_policy_faction_desc - - short_effect_desc = imperial_policy_faction_short_effect_desc - - sort_order = 4 - - is_shown = { - realm_law_use_imperial_policy_trigger = yes - NAND = { - tgp_is_ceremonial_liege_trigger = yes - tgp_is_ceremonial_regent_trigger = no - } - } - - discontent_progress = { - base = 0 - - common_discontent_progress_modifier = yes - } - - power_threshold = { - base = 80 - - modifier = { - add = 20 - faction_target = { - has_perk = hard_rule_perk - } - desc = "FACTION_POWER_HARD_RULE" - } - - #Lower the threshold depending on the state of other factions - dynamic_power_threshold_scripted_modifier = { - FACTION_TYPE1 = claimant_faction - FACTION_TYPE2 = independence_faction - FACTION_TYPE3 = liberty_faction - } - } - - demand = { - save_scope_as = faction - - faction_leader = { - save_scope_as = faction_leader - } - - faction_target = { - save_scope_as = faction_target - } - - # Let the human players in the faction know that the demand will be sent - every_faction_member = { - limit = { - is_ai = no - this != scope:faction.faction_leader - } - trigger_event = faction_demand.0225 - } - - # Send the actual demand in 5 days - faction_target = { - trigger_event = { - id = faction_demand.0221 - days = 5 - } - } - } - - ai_demand_chance = { - base = 0 - - # 30% base chance at minimum power (80%), increasing linearly - compare_modifier = { - value = faction_power - multiplier = 0.375 - } - - # Once the faction has a good chance to win (10% stronger than liege) demand chance increases much more rapidly. - compare_modifier = { - trigger = { faction_power > 110 } - value = faction_power - multiplier = 0.75 - } - - # Less likely if already in a war with an external ruler - the Liberty Faction is pretty sporting - modifier = { - add = -75 - faction_target = { - any_war_enemy = { - NOT = { - target_is_liege_or_above = root.faction_target - } - } - } - } - - modifier = { - add = -1000 - faction_target = { - involved_activity ?= { - has_activity_type = activity_coronation - activity_host = prev - } - } - } - } - - on_war_start = { - every_faction_member = { - limit = { - has_variable = gathered_support_for_faction - var:gathered_support_for_faction = root - } - spawn_army = { - name = gathered_support_for_faction_army - levies = { - value = this.massive_influence_value - multiply = 3 - } - men_at_arms = { - type = light_footmen - stacks = 2 - } - location = this.location - war = root.faction_war - inheritable = yes - } - } - } - - is_valid = { - faction_target ?= { - is_independent_ruler = yes - realm_law_use_imperial_policy_trigger = yes - } - } - - is_character_valid = { - common_character_validity_trigger = { - FACTION_TARGET = scope:faction.faction_target - } - has_valid_faction_members_trigger = yes - } - - can_character_create_ui = { - base_faction_trigger = { FACTION_TYPE = imperial_policy_faction } - common_can_character_create_trigger = { - FACTION_TARGET = scope:target - } - imperial_policy_faction_can_create_trigger = yes - } - - can_character_create = { - common_can_character_create_trigger = { - FACTION_TARGET = scope:target - } - imperial_policy_faction_can_create_trigger = yes - } - - can_character_join = { - common_can_character_join_trigger = { - FACTION_TARGET = scope:faction.faction_target - } - - trigger_if = { - limit = { - scope:faction.faction_target = { government_has_flag = government_is_administrative } - } - scope:faction.faction_target = { - top_liege = this - } - } - realm_law_use_imperial_policy_trigger = yes - japan_faction_cohesion_trigger = yes - } - - can_character_become_leader = { - can_become_leader_of_faction_trigger = yes - } - - ai_create_score = { - base = 0 # Join Weight is set primarily based on what Crown Laws a realm has. - - ############ - # BLOCKERS # - ############ - common_create_faction_blockers = { - FACTION_TARGET = scope:target - FLAG = recent_imperial_policy_faction_war - } - - ####################### - # Standard AI Weights # - # - # Modifiers for Liberty Factions are inherently small. - # This is because Liberty is the 'Default Faction' that vassals are join if they don't want/can't join any other faction. - # 'Base Join Weight' depends on the current Crown Authority level. - common_faction_modifiers = { - FACTION_TARGET = scope:target - OPINION_MULTIPLIER = -1 - MAX_OPINION = 0 - POWER = 0 - THRESHOLD = 80 - } - - imperial_policy_faction_modifiers = { - FACTION_TARGET = scope:target - } - #House Hostility from Armenian tradition - modifier = { - desc = "FACTION_REASON_HOUSE_HOSTILITY" - - scope:target.house ?= { - this != root.house - } - culture = { has_cultural_parameter = house_hostility_more_common } - - factor = 1.25 - } - - # Extra check on leading house - modifier = { - factor = 0 - NOT = { house.house_confederation.leading_house ?= house } - } - } - - ai_join_score = { - base = 0 # Join Weight is set primarily based on what Crown Laws a realm has. - - ############ - # BLOCKERS # - common_join_faction_blockers = { - FACTION_TARGET = scope:faction.faction_target - } - - ####################### - # Standard AI Weights # - #AI - # Modifiers for Liberty Factions are inherently small. - # This is because Liberty is the 'Default Faction' that vassals are join if they don't want/can't join any other faction. - common_faction_modifiers = { - FACTION_TARGET = scope:faction.faction_target - OPINION_MULTIPLIER = -1 - MAX_OPINION = 0 - POWER = scope:faction.faction_power - THRESHOLD = scope:faction.faction_power_threshold - } - - imperial_policy_faction_modifiers = { - FACTION_TARGET = scope:faction.faction_target - } - - struggle_faction_modifiers = yes - - #House Hostility from Armenian tradition - modifier = { - desc = "FACTION_REASON_HOUSE_HOSTILITY" - - scope:faction.faction_target.house ?= { - this != root.house - } - culture = { has_cultural_parameter = house_hostility_more_common } - - factor = 1.25 - } - #EP3 admin legitimacy event - modifier = { - desc = "FACTION_REASON_LOW_LEGITIMACY_CHALLENGER" - add = 25 - scope:faction = { - any_faction_member = { - has_character_flag = low_legitimacy_admin_factions_flag - } - } - } - } - - on_creation = { - save_scope_as = faction - tgp_bloc_members_join_faction_effect = yes - if = { - limit = { - any_player = { - has_government = landless_adventurer_government - is_within_diplo_range = { CHARACTER = scope:faction.faction_target } - OR = { - has_contact = scope:faction.faction_leader - NOT = { has_contact = scope:faction.faction_target } - } - any_character_task_contract = { - task_contract_type = laamp_join_faction_contract - count <= 3 - } - can_create_task_contract = { - type_name = laamp_join_faction_contract - employer = scope:faction.faction_leader - } - save_temporary_scope_as = player_laamp - } - } - scope:player_laamp = { - create_task_contract = { - task_contract_type = laamp_join_faction_contract - task_contract_tier = scope:faction.faction_leader.task_contract_tier_value - location = scope:faction.faction_leader.primary_title.title_province - task_contract_employer = scope:faction.faction_leader - target = scope:faction.faction_target - } - } - } - } - - county_allow_join = no - county_allow_create = no -} diff --git a/common/lease_contracts/00_theocracy_lease.txt b/common/lease_contracts/00_theocracy_lease.txt deleted file mode 100644 index 53ceb24fb..000000000 --- a/common/lease_contracts/00_theocracy_lease.txt +++ /dev/null @@ -1,317 +0,0 @@ -# Definition of lease used for organized churches. Required for the game to run. -theocracy_lease = { - hierarchy = { - type = vassal - ruler_valid = { - rite ?= { rite_has_doctrine = doctrine_theocracy_temporal } - NOT = { government_has_flag = government_is_theocracy } - } - liege_or_vassal_valid = { - faith = scope:target.faith - } - lessee = cp:councillor_court_chaplain - barony_valid = { - title_province = { has_holding_type = church_holding } - } - } - - government = theocracy_government - valid_holdings = { church_holding } - ruler_share_min_opinion_from_lessee = 1 - hook_strength_max_opinion = strong - - tax_split = { - lease_liege = 0.25 - ruler_max = 0.25 - ruler = { - if = { - limit = { - scope:lessee = { - court_chaplain_endorse_override_trigger = yes - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_STRONG_HOOK - value = 0.25 - } - } - else_if = { - limit = { is_ai = yes } - add = { - desc = THEOCRATIC_LEASE_RATIO_FROM_OPINION - value = { - scope:lessee = { value = "opinion(scope:ruler)" } - } - divide = 400 - } - } - - save_temporary_value_as = current_total - if = { - limit = { scope:current_total > 0.25 } - max = { - desc = THEOCRATIC_LEASE_RATIO_MAX_25 - value = 0.25 - } - } - } - } - - levy_split = { - lease_liege = 0.15 - ruler_max = 0.50 - ruler = { - if = { - limit = { - scope:lessee = { court_chaplain_endorse_override_trigger = yes } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_STRONG_HOOK - value = 0.5 - } - } - else = { - add = { - desc = THEOCRATIC_LEASE_RATIO_FROM_OPINION - value = { - scope:lessee = { value = "opinion(scope:ruler)" } - } - divide = 200 - } - } - max = 0.5 - } - } -} - - -# Definition of lease used for Ecclesiastical churches (Christian) -ecclesiastical_lease = { - hierarchy = { - type = clerical_region - ruler_valid = { - rite = { rite_has_doctrine = doctrine_theocracy_temporal } - NOT = { government_has_flag = government_is_ecclesiastical } - } - liege_or_vassal_valid = { - faith = scope:target.faith - } - lessee = cp:councillor_court_chaplain # should be a councillor - - barony_valid = { - title_province = { - has_holding_type = church_holding - } - # Allow Ecclesiastical rulers to hold temples directly - NOT = { - county = { - holder = { - government_has_flag = government_is_ecclesiastical - } - } - } - } - } - - government = ecclesiastical_government - valid_holdings = { church_holding } - - ruler_share_min_opinion_from_lessee = 1 - hook_strength_max_opinion = strong - - tax_split = { - lease_liege = { - value = 0 - if = { - limit = { - scope:lease_liege = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_minimal_centralization - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_MINIMAL_CENTRALIZATION - value = 0.05 - } - } - else_if = { - limit = { - scope:lease_liege = { - OR = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_mild_centralization - } - # Default for Ecclesiasticals outside of the situation - NOT = { exists = top_participant_group:the_christian_church } - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_MILD_CENTRALIZATION - value = 0.1 - } - } - else_if = { - limit = { - scope:lease_liege = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_strong_centralization - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_STRONG_CENTRALIZATION - value = 0.20 - } - } - # Lessee Bishops don't pay hierarchical to the pope (they need a Clerical Region to exist) - if = { - limit = { - is_landed = no # Local bishop lessee - top_superior = scope:lease_liege # Head of Faith is superior - NOT = { exists = liege.capital_county.clerical_region_title } # We don't have a clerical region - } - max = { - desc = THEOCRATIC_LEASE_RATIO_MISSING_CLERICAL_REGION - value = 0.001 - } - } - } - top_lease_liege_direct = { - value = 0 - if = { - limit = { - scope:lease_liege = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_strong_centralization - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_STRONG_CENTRALIZATION - value = 0.01 - } - } - } - - ruler_max = 0.25 # Ceiling on the ruler's share, also quoted by the 'up to' tooltips. - ruler = { - value = 0 - if = { - limit = { - scope:lessee = { - court_chaplain_endorse_override_trigger = yes - } - scope:ruler = { - OR = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_personal_secular_obligations - } - # Default for Christians outside of the situation - NOT = { exists = top_participant_group:the_christian_church } - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_STRONG_HOOK - value = 0.25 - } - } - else_if = { - limit = { - scope:lessee = { - is_ai = yes - court_chaplain_endorse_override_trigger = no - } - scope:ruler = { - OR = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_personal_secular_obligations - } - # Default for Christians outside of the situation - NOT = { exists = top_participant_group:the_christian_church } - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_FROM_OPINION - value = { - scope:lessee = { value = "opinion(scope:ruler)" } - } - divide = 400 # Divide opinion -100/+100 with 400 gives range -0.25/+0.25 - } - } - else_if = { - limit = { - scope:ruler = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_fixed_secular_obligations - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_FIXED_OBLIGATIONS - value = 0.15 - } - } - if = { - limit = { - scope:ruler = { - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_local_secular_power - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_LOCAL_SECULAR_POWER - value = 0.10 - } - } - save_temporary_value_as = current_total - if = { - limit = { - scope:current_total > 0.25 - } - max = { - desc = THEOCRATIC_LEASE_RATIO_MAX_25 - value = 0.25 - } - } - } - } - - levy_split = { - lease_liege = 0.15 - - ruler_max = 0.50 # Ceiling on the ruler's share, also quoted by the 'up to' tooltips. - ruler = { - if = { - limit = { - scope:ruler = { - OR = { - has_strong_hook = scope:lessee - top_participant_group:the_christian_church ?= { - has_participant_group_parameter = the_christian_church_fixed_secular_obligations - } - } - } - } - add = { - desc = THEOCRATIC_LEASE_RATIO_STRONG_HOOK - value = 0.50 - } - } - else = { - add = { - desc = THEOCRATIC_LEASE_RATIO_FROM_OPINION - value = { - scope:lessee = { value = "opinion(scope:ruler)" } - } - divide = 200 # Divide opinion range -100/+100 with 200 gives range -0.5/+0.5 - } - } - max = 0.50 - } - } -} diff --git a/common/legitimacy/_legitimacy.info b/common/legitimacy/_legitimacy.info deleted file mode 100644 index e19949d7f..000000000 --- a/common/legitimacy/_legitimacy.info +++ /dev/null @@ -1,59 +0,0 @@ - = { - # Should this legitimacy type apply to this playable ruler, evaluated daily for the player, yearly for AI - # First valid one is selected - # root = ruler character - is_valid = { - - } - - # What level the AI expects of a liege with this legitimacy type - # root = vassal - # scope:liege = liege character - ai_expected_level = { -