From a4d812a52c80403438178ad372ac97840300f700 Mon Sep 17 00:00:00 2001 From: trashmasteruni Date: Mon, 19 Oct 2026 21:12:02 +0200 Subject: [PATCH] hopefully updated on actions and scripted triggers --- common/on_action/army_on_actions.txt | 27 +- common/on_action/death.txt | 135 +- common/on_action/dlc/mpo/mpo_on_actions_2.txt | 699 -- common/on_action/dlc/pam/pam_on_actions.txt | 544 -- common/on_action/religion_on_actions.txt | 446 +- common/on_action/title_on_actions.txt | 470 +- common/on_action/yearly_on_actions.txt | 1901 ++++- .../00_ai_value_triggers.txt | 6 +- .../00_available_for_events_triggers.txt | 5 +- .../00_building_requirement_triggers.txt | 151 +- common/scripted_triggers/00_coa_triggers.txt | 66 +- .../00_councillor_triggers.txt | 86 +- .../00_courtier_guest_management_triggers.txt | 63 +- .../00_diarchy_scripted_triggers.txt | 15 +- .../00_interaction_triggers.txt | 447 - .../scripted_triggers/00_laamp_triggers.txt | 2 +- common/scripted_triggers/00_law_triggers.txt | 7 +- .../00_military_triggers.txt | 2 +- .../00_relation_triggers.txt | 1246 --- .../00_religious_triggers.txt | 540 +- .../00_war_and_peace_triggers.txt | 88 +- common/scripted_triggers/07_ep3_triggers.txt | 2 +- .../pam_antipope_triggers.txt | 278 - .../scripted_triggers/pam_heresy_triggers.txt | 378 + .../scripted_triggers/pam_saint_triggers.txt | 254 + .../pam_scripted_triggers.txt | 7371 +++++++++++++++++ .../pam_secular_faith_triggers.txt | 65 + 27 files changed, 10879 insertions(+), 4415 deletions(-) delete mode 100644 common/on_action/dlc/mpo/mpo_on_actions_2.txt delete mode 100644 common/on_action/dlc/pam/pam_on_actions.txt delete mode 100644 common/scripted_triggers/00_interaction_triggers.txt delete mode 100644 common/scripted_triggers/00_relation_triggers.txt delete mode 100644 common/scripted_triggers/pam_antipope_triggers.txt create mode 100644 common/scripted_triggers/pam_heresy_triggers.txt create mode 100644 common/scripted_triggers/pam_saint_triggers.txt create mode 100644 common/scripted_triggers/pam_scripted_triggers.txt create mode 100644 common/scripted_triggers/pam_secular_faith_triggers.txt diff --git a/common/on_action/army_on_actions.txt b/common/on_action/army_on_actions.txt index d71fa93f9..e1926f2c9 100644 --- a/common/on_action/army_on_actions.txt +++ b/common/on_action/army_on_actions.txt @@ -24,29 +24,6 @@ on_army_monthly = { } } } - ROOT = { - if = { - limit = { - ROOT = { is_at_war = yes } - NOT = { - has_character_modifier = armies_raised_modifier - } - } - add_character_modifier = { - modifier = armies_raised_modifier - years = 5 - } - } - else_if = { - limit = { - ROOT = { NOT = { is_at_war = yes } } - has_character_modifier = armies_raised_modifier - } - remove_character_modifier = armies_raised_modifier - } - else = { - } - } } } @@ -482,7 +459,7 @@ on_siege_completion = { # If you have the Miles Christi tenet get SP pam_miles_christi_fulfillment_from_combat_effect = yes - + if = { limit = { has_personal_tenet_flag = tenet_aniconism_destruction_fulfillment @@ -495,7 +472,7 @@ on_siege_completion = { change_spiritual_fulfillment = minor_spiritual_fulfillment_value } } - + # We change your legend to reflect this siege if = { limit = { diff --git a/common/on_action/death.txt b/common/on_action/death.txt index 8d87b9afc..b1db4be43 100644 --- a/common/on_action/death.txt +++ b/common/on_action/death.txt @@ -258,7 +258,7 @@ on_death = { } if = { limit = { - player_heir = { is_ai = no NOT = { government_has_flag = government_allows_nomad_domicile_titles }} + player_heir = { is_ai = no } } player_heir = { every_held_title = { @@ -273,16 +273,11 @@ on_death = { limit = { is_ai = no } - if = { + every_held_title = { limit = { - NOT = { government_has_flag = government_allows_nomad_domicile_titles } - } - every_held_title = { - limit = { - is_nomad_title = yes - } - set_variable = player_domicile_title + is_nomad_title = yes } + set_variable = player_domicile_title } player_heir = { add_character_flag = { @@ -351,7 +346,7 @@ on_death = { # destroy_title = title:e_mongol_empire # } - # Fix gods-damned Bavaria splitting from East Francia in an ugly fashion in 867. + # Ludwig the Younger inherits East Francia and Karlmann Bavaria, as historically. if = { limit = { # Make sure we're looking at the right guy & that the circumstances haven't changed too much. @@ -374,28 +369,60 @@ on_death = { } } NOT = { has_primary_title = title:k_bavaria } - # Players can sort this themselves: you just need to have Bavaria as your primary title and it's all fine. - is_ai = yes + NOT = { exists = designated_heir } + is_valid_designated_heir = character:42019 } - # If we've got no Bavaria, create it. - if = { - limit = { - title:k_bavaria = { is_title_created = no } - } - create_title_and_vassal_change = { - type = created - save_scope_as = change - } - title:k_bavaria = { - change_title_holder = { - holder = root - change = scope:change + set_designated_heir = character:42019 + } + else_if = { + limit = { + this = character:90107 + has_variable = ludwig_younger_designated_by_history + designated_heir ?= character:42019 + NAND = { + highest_held_title_tier = tier_kingdom + has_realm_law = confederate_partition_succession_law + title:k_bavaria = { + OR = { + is_title_created = no + holder = root + } + any_in_de_jure_hierarchy = { + tier = tier_county + count >= 22 + holder = { + any_liege_or_above = { this = root } + } + } } + NOT = { has_primary_title = title:k_bavaria } } - resolve_title_and_vassal_change = scope:change } - # Then switch around. - set_primary_title_to = title:k_bavaria + clear_designated_heir = yes + } + # Salzburg sits outside any de jure kingdom, so it would follow Ludwig the Younger into East Francia instead of going to Bavaria with Karlmann + if = { + limit = { + this = character:90107 + designated_heir ?= character:42019 + title:d_et_salzburg.holder ?= { is_vassal_of = root } + character:42018 ?= { + is_alive = yes + is_vassal_of = root + } + } + create_title_and_vassal_change = { + type = granted + save_scope_as = salzburg_change + add_claim_on_loss = no + } + title:d_et_salzburg.holder = { + change_liege = { + liege = character:42018 + change = scope:salzburg_change + } + } + resolve_title_and_vassal_change = scope:salzburg_change } # Diarchies @@ -784,12 +811,6 @@ on_death = { limit = { ep1_artifact_is_court_artifact_trigger = yes } set_variable = equipped_court_succession } - if = { - limit = { - any_equipped_character_artifact = { artifact_visual_after_death_trigger = yes } - } - trigger_event = death_management.0150 - } } if = { @@ -2341,6 +2362,25 @@ on_death = { } } } + # CE3 achievement: The Father, the Son, and the Holy Grandson - pass the theocrat dynasty chain to the player's same-dynasty heir + if = { + limit = { + is_ai = no + has_variable = ce3_theocrat_dynasty_chain + exists = dynasty + player_heir ?= { dynasty ?= root.dynasty } + } + save_scope_value_as = { + name = ce3_theocrat_dynasty_chain_predecessor + value = var:ce3_theocrat_dynasty_chain + } + player_heir = { + trigger_event = { + on_action = ce3_theocrat_dynasty_chain_succession + days = 1 + } + } + } #If you are a Christian ruler who does not take pam_decision_last_rites their will have their legitimacy and vassal opinion lowered if = { limit = { @@ -2603,6 +2643,33 @@ pam_dulia_personal_sainthood_convert = { } } +# Root = the player's heir, one day after the player's same-dynasty predecessor died +# scope:ce3_theocrat_dynasty_chain_predecessor = the predecessor's chain length +ce3_theocrat_dynasty_chain_succession = { + trigger = { + is_ai = no + exists = scope:ce3_theocrat_dynasty_chain_predecessor + government_has_flag = government_is_theocracy + any_held_title = { has_clerical_region = yes } + } + effect = { + set_variable = { + name = ce3_theocrat_dynasty_chain + value = { + add = scope:ce3_theocrat_dynasty_chain_predecessor + add = 1 + } + } + if = { + limit = { var:ce3_theocrat_dynasty_chain >= 3 } + add_achievement_global_variable_effect = { + VARIABLE = ce3_07_the_father_the_son_and_the_holy_grandson_achievement_unlocked + VALUE = yes + } + } + } +} + # Root = character # Triggered when someone is about to die from a natural death but is given a second chance by meeting # the has_natural_death_second_chance scripted rule diff --git a/common/on_action/dlc/mpo/mpo_on_actions_2.txt b/common/on_action/dlc/mpo/mpo_on_actions_2.txt deleted file mode 100644 index ce7f49c81..000000000 --- a/common/on_action/dlc/mpo/mpo_on_actions_2.txt +++ /dev/null @@ -1,699 +0,0 @@ -mpo_yearly_events_nomads = { - trigger = { - has_mpo_dlc_trigger = yes - government_has_flag = government_is_nomadic - } - - random_events = { - chance_to_happen = 100 - - # EVENT CHAINS/STORY CYCLE EVENTS - 100 = nomad_events.0001 # Starts the Achmach Fanakiti event chain - - # Regular events - 150 = mpo_nomad_events.1030 # You choose a sport for your son to tryhard - 200 = mpo_nomad_events.1020 # Your kin wants to break off from your tribe - 250 = court_astrologer_events.0002 # Your Astrologer suggest a better place to migrate to - 250 = nomad_events.0100 # Two vassals have a herd dispute - 250 = nomad_events.0120 # You take an evening ride with someone - 200 = nomad_events.0130 # A merchant offers you some herd - 150 = nomad_events.0140 # A foreign merchant passes by your capital and asks to stay - 250 = nomad_events.0150 # You share a drink with a courtier - 300 = nomad_events.0160 # Your spouse tells you they admire you - 300 = nomad_events.0170 # Your spouse is scared of your high dread - 250 = nomad_events.0180 # Random courtier laughs at your child low prowess - 250 = nomad_events.0190 # Reminisce of a past memory - 250 = nomad_events.0200 # Someone tells you of a dream they had - 250 = nomad_events.0220 # Spouse scolds you for your low Prowess - 250 = nomad_events.0230 # Spouse is feeling homesick - 200 = nomad_events.0240 # Neighbouring Nomad's herd shows up in your capital - 100 = nomad_events.0250 # Enthusiastic priest asks you to convert - 100 = nomad_events.0260 # Distant priest arrives at your court - 100 = mpo_nomad_events.1050 # A neighboring herder is salty at you - 300 = mpo_nomad_events.1060 # You trade with non-nomad neighbors - 50 = mpo_nomad_events.1070 #You wake up after having ridden off alone - 200 = mpo_nomad_events.1080 #Neighbor is intruding on your land hunting a criminal - 150 = mpo_nomad_events.1100 #You adapt your herds to the local terrain - 150 = mpo_nomad_events.1110 #Your capital is by a place you can fish - 200 = mpo_events_tova.0025 # You are invited to a knucklebone shooting game - 200 = mpo_events_tova.0030 # No astrologer? Someone comes to you with a vision - 200 = mpo_events_tova.0035 # Anda comes to you with marital concerns - 200 = mpo_events_tova.0045 # A Treasured Friend - 250 = nomad_events_oltner.0001 # Hunt sighting in your lands - 250 = nomad_events_oltner.0002 # Bird sighting in your lands - 250 = nomad_events_oltner.0003 # Dangerous Hunt sighting in your lands - 150 = nomad_events_oltner.0004 # Zud - Dangerous animals eat your herd - 250 = nomad_events_oltner.0005 # Good season! Animals aplenty. - 200 = nomad_events_oltner.0006 # You are offered a skilled Master of the Chase from a tributary - 200 = nomad_events_oltner.0007 # You are offered a falcon from a tributary - 50 = mpo_bb_events.0001 # blood brother comes by for a wrestling match - 100 = mpo_events_anna.0001 #Train Them Young - teach a child how to ride a horse - 200 = mpo_events_anna.0005 #Stories from the Past - choose a story to be told - 200 = mpo_events_anna.0010 #Whistle Like an Arrow - being taught how to whistle as a child - 250 = mpo_events_ariana.0001 # Nest Sighting - 50 = mpo_events_ariana.0010 # Your Heir wants to convert to a different faith - 250 = mpo_events_ariana.0020 # A spouse is suspicious of a councillor - 250 = mpo_events_ariana.0050 # A family member risks being branded - 150 = mpo_events_ariana.0060 # A child in your family spots an eagles nest with treasure - 250 = mpo_events_ariana.0080 # Someone tells you about a magical tree - 150 = pet_animal.3050 # Your rival has an eagle - 250 = mpo_events_ariana.0090 # Your child wants to be a herder - 250 = mpo_events_ariana.0100 # A non-martial gender family member is very skilled - 150 = mpo_events_ariana.0110 # Your court astrologer wants you to move your capital - - # SEASON SPECIFIC EVENTS - 300 = mpo_nomads_season_events.0001 # Herders robbed during drought - 300 = mpo_nomads_season_events.0005 # A hungry neighbour asks for herd - 300 = mpo_nomads_season_events.0010 # A well-to-do neighbor offers herd - 300 = mpo_nomads_season_events.0015 # Two Kurultai members fight over food - 150 = nomad_events.0110 # A snow wolf attacks a child (weighted up during white zud/cold zud) - 300 = nomad_events.0210 # Spouse/Child is worried about low herd - 150 = mpo_nomad_events.1120 #It's winter. wolves are hungry for your herd (weighted up during white zud/cold zud) - } -} - -mpo_migration_finished = { - effect = { - if = { # We send an event if you're migrating into a Tributary's lands - limit = { - has_variable = migrating_into_tributary_war_var - } - trigger_event = { - id = migration_events.0002 - days = 1 - } - } - set_variable = { - name = recently_migrated - years = 3 - } - every_held_county = { - limit = { - exists = duchy - duchy = root.capital_province.duchy - } - change_county_control = -50 - } - every_realm_province = { - limit = { - has_province_modifier = recently_looted_modifier - } - remove_province_modifier = recently_looted_modifier - } - if = { - limit = { - highest_held_title_tier >= tier_duchy - } - while = { - count = 2 - trigger_event = { - on_action = mpo_migration_contract - months = 1 - } - } - } - else = { - trigger_event = { - on_action = mpo_migration_contract - months = 1 - } - } - domicile ?= { - move_domicile = root.capital_province - } - every_vassal = { - domicile ?= { - move_domicile = prev.capital_province - } - } - if = { - limit = { - has_character_modifier = mpo_migrating_accolade_duke_modifier - } - remove_character_modifier = mpo_migrating_accolade_duke_modifier - } - else_if = { - limit = { - has_character_modifier = mpo_migrating_accolade_king_modifier - } - remove_character_modifier = mpo_migrating_accolade_king_modifier - } - else_if = { - limit = { - has_character_modifier = mpo_migrating_accolade_emperor_modifier - } - remove_character_modifier = mpo_migrating_accolade_emperor_modifier - } - if = { - limit = { - has_variable = nomad_migration_preserve_coronation - } - remove_variable = nomad_migration_preserve_coronation - } - } -} - -mpo_migration_contract = { - trigger = { - is_landed = yes - has_mpo_dlc_trigger = yes - government_has_flag = government_is_nomadic - has_variable = recently_migrated - any_held_county = { - is_landless_type_title = no - exists = title_province - county_control < 90 - } - } - - random_events = { - 100 = mpo_contract_events.0001 - 100 = mpo_contract_events.0011 - 100 = mpo_contract_events.0021 - 100 = mpo_contract_events.0031 - 20 = mpo_contract_events.0041 - 100 = mpo_contract_events.0051 - 100 = mpo_contract_events.0061 - 100 = mpo_contract_events.0071 - 100 = mpo_contract_events.0081 - 100 = mpo_contract_events.0091 - } -} - - -# Triggered from code on the day after a migration travel ends -# -# root - migrating ruler -# scope:actor - migration ruler (compatibility with triggers and effects used in migration interaction) -# scope:recipient - holder of the target title -# scope:target_title - higher tier title target of the migration. Can be of any tier -# scope:domain - county or duchy tier title, all land within it shall become new personal domain of the migrating ruler -# -on_migration_travel_end = { - events = { - migration_events.0001 - } - - effect = { - if = { # MPO ACHIEVEMENT Steppe by Steppe - limit = { - is_ai = no - exists = global_var:started_steppe_by_steppe_achievement - situation:the_great_steppe ?= { - situation_sub_region:steppe_west = { - situation_sub_region_has_county = root.capital_county - } - } - } - add_achievement_global_variable_effect = { - VARIABLE = mpo_steppe_by_steppe_achievement_unlocked - VALUE = yes - } - } - migration_title_and_vassal_change_effect = yes - trigger_event = { - on_action = mpo_migration_finished - } - } -} - -# triggered from code when migration war ends -# -# root - migrating ruler -# scope:actor - migration ruler (compatibility with triggers and effects used in migration interaction) -# scope:recipient - primary defender in migration war -# scope:target_title - higher tier title target of the migration. Can be of any tier -# scope:domain - county or duchy tier title, all land within it shall become new personal domain of the migrating ruler -# scope:war - migration war. War will disappear after this onaction - -on_migration_war_end = { - effect = { - if = { # MPO ACHIEVEMENT Steppe by Steppe - limit = { - is_ai = no - exists = global_var:started_steppe_by_steppe_achievement - location = { - geographical_region = world_steppe_west - } - } - add_achievement_global_variable_effect = { - VARIABLE = mpo_steppe_by_steppe_achievement_unlocked - VALUE = yes - } - } - if = { - limit = { - scope:war = { has_variable = migration_victory } - } - migration_title_and_vassal_change_effect = yes - trigger_event = { - on_action = mpo_migration_finished - } - if = { - limit = { - has_variable = nomad_migration_preserve_coronation - } - remove_variable = nomad_migration_preserve_coronation - } - every_character_situation = { - limit = { - any_participant_group = { - participant_group_type = nomad_rulers_capital - participant_group_has_character = root - } - } - every_participant_group = { - limit = { - participant_group_type = nomad_rulers_capital - participant_group_has_character = root - } - every_situation_group_participant = { - limit = { - save_temporary_scope_as = temp_scope - NOT = { this = root } - is_migrating = yes - exists = current_travel_plan - OR = { - current_travel_plan.final_destination_province.county = scope:target_title - scope:domain = { - any_in_de_jure_hierarchy = { - tier = tier_county - this = scope:temp_scope.current_travel_plan.final_destination_province.county - } - } - } - } - save_scope_as = invalidated_ruler - scope:invalidated_ruler = { - send_interface_message = { - type = msg_migration_into_realm - title = war_invalidated_migration - desc = war_invalidated_migration_desc - - left_icon = root - right_icon = scope:invalidated_ruler - } - } - } - } - } - } - } -} - -# triggered from code right after kurultai succession has been resolved -# -# root - new heir (character) -# scope:was_kurultai - (bool) if new heir was part of the predecessor's Kurultai Council -# scope:kurultai_members - list all characters who were part of the predecessor's Kurultai Council -# scope:obedient_kurultai - list all obedient characters who were part of the Kurultai Election (both Council and Children) -# scope:disobedient_kurultai - list all disobedient characters who were part of the Kurultai Election (both Council and Children) -# -on_kurultai_succession_stable = { - trigger = { - has_realm_law = single_heir_succession_kurultai_law - } - effect = { - root = { - if = { - limit = { - exists = this - "list_size(obedient_kurultai)" > 0 - } - every_in_list = { - list = obedient_kurultai - limit = { - exists = this - this != root - } - add_opinion = { - target = root - modifier = obedience_opinion - years = 5 - } - } - create_character_memory = { - type = had_stable_kurultai_succession - } - } - } - } -} - -# triggered from code right after kurultai succession has been resolved -# -# root - new heir (character) -# scope:was_kurultai - (bool) if new heir was part of the predecessor's Kurultai Council -# scope:kurultai_members - list all characters who were part of the predecessor's Kurultai Council -# scope:obedient_kurultai - list all obedient characters who were part of the Kurultai Election (both Council and Children) -# scope:disobedient_kurultai - list all disobedient characters who were part of the Kurultai Election (both Council and Children) -# -on_kurultai_succession_chaotic = { - trigger = { - has_realm_law = single_heir_succession_kurultai_law - primary_title = { - title_held_years < 1 - } - } - effect = { - root = { - if = { - limit = { - exists = this - "list_size(obedient_kurultai)" > 0 - } - every_in_list = { - list = obedient_kurultai - limit = { - exists = this - this != root - } - add_opinion = { - target = root - modifier = obedience_opinion - years = 5 - } - } - } - # Siblings gain claims on all your titles - every_held_title = { - limit = { - tier >= tier_county - } - save_scope_as = title_claim - root = { - every_sibling = { - limit = { - OR = { - AND = { - is_male = yes - faith_dominant_gender_male_or_equal = yes - } - AND = { - is_female = yes - faith_dominant_gender_female_or_equal = yes - } - } - NOT = { - has_claim_on = scope:title_claim - } - } - add_pressed_claim = scope:title_claim - add_to_list = ai_claimant_faction_preference - } - every_in_list = { - list = disobedient_kurultai - limit = { - OR = { - AND = { - is_male = yes - faith_dominant_gender_male_or_equal = yes - } - AND = { - is_female = yes - faith_dominant_gender_female_or_equal = yes - } - } - NOT = { - has_claim_on = scope:title_claim - } - } - add_pressed_claim = scope:title_claim - add_to_list = ai_claimant_faction_preference - } - } - } - random_in_list = { - list = ai_claimant_faction_preference - limit = { - is_physically_able = yes - } - weight = { - base = 1 - modifier = { - add = martial - } - modifier = { - add = prowess - } - modifier = { - add = dread - } - modifier = { - add = -250 - is_adult = no - } - } - add_character_flag = nomad_preferred_claimant - } - create_character_memory = { - type = had_chaotic_kurultai_succession - } - } - } - random_on_action = { - 10 = kurultai_succession_chaotic_minor - 20 = kurultai_succession_chaotic_medium - 90 = kurultai_succession_chaotic_major - } -} - -kurultai_succession_chaotic_minor = { - trigger = { - # No trigger for Minor penalties - NOT = { - has_character_flag = had_mongolia_split - } - } - weight_multiplier = { - base = 1 - modifier = { # be a bit kinder to the AI - factor = 2 - is_ai = yes - } - } - random_events = { - 100 = mpo_chaotic_kurultai_succession.0001 # Siblings become your rivals - 150 = mpo_chaotic_kurultai_succession.0002 # Brother seizes the lands of a Tributary and becomes independent - 150 = mpo_chaotic_kurultai_succession.0003 # Tributary leaves - 100 = mpo_chaotic_kurultai_succession.0004 # County Control loss - 100 = mpo_chaotic_kurultai_succession.0005 # Loss of Prestige Level - 100 = mpo_chaotic_kurultai_succession.0006 # 10% of Herd defects to Neighboring realm - 100 = mpo_chaotic_kurultai_succession.0007 # Good Courtiers defect to Neighbor - 100 = mpo_chaotic_kurultai_succession.0008 # MaA Regiment defects to neighbor - } -} - -kurultai_succession_chaotic_medium = { - trigger = { - OR = { - "list_size(disobedient_kurultai)" >= 2 - "list_size(obedient_kurultai)" <= 0 - } - OR = { - highest_held_title_tier >= tier_kingdom - any_tributary = { - count >= 10 - } - } - NOT = { - has_character_flag = had_mongolia_split - } - } - random_events = { - 100 = mpo_chaotic_kurultai_succession.0009 # Gold divided by Siblings - 100 = mpo_chaotic_kurultai_succession.0010 # Legitimacy -500 - 100 = mpo_chaotic_kurultai_succession.0011 # 20% of Herd defects to Neighboring realm - 350 = mpo_chaotic_kurultai_succession.0013 # 20% Realm Split - 150 = mpo_chaotic_kurultai_succession.0016 # 3 Tributaries leave - } -} - -kurultai_succession_chaotic_major = { - trigger = { - OR = { - "list_size(disobedient_kurultai)" >= "list_size(obedient_kurultai)" - "list_size(obedient_kurultai)" <= 0 - } - OR = { - highest_held_title_tier >= tier_kingdom - any_tributary = { - count >= 10 - } - } - NOT = { - has_character_flag = had_mongolia_split - } - } - weight_multiplier = { - base = 1 - modifier = { # be a bit kinder to the AI - factor = 0.5 - is_ai = yes - } - } - random_events = { - 300 = mpo_chaotic_kurultai_succession.0012 # 50% Split realm De Jure with Sibling - 50 = mpo_chaotic_kurultai_succession.0014 # Extreme kurultai disapproval: shatter realm - 100 = mpo_chaotic_kurultai_succession.0015 # 40% of Herd defects to Neighboring realm - 100 = mpo_chaotic_kurultai_succession.0017 # All Tributaries leave - } -} - -mpo_tributary_check_pulse = { - trigger = { - is_landed = no - is_migrating = no - is_at_war = no - number_of_tributaries > 0 - } - - effect = { - every_tributary = { - root = { - send_interface_message = { - type = msg_tributaries_breaking_free_bad - title = tributaries_breaking_free_message_title - left_icon = root - right_icon = prev - show_as_tooltip = { - prev = { end_tributary = yes } - } - } - } - send_interface_message = { - type = msg_tributaries_breaking_free_good - title = tributaries_breaking_free_message_player_title - left_icon = this - right_icon = root - end_tributary = yes - } - } - } -} - -mpo_de_jure_shift = { - trigger = { - government_has_flag = government_is_nomadic - highest_held_title_tier >= tier_kingdom - } - effect = { - switch = { - trigger = root.highest_held_title_tier - # TODO: TIT-72244 we don't have lists for hegemony for now - #tier_hegemony = { - # de_jure_shifting_effect = { - # UPPER_TIER = hegemony - # LOWER_TIER = empire - # } - #} - tier_empire = { - de_jure_shifting_effect = { - UPPER_TIER = empire - LOWER_TIER = kingdom - } - } - tier_kingdom = { - de_jure_shifting_effect = { - UPPER_TIER = kingdom - LOWER_TIER = duchy - } - } - } - } -} - -# root - Character who changed government -# scope:old_government - Character's old government type -on_government_change = { - effect = { - if = { - limit = { - scope:old_government = government_type:nomad_government - NOT = { government_has_flag = government_allows_nomad_domicile_titles } - } - - every_held_title = { - limit = { is_nomad_title = yes } - root = { - destroy_title = prev - } - } - } - if = { - limit = { - is_confederation_member = yes - NAND = { - government_is_japanese_trigger = yes - exists = house.house_confederation - } - NOR = { - government_has_flag = government_is_nomadic - government_has_flag = government_is_tribal - } - } - confederation = { - remove_confederation_member = root - } - } - if = { - limit = { - has_variable = crowned_emperor_var - NOR = { - has_game_rule = coronation_laws_off - has_realm_law = crowned_emperor - } - } - add_realm_law = crowned_emperor - } - if = { - limit = { - has_variable = crowned_king_var - NOR = { - has_game_rule = coronation_laws_off - has_realm_law = crowned_king - } - } - add_realm_law = crowned_king - } - if = { - limit = { scope:old_government = government_type:mandala_government } - #Remove Aspect modifiers/variables - if = { - limit = { has_character_modifier = mandala_increments_of_peace_modifier } - remove_character_modifier = mandala_increments_of_peace_modifier - } - if = { - limit = { has_character_modifier = mandala_creator_modifier } - remove_character_modifier = mandala_creator_modifier - } - remove_variable = mandala_house_power_accumulated_increments_of_peace - remove_variable = mandala_house_power_accumulated_creator - #Remove max piety cap modifiers/variables - if = { - limit = { has_character_modifier = budding_divinity_modifier } - remove_character_modifier = budding_divinity_modifier - } - if = { - limit = { has_character_modifier = budding_deity_modifier } - remove_character_modifier = budding_deity_modifier - } - if = { - limit = { has_character_modifier = budding_godhood_modifier } - remove_character_modifier = budding_godhood_modifier - } - remove_variable = not_subject_to_succession_trials - remove_variable = tribute_mission_grace - } - if = { - limit = { - government_has_flag = government_is_mandala - is_house_head = yes - } - #Set the house aspect to default, please - house = { - set_house_aspiration = { type = no_aspect } - } - } - } -} diff --git a/common/on_action/dlc/pam/pam_on_actions.txt b/common/on_action/dlc/pam/pam_on_actions.txt deleted file mode 100644 index db409067f..000000000 --- a/common/on_action/dlc/pam/pam_on_actions.txt +++ /dev/null @@ -1,544 +0,0 @@ -# referenced by code. Fired yearly on every rite -# root = rite -on_rite_yearly = { - effect = { - rite_yearly_hor_passive_learning_effect = yes - rite_yearly_hor_divergence_drift_effect = yes - } -} - -pam_the_christian_church_yearly_on_action = { - effect = { - # Non Christian presence in Europe - pam_the_christian_church_non_christian_kingdom_in_europe_catalyst_effect = yes - # Non-Catholic ruler controls the Papal State's de jure capital - pam_the_christian_church_catholic_hof_weak_papal_state_control_catalyst_effect = yes - # Byzantine emperor is not Christian - pam_the_christian_church_byzantine_emperor_non_christian_catalyst_effect = yes - } -} -# Tier 1 is paced once from pam_cathedral_01 on_start_build (years = 2). -pam_cathedral_great_project_yearly_on_action = { - effect = { - every_great_project = { - limit = { - OR = { - great_project_type = pam_cathedral_02 - great_project_type = pam_cathedral_03 - } - } - great_project_founder = { - save_scope_as = founder - trigger_event = { - on_action = pam_cathedral_great_project_yearly_founder_events_on_action - years = 5 - } - } - great_project_owner = { - if = { - limit = { - this = scope:founder - } - trigger_event = { - on_action = pam_cathedral_great_project_yearly_owner_events_on_action - years = 10 - } - } - else = { - trigger_event = { - on_action = pam_cathedral_great_project_yearly_owner_events_on_action - years = 5 - } - } - } - } - } -} -pam_cathedral_great_project_yearly_founder_events_on_action = { - random_events = { - 1 = pam_great_projects_events.0007 - 1 = pam_great_projects_events.0008 - 1 = pam_great_projects_events.0011 - 1 = pam_great_projects_events.0013 - } -} -pam_cathedral_great_project_yearly_owner_events_on_action = { - random_events = { - 1 = pam_great_projects_events.0012 - } -} - -study_faith_success = { - on_actions = { - pam_study_faith_personal_tenet_on_action - } -} - -on_travel_plan_movement = { - on_actions = { - pam_mountain_travel_personal_tenet_on_action - sun_worship_desert_travel_personal_tenet_on_action - pam_sanctity_of_nature_travel_on_action - } -} - -on_building_completed = { - on_actions = { - pam_sanctity_of_nature_building_completed_on_action - } -} - -on_faith_conversion = { - on_actions = { - pam_tax_nonbelievers_faith_conversion_on_action - } -} - -on_birth_child = { - on_actions = { - pam_auspicious_birthright_birth_on_action - } -} - -pam_study_faith_personal_tenet_on_action = { - effect = { - if = { - limit = { - scope:owner = { - has_personal_tenet_flag = adaptive_study_rite_cultural_acceptance - culture != scope:target.culture - } - } - scope:owner = { - culture = { - change_cultural_acceptance = { - target = scope:target.culture - value = minor_cultural_acceptance_gain - desc = pam_adaptive_study_rite_cultural_acceptance - } - } - send_interface_toast = { - type = event_toast_effect_good - title = pam_adaptive_study_rite_cultural_acceptance_toast - left_icon = scope:owner - right_icon = scope:target - } - } - } - } -} - -pam_mountain_travel_personal_tenet_on_action = { - effect = { - if = { - limit = { - has_personal_tenet_flag = cthonic_redoubts_mountain_travel_fulfillment - current_travel_plan.current_location = { - OR = { - terrain = mountains - terrain = desert_mountains - } - } - current_travel_plan = { - NOT = { has_variable = pam_mountain_travel_fulfillment_awarded } - } - } - current_travel_plan = { - set_variable = pam_mountain_travel_fulfillment_awarded - } - send_interface_toast = { - type = event_toast_effect_good - title = pam_cthonic_redoubts_mountain_travel_toast - left_icon = root - add_piety = minor_piety_gain - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - } - } -} - -sun_worship_desert_travel_personal_tenet_on_action = { - effect = { - if = { - limit = { - has_personal_tenet_flag = tenet_sun_worship_desert_pilgrim - current_travel_plan.current_location = { - OR = { - terrain = desert - terrain = desert_mountains - terrain = oasis - } - } - current_travel_plan = { - NOT = { has_variable = sun_worship_desert_fulfillment_awarded } - } - } - current_travel_plan = { - set_variable = sun_worship_desert_fulfillment_awarded - } - send_interface_toast = { - type = event_toast_effect_good - title = sun_worship_desert_travel_toast - left_icon = root - add_piety = minor_piety_gain - change_spiritual_fulfillment = minor_spiritual_fulfillment_value - } - } - } -} - -pam_sanctity_of_nature_travel_on_action = { - effect = { - if = { - limit = { - current_travel_plan.current_location = { - has_province_modifier = preserved_wilderness_modifier - } - } - current_travel_plan = { - if = { - limit = { - NOT = { has_travel_plan_modifier = preserved_wilderness_travel_modifier } - } - add_travel_plan_modifier = preserved_wilderness_travel_modifier - } - } - } - else_if = { - limit = { - current_travel_plan = { - has_travel_plan_modifier = preserved_wilderness_travel_modifier - } - } - current_travel_plan = { - remove_travel_plan_modifier = preserved_wilderness_travel_modifier - } - } - - if = { - limit = { - has_personal_tenet_flag = tenet_sanctity_of_nature_wilderness_fulfillment - current_travel_plan.current_location = { - has_holding = no - is_sea_province = no - } - current_travel_plan = { - OR = { - NOT = { has_variable_list = pam_sanctity_of_nature_visited_wilderness } - AND = { - has_variable_list = pam_sanctity_of_nature_visited_wilderness - NOT = { - is_target_in_variable_list = { - name = pam_sanctity_of_nature_visited_wilderness - target = root.current_travel_plan.current_location - } - } - } - } - } - } - change_spiritual_fulfillment = miniscule_spiritual_fulfillment_value - current_travel_plan = { - add_to_variable_list = { - name = pam_sanctity_of_nature_visited_wilderness - target = root.current_travel_plan.current_location - } - } - } - } -} - -pam_sanctity_of_nature_building_completed_on_action = { - # add_great_building fires on_building_completed during history setup. - trigger = { - has_global_variable = game_has_started - } - - effect = { - if = { - limit = { - has_holding = yes - has_province_modifier = preserved_wilderness_modifier - } - remove_province_modifier = preserved_wilderness_modifier - } - } -} - -pam_tax_nonbelievers_faith_conversion_on_action = { - trigger = { - exists = scope:actor - root != scope:actor - scope:actor = { - has_personal_tenet_flag = tax_nonbelievers_fulfillment_from_conversion - } - } - effect = { - scope:actor = { - pam_tax_nonbelievers_conversion_fulfillment_effect = yes - } - } -} - -pam_auspicious_birthright_birth_on_action = { - effect = { - if = { - limit = { - OR = { - scope:mother = { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - } - scope:real_father ?= { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - } - } - } - # Base 5% chance for later children; the first-child modifiers shift the chance to 20%. - random_list = { - 95 = { - modifier = { - add = -15 - OR = { - scope:mother = { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - NOR = { - any_child = { - even_if_dead = yes - this != scope:child - } - } - } - scope:real_father ?= { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - NOR = { - any_child = { - even_if_dead = yes - this != scope:child - } - } - } - } - } - } - 5 = { - modifier = { - add = 15 - OR = { - scope:mother = { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - NOR = { - any_child = { - even_if_dead = yes - this != scope:child - } - } - } - scope:real_father ?= { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - NOR = { - any_child = { - even_if_dead = yes - this != scope:child - } - } - } - } - } - random_list = { - 1 = { - trigger = { - NOR = { - has_trait = dwarf - has_trait = giant - } - } - add_trait = dwarf - } - 1 = { - trigger = { - NOR = { - has_trait = giant - has_trait = dwarf - } - } - add_trait = giant - } - 1 = { - trigger = { - NOT = { has_trait = albino } - } - add_trait = albino - } - 1 = { - trigger = { - NOT = { has_trait = clubfooted } - } - add_trait = clubfooted - } - 1 = { - trigger = { - NOT = { has_trait = bleeder } - } - add_trait = bleeder - } - 1 = { - trigger = { - NOT = { has_trait = hunchbacked } - } - add_trait = hunchbacked - } - 1 = { - trigger = { - NOT = { has_trait = lisping } - } - add_trait = lisping - } - 1 = { - trigger = { - NOT = { has_trait = stuttering } - } - add_trait = stuttering - } - 1 = { - trigger = { - NOR = { - has_trait = spindly - has_trait = physique_good - } - } - add_trait = spindly - } - 1 = { - trigger = { - NOT = { has_trait = scaly } - } - add_trait = scaly - } - 1 = { - trigger = { - NOT = { has_trait = wheezing } - } - add_trait = wheezing - } - 1 = { - trigger = { - NOR = { - has_trait = beauty_bad - has_trait = beauty_good - } - } - add_trait = beauty_bad_2 - } - } - } - } - } - if = { - limit = { - scope:child = { - OR = { - has_trait = dwarf - has_trait = albino - has_trait = clubfooted - has_trait = bleeder - has_trait = scaly - has_trait = giant - has_trait = hunchbacked - has_trait = spindly - has_trait = wheezing - has_trait = lisping - has_trait = stuttering - has_trait = beauty_bad - } - } - OR = { - scope:mother = { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - } - scope:real_father ?= { - has_personal_tenet_flag = mystical_birthright_spiritual_leader - } - } - } - scope:child = { - add_character_modifier = { - modifier = pam_mystical_birthright_spiritual_leader_modifier - } - } - if = { - limit = { - scope:mother = { - is_ai = no - } - } - scope:mother = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_mystical_birthright_spiritual_leader_toast - left_icon = scope:child - custom_tooltip = { - text = pam_mystical_birthright_spiritual_leader_toast_tt - } - } - } - } - if = { - limit = { - scope:real_father ?= { - is_ai = no - } - } - scope:real_father = { - send_interface_toast = { - type = event_toast_effect_good - title = pam_mystical_birthright_spiritual_leader_toast - left_icon = scope:child - custom_tooltip = { - text = pam_mystical_birthright_spiritual_leader_toast_tt - } - } - } - } - } - } -} - -# used by code, do not rename or remove. -# root = clerical region holder -# scope:title = clerical region title -# scope:county = capital county -# scope:reason = reason that triggered this mismatch. flag can be: -# - county_converted (county is now of different faith, holder stayed old faith) -# - character_converted (character converted away from county faith) -# - changed_tenets_or_doctrines (county and character are still matching faith but the faith doesn't support clerical regions anymore) -on_clerical_region_faith_mismatch = { - # TIT-75963 player choice when capital converts; TIT-75964 other succession cases - events = { - # Capital converted; both Faiths have Clerical Regions (player) - pam_clergy_events.0051 - # AI / other mismatch reasons / new Faith lacks Clerical Regions - pam_clergy_events.0052 - } -} - -# used by code, do not rename or remove. -# root = challenger character -# scope:sponsor = former sponsor title -# scope:title = challenger title -on_challenger_removed = { - effect = { - if = { - limit = { - is_alive = yes - has_character_flag = antipope_flag - } - remove_character_flag = antipope_flag - } - # TODO_PAM move antipope removal cleanup effects here - #if = { - # limit = { root = scope:title.holder } - # destroy_title = scope:title - #} - } - -} diff --git a/common/on_action/religion_on_actions.txt b/common/on_action/religion_on_actions.txt index 047bbef7b..3d77eee72 100644 --- a/common/on_action/religion_on_actions.txt +++ b/common/on_action/religion_on_actions.txt @@ -9,7 +9,6 @@ # scope:diverged (true/false) optional scope, true if the faith was created because of a Rite diverging too much. Notice create a 100+ divergence heresy at the start does not count. on_faith_created = { effect = { - main_rite = { force_refresh_head_of_rite = yes } # Faiths created by a rite diverging too far start at 0 fervor if = { limit = { @@ -177,26 +176,6 @@ on_faith_created = { } } } - # The founding wave (founder and vassals who already accepted) brings their courts, as with a new rite - # Listed first, since the conversions below add characters to the faith being iterated - if = { - limit = { - NOT = { scope:diverged ?= yes } - } - root = { - every_faith_character = { - limit = { is_ruler = yes } - add_to_temporary_list = pam_reform_founding_wave - } - } - every_in_list = { - list = pam_reform_founding_wave - pam_convert_court_to_faith_effect = { - FAITH = root - OLD_FAITH = scope:old_faith - } - } - } } else = { scope:founder ?= { @@ -292,6 +271,109 @@ on_faith_created = { pam_seed_cardinals_effect = yes } } + # Achievements - evaluated on the acting character, as add_achievement_* gate on is_ai. + scope:founder ?= { + if = { + limit = { faith = root } + add_achievement_flag_effect = { FLAG = achievement_its_not_a_cult_flag } + if = { + limit = { + scope:old_faith = { + religion_tag = west_african_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_siguic + VALUE = yes + } + } + if = { + limit = { + scope:old_faith = { + religion_tag = west_african_orisha_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_orisha + VALUE = yes + } + } + if = { + limit = { + scope:old_faith = { + religion_tag = west_african_bori_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_bori + VALUE = yes + } + } + if = { + limit = { + scope:old_faith = { + religion_tag = west_african_roog_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_roog_sene + VALUE = yes + } + } + if = { + limit = { + scope:old_faith = { + religion_tag = akom_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_akom + VALUE = yes + } + } + if = { + limit = { + scope:old_faith = { + religion_tag = kushitism_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_kushitism + VALUE = yes + } + } + if = { + limit = { + scope:old_faith = { + religion_tag = waaqism_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_waaqism + VALUE = yes + } + } + if = { + limit = { + scope:old_faith = { + religion_tag = north_african_religion + has_doctrine_parameter = unreformed + } + } + add_achievement_global_variable_effect = { + VARIABLE = achievement_mother_of_us_all_achamanism + VALUE = yes + } + } + } + } # These events need a character, so they fire on the new faith's head, never a founder outside the faith root.main_rite.head_of_rite ?= { trigger_event = faith_conversion.0001 # Convert capital county @@ -438,11 +520,13 @@ on_rite_created = { has_character_flag = forced_conversion_on_reform } set_character_faith = root.faith + set_character_rite = root.rite every_vassal_or_below = { limit = { faith = scope:old_faith } random = { chance = 75 set_character_faith = root.faith + set_character_rite = root.rite } } every_sub_realm_county = { @@ -450,6 +534,7 @@ on_rite_created = { random = { chance = 75 set_county_faith = root.faith + set_county_rite = root.rite } } } @@ -641,10 +726,18 @@ on_faith_conversion = { } } trigger_event = NEOW_dynamic_titles.1000 - } ###################################################### + } + set_variable = { + name = old_rite + value = scope:old_rite + days = 30 + } + pam_on_conversion_effect = yes + pam_remove_forbidden_personal_tenet_secret_if_invalid_effect = yes + update_syncretism_personal_tenet_effect = yes # EP3 - State Faith if = { limit = { @@ -967,12 +1060,12 @@ on_rite_change = { } } random_held_title = { - limit = { - tier = tier_county + limit = { + tier = tier_county any_county_province = { has_variable = monastic_order_capital } - } + } random_county_province = { limit = { has_variable = monastic_order_capital @@ -1469,7 +1562,7 @@ pagan_conversion_pulse = { } events = { - # global_religion.0001 #Pagan reformed by neighbor, spouse, soulmate, friend, or geographic location + global_religion.0001 #Pagan reformed by neighbor, spouse, soulmate, friend, or geographic location } } @@ -1862,304 +1955,3 @@ on_character_holy_site_created = { } } } - -on_character_faith_change = { - effect = { - check_for_equal_doctrine_effect = yes - every_held_title = { - update_dynamic_coa = yes - } - - # Struggles - ## Struggle Catalysts - ### Heir changes culture while under age - if = { - limit = { - catalyst_very_important_child_change_culture_or_faith_preliminary_trigger = yes - } - random_parent = { - limit = { - any_character_struggle = { - involvement = involved - } - } - every_character_struggle = { - involvement = involved - activate_struggle_catalyst = { - catalyst = catalyst_very_important_child_change_culture_or_faith - character = root - } - } - } - } -# ## Struggle Effects -## ### persian_struggle: switching faith to anything that isn't an orthodox Sunni creed'll flip you to detractor. -## if = { -## limit = { -## # Gotta be in the appropriate struggle. -## any_character_struggle = { this = struggle:persian_struggle } -## # Filter out pre-existing detractors. -## NOT = { has_trait = fp3_struggle_detractor } -## # Now, check the new faith. -## exists = title:d_sunni.holder -## OR = { -## NOT = { exists = faith.religious_head } -## NOT = { faith.religious_head = title:d_sunni.holder } -## } -## } -## send_interface_toast = { -## type = event_toast_effect_neutral -## title = persian_struggle.tt.converted_away_from_sunni_orthodoxy -## left_icon = root -## hidden_effect = { remove_trait = fp3_struggle_supporter } -## add_trait_force_tooltip = fp3_struggle_detractor -## } -## } -# -# # Local conversion -# if = { -# limit = { -# exists = root.capital_province -# root.capital_province.faith = root.faith -# any_character_struggle = { -# involvement = involved -# phase_has_catalyst = catalyst_convert_local_culture_faith -# is_faith_involved_in_struggle = root.faith -# } -# } -# every_character_struggle = { -# involvement = involved -# activate_struggle_catalyst = { -# catalyst = catalyst_convert_local_culture_faith -# character = root -# } -# } -# } -# else_if = { # Forced conversion -# limit = { -# any_character_struggle = { -# involvement = involved -# is_faith_involved_in_struggle = root.faith -# phase_has_catalyst = catalyst_forced_conversion -# } -# } -# every_character_struggle = { -# involvement = involved -# activate_struggle_catalyst = { -# catalyst = catalyst_forced_conversion -# character = root -# } -# } -# } -# else_if = { -# limit = { -# has_trait = fp3_struggle_supporter -# any_character_struggle = { -# involvement = involved -# is_faith_involved_in_struggle = root.faith -# phase_has_catalyst = catalyst_supporter_forced_conversion -# } -# } -# every_character_struggle = { -# involvement = involved -# activate_struggle_catalyst = { -# catalyst = catalyst_supporter_forced_conversion -# character = root -# } -# log_debug_variable_for_persian_struggle_effect = { VAR = unrest_catalyst_supporter_forced_conversion } -# } -# } -# else_if = { -# limit = { -# has_trait = fp3_struggle_detractor -# any_character_struggle = { -# involvement = involved -# is_faith_involved_in_struggle = root.faith -# phase_has_catalyst = catalyst_detractor_forced_conversion -# } -# } -# every_character_struggle = { -# involvement = involved -# activate_struggle_catalyst = { -# catalyst = catalyst_detractor_forced_conversion -# character = root -# } -# log_debug_variable_for_persian_struggle_effect = { VAR = stabil_catalyst_detractor_forced_conversion } -# } -# } - - - # Achievements - if = { - limit = { is_ai = no } - - if = { # FP2 - Basque In My Glory - limit = { faith = faith:basque_pagan } - add_achievement_global_variable_effect = { - VARIABLE = fp2_basque_in_my_glory_achievement_unlocked - VALUE = yes - } - } - } - - # Hostage story cycle - if = { - limit = { - is_hostage = yes - is_adult = no - # Did they just change to their captor's culture - faith = warden.faith - } - save_scope_as = hostage - warden = { - trigger_event = bp2_yearly.8050 - } - } - - if = { - limit = { - has_variable = japan_1010_discount - var:japan_1010_discount = faith - } - remove_variable = japan_1010_discount - } - - if = { - limit = { - has_character_flag = tgp_japan_1040_discount - faith.religion = religion:shintoism_religion - } - remove_character_flag = tgp_japan_1040_discount - } - - #Lose Mandala if you change to a monotheist faith - mandala_no_longer_polytheist_effect = yes - } - events = { - faith_conversion.0002 # Remove obsolete modifiers - faith_conversion.0004 # Convert Theocracies - faith_conversion.0005 # Update marriage opinions - great_holy_war.0025 # Replace Recipient for ongoing GHW - great_holy_war.0029 # Beneficiary converted, remove and replace. - great_holy_war.0059 # Clear Crusader traits on conversion. - great_holy_war.0084 # Replace fallback ghw recipient - great_holy_war.0085 # Remove pledged vassals upon conversion of their liege. - war_event.3100 # Handles invalidation of religious wars - } -} - -faith_fervor_events_pulse = { - trigger = { - NOR = { - has_doctrine_parameter = unreformed - has_variable = recent_fervor_event - } - } - - random_events = { - chance_to_happen = 6 # ~53% chance of occurring within a given year. 90% chance within 3 years, 99.8% chance within 5. - 100 = fervor.1001 - 100 = fervor.2001 - } -} - -on_rite_updated = { - events = { - } - - effect = { - root = { - save_scope_as = rite - } - - if = { # slient it for EC since EC has unique evvent to inform - limit = { - exists = scope:changed_tenets_or_doctrines - OR = { - NOT = { - faith = { has_variable = ecumenical_council_ongoing } - } - exists = scope:consume_rite_edit_token - } - } - - # The message icon slot must never be left unset, hence the fall-through to the rite itself - if = { - limit = { any_in_list = { list = added_tenets count >= 1 } } - every_in_list = { - list = added_tenets - save_scope_as = rite_change_icon - } - } - else_if = { - limit = { any_in_list = { list = added_doctrines count >= 1 } } - every_in_list = { - list = added_doctrines - save_scope_as = rite_change_icon - } - } - else_if = { - limit = { any_in_list = { list = removed_tenets count >= 1 } } - every_in_list = { - list = removed_tenets - save_scope_as = rite_change_icon - } - } - else_if = { - limit = { any_in_list = { list = removed_doctrines count >= 1 } } - every_in_list = { - list = removed_doctrines - save_scope_as = rite_change_icon - } - } - else = { - root = { save_scope_as = rite_change_icon } - } - - every_player = { - limit = { - OR = { - rite = root - AND = { - faith = root.faith - root.faith.main_rite = root - } - } - } - send_interface_message = { - type = msg_rite_updated - title = msg_rite_updated - left_icon = scope:rite_change_icon - - show_as_tooltip = { - every_in_list = { - list = removed_doctrines - root = { remove_rite_doctrine = prev } - } - every_in_list = { - list = added_doctrines - root = { add_rite_doctrine = prev } - } - every_in_list = { - list = removed_tenets - root = { remove_rite_tenet = prev } - } - every_in_list = { - list = added_tenets - root = { add_rite_tenet = prev } - } - } - } - } - } - - head_of_rite ?= { - trigger_event = faith_creation.0004 # Update HoF succession law - trigger_event = faith_creation.0001 # Temporal rel head setup - trigger_event = faith_creation.0002 # Spiritual rel head setup - trigger_event = faith_creation.0011 # Restore Temporal rel head - trigger_event = faith_creation.0012 # Restore Spiritual rel head - trigger_event = faith_creation.1100 # Destroy HoF title if no longer valid - } - } -} diff --git a/common/on_action/title_on_actions.txt b/common/on_action/title_on_actions.txt index dbb654c26..6d5371024 100644 --- a/common/on_action/title_on_actions.txt +++ b/common/on_action/title_on_actions.txt @@ -36,6 +36,28 @@ on_title_destroyed = { owner = { destroy_title = prev } } # If the title of an independent admin ruler is destroyed, let's make sure we handle any stray admin vassals + + ################ N3OW Dynamic Titles ################## + + if = { + limit = { + OR = { + scope:title = title:k_kuban + scope:title = title:d_volgorad + scope:title = title:c_volgograd + scope:title = title:b_volgograd + scope:title = title:e_france + scope:title = title:e_nistrenia + scope:title = title:e_europa + scope:title = title:e_britannia + scope:title = title:e_germany + } + } + trigger_event = NEOW_dynamic_titles.1000 + } + + ###################################################### + if = { limit = { government_has_mechanic = administrative @@ -179,37 +201,6 @@ on_title_destroyed = { } } } - } -} - -# A title is transferred to a new character -# root = the new holder -# scope:title = the title that changes hands -# scope:previous_holder = previous holder. Might be dead -on_title_gain = { - effect = { - - ################ N3OW Dynamic Titles ################## - - if = { - limit = { - OR = { - scope:title = title:k_kuban - scope:title = title:d_volgorad - scope:title = title:c_volgograd - scope:title = title:b_volgograd - scope:title = title:e_france - scope:title = title:e_nistrenia - scope:title = title:e_europa - scope:title = title:e_britannia - scope:title = title:e_germany - } - } - trigger_event = NEOW_dynamic_titles.1000 - } - - ###################################################### - # Empire Faith Gate: refresh contested-empire modifiers immediately when an empire is destroyed. if = { @@ -219,7 +210,241 @@ on_title_gain = { } root = { efg_recalculate_contested_empire_for_faith_effect = yes } } - + + if = { + limit = { + scope:landed_title = { + has_title_law = confederation_elective_succession_law + } + } + if = { + limit = { + has_character_modifier = confederate_king_modifier + } + remove_character_modifier = confederate_king_modifier + } + if = { + limit = { + has_character_modifier = coronated_confed_modifier + } + remove_character_modifier = coronated_confed_modifier + } + } + + ######### + # PAM # + ######### +# if = { +# limit = { +# scope:landed_title = { +# has_clerical_region = yes +# root = { religion = religion:christianity_religion } +# } +# } +# situation:the_christian_church.situation_sub_region:core = { +# remove_clerical_realm_from_sub_region = scope:landed_title +# } +# } + } +} + +# A title is transferred to a new character +# root = the new holder +# scope:title = the title that changes hands +# scope:previous_holder = previous holder. Might be dead +on_title_gain = { + effect = { + # refresh the state rite if conquered in a GHW, otherwise crusader kings will follow muslim faith in egypt. + if = { + limit = { + scope:transfer_type = flag:conquest_holy_war + exists = scope:title.state_rite + } + scope:title = { + set_state_rite = root.rite + } + } + if = { + limit = { clerical_elector_title ?= scope:title } + pam_strip_illegal_cardinalate_effect = yes + } + if = { + limit = { + exists = clerical_elector_title + scope:title = clerical_elector_title + } + add_character_flag = cardinal_flag + situation:the_christian_church ?= { + add_manual_participant = prev + } + } + # Unconditional: also catches a sitting Head of Faith who is handed a cardinalate + pam_vacate_head_of_faith_cardinalate_effect = yes + if = { + limit = { + scope:title = { has_clerical_region = yes } + religion = religion:christianity_religion + } + situation:the_christian_church ?= { + add_manual_participant = prev + } + } + if = { + limit = { + government_has_flag = government_is_landless_adventurer + OR = { + scope:transfer_type = flag:inheritance + scope:transfer_type = flag:appointment_succession + } + religion = religion:christianity_religion + OR = { + scope:title = { has_clerical_region = yes } + scope:title = { has_title_law = clerical_appointment_law } + scope:previous_holder = { has_realm_law = clerical_appointment_law } + } + any_held_title = { has_variable = adventurer_creation_reason } + } + destroy_laamp_effect = { ADVENTURER = root } + change_government = ecclesiastical_government + } + if = { + limit = { + OR = { + scope:title = title:d_coptic_papacy + scope:title = title:d_apostolic_church + } + } + change_government = ecclesiastical_government + } + pam_align_theocracy_with_faith_government_effect = yes + # The three-year pulse is too slow for a non-Christian clerical court landed mid-game, which has no other Clerical Appointment candidates + if = { + limit = { + pam_government_is_religious_playable_trigger = yes + religion != religion:christianity_religion + NOT = { exists = primary_heir } + } + pam_seed_monk_courtiers_effect = yes + } + if = { + limit = { scope:title = title:d_benedictine_order } + set_variable = { name = benedictine } + } + if = { + limit = { scope:title = title:k_papal_state } + enforce_papal_latin_court_language_effect = yes + # PAM - track how many Popes in a row have been of the same dynasty + pam_the_christian_church_papal_dynasty_capture_catalyst_effect = yes + if = { + limit = { + faith = { has_doctrine_parameter = has_clerical_electors } + NOT = { has_realm_law = theocratic_elective_succession_law } + } + add_realm_law_skip_effects = theocratic_elective_succession_law + } + } + # Move a county+ Realm Priest Puppet to Clerical Ruler while the puppeteer slot is still free + if = { + limit = { + is_clergy = yes + scope:title.tier >= tier_county + highest_held_title_tier = scope:title.tier + exists = puppeteer + is_puppet_of_type = theological_agent_puppet + } + pam_make_clerical_ruler_puppet_effect = { PUPPETEER = puppeteer } + } + scope:previous_holder ?= { + if = { + limit = { + NOT = { exists = clerical_elector_title } + is_alive = yes + } + remove_character_flag = cardinal_flag + } + if = { + limit = { + is_alive = yes + OR = { + scope:title = { has_clerical_region = yes } + root.clerical_elector_title ?= scope:title + } + NOR = { + exists = clerical_elector_title + any_held_title = { has_clerical_region = yes } + } + } + situation:the_christian_church ?= { + if = { + limit = { is_manual_participant = prev } + remove_manual_participant = prev + } + } + } + } + # An inherited antipope title carries its Flavourization flag to the heir + if = { + limit = { + scope:title.tier = tier_kingdom + pam_is_antipope_trigger = yes + } + add_character_flag = antipope_flag + } + scope:previous_holder ?= { + if = { + limit = { + is_alive = yes + has_character_flag = antipope_flag + pam_is_antipope_trigger = no + } + remove_character_flag = antipope_flag + } + } + # PAM: a player's kin takes a great office of the Church + # pam_establish_antipope_effect waits for this + # The challenger registers only after the title change + if = { + limit = { + religion = religion:christianity_religion + pam_title_is_church_seat_trigger = { TITLE = scope:title } + } + pam_family_becomes_prelate_effect = { + TITLE = scope:title + KIND = flag:head_of_faith + } + } + else_if = { + limit = { + religion = religion:christianity_religion + scope:title = { has_clerical_region = yes } + NOT = { + any_held_title = { + has_clerical_region = yes + this != scope:title + } + } + } + pam_family_becomes_prelate_effect = { + TITLE = scope:title + KIND = flag:archbishop + } + } + + # PAM - a Christian prelate takes a landed title outside the clerical regions + pam_the_christian_church_clergy_gained_landed_title_catalyst_effect = yes + if = { + limit = { + religion = religion:christianity_religion + scope:title = { has_clerical_region = yes } + exists = scope:previous_holder + } + pam_react_to_new_archbishop_effect = { TITLE = scope:title } + } + pam_offer_great_schism_stance_effect = yes + + ###################### + # COUNTY-TIER TITLES # + ###################### if = { limit = { scope:title.tier = tier_county @@ -230,7 +455,6 @@ on_title_gain = { ########### if = { limit = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } scope:title = { is_nomad_title = yes exists = title_domicile @@ -240,7 +464,6 @@ on_title_gain = { if = { limit = { root = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } any_held_title = { is_nomad_title = yes exists = title_domicile @@ -251,7 +474,6 @@ on_title_gain = { if = { limit = { root = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } any_held_title = { is_nomad_title = yes exists = title_domicile @@ -287,7 +509,6 @@ on_title_gain = { } else_if = { limit = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } exists = var:player_domicile_title } root = { @@ -303,7 +524,6 @@ on_title_gain = { title_domicile = { if = { limit = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } exists = root.dynasty scope:previous_holder.dynasty ?= root.dynasty } @@ -330,7 +550,6 @@ on_title_gain = { root = { random_held_title = { limit = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } is_nomad_title = yes exists = title_domicile NOT = { this = scope:title } @@ -355,9 +574,6 @@ on_title_gain = { root = { random_held_title = { limit = { - root = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } - } is_nomad_title = yes exists = title_domicile NOT = { this = scope:title } @@ -368,7 +584,6 @@ on_title_gain = { title_domicile = { if = { limit = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } exists = root.dynasty scope:previous_holder.dynasty ?= root.dynasty } @@ -385,7 +600,6 @@ on_title_gain = { if = { limit = { exists = global_var:game_has_started - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } NOT = { exists = previous_holder } @@ -393,7 +607,6 @@ on_title_gain = { if = { limit = { root = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } OR = { house.house_head ?= { this != root @@ -586,12 +799,12 @@ on_title_gain = { has_character_flag = domicile_culture_and_faith_check OR = { domicile.domicile_culture != scope:title.culture - domicile.domicile_faith != scope:title.faith + domicile.domicile_rite != scope:title.rite } } domicile = { set_domicile_culture = scope:title.culture - set_domicile_faith = scope:title.faith + set_domicile_rite = scope:title.rite } remove_character_flag = domicile_culture_and_faith_check } @@ -607,8 +820,8 @@ on_title_gain = { } } if = { - limit = { domicile.domicile_faith != scope:title.faith } - scope:title = { set_county_faith = root.domicile.domicile_faith } + limit = { domicile.domicile_rite != scope:title.rite } + scope:title = { set_county_rite = root.domicile.domicile_rite } } } } @@ -796,6 +1009,24 @@ on_title_gain = { } } + ########### + # CE1 - Isolated Capital only carries over to a successor + ########### + if = { + limit = { + scope:title = { has_county_modifier = isolate_capital_decision_modifier } + NOR = { + scope:transfer_type = flag:inheritance + scope:transfer_type = flag:abdication + scope:transfer_type = flag:appointment_succession + scope:transfer_type = flag:election + } + } + scope:title = { + remove_county_modifier = isolate_capital_decision_modifier + } + } + ########### # EP3 ADVENTURERS BECOMING LANDED ########### @@ -1673,6 +1904,30 @@ on_title_gain = { # trigger_event = roman_restoration.0005 # } #Mongol empire and GoK should lose other empires + if = { + limit = { + primary_title ?= { + OR = { + this = title:e_mongol_empire + AND = { + exists = global_var:greatest_of_khans_title + this = global_var:greatest_of_khans_title + } + } + } + scope:title = { + NOR = { + this = title:e_mongol_empire + AND = { + exists = global_var:greatest_of_khans_title + this = global_var:greatest_of_khans_title + } + } + } + is_ai = yes + } + destroy_title = scope:title + } # You just inherited an Emperor title!! if = { limit = { @@ -1792,6 +2047,70 @@ on_title_gain = { # value = yes # } # } + # TGP CEREMONIAL RULER + # IMPERIAL INHERITANCE + else_if = { + limit = { + scope:title = { + this = title:k_france + } + NOR = { + dynasty = { this = dynasty:25061 } # Not held by a Karling + any_liege_or_above = { + dynasty = { this = dynasty:25061 } # And does not have a liege that is a Karling + } + has_global_variable = west_francia_renamed + } + } + trigger_event = { + id = title_event.0001 + days = 1 + } + } + # East Francia becomes Germany when no longer controlled by a Karling + else_if = { + limit = { + scope:title = { + this = title:k_east_francia + } + NOR = { + dynasty = { this = dynasty:25061 } # Not held by a Karling + any_liege_or_above = { + dynasty = { this = dynasty:25061 } # And does not have a liege that is a Karling + } + has_global_variable = east_francia_renamed + } + } + trigger_event = { + id = title_event.0002 + days = 1 + } + } + # Hidden management event to determine if we need to axe Asturias &, if we do, what notification events to send out afterwards. + else_if = { + limit = { + scope:title = title:k_castille + title:k_asturias = { + # Leon must be de jure part of Asturias, or else there's no reason to ever stop calling it Asturias. + any_in_de_jure_hierarchy = { this = title:d_leon } + } + } + trigger_event = { + id = title_event.0011 + days = 1 + } + } + # FP2 El Cid Achievement + else_if = { + limit = { + scope:title = title:k_valencia + has_character_flag = fp2_el_cid_blood_relation_legacy + } + set_global_variable = { # DO. NOT. USE. add_achievement_global_variable_effect. IT BREAKS THE ACHIEVEMENT. + name = fp2_el_cid_achievement_unlocked + value = yes + } + } # TGP CEREMONIAL RULER # IMPERIAL INHERITANCE else_if = { @@ -2095,7 +2414,6 @@ on_title_gain = { } if = { # Get legitimacy from Reception Hall House Bonus limit = { - exists = house house = { has_variable = ep3_legacy_legitimacy_counter } primary_title = scope:title } @@ -2243,7 +2561,6 @@ on_title_gain = { top_liege = root.top_liege government_has_mechanic = administrative this != scope:title_gainer -# scope:title != title:k_chrysanthemum_throne } send_interface_message = { type = msg_admin_title_gained @@ -2343,7 +2660,7 @@ on_title_gain = { # TGP, bow before liege mandated if = { limit = { - culture ?= { has_cultural_parameter = must_pledge_loyalty_to_liege } + culture = { has_cultural_parameter = must_pledge_loyalty_to_liege } } if = { # if you are now the top liege, all your direct vassals with the same parameter who have not yet sworn fealty to you must swear fealty limit = { @@ -2353,7 +2670,7 @@ on_title_gain = { every_vassal = { if = { limit = { - culture ?= { has_cultural_parameter = must_pledge_loyalty_to_liege } + culture = { has_cultural_parameter = must_pledge_loyalty_to_liege } OR = { government_has_flag = government_is_feudal government_has_flag = government_is_clan @@ -2372,7 +2689,7 @@ on_title_gain = { } else_if = { # if you now have a new liege, and they also follow a culture with the Pay Homage requirement, you must swear continued fealty limit = { - liege.culture ?= { has_cultural_parameter = must_pledge_loyalty_to_liege } + liege.culture = { has_cultural_parameter = must_pledge_loyalty_to_liege } OR = { government_has_flag = government_is_feudal government_has_flag = government_is_clan @@ -2535,7 +2852,7 @@ on_title_gain = { if = { limit = { has_character_flag = peasant_outfit - NOT = { government_has_flag = government_is_true_herder } + NOT = { government_has_flag = government_is_herder } } remove_character_flag = peasant_outfit } @@ -3056,8 +3373,15 @@ on_title_gain = { } } events = { + roman_restoration.0005 #New Roman Emperor gets Augustus trait. (old holder, if still alive, loses it) + roman_restoration.0199 #Restoring the Pentarchy. + title_event.0021 # Rename/recolor Britannia based on founder's culture; applied immediately on creation + delay = { days = 1 } realm_maintenance.2001 #Big notification about inheriting emperor tier title british_isles.1032 # Danelaw-England partition calc. + title_event.0001 # Rename West Francia to France + title_event.0002 # Rename East Francia to Germany + title_event.0011 # Asturias becomes Leon upon emergence of Castille # If we weren't already in a diarchy but should be, put us in one. diarchy.0011 ep3_emperor_yearly.2020 # EP3: The Patriarch refuses to crown you as new emperor because you have a criminal trait @@ -3110,7 +3434,6 @@ on_title_gain_inheritance = { root = { becomes_independent = { change = scope:change } } - resolve_title_and_vassal_change = scope:change } # if = { # limit = { @@ -3258,7 +3581,7 @@ on_title_gain_usurpation = { # scope:new_holder = new holder. on_title_lost = { events = { - # british_isles.1033 # Danelaw-England partition calc. + british_isles.1033 # Danelaw-England partition calc. } effect = { @@ -3296,7 +3619,7 @@ on_title_lost = { if = { limit = { #We only want to grab tribal cultures. - culture ?= { + culture = { NOT = { has_cultural_era_or_later = culture_era_early_medieval } } #Must have lost their last piece of land. @@ -3400,7 +3723,7 @@ on_title_lost = { custom_tooltip = msg_rival_dethroned_desc - stress_and_fulfillment_impact = { + stress_impact = { base = medium_stress_loss vengeful = medium_stress_loss } @@ -4725,8 +5048,37 @@ on_vassal_change = { limit = { liege = root # I.e. root is independent } - # And is not of a high enough rank, change government if = { + limit = { + is_landed = no + any_held_title = { + is_noble_family_title = yes + } + } + if = { + limit = { + domicile.domicile_location.county.holder.top_liege ?= { + government_allows = noble_families + highest_held_title_tier > root.highest_held_title_tier + } + } + create_title_and_vassal_change = { + type = swear_fealty + save_scope_as = change + add_claim_on_loss = no + } + change_liege = { + liege = domicile.domicile_location.county.holder.top_liege + change = scope:change + } + resolve_title_and_vassal_change = scope:change + } + else = { + trigger_event = ep3_laamps.0002 + } + } + # And is not of a high enough rank, change government + else_if = { limit = { administrative_tier_allows_independence = no } diff --git a/common/on_action/yearly_on_actions.txt b/common/on_action/yearly_on_actions.txt index 41a7cca40..b1ce932de 100644 --- a/common/on_action/yearly_on_actions.txt +++ b/common/on_action/yearly_on_actions.txt @@ -2,6 +2,16 @@ # Root does not exist yearly_global_pulse = { effect = { + # Random chance for the Black Plague to spawn + bd_random_game_rule_effect = yes + # Daoxue is disabled in the 867 history and nothing else enables it during play + if = { + limit = { + current_year >= 1050 + rite:daoxue ?= { is_rite_enabled = no } + } + rite:daoxue = { set_rite_enabled = yes } + } # Historical character spawner # if = { # limit = { @@ -701,48 +711,955 @@ yearly_global_pulse = { } } } + spawn_historical_characters_effect = yes + } + # Visigothic culture split + ## Deprecated; to reenable, remove always = no line & decomment the trigger_event section. + if = { + limit = { + always = no + current_date <= 920.1.1 # No need to check this in later starts + NOT = { has_global_variable = visigothic_culture_split } + current_date >= 850.1.1 + } + random = { + chance = 0 # No chance the first year of play if starting in 867 + modifier = { + add = 10 + current_date >= 868.1.1 + } + modifier = { + add = 10 # 20% chance + current_date >= 875.1.1 + } + modifier = { + add = 10 # 30% chance + current_date >= 890.1.1 + } + set_global_variable = { + name = visigothic_culture_split + value = yes + } + #trigger_event = { + #id = global_culture.0001 + #days = { 60 300 } + #} + } + } + # Norse culture split. + if = { + limit = { + current_date < 990.1.1 + NOT = { has_global_variable = norse_culture_split } + current_date >= 950.1.1 + } + random = { + chance = 10 + modifier = { + add = 20 # 30% chance + current_date >= 960.1.1 + } + modifier = { + add = 30 # 60% chance + current_date >= 970.1.1 + } + modifier = { + add = 40 # 100% chance + current_date >= 980.1.1 + } + set_global_variable = { + name = norse_culture_split + value = yes + } + trigger_event = { + id = global_culture.0011 + days = { 60 300 } + } + } + } + # Anglo-Saxon -> Scottish Culture Shift + if = { + limit = { + current_date <= 1066.1.1 # No need to check this in later starts + NOT = { has_global_variable = scottish_culture_creation } + current_date >= 867.1.1 + } + random = { + chance = 0 # No chance the first year of play if starting in 867 + modifier = { + add = 2 # 2% chance per year + current_date >= 900.1.1 + } + modifier = { + add = 8 # 10% chance per year + current_date >= 950.1.1 + } + modifier = { + add = 15 # 25% chance per year + current_date >= 1000.1.1 + } + set_global_variable = { + name = scottish_culture_creation + value = yes + } + trigger_event = { + id = global_culture.0031 + days = { 60 300 } + } + } + } + # Mongol Invasion + if = { limit = { has_game_rule = never_mongol_invasion } } + else_if = { + limit = { + has_game_rule = random_mongol_invasion + NOT = { has_global_variable = mongols_have_appeared } + #Greatest of khans hasn't come along + NOT = { has_global_variable = greatest_of_khans_title } + #Someone's not currently trying to be greatest of khans + NOT = { has_global_variable = mpo_gok_war_ongoing } + #Temujin dying prevents Mongol invasion for at least 50 years + NOT = { + has_global_variable = temujin_failed + } + } + random = { + chance = temujin_appearance_base_chance + modifier = { + factor = 0.25 + current_date < 1180.1.1 + } + modifier = { + add = 3 + current_date > 1200.1.1 + } + modifier = { + add = 5 + current_date > 1220.1.1 + } + modifier = { + add = 5 + current_date > 1235.1.1 + } + set_global_variable = { + name = mongols_have_appeared + value = yes + } + debug_log = "Attempting to spawn mongol invasion within 240 days" + trigger_event = { + id = mongol_invasion.0001 + days = { 2 240 } + } + } + } + else = { + if = { + limit = { + current_date > 1180.1.1 + current_date < 1250.1.1 + NOT = { has_global_variable = mongols_have_appeared } + #Greatest of khans hasn't come along + NOT = { has_global_variable = greatest_of_khans_title } + #Someone's not currently trying to be greatest of khans + NOT = { has_global_variable = mpo_gok_war_ongoing } + trigger_if = { + limit = { + game_start_date = 1178.10.1 + } + years_from_game_start >= 20 + } + #Temujin dying prevents Mongol invasion for at least 50 years + NOT = { + has_global_variable = temujin_failed + } + } + debug_log = "Checking for chance of spawning mongols under historical settings" + random = { + chance = temujin_appearance_base_chance + modifier = { + add = 9 + current_date > 1200.1.1 + } + modifier = { + add = 10 + current_date > 1220.1.1 + } + modifier = { + add = 20 + current_date > 1235.1.1 + } + modifier = { + add = 30 + exists = character:125501 # Temüjin + character:125501 = { + is_physically_able_ai_adult = yes + } + } + set_global_variable = { + name = mongols_have_appeared + value = yes + } + debug_log = "Attempting to spawn mongol invasion within 240 days" + trigger_event = { + id = mongol_invasion.0001 + days = { 2 240 } + } + } + } + } + # Almohad Invasion + if = { + limit = { + current_date >= 1110.1.1 + current_date < 1150.1.1 + NOT = { has_global_variable = spawned_almohads } + } + random = { + chance = almohad_appearance_base_chance + modifier = { + add = 3 + current_date >= 1130.1.1 + } + modifier = { + add = 3 + current_date >= 1140.1.1 + } + debug_log = "Attempting to spawn Almohads within 240 days" + trigger_event = { + id = almohad.0001 + days = { 2 240 } + } + } + } + # Jomsvikings form autonomously. + if = { + limit = { + # Do we have the correct flavour pack? + has_fp1_dlc_trigger = yes + # Must be within the 10th century. + current_date >= 900.1.1 + current_date < 1000.1.1 + # The Jomsvikings cannot have already formed for any reason & by any method. + fp1_jomsvikings_have_not_existed_trigger = yes + # Must be a valid target somewhere in the appropriate region. + any_county_in_region = { + region = dlc_fp1_region_non_scandinavian_southern_baltic + holder = { fp1_ruler_eligible_for_jomsviking_coup = yes } + } + } + random = { + # Low initial chance, to give the player time. + chance = 5 + # Add 5% every decade for the first half of the century. + modifier = { + add = 5 + current_date >= 910.1.1 + } + modifier = { + add = 5 + current_date >= 920.1.1 + } + modifier = { + add = 5 + current_date >= 930.1.1 + } + modifier = { + add = 5 + current_date >= 940.1.1 + } + modifier = { + add = 5 + current_date >= 950.1.1 + } + # And then add another 25% solid chance for the whole of the latter half of the century. + modifier = { + add = 25 + current_date >= 960.1.1 + } + # Fire the event. + trigger_event = { + id = fp1_jomsvikings.1011 + days = { 30 300 } + } + } + } + # A wandering French monk appears. + if = { + limit = { + # Do we have the correct flavour pack? + has_fp2_dlc_trigger = yes + # Must be before the monk would likely die. + current_date <= 880.1.1 + # The monk hasn't already tried to turn up somewhere. + NOT = { + is_target_in_global_variable_list = { + name = unavailable_unique_events + target = flag:lyonese_monk_event + } + } + } + # If there's a player in this region, we wait for one to become eligible. + if = { + limit = { + any_player = { + capital_province = { geographical_region = dlc_fp2_lyonese_monk_region } + } + } + if = { + limit = { + OR = { + any_player = { + capital_province = { geographical_region = dlc_fp2_lyonese_monk_region } + fp2_lyonese_monk_0002_valid_character_configuration_trigger = yes + } + current_date = 880.1.1 + } + } + # Fire the event. + trigger_event = { + id = fp2_lyonese_monk.0002 + days = { 30 90 } + } + } + } + # Otherwise, we roll randomly per year immediately. + else_if = { + limit = { + any_county_in_region = { + region = dlc_fp2_lyonese_monk_region + holder = { fp2_lyonese_monk_0002_valid_court_trigger = yes } + } + } + random = { + # Low initial chance, to give the player time. + chance = 5 + # Slowly ramp up the chance till *someone* is selected, assuming we have any valid candidates. + modifier = { + add = 20 + current_date >= 870.1.1 + } + modifier = { + add = 25 + current_date >= 873.1.1 + } + modifier = { + add = 25 + current_date >= 876.1.1 + } + modifier = { + add = 25 + current_date = 880.1.1 + } + # Fire the event. + trigger_event = { + id = fp2_lyonese_monk.0002 + days = { 30 90 } + } + } + } + } + + # Rabbinicism becomes Monogamous + if = { + limit = { + # Rabbi Gershom bans polygamy sometime in the 11th century + current_date > "1000.01.01" + # Make sure this hasn't happened already + faith:rabbinic_faith = { + main_rite = { + rite_has_doctrine = doctrine_polygamy + NOT = { + has_variable = rabbinicism_accepted_monogamy + has_variable = rabbinicism_rejected_monogamy + } + } + } + } + religion:judaism_religion = { + every_faith = { + limit = { + main_rite = { + rite_has_doctrine = doctrine_polygamy + rite_has_doctrine = temple_authority_rabbinic_doctrine + } + } + if = { + limit = { + exists = religious_head + } + if = { + limit = { + religious_head = { top_liege != this } + religious_head.top_liege.faith = this + } + religious_head.top_liege = { trigger_event = jewish_events.0001 } + } + else_if = { + limit = { + religious_head = { top_liege != this } + religious_head.liege.faith = this + } + religious_head.liege = { trigger_event = jewish_events.0001 } + } + else = { + religious_head = { trigger_event = jewish_events.0001 } + } + } + else_if = { + limit = { + any_player = { # Checking players is more performant than checking faith characters and limiting it to players + faith = prev + } + } + random_player = { + limit = { faith = prev } + trigger_event = jewish_events.0001 + } + } + else = { + random_faith_character = { + trigger_event = jewish_events.0001 + } + } + } + } + } + + # The Great Schism, for games without PAM + if = { + limit = { + has_pam_dlc_trigger = no + current_date >= 1054.1.1 + NOT = { has_global_variable = pam_great_schism_decision_taken } + exists = faith:christian_faith + } + trigger_event = { + id = great_schism.0001 + days = 196 # 1054.1.1 -> 1054.7.16 + } + } + + # The Rise of the Seljuk + if = { limit = { has_game_rule = never_seljuk_invasion } } + else_if = { # Random Seljuk Invasion + limit = { + has_game_rule = random_seljuk_invasion + NOR = { + exists = global_var:seljuk_invasion_happened + exists = struggle:persian_struggle # We don't allow it during the struggle (not that it can happen in 930) + } + } + random = { + chance = fp3_seljuk_chance_of_appearance + modifier = { + add = 5 + current_date > 965.1.1 + } + modifier = { + add = 5 + current_date > 985.1.1 + } + modifier = { + add = 5 + current_date > 1005.1.1 + } + modifier = { + factor = 0.25 + OR = { + culture:turkish = { culture_number_of_counties = 0 } + faith:sunni = { has_followers_trigger = no } + } + } + set_global_variable = { + name = seljuk_invasion_happened + value = yes + } + debug_log = "Attempting to spawn seljuk invasion within 240 days" + trigger_event = { + id = fp3_story_cycle_seljuks_invasion_events.0001 + days = { 2 240 } + } + } + } + else_if = { # Historical Seljuk Invasion + limit = { + current_date < 1066.1.1 + current_date >= 945.1.1 + NOR = { + exists = global_var:seljuk_invasion_happened + exists = struggle:persian_struggle # We don't allow it during the struggle (not that it can happen in 930) + } + } + random = { + chance = fp3_seljuk_chance_of_appearance + modifier = { + add = 5 + current_date > 965.1.1 + } + modifier = { + add = 5 + current_date > 985.1.1 + } + modifier = { + add = 5 + current_date > 1005.1.1 + } + modifier = { + factor = 0.25 + OR = { + culture:turkish = { culture_number_of_counties = 0 } + faith:sunni = { has_followers_trigger = no } + } + } + set_global_variable = { + name = seljuk_invasion_happened + value = yes + } + debug_log = "Attempting to spawn seljuk invasion within 240 days" + trigger_event = { + id = fp3_story_cycle_seljuks_invasion_events.0001 + days = { 2 240 } + } + } + } + + # Zanj Rebellion + if = { + limit = { + current_date = 868.1.2 + NOT = { exists = global_var:zanj_rebellion_happened } + } + debug_log = "Zanj Rebellion Story Cycle Started" + trigger_event = { + id = fp3_story_cycle_zanj_rebellion_events.0001 + days = { 100 5000 } + } + set_global_variable = { + name = zanj_rebellion_happened + value = yes + } + } + #Grant latin emperor a de jure kingdom after 100 years, if they've failed to grab any de jure lands yet + if = { + limit = { + exists = global_var:byz_collapse_counter + current_year >= global_var:byz_collapse_counter + exists = title:e_latin_empire.holder + title:e_latin_empire.holder = { + is_alive = yes + primary_title = title:e_latin_empire + capital_county.kingdom = { + empire = title:e_byzantium + any_de_jure_county = { + percent >= 0.5 + holder.top_liege = { + this = title:e_latin_empire.holder + } + } + } + } + NOT = { + title:e_latin_empire = { + any_in_de_jure_hierarchy = { + tier <= tier_kingdom + } + } + } + } + title:e_latin_empire.holder = { + trigger_event = ep3_frankokratia_events.0140 + } + } + #Greek anarchy CB becomes unavailable when things are settled + if = { + limit = { + exists = global_var:byz_collapse_counter + current_year >= global_var:byz_collapse_counter + OR = { + NOT = { + exists = title:e_latin_empire.holder + } + title:e_latin_empire.holder ?= { + NOT = { + any_realm_county = { + OR = { + empire = title:e_latin_empire + empire = title:e_byzantium + } + } + } + } + title:e_latin_empire.holder ?= { + any_held_title = { + this = title:e_byzantium + } + } + } + } + remove_global_variable = byz_collapse_counter + + #Send notification out to everyone in de jure latin empire + if = { + limit = { + title:e_latin_empire = { + any_in_de_jure_hierarchy = { + holder ?= { + is_ai = no + } + } + } + } + title:e_latin_empire = { + every_in_de_jure_hierarchy = { + limit = { + holder ?= { + is_ai = no + } + } + if = { + limit = { + holder ?= { + NOT = { is_in_list = latin_byz_notify } + } + } + holder = { + add_to_list = latin_byz_notify + } + } + } + } + } + if = { + limit = { + title:e_byzantium = { + any_in_de_jure_hierarchy = { + holder ?= { + is_ai = no + } + } + } + } + title:e_byzantium = { + every_in_de_jure_hierarchy = { + limit = { + holder ?= { + is_ai = no + } + } + if = { + limit = { + holder = { + NOT = { is_in_list = latin_byz_notify } + } + } + holder = { + add_to_list = latin_byz_notify + } + } + } + } + } + title:e_latin_empire.holder = { + if = { + limit = { + is_ai = no + NOT = { is_in_list = latin_byz_notify } + } + add_to_list = latin_byz_notify + } + trigger_event = ep3_frankokratia_events.0081 + } + title:e_byzantium.holder = { + if = { + limit = { + is_ai = no + NOT = { is_in_list = latin_byz_notify } + } + add_to_list = latin_byz_notify + } + } + title:e_byzantium = { + save_scope_as = byzantium + } + if = { + limit = { + any_in_list = { + list = latin_byz_notify + count > 0 + } + } + every_in_list = { + list = latin_byz_notify + send_interface_message = { + type = msg_frankokratia_anarchy_end + title = msg_greek_anarchy_cb_loss.t + desc = msg_greek_anarchy_cb_loss.desc + right_icon = scope:byzantium + custom_tooltip = lose_greek_anarchy_cb_tt + } + } + } + } + # TGP House Relations tracking + every_dynasty = { + every_dynasty_house = { + every_house_relation = { + if = { + limit = { + has_variable = house_relation_duration_years + } + change_variable = { + name = house_relation_duration_years + add = 1 + } + } + else = { + set_variable = { + name = house_relation_duration_years + value = 1 + } + } + } + } + } + if = { + limit = { + title:h_china.holder ?= { + can_have_tributaries_trigger = yes + any_tributary = { + count < 20 # hol' up with this if China already has 20 tributaries or more + } + } + } + random_county_in_region = { + region = tgp_china_tributary_region + limit = { + holder.top_overlord = { + is_ai = yes + is_independent_ruler = yes + any_county_in_region = { + region = tgp_china_tributary_region + this = prev.primary_title + } + NOR = { + any_owned_story = { + OR = { + story_type = story_mongol_invasion + story_type = story_greatest_of_khans + } + } + mpo_has_gok_mongol_empire_trigger = yes + has_trait = conqueror + has_trait = greatest_of_khans + is_gurkhan = yes + } + } + } + holder.top_overlord = { + set_variable = { + name = wants_to_become_tributary_of_china + years = 10 # if they haven't completed a tribute mission within 10 years we stop trying + } + } + } + } + + + every_hegemony = { + holder ?= { + if = { + limit = { + has_title = title:h_china + exists = top_participant_group:dynastic_cycle + } + every_tributary = { # update tributary favor + limit = { subject_standing >= 1 } #We do not reduce it if it is below 1 + add_subject_standing = { + value = { + situation:dynastic_cycle = { + switch = { + trigger = situation_current_phase + situation_dynastic_cycle_phase_stability = { + value = imperial_grace_loss_situation_dynastic_cycle_phase_stability + } + situation_dynastic_cycle_phase_stability_expansion = { + value = imperial_grace_loss_situation_dynastic_cycle_phase_stability_expansion + } + situation_dynastic_cycle_phase_stability_advancement = { + value = imperial_grace_loss_situation_dynastic_cycle_phase_stability_advancement + } + situation_dynastic_cycle_phase_instability = { + value = imperial_grace_loss_situation_dynastic_cycle_phase_instability + } + situation_dynastic_cycle_phase_instability_conquest = { + value = imperial_grace_loss_situation_dynastic_cycle_phase_instability_conquest + } + situation_dynastic_cycle_phase_chaos = { + value = imperial_grace_loss_situation_dynastic_cycle_phase_chaos + } + } + } + min = { #We don't reduce it below 0 + value = subject_standing + multiply = -1 + } + } + } + } + } + else = { + every_tributary = { + limit = { subject_standing > 0 } + add_subject_standing = -1 + } + } + } + } + #Yearly Imperial Grace Reduction for Hegemonic Tributaries + if = { + limit = { + exists = suzerain + suzerain = { highest_held_title_tier = tier_hegemony } + NOT = { exists = suzerain.top_participant_group:dynastic_cycle } + } + } + # Empire Faith Gate: multi-empire-same-faith legitimacy (iterate list, not every_independent_ruler). + if = { + limit = { empire_faith_gate_enabled_trigger = yes } + every_in_global_list = { + variable = efg_empire_holders + limit = { + is_alive = yes + is_landed = yes + highest_held_title_tier >= tier_empire + } + save_temporary_scope_as = efg_ruler + # Characters with multiple empire titles are exempt. + if = { + limit = { + faith_has_existing_empire_holder_trigger = yes + # Skip characters still in pending; empire_faith_gate.0002 applies them. + NOT = { exists = var:efg_modifier_pending_end_year } + any_in_global_list = { + variable = efg_empire_holders + efg_same_faith_empire_holder_trigger = yes + count >= 2 + } + } + remove_character_modifier = multi_empire_same_faith_penalty_1 + remove_character_modifier = multi_empire_same_faith_penalty_2 + remove_character_modifier = multi_empire_same_faith_penalty_3 + # Tier: 4+ = 3, 3 = 2, 2 = 1 (only two list scans) + if = { + limit = { + any_in_global_list = { + variable = efg_empire_holders + efg_same_faith_empire_holder_trigger = yes + count >= 4 + } + } + add_character_modifier = { + modifier = multi_empire_same_faith_penalty_3 + } + } + else_if = { + limit = { + any_in_global_list = { + variable = efg_empire_holders + efg_same_faith_empire_holder_trigger = yes + count >= 3 + } + } + add_character_modifier = { + modifier = multi_empire_same_faith_penalty_2 + } + } + else = { + add_character_modifier = { + modifier = multi_empire_same_faith_penalty_1 + } + } + + # Empire Faith Gate: make AI emperors treat same-faith competitors as rivals. + if = { + limit = { + is_ai = yes + has_contested_empire_trigger = yes + rite = { rite_has_parameter = excommunication_active } + } + every_in_global_list = { + variable = efg_empire_holders + limit = { + NOT = { this = scope:efg_ruler } + efg_same_faith_empire_holder_trigger = yes + scope:efg_ruler = { + NOR = { + has_relation_rival = prev + has_relation_nemesis = prev + } + } + } + scope:efg_ruler = { + set_relation_rival = { + target = prev + reason = efg_contested_empire_rivalry + } + } + } + } + } + else_if = { + limit = { + OR = { + has_contested_empire_trigger = yes + has_variable = efg_modifier_pending_end_year + } + OR = { + NOT = { faith_has_existing_empire_holder_trigger = yes } + NOT = { + any_in_global_list = { + variable = efg_empire_holders + efg_same_faith_empire_holder_trigger = yes + count >= 2 + } + } + } + } + remove_character_modifier = multi_empire_same_faith_penalty_1 + remove_character_modifier = multi_empire_same_faith_penalty_2 + remove_character_modifier = multi_empire_same_faith_penalty_3 + } + } + } + # complete grand campaign if whole target kingdom conquered in other way + if = { + limit = { + exists = title:h_china.holder + any_great_project = { + great_project_type = grand_campaign_project + great_project_owner = title:h_china.holder + var:grand_campaign_target_kingdom ?= { + any_de_jure_county = { + count = all + holder.top_overlord = title:h_china.holder + } + } + } + } + every_great_project = { + limit = { + great_project_type = grand_campaign_project + great_project_owner = title:h_china.holder + var:grand_campaign_target_kingdom ?= { + any_de_jure_county = { + count = all + holder.top_overlord = title:h_china.holder + } + } + } + complete_great_project = this + } } -# if = { -# limit = { -# title:h_china.holder ?= { -# can_have_tributaries_trigger = yes -# any_tributary = { -# count < 20 # hol' up with this if China already has 20 tributaries or more -# } -# } -# } -# random_county_in_region = { -# region = tgp_china_tributary_region -# limit = { -# holder.top_overlord = { -# is_ai = yes -# is_independent_ruler = yes -# any_county_in_region = { -# region = tgp_china_tributary_region -# this = prev.primary_title -# } -# NOR = { -# any_owned_story = { -# OR = { -# story_type = story_mongol_invasion -# story_type = story_greatest_of_khans -# } -# } -# mpo_has_gok_mongol_empire_trigger = yes -# has_trait = conqueror -# has_trait = greatest_of_khans -# is_gurkhan = yes -# } -# } -# } -# holder.top_overlord = { -# set_variable = { -# name = wants_to_become_tributary_of_china -# years = 10 # if they haven't completed a tribute mission within 10 years we stop trying -# } -# } -# } -# } } on_actions = { @@ -755,6 +1672,9 @@ yearly_global_pulse = { # Root is the character yearly_playable_pulse = { effect = { + ai_budget_manipulation_effect = yes + hedonistic_obesity_modifier_sync_effect = yes + if = { limit = { has_title = title:k_papal_state @@ -1260,8 +2180,6 @@ yearly_playable_pulse = { } else = { } - ai_budget_manipulation_effect = yes - hedonistic_obesity_modifier_sync_effect = yes #Mandala if = { @@ -1380,9 +2298,16 @@ yearly_playable_pulse = { has_treasury = yes } trigger_event = tgp_china_ministry.0100 - trigger_event = pam_theocratic_budget_events.0001 } } + # Theocratic budget maintenance (top superior, can be vassal) + if = { + limit = { + has_treasury = yes + government_has_mechanic = theocracy + } + trigger_event = pam_theocratic_budget_events.0001 + } # Assign or level up court type trait for courtiers in a royal court if = { limit = { @@ -1646,12 +2571,21 @@ yearly_playable_pulse = { } else_if = { # Is Admin limit = { - government_has_flag = government_is_administrative + government_has_mechanic = administrative is_landed = yes } # Failsafe to ensure we don't get independent admin rulers of too low a rank (i.e. below king) - # Failsafe to ensure we don't have a noble family holding land without other titles - Give any held land to liege if = { + limit = { + # Is independent + liege = root + # Is less than King tier + administrative_tier_allows_independence = no + } + admin_change_government_effect = yes + } + # Failsafe to ensure we don't have a noble family holding land without other titles - Give any held land to liege + else_if = { limit = { # They are a Vassal is_independent_ruler = no @@ -1662,7 +2596,7 @@ yearly_playable_pulse = { } # And no other high tier Titles trigger_if = { - limit = { has_government = japan_administrative_government } + limit = { government_has_flag = government_has_county_tier_noble_families } NOT = { any_held_title = { tier >= tier_county @@ -2039,7 +2973,6 @@ yearly_playable_pulse = { government_has_flag = government_is_nomadic is_landed = no liege = { is_ai = yes } - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } } every_held_title = { limit = { @@ -2077,18 +3010,24 @@ yearly_playable_pulse = { NOT = { government_has_flag = government_is_nomadic } any_held_title = { is_nomad_title = yes + trigger_if = { + limit = { exists = title_domicile } + title_domicile = { is_domicile_type = yurt } + } } - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } } save_scope_as = scoped_ruler if = { limit = { is_ai = yes - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } } every_held_title = { limit = { is_nomad_title = yes + trigger_if = { + limit = { exists = title_domicile } + title_domicile = { is_domicile_type = yurt } + } } scope:scoped_ruler = { destroy_title = prev @@ -2099,7 +3038,6 @@ yearly_playable_pulse = { else_if = { limit = { is_ai = no - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } } change_government = nomad_government } @@ -2123,12 +3061,19 @@ yearly_playable_pulse = { } any_held_title = { is_nomad_title = yes + trigger_if = { + limit = { exists = title_domicile } + title_domicile = { is_domicile_type = yurt } + } } - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } } every_held_title = { limit = { is_nomad_title = yes + trigger_if = { + limit = { exists = title_domicile } + title_domicile = { is_domicile_type = yurt } + } } scope:scoped_ruler = { destroy_title = prev @@ -2225,7 +3170,7 @@ yearly_playable_pulse = { interaction = declaration_of_repentance_interaction actor = this recipient = scope:anointment_authority - execute_threshold = maybe + send_threshold = maybe } } #Next step is getting approval @@ -2242,7 +3187,7 @@ yearly_playable_pulse = { interaction = coronation_anointment_request actor = this recipient = scope:anointment_authority - execute_threshold = maybe + send_threshold = maybe } } #Next step is hosting the dang coronation @@ -2252,6 +3197,453 @@ yearly_playable_pulse = { debug_log_scopes = yes } } + #Very weak landed nomads are culled + if = { + limit = { + years_from_game_start > 3 + government_has_flag = government_is_nomadic + domicile ?= { + herd < 150 + } + is_at_war = no + is_landed = yes + capital_county.title_province = { + has_holding_type = nomad_holding + } + is_ai = yes + any_held_title = { + exists = title_domicile + NOT = { exists = var:player_domicile_title } + } + is_imprisoned = no + is_migrating = no + NOR = { + exists = involved_activity + any_close_or_extended_family_member = { + is_ai = no + } + liege ?= { + is_ai = no + } + any_ally = { + is_ai = no + } + any_vassal = { + is_ai = no + } + any_tributary = { + is_ai = no + } + any_player = { + root = { + is_of_major_or_minor_interest_trigger = { CHARACTER = prev } + } + } + } + } + #Cull if weak or has been slightly weak for multiple years + if = { + limit = { + OR = { + domicile ?= { + herd <= 50 + } + has_character_flag = weakish_nomad + } + } + #Grant any vassals independence or transfer to liege + every_vassal = { + limit = { + highest_held_title_tier >= tier_county + } + save_scope_as = nomad_vassal + create_title_and_vassal_change = { + type = independency + save_scope_as = change + add_claim_on_loss = no + } + change_liege_or_become_independent = { + CHANGE = scope:change + VASSAL = scope:nomad_vassal + } + resolve_title_and_vassal_change = scope:change + } + #Give all titles to herders + give_domain_to_herders = yes + #Make LAAMP or wanderer + clean_up_ai_nomad_effect = yes + } + #Set flag if first year and only slightly weak + else = { + add_character_flag = { + flag = weakish_nomad + months = 18 + } + } + } + + #Accolades training squires + if = { + limit = { + any_accolade = { + exists = acclaimed_knight + acclaimed_knight = { + is_incapable = no + is_imprisoned = no + } + accolade_squires_quality_value >= accolade_squires_inexperienced_minimum_value + } + } + random = { + chance = { + value = 0 + every_accolade = { + limit = { + exists = acclaimed_knight + acclaimed_knight = { + is_incapable = no + is_imprisoned = no + } + accolade_squires_quality_value >= accolade_squires_inexperienced_minimum_value + } + add = 33 + } + } + #Need to trigger one accolade's effect now, and the rest on increments to space out their messages + random_accolade = { + limit = { + #Favour accolades who have not trained squire in last 3 years + NOT = { + has_variable = recently_trained_squire + } + accolade_can_train_squire_trigger = yes + } + alternative_limit = { + accolade_can_train_squire_trigger = yes + } + #Give other accolades a chance to train squires + set_variable = { + name = recently_trained_squire + years = 3 + } + accolade_squire_training_effect = yes + } + } + } + + ############### + # PAM Simony Tenet + ############### + if = { + limit = { + OR = { + rite = { rite_has_parameter = tenet_simony_wealth_fulfillment } + has_personal_tenet_flag = tenet_simony_wealth_fulfillment + } + } + random = { + chance = { + value = 25 + multiply = { + value = 1 + add = { + value = gold + subtract = simony_yearly_gold_value + divide = simony_yearly_gold_value + } + min = 1 + max = 3 + } + } + trigger_event = { + id = pam_tenet_events.0002 + days = { 21 37 } + } + } + } + ############### + # PAM Personal Syncretism Tenets + ############### + if = { + limit = { + has_personal_tenet_flag = tenet_syncretism_county_bonus + } + every_held_county = { + limit = { + pam_personal_syncretism_county_bonus_trigger = yes + } + add_county_modifier = { + modifier = pam_personal_syncretism_county_modifier + years = 2 + } + } + } + ############### + # PAM Pentarchy Tenet + ############### + if = { + limit = { + rite ?= { rite_has_parameter = tenet_pentarchy_holy_site_prosperity } + } + faith = { + every_holy_site = { + limit = { + exists = holy_site_county.holder + holy_site_county.holder = root + holy_site_county.faith = root.faith + } + holy_site_county = { + add_county_modifier = { + modifier = tenet_pentarchy_holy_site_modifier + years = 2 + } + } + } + } + } + ############### + # PAM Miaphysitism Tenet + ############### + if = { + limit = { + has_personal_tenet_flag = tenet_miaphysitism_open_confession + liege ?= { + NOT = { faith = root.faith } + } + } + send_interface_toast = { + type = event_toast_effect_good + title = pam_miaphysitism_open_confession_toast_title + left_icon = root + add_piety = minor_piety_gain + } + } + ############### + # PAM Scholasticism Tenet + ############### + if = { + limit = { + has_personal_tenet_flag = tenet_scholasticism_university_chance + NOT = { + has_character_modifier = tenet_scholasticism_modifier + } + } + pam_tenet_scholasticism_yearly_effect = yes + } + ############### + # PAM Love Thy Neighbor Tenet + ############### + if = { + limit = { + rite = { rite_has_parameter = tenet_love_thy_neighbour_county_bonus } + any_held_county = { + faith = prev.faith + county_opinion >= 60 + NOT = { + has_county_modifier = tenet_love_thy_neighbour_modifier + } + } + } + random_held_county = { + limit = { + faith = prev.faith + county_opinion >= 60 + NOT = { + has_county_modifier = tenet_love_thy_neighbour_modifier + } + } + root = { + send_interface_toast = { + type = event_toast_effect_good + title = pam_love_thy_neighbor_toast_title + left_icon = prev + prev = { + add_county_modifier = { + modifier = tenet_love_thy_neighbour_modifier + years = 20 + } + } + } + } + } + } + ############### + # PAM Harmonious Society Tenet - the Five Bonds + ############### + if = { + limit = { + has_personal_tenet_flag = tenet_harmonious_society_five_bonds + } + pam_harmonious_society_five_bonds_effect = yes + } + else_if = { + # The tenet is gone but its stacks are not, so clear them out. + limit = { + has_character_modifier = tenet_harmonious_society_five_bonds_modifier + } + remove_all_character_modifier_instances = tenet_harmonious_society_five_bonds_modifier + } + ############### + # PAM Purgatory Tenet - temporal punishment for sin + ############### + if = { + limit = { + rite = { + rite_has_parameter = tenet_purgatory_sinful_characters_gain_less_piety + } + } + pam_tenet_purgatory_sin_penalty_effect = yes + } + else_if = { + limit = { + has_character_modifier = tenet_purgatory_sin_penalty_modifier + } + remove_all_character_modifier_instances = tenet_purgatory_sin_penalty_modifier + } + ############### + # PAM Original Sin Tenet + ############### + if = { + limit = { + rite = { + rite_has_parameter = tenet_original_sin_sinners_insight + } + } + pam_tenet_original_sin_insight_effect = yes + } + else_if = { + limit = { + has_character_modifier = tenet_original_sin_sinners_insight_modifier + } + remove_all_character_modifier_instances = tenet_original_sin_sinners_insight_modifier + } + ############### + # PAM Apostolic Succession Tenet - the episcopal chain + ############### + if = { + limit = { + rite = { + rite_has_parameter = tenet_apostolic_succession_legitimacy_per_theocratic_vassal + } + } + pam_tenet_apostolic_succession_episcopate_effect = yes + } + else_if = { + limit = { + has_character_modifier = tenet_apostolic_succession_episcopate_modifier + } + remove_character_modifier = tenet_apostolic_succession_episcopate_modifier + } + ############### + # PAM Divine Liturgy Tenet - the choirs of a ruler's own churches + ############### + if = { + limit = { + rite = { + rite_has_parameter = tenet_divine_liturgy_temple_piety + } + } + pam_tenet_divine_liturgy_choirs_effect = yes + } + else_if = { + limit = { + has_character_modifier = tenet_divine_liturgy_choirs_modifier + } + remove_character_modifier = tenet_divine_liturgy_choirs_modifier + } + ############### + # PAM Divine Liturgy Tenet - the officiating chaplain + ############### + if = { + limit = { + has_personal_tenet_flag = tenet_divine_liturgy_well_sung_liturgy + } + pam_tenet_divine_liturgy_officiant_effect = yes + } + #Monastic trait XP + if = { + limit = { + government_has_flag = government_is_monastic_holy_order + has_trait = devoted + } + #Gain from learning and piety + add_trait_xp = { + trait = devoted + value = yearly_monastic_xp_gain_value + } + monastic_lifestyle_xp_yearly_gain_effect = yes + every_courtier = { + limit = { + has_trait = devoted + } + add_trait_xp = { + trait = devoted + value = yearly_monastic_xp_gain_value + } + monastic_lifestyle_xp_yearly_gain_effect = yes + } + } + #Military Order XP + else_if = { + limit = { + government_has_flag = government_is_military_holy_order + has_trait = order_member + } + military_order_yearly_trait_gain_effect = yes + military_order_lifestyle_xp_yearly_gain_effect = yes + every_courtier = { + limit = { + has_trait = devoted + } + military_order_lifestyle_xp_yearly_gain_effect = yes + } + } + + # Passive Rite Learning + random = { + chance = passive_rite_learning_yearly_chance + passive_rite_learning_pulse_effect = yes + } + #Accolade mercenary sends gold + if = { + limit = { + has_variable = acc_merc_patron + is_ai = yes + is_imprisoned = no + var:acc_merc_patron = { + is_ruler = yes + is_alive = yes + is_allied_to = root + } + } + save_scope_as = accolade_merc + var:acc_merc_patron = { + trigger_event = accolade.0110 + } + } + if = { + limit = { + NOT = { exists = puppeteer } + OR = { + has_character_modifier = skilled_puppeteer_modifier_diplomacy + has_character_modifier = skilled_puppeteer_modifier_martial + has_character_modifier = skilled_puppeteer_modifier_stewardship + has_character_modifier = skilled_puppeteer_modifier_intrigue + has_character_modifier = skilled_puppeteer_modifier_learning + has_character_modifier = skilled_puppeteer_modifier_general + has_character_modifier = spiritual_puppeteer_modifier_cleric + has_character_modifier = spiritual_puppeteer_modifier_secular + has_character_modifier = dreadful_puppeteer_modifier + has_character_modifier = beloved_puppeteer_modifier + has_character_modifier = deranging_puppeteer_modifier + } + } + remove_puppet_modifiers_effect = yes + } + #gnostic tenet learning effect + gnostic_tenet_learning_effect = yes + pam_align_theocracy_with_faith_government_effect = yes + pam_strip_illegal_cardinalate_effect = yes } events = { court_maintenance.0012 # Dynasty banner improves with renown @@ -2336,12 +3728,19 @@ three_year_playable_pulse = { limit = { any_held_title = { is_nomad_title = yes + trigger_if = { + limit = { exists = title_domicile } + title_domicile = { is_domicile_type = yurt } + } } - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } } every_held_title = { limit = { is_nomad_title = yes + trigger_if = { + limit = { exists = title_domicile } + title_domicile = { is_domicile_type = yurt } + } } scope:scoped_ruler = { destroy_title = prev @@ -2399,10 +3798,10 @@ three_year_playable_pulse = { } if = { limit = { - domicile.domicile_faith != capital_county.faith + domicile.domicile_rite != capital_county.rite } domicile = { - set_domicile_faith = scope:scoped_ruler.capital_county.faith + set_domicile_rite = scope:scoped_ruler.capital_county.rite } } } @@ -2421,7 +3820,6 @@ three_year_playable_pulse = { if = { limit = { - NOR = { liege = { government_has_flag = government_allows_nomad_domicile_titles } government_has_flag = government_allows_nomad_domicile_titles } NOT = { any_held_title = { is_nomad_title = yes @@ -2436,7 +3834,6 @@ three_year_playable_pulse = { } domicile ?= { add_domicile_building = yurt_main_02 - add_domicile_building = yurt_main_03 add_random_yurt_external_building_effect = yes add_random_yurt_external_building_effect = yes upgrade_random_yurt_external_building_effect = yes @@ -2457,28 +3854,6 @@ three_year_playable_pulse = { domicile = { move_domicile = scope:scoped_ruler.capital_province } } } - #same tradition opinion - if = { - limit = { - culture = { - has_cultural_parameter = likes_same_tradition - } - } - every_ruler = { - if = { - limit = { - culture = { - has_cultural_parameter = likes_same_tradition - } - } - add_opinion = { - target = PREV - modifier = same_tradition_opinion - opinion = 10 - } - } - } - } if = { # Inspirations for courtiers of Advancement Movement rulers limit = { has_dlc_feature = all_under_heaven @@ -2501,6 +3876,78 @@ three_year_playable_pulse = { desc = courtier_inspired_effect } } + #Accolade knights training + if = { + limit = { + any_accolade = { + accolade_can_train_knight_trigger = yes + } + } + random = { + chance = { + value = 0 + every_accolade = { + limit = { + accolade_can_train_knight_trigger = yes + } + if = { + limit = { + var:lifetime_glory >= monumental_glory_value + } + add = 33 + } + if = { + limit = { + var:lifetime_glory >= massive_glory_value + } + add = 33 + } + if = { + limit = { + var:lifetime_glory >= major_glory_value + } + add = 33 + } + add = 33 + } + } + #Need to trigger one accolade's effect now, and the rest on increments to space out their messages + random_accolade = { + weight = { + base = 3 + modifier = { + add = 1 + var:lifetime_glory >= monumental_glory_value + } + modifier = { + add = 1 + var:lifetime_glory >= massive_glory_value + } + modifier = { + add = 1 + var:lifetime_glory >= major_glory_value + } + } + limit = { + #Favour accolades who have not trained recently + NOT = { + has_variable = recently_trained_knight + } + accolade_can_train_knight_trigger = yes + } + alternative_limit = { + accolade_can_train_knight_trigger = yes + } + #Give other accolades a chance to train squires + set_variable = { + name = recently_trained_knight + years = 15 + } + accolade_knight_training_effect = yes + } + } + } + pam_christian_situation_hof_incite_holy_war_effect = yes } } @@ -2720,7 +4167,6 @@ five_year_playable_pulse = { } } } - } events = { courtier_guest_management.3001 # Courtiers and guests getting relationships & secrets @@ -2740,9 +4186,6 @@ five_year_playable_pulse = { # Root is the character # scope:quarter is which quarter it's for, from 1 to 4. Note that scope:quarter = 1 isn't necessarily in Q1 by calendar time quarterly_playable_pulse = { - - effect = { - } on_actions = { realm_maintenance_quarterly_pulse @@ -2767,7 +4210,7 @@ quarterly_playable_pulse = { mpo_tributary_check_pulse } random_on_action = { - chance_to_happen = 75 + chance_to_happen = 50 chance_of_no_event = { # Fewer events for the AI value = 0 if = { @@ -2816,13 +4259,12 @@ random_yearly_playable_pulse = { 5 = fp1_yearly_events 4 = fp2_yearly_events 4 = fp3_yearly_events - 2 = bp1_yearly_events -# 6 = ep3_yearly_events_byzantium + #2 = bp1_yearly_events # Retired on purpose; contents are all in on_yearly_events 6 = ep3_yearly_events_admin 6 = NEOW_yearly_flavor_events 6 = tgp_japan_yearly_events 6 = tgp_china_yearly_events - 6 = tgp_mandala_yearly_events + 3 = tgp_mandala_yearly_events 6 = ongoing_house_feud_events 10 = mpo_yearly_events_nomads } @@ -2885,7 +4327,10 @@ random_yearly_playable_pulse = { if = { limit = { is_ai = yes - is_independent_ruler = yes + OR = { + is_independent_ruler = yes + top_superior ?= this + } has_treasury = yes OR = { # In big treasury debt @@ -2919,13 +4364,12 @@ random_yearly_playable_pulse = { delay = { days = { 181 240 } } bp2_child_pulse delay = { days = { 181 240 } } -# bp2_parent_guardian_hostage_taker_pulse -# delay = { days = { 241 290 } } bp2_adult_followups delay = { days = { 291 310 } } court_scholar_ongoing delay = { days = { 25 44 } } clan_events_on_action + delay = { days = { 14 310 } } ep3_akolouthos_on_action delay = { days = { 25 44 } } mpo_migration_contract @@ -2941,20 +4385,12 @@ random_yearly_playable_pulse = { # Called from code once a year for all characters, at a random point that year (individually for each character) # Root is the character random_yearly_everyone_pulse = { - effect = { - } on_actions = { yearly_health_pulse stress_pulse prison_maintenance_pulse house_feud_ai_scheme_pulse } - random_on_action = { - chance_of_no_event = { - value = 95 - } - 1 = assign_trait_events - } events = { holy_order.0206 #To increment the years passed since loan marriage_interaction.0007 #One of the betrothed became part of clergy that doesn't allow marriage @@ -3046,6 +4482,8 @@ five_year_everyone_pulse = { } } + + if = { # Long term gold is pointless for Barons - add it to short term instead limit = { is_ai = yes @@ -3136,7 +4574,6 @@ three_year_pool_pulse = { } } 100 = courtier_guest_management.4001 # Wanderer becomes an adventurer - 100 = courtier_guest_management.4002 } } @@ -3301,6 +4738,29 @@ on_yearly_events = { 100 = stress_trait_ongoing.4502 # Cannibal needs to satisfy their craving! 100 = stress_trait_ongoing.5001 # Inappetetic has a important character prepare a feast for them. + # Interesting Trait events + #lunatic + 5 = trait_specific.1001 #You start experiencing symptoms (hallucinations) + 5 = trait_specific.1002 #You start experiencing symptoms (disorganized thoughts) + #possessed + 5 = trait_specific.2001 #Start experiencing symptoms (fear, visual distortions, seizure) + #depressed + 15 = trait_specific.3001 #You start to experience symptoms (tiredness, feeling "empty") + #witch + 50 = trait_specific.4001 #You find an old tome + #cannibal + 5 = trait_specific.5001 #You crave rare and exotic meat + # 50 = trait_specific.5003 Deprecated + #deviant + 30 = trait_specific.6001 #You discover some books that in turn makes you discover something about yourself + 50 = trait_specific.6002 #Your deviant lover introduces you to some freaky stuff + #drunkard + 50 = trait_specific.7001 #Find solace in drink + #herbalist + 100 = trait_specific.8001 #A merchant sends you some seeds + #poet + 75 = trait_specific.9001 # You spend an evening musing over (bad) rhymes. + #Elephant events for India 300 = yearly.9020 # A Mighty Elephant @@ -3499,10 +4959,10 @@ on_yearly_events = { 50 = lover.7005 #Chance that a close family member becomes a potential lover #TGP Elder/Disciple events - 100 = chinese_students.001 #Rivalry between two students - 100 = chinese_students.010 #Disciple writes a scroll - 100 = chinese_students.020 #Disciple performs divination - 100 = chinese_students.030 #Disciple displays talent or requests improvement + 100 = chinese_students.0001 #Rivalry between two students + 100 = chinese_students.0010 #Disciple writes a scroll + 100 = chinese_students.0020 #Disciple performs divination + 100 = chinese_students.0030 #Disciple displays talent or requests improvement #FP1 Events (These ones do not explicitly need you to be norse, but should be more likely if you are - present in both this and fp1_yearly_events) 200 = fp1_yearly.2100 # Two lovers duel for your love @@ -3615,7 +5075,7 @@ on_yearly_events = { 150 = fp2_yearly.3003 # A Flavorful Evening # 180 = fp2_struggle.2003 # Band of Lost Birds - #BP1 - Bontent Pack One Events + #BP1 Events 100 = bp1_yearly.1000 # Best friend introduces you to a new hobby 200 = bp1_yearly.1010 # A friend offers to mediate with your HoF who has excommunicated you 500 = bp1_yearly.1020 # A friend visits you on your dying bed @@ -3642,7 +5102,7 @@ on_yearly_events = { 100 = bp1_yearly.3007 # Spouse's family member wants you to sponsor their inspiration 100 = bp1_yearly.3100 # Your vassal/friend/family member offers you a skilled courtier 20 = bp1_yearly.3101 # Friend offers to sell you a county you have a claim on - 100 = bp1_yearly.3201 #Fake feast invite from rival/nemesis + 100 = bp1_yearly.3201 # Fake feast invite from rival/nemesis 100 = bp1_yearly.3300 # Remembering a pilgrimage 200 = bp1_yearly.3301 # Remembering a pilgrimage w/ a friend 100 = bp1_yearly.4000 # Reflect over a family memory @@ -3659,55 +5119,55 @@ on_yearly_events = { 200 = bp1_yearly.5705 # Your friend tries to talk you out of a bad relationship 100 = bp1_yearly.5706 # You sleep with your rival's offspring 400 = bp1_yearly.5707 # Your rival catches you sleeping with their offspring - 200 = bp1_yearly.5708 #You empathise with a friend's faith - 100 = bp1_yearly.5709 #Tempers flare between you and your rival - 100 = bp1_yearly.5713 #Your lover asks for money - 100 = bp1_yearly.5715 #You and a friend argue about pronunciation - 100 = bp1_yearly.5716 #Your zealous wife burns books - 100 = bp1_yearly.5717 #Your rival and your friend get into a drunken brawl - 100 = bp1_yearly.5719 #Your disloyal vassal is trying to embezzle - 100 = bp1_yearly.5720 #You and your rival armwrestle - 200 = bp1_yearly.5722 #Your nemesis launches your pet out of a catapult - 100 = bp1_yearly.5725 #You search for Khutulun - 100 = bp1_yearly.5728 #Rival steals and burns one of your artifacts - 10 = bp1_yearly.5740 #Scrambling for Answers - 80 = bp1_yearly.5800 #You make a perfume - 125 = bp1_yearly.6000 #Attacked by Rival's Child / Family Feud - 100 = bp1_yearly.7000 #Go on a picnic - 100 = bp1_yearly.7001 #Go fishing - 10 = bp1_yearly.7002 #Throw chamberpot at rival - 25 = bp1_yearly.7003 #Orgy Tapestry - 100 = bp1_yearly.7004 #Friend offers to talk about bad memory - 100 = bp1_yearly.7010 #Loyalty test - 100 = bp1_yearly.7050 #Memory of a war - 100 = bp1_yearly.7051 #Memory of Battle - 100 = bp1_yearly.7052 #Telling a story of a memory - 100 = bp1_yearly.7053 #A memory of revenge - 100 = bp1_yearly.7054 #Forgetting a memory - 100 = bp1_yearly.7055 #Recording a memory - 100 = bp1_yearly.7056 #Intimidating someone - 150 = bp1_yearly.7057 #Yearning - 100 = bp1_yearly.7058 #Friend eats all your food - 100 = bp1_yearly.8000 #Claimant moving towards rivalry - 200 = bp1_yearly.8010 #Best friend offers you a negotiated alliance - 100 = bp1_yearly.8020 #Rival of your rival offers friendship - 100 = bp1_yearly.8040 #Friend with conflicting personality falls out with you + 200 = bp1_yearly.5708 # You empathise with a friend's faith + 100 = bp1_yearly.5709 # Tempers flare between you and your rival + 70 = bp1_yearly.5713 # Your lover asks for money + 100 = bp1_yearly.5715 # You and a friend argue about pronunciation + 100 = bp1_yearly.5716 # Your zealous wife burns books + 100 = bp1_yearly.5717 # Your rival and your friend get into a drunken brawl + 100 = bp1_yearly.5719 # Your disloyal vassal is trying to embezzle + 100 = bp1_yearly.5720 # You and your rival armwrestle + 200 = bp1_yearly.5722 # Your nemesis launches your pet out of a catapult + 100 = bp1_yearly.5725 # You search for Khutulun + 50 = bp1_yearly.5728 # Rival steals and burns one of your artifacts + 10 = bp1_yearly.5740 # Scrambling for Answers + 80 = bp1_yearly.5800 # You make a perfume + 125 = bp1_yearly.6000 # Attacked by Rival's Child / Family Feud + 100 = bp1_yearly.7000 # Go on a picnic + 100 = bp1_yearly.7001 # Go fishing + 10 = bp1_yearly.7002 # Throw chamberpot at rival + 25 = bp1_yearly.7003 # Orgy Tapestry + 100 = bp1_yearly.7004 # Friend offers to talk about bad memory + 100 = bp1_yearly.7010 # Loyalty test + 100 = bp1_yearly.7050 # Memory of a war + 100 = bp1_yearly.7051 # Memory of Battle + 100 = bp1_yearly.7052 # Telling a story of a memory + 100 = bp1_yearly.7053 # A memory of revenge + 100 = bp1_yearly.7054 # Forgetting a memory + 100 = bp1_yearly.7055 # Recording a memory + 100 = bp1_yearly.7056 # Intimidating someone + 150 = bp1_yearly.7057 # Yearning + 100 = bp1_yearly.7058 # Friend eats all your food + 100 = bp1_yearly.8000 # Claimant moving towards rivalry + 200 = bp1_yearly.8010 # Best friend offers you a negotiated alliance + 100 = bp1_yearly.8020 # Rival of your rival offers friendship + 100 = bp1_yearly.8040 # Friend with conflicting personality falls out with you 25 = bp1_yearly.8100 #Sycophant/favoritism chain start - 100 = bp1_yearly.9001 #Bully/guardian destroys your favourite toy - 100 = bp1_yearly.9005 #You get revenge for your destroyed toy - 100 = bp1_yearly.9006 #Becoming friends over a common sin - 10 = bp1_yearly.9007 #You find a peasant who looks exactly like you - 50 = bp1_yearly.9016 #Uppity second-in-line wants the throne - 50 = bp1_yearly.9017 #Uppity child is insecure about culture - 200 = bp1_yearly.9018 #Illegitimate child feels excluded - 100 = bp1_yearly.9019 #Spouse proposes a gay threesome - 200 = bp1_yearly.9020 #Spouse wants to do something kinky - 100 = bp1_yearly.9021 #Rival spouse is good in the bedroom - 100 = bp1_yearly.9022 #Friend holds an intervention - 200 = bp1_yearly.9023 #You realise you don't speak the same language - 100 = bp1_yearly.9024 #A friend visits you while you're sick - 150 = bp1_yearly.9025 #You realise you hate your friend - 100 = bp1_yearly.9026 #You're haunted by an old friend who convinces you to make ammends before you die + 100 = bp1_yearly.9001 # Bully/guardian destroys your favourite toy + 100 = bp1_yearly.9005 # You get revenge for your destroyed toy + 100 = bp1_yearly.9006 # Becoming friends over a common sin + 10 = bp1_yearly.9007 # You find a peasant who looks exactly like you + 50 = bp1_yearly.9016 # Uppity second-in-line wants the throne + 50 = bp1_yearly.9017 # Uppity child is insecure about culture + 200 = bp1_yearly.9018 # Illegitimate child feels excluded + 100 = bp1_yearly.9019 # Spouse proposes a gay threesome + 200 = bp1_yearly.9020 # Spouse wants to do something kinky + 100 = bp1_yearly.9021 # Rival spouse is good in the bedroom + 100 = bp1_yearly.9022 # Friend holds an intervention + 200 = bp1_yearly.9023 # You realise you don't speak the same language + 100 = bp1_yearly.9024 # A friend visits you while you're sick + 150 = bp1_yearly.9025 # You realise you hate your friend + 100 = bp1_yearly.9026 # You're haunted by an old friend who convinces you to make amends before you die 100 = bp1_yearly.9034 # You find a terrifying bog witch 100 = bp1_yearly.9037 # You find a bog corpse 100 = bp1_yearly.9040 # The ghost of your dead lover wants to have sex again @@ -4042,8 +5502,41 @@ on_yearly_events = { 250 = tgp_china_yearly.0015 # Settle merchant dispute 250 = tgp_china_yearly.0020 # County has unpaid back-taxes + 100 = tgp_japan_yearly_events.0001 # 0001 - Spreading Joy - furoshiki + 10 = tgp_japan_yearly_events.0021 # 0021 - Among the Blossoms - Hanami (Cherry Blossoms) + 20 = tgp_japan_yearly_events.0026 # 0026 - Tales of the Tengu - Tengu + 10 = tgp_japan_yearly_events.0036 # 0036 - Green Thumb + 50 = tgp_japan_yearly_events.1010 # 1010 - Two buddhist sects are fighting, and ask you to pick a side + 5 = tgp_japan_yearly_events.1020 # 1020 - Your senses are playing tricks on you, and you encounter a new Yokai + 100 = tgp_japan_yearly_events.1030 # 1030 - You pray at a shrine for future success + 20 = tgp_japan_yearly_events.1050 # 1050 - You are accused of violating a dumb rule + 5 = tgp_japan_yearly_events.1060 # 1060 - A prisoner requests to be mercy killed + 20 = tgp_japan_yearly_events.1070 # 1070 - A temple in your realm has burned down + 100 = tgp_japan_yearly_events.1080 # 1080 - Someone is fishing in the tsuri-dono + 10 = tgp_japan_yearly_events.1090 # 1090 - Growing old with no heir + 20 = tgp_japan_yearly_events.1100 # 1100 - You contract Guilt Fever + 100 = tgp_japan_yearly_events.1110 # 1110 - An animal is seen near the shrine of a God + #5 = tgp_japan_yearly_events.1070 # 1070 A temple in your realm has burned down + 10 = tgp_japan_yearly_events.1090 # 1090 - Growing old with no heir + 20 = tgp_japan_yearly_events.1100 # 1100 - You contract Guilt Fever + 100 = tgp_japan_yearly_events.1110 # 1110 - An animal is seen near the shrine of a God + 50 = tgp_japan_yearly_events.1130 # 1130 - Your daughter expresses an interest in poetry + 50 = tgp_japan_yearly_events.1150 # 1150 - The emperor is passing in your lands + 100 = tgp_japan_yearly_events.1160 # 1160 - You are offered a concubine from a rival house + 100 = tgp_japan_yearly_events.1170 # 1170 - The prose that you're reading is of an unknown language + 50 = tgp_japan_yearly_events.1180 # 1180 - You've been gifted a Bonsai tree for your garden + 20 = tgp_japan_yearly_events.1190 # 1190 - You have a bad trait and you're making some decisions at night + 200 = tgp_japan_yearly_events.1200 # 1200 - Congestion in the Capital + 200 = tgp_japan_yearly_events.1210 # 1210 - Fit to Lead + 200 = tgp_japan_yearly_events.1225 # 1225 - A Poetic Life + 25 = tgp_japan_yearly_events.1220 # 1220 - You've witnessed a miracle made by a Buddhist monk + 25 = tgp_japan_yearly_events.1230 # 1230 - Fear of a low durability artifact coming to life (Yokai) + 100 = tgp_japan_yearly_events.1240 # 1240 - A traveler poet visits court and can't read from right to left + 100 = tgp_japan_yearly_events.1260 #1260 - Begin a journey of poetic discovery + # TGP- Mandala Events - 100 = tgp_east_asia_mandala_events.9000 #Freak accident makes you seem inclined to divinity + 10000 = tgp_east_asia_mandala_events.9000 #Freak accident makes you seem inclined to divinity + # ^ this big 10000 number is intended, it's Wanua-only and kinda fun 100 = devaraja.0002 100 = devaraja.0003 100 = devaraja.0004 @@ -4067,6 +5560,102 @@ on_yearly_events = { 100 = tgp_ceremonial_liege_events.0020 # The liege/regent is in an activity which you were not invited to (Liege/Regent) 50 = tgp_ceremonial_liege_events.0030 # A scholar writes about you two and the liege is clearly favored (Liege/Regent) 75 = tgp_ceremonial_liege_events.0040 # Someone is questioning why you are even ruled over by your vassal at all (Regent) + + # Elder events + 400 = elder_events.1000 # Withering Mind - Relative forgets your name + 400 = elder_events.1100 # Fragile Bones - Trip and fall down the stairs + 400 = elder_events.1200 # Faltering Heart / Infirm - Have a mini-stroke + 400 = elder_events.1300 # Withering mind - Forget your education + 800 = elder_events.1400 # Faltering heart - Chance of death from sex + 1200 = elder_events.1500 # Faltering heart - Chance to kill your spouse if you're young and they are old + 1600 = elder_events.1600 # Faltering heart/Fragile bones/Infirm - Lose athletic + + # BFJ + 300 = blotsven.0001 # Blot-Sven starter event, gives you a chance at getting a claim for the kingdom of Sweden. + + # PAM - Christian Rulers Events + 100 = pam_religious_artifact_events.0001 # Courtier asks for sponsoring for making a religious artifact + 100 = pam_theocratic_ruler_events.0001 # Theocratic ruler: ecclesiastical subordinate brings news of a noble bequest + 100 = pam_theocratic_ruler_events.0002 # Prince-bishop: neighbouring unreformed ruler passes through / visits court + 100 = pam_theocratic_ruler_events.0003 # Marshal/steward council after war or raids: alliance, levies, or relief + 100 = pam_theocratic_ruler_events.0004 # Monastic order in realm: collaboration audience with prior/abbot + 100 = pam_theocratic_ruler_events.0005 # Military holy order in realm: audience with order master + 100 = pam_theocratic_ruler_events.0006 # Peasant leader withholds church taxes: enforce, forgive, or scapegoat steward + 100 = pam_theocratic_ruler_events.0007 # Theocratic ruler: realm at peace; a moment of blissful harmony + 100 = pam_theocratic_ruler_events.0008 # Theocratic ruler: inherited secular stone; repurpose for episcopal palace + 100 = pam_theocratic_ruler_events.0009 # Theocratic ruler: heir loses temper during sermon; counsel or discipline + 100 = pam_theocratic_ruler_events.0010 # Theocratic ruler: proven warrior and pilgrim; marshal and chaplain counsel sword or crozier + 100 = pam_theocratic_ruler_events.0011 # Theocratic ruler: landed subject seeks church burial for fallen crusader kinsman + 100 = pam_theocratic_ruler_events.0013 # Theocratic ruler: angelic voice at mass; recruit for choir, seduce, or reject worldly song + 50 = pam_theocratic_ruler_events.0014 # Theocratic ruler: neighbouring convert urges adopting foreign core tenets at sermon + 50 = pam_theocratic_ruler_events.0015 # Theocratic ruler: prayer hearing with top two succession candidates + + # PAM Flavor Events + 50 = pam_generic_events.0001 # Gain Religious Scholar + 50 = pam_generic_events.0002 # Child doubts their goodness + 50 = pam_generic_events.0003 # Spouse worries about your sinful ways + 100 = pam_generic_events.0004 # Friend/chaplain comforts after family death + 100 = pam_generic_events.0005 # Excommunicated: loyal vassal offers to thrash clerical region holder + 20 = pam_generic_events.0008 # You hear the voice of god telling you how virtuous you are + 50 = pam_generic_events.0009 # Clergy member has a hellish nightmare + 50 = pam_generic_events.0011 # Scold a courtier for their sins + 100 = pam_secular_faith_events.0001 # Holy Smoke - a holy-day censing draws the ruler into the congregation's devotion + 500 = pam_secular_faith_events.0002 # Pikuach Nefesh - ride out to save a traveler on the Sabbath - High weight because of rarity of trigger + 100 = pam_secular_faith_events.0003 # A Vision in the Night - a vivid divine vision demands interpretation + 50 = pam_secular_faith_events.0004 # Forbidden Truth - temptation toward a secret, forbidden personal tenet + 100 = pam_secular_faith_events.0005 # By Candlelight - evening study reveals a foreign tenet or doctrine + 100 = pam_secular_faith_events.0006 # Bones of a Saint - a relic-seller offers dubious holy bones + 100 = pam_secular_faith_events.0007 # Arrogant Bishop - a proud theocrat vassal scorns his lord + 100 = pam_secular_faith_events.0008 # The Weight of Sin - a penance for the personality trait the rite holds sinful + 100 = pam_secular_faith_events.0009 # A Christlike Stranger - a beggar at the gate may be more than he seems + 100 = pam_secular_faith_events.0011 # The Penitents - a flagellant procession reaches the capital + 100 = pam_secular_faith_events.0012 # Blessing of Arms - a peacetime consecration of the ruler's arms + 100 = pam_secular_faith_events.0013 # A Death Foretold - a mad preacher foretells the natural death of an aged or ailing courtier; the prophecy comes due in a follow-up + 100 = pam_secular_faith_events.0015 # The Weeping Icon - a holy image is said to weep + 100 = pam_secular_faith_events.0016 # A Price for the Pulpit - a wanderer offers gold for the realm-priest office (simony) + 100 = pam_secular_faith_events.0017 # A Heretic at Court - a courtier is exposed as a heretic + 100 = pam_secular_faith_events.0018 # A Child for God - an offer to pledge a child to the Church (oblation) + 100 = pam_secular_faith_events.0019 # The Peace of God - end the feuds between your vassals in a holy peace + 100 = pam_secular_faith_events.0021 # A Sign in the Heavens - a portent appears in the night sky + 100 = pam_secular_faith_events.0022 # The King's Touch - a sick courtier begs the ruler's healing touch + 100 = pam_secular_faith_events.0023 # A Wandering Scribe - a lettered wanderer offers their services + 100 = pam_secular_faith_events.0024 # Into the Cloister - force a rival courtier to take holy vows + 100 = pam_secular_faith_events.0025 # Godfather/Godmother - sponsoring a convert's baptism + 100 = pam_secular_faith_events.0026 # A Besieged Soul - a courtier is tormented as if possessed; exorcise or treat them + 100 = pam_secular_faith_events.0027 # Crisis of Faith - low Spiritual Fulfillment; realign a personal tenet + 100 = pam_secular_faith_events.0028 # My Soul, at Peace - high Spiritual Fulfillment; spread or change personal tenets + 100 = pam_secular_faith_events.0029 # A Visit from the Dead - a dream of a departed family member + 100 = pam_secular_faith_events.0030 # The Anchorite - a devout courtier asks to be walled into a church cell + 100 = pam_secular_faith_events.0031 # An Argument of Scholars - two learned courtiers clash over doctrine + 100 = pam_secular_faith_events.0032 # The Tempting Hour - a fast tested in the night + 100 = pam_secular_faith_events.0033 # Pillow Sermons - a spouse who believes differently + 50 = pam_secular_faith_events.0034 # The Foundling - an abandoned child left at the church + 100 = pam_secular_faith_events.0035 # The Mortification - a courtier's holy self-destruction + 100 = pam_secular_faith_events.0036 # Wisdom of the Anchorite - a hermit's hard counsel + 50 = pam_secular_faith_events.0037 # Carnal Revelation - a glimpse of Carnal Exaltation + 50 = pam_secular_faith_events.0038 # A Taste of Paradise - a glimpse of Hedonism + 50 = pam_secular_faith_events.0039 # A Prayer in the Dark - the spymaster uncovers a secret at prayer (Sacred Shadows) + 50 = pam_secular_faith_events.0040 # Flesh of the Faithful - a glimpse of Ritual Cannibalism + 50 = pam_secular_faith_events.0041 # The Naked Truth - an Adamite preaches, and a secret temptation + 100 = pam_secular_faith_events.0042 # The Road Made Easy - a patron offers to fund the next pilgrimage + 100 = pam_secular_faith_events.0043 # A Pilgrim's Welcome - the realm priest pledges acclaim for the next completed pilgrimage + 100 = pam_secular_faith_events.0044 # The Ear of the Clergy - clerical petitions are more readily accepted for a time + 50 = pam_secular_faith_events.0045 # Epiphany - a temporary faith/rite creation cost discount + 100 = pam_secular_faith_events.0046 # Shared Conviction - adopting an intimate's personal tenet + 100 = pam_secular_faith_events.0047 # Priestly Devotion - a free loyalty hook on the realm priest + 50 = pam_secular_faith_events.0048 # Demonic Dreams - a tormenting dream, lifted by a temple or pilgrimage + 50 = pam_secular_faith_events.0049 # "Celestial Hierarchy" - a lustful priest's secret midnight rite + 50 = pam_secular_faith_events.0050 # Confession - lustful thoughts about the court chaplain; take a lover or resist + 50 = pam_secular_faith_events.0051 # The Lord your God - a mad ruler obeys a divine voice; a gamble of blessing, apoplexy, or death + 100 = pam_secular_faith_events.0052 # After You're Gone - an old ruler settles where they will lie + 50 = pam_secular_faith_events.0053 # The Saint Goes Forth - a held relic is borne in procession + 100 = pam_secular_faith_events.0054 # The Basin and the Towel - the ruler washes the feet of the poor + 100 = pam_secular_faith_events.0055 # The Voice of Bronze - a newly recast church bell is baptized + 100 = pam_secular_faith_events.0056 # A Sparrow in the Hall - Bede's sparrow flies through the evening meal + 100 = pam_secular_faith_events.0057 # The Church Ale - the parish brews to pay for the church roof + 100 = pam_secular_faith_events.0058 # Quid Mus Sumit? - a mouse has eaten of the reserved Host + 100 = pam_secular_faith_events.0059 # The Lord's Day - the chaplain bars the hunt on the day of rest + 1000 = pam_secular_faith_events.0060 # A Life Unburdened - a beggar is happier than you } } diff --git a/common/scripted_triggers/00_ai_value_triggers.txt b/common/scripted_triggers/00_ai_value_triggers.txt index e53e66f92..a310a0372 100644 --- a/common/scripted_triggers/00_ai_value_triggers.txt +++ b/common/scripted_triggers/00_ai_value_triggers.txt @@ -97,7 +97,7 @@ ai_has_warlike_personality = { ai_greed >= 25 } government_has_flag = government_is_tribal - culture ?= { has_cultural_pillar = ethos_bellicose } + culture = { has_cultural_pillar = ethos_bellicose } } NOR = { @@ -105,8 +105,8 @@ ai_has_warlike_personality = { has_trait = compassionate has_trait = craven has_trait = calm - faith ?= { has_doctrine_parameter = pacifist } - culture ?= { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith } + faith = { has_doctrine_parameter = pacifist } + culture = { has_cultural_parameter = reduced_cost_for_conversion_to_pacifist_faith } house ?= { has_house_modifier = unity_house_focused_on_economy_modifier } diff --git a/common/scripted_triggers/00_available_for_events_triggers.txt b/common/scripted_triggers/00_available_for_events_triggers.txt index c7d702204..79f5cabae 100644 --- a/common/scripted_triggers/00_available_for_events_triggers.txt +++ b/common/scripted_triggers/00_available_for_events_triggers.txt @@ -967,7 +967,10 @@ is_landed_or_landless_administrative_or_theocratic = { is_playable_character = { is_ruler = yes OR = { - exists = domicile + custom_tooltip = { + text = GAME_OVER_CANNOT_PLAY_ESTATELESS + has_domicile = yes + } # exclude barons trigger_if = { limit = { diff --git a/common/scripted_triggers/00_building_requirement_triggers.txt b/common/scripted_triggers/00_building_requirement_triggers.txt index 38a8f9891..1c52b2bac 100644 --- a/common/scripted_triggers/00_building_requirement_triggers.txt +++ b/common/scripted_triggers/00_building_requirement_triggers.txt @@ -237,12 +237,8 @@ building_orchards_requirement_terrain = { terrain = floodplains terrain = oasis has_building_or_higher = qanats_05 - AND = { - exists = culture - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = vegetarian_fruit_orchard_allowed } - } + culture = { + has_cultural_parameter = vegetarian_fruit_orchard_allowed } } } @@ -255,13 +251,7 @@ building_farm_estates_requirement_terrain = { terrain = hills terrain = jungle } - AND = { - exists = county.culture - trigger_if = { - limit = { exists = county.culture } - county.culture ?= { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle } - } - } + county.culture = { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle } } } } @@ -335,26 +325,14 @@ building_paddy_fields_requirement_terrain = { } AND = { terrain = wetlands - AND = { - exists = county.culture - trigger_if = { - limit = { exists = county.culture } - county.culture ?= { has_cultural_parameter = champa_rice_wet_land_paddies } - } - } + county.culture = { has_cultural_parameter = champa_rice_wet_land_paddies } } AND = { OR = { terrain = hills terrain = jungle } - AND = { - exists = county.culture - trigger_if = { - limit = { exists = county.culture } - county.culture ?= { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle } - } - } + county.culture = { has_cultural_parameter = rice_cultivators_can_construct_paddy_fields_in_hills_and_jungle } } } } @@ -469,13 +447,7 @@ building_elephant_pens_requirement_terrain = { terrain = jungle OR = { geographical_region = world_innovation_elephants - AND = { - exists = culture - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = elephant_pens_building_bonuses } - } - } + culture = { has_cultural_parameter = elephant_pens_building_bonuses } } } @@ -483,13 +455,7 @@ building_horse_pastures_requirement_terrain = { OR = { terrain = steppe geographical_region = world_steppe_east - AND = { - exists = culture - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = unlock_horse_pastures_building } - } - } + culture = { has_cultural_parameter = unlock_horse_pastures_building } } } @@ -505,13 +471,7 @@ building_quarries_requirement_terrain = { OR = { terrain = mountains terrain = desert_mountains - AND = { - exists = culture - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = can_build_quarries_everywhere } - } - } + culture = { has_cultural_parameter = can_build_quarries_everywhere } } } @@ -526,13 +486,7 @@ building_warrior_lodges_requirement_terrain = { } NOT = { geographical_region = world_horse_buildings_in_hills_and_mountains } } - AND = { - exists = culture - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = warrior_lodges_lift_restrictions } - } - } + culture = { has_cultural_parameter = warrior_lodges_lift_restrictions } } } @@ -569,7 +523,7 @@ building_wind_furnace_requirement_terrain = { } - scope:holder.culture ?= { has_innovation = innovation_wootz_steel } + scope:holder.culture = { has_innovation = innovation_wootz_steel } } building_hill_forts_requirement_terrain = { @@ -633,13 +587,7 @@ building_caravanserai_requirement_terrain = { building_qanats_requirement_terrain = { county ?= { - AND = { - exists = culture - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = unlocks_qanat_building } - } - } + culture = { has_cultural_parameter = unlocks_qanat_building } county_has_province_with_terrain = { terrain = hills terrain = tells @@ -700,7 +648,34 @@ barony_cannot_construct_holding = { terrain = desert terrain = desert_mountains } - geographical_region = world_africa_sahara + # the corridors + trigger_if = { + limit = { geographical_region = world_africa_sahara } + OR = { + this = province:6650 + this = province:6651 + this = province:6652 + this = province:6653 + this = province:6654 + this = province:6655 + this = province:6656 + this = province:6657 + this = province:6658 + this = province:6659 + this = province:6660 + this = province:6661 + this = province:6662 + this = province:6663 + this = province:6664 + this = province:6665 + this = province:6666 + this = province:6667 + this = province:6668 + } + } + trigger_else = { + always = no + } } } @@ -809,22 +784,22 @@ add_random_building_trigger = { generic_economic_building_innovation_trigger = { trigger_if = { limit = { has_building_or_higher = $BUILDING$_01 } - scope:build_owner.culture ?= { has_innovation = innovation_crop_rotation } + scope:build_owner.culture = { has_innovation = innovation_crop_rotation } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_02 } building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture ?= { has_innovation = innovation_manorialism } + scope:build_owner.culture = { has_innovation = innovation_manorialism } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_04 } building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture ?= { has_innovation = innovation_guilds } + scope:build_owner.culture = { has_innovation = innovation_guilds } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_06 } building_requirement_castle_city_church = { LEVEL = 04 } - scope:build_owner.culture ?= { has_innovation = innovation_cranes } + scope:build_owner.culture = { has_innovation = innovation_cranes } } } @@ -832,22 +807,22 @@ generic_economic_building_innovation_trigger = { generic_fortification_building_innovations_trigger = { trigger_if = { limit = { has_building_or_higher = $BUILDING$_01 } - scope:build_owner.culture ?= { has_innovation = innovation_motte } + scope:build_owner.culture = { has_innovation = innovation_motte } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_02 } building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture ?= { has_innovation = innovation_battlements } + scope:build_owner.culture = { has_innovation = innovation_battlements } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_04 } building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture ?= { has_innovation = innovation_hoardings } + scope:build_owner.culture = { has_innovation = innovation_hoardings } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_06 } building_requirement_castle_city_church = { LEVEL = 04 } - scope:build_owner.culture ?= { has_innovation = innovation_machicolations } + scope:build_owner.culture = { has_innovation = innovation_machicolations } } } @@ -855,22 +830,22 @@ generic_fortification_building_innovations_trigger = { generic_recruitment_building_innovations_trigger = { trigger_if = { limit = { has_building_or_higher = $BUILDING$_01 } - scope:build_owner.culture ?= { has_innovation = innovation_barracks } + scope:build_owner.culture = { has_innovation = innovation_barracks } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_02 } building_requirement_castle_city_church = { LEVEL = 02 } - scope:build_owner.culture ?= { has_innovation = innovation_burhs } + scope:build_owner.culture = { has_innovation = innovation_burhs } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_04 } building_requirement_castle_city_church = { LEVEL = 03 } - scope:build_owner.culture ?= { has_innovation = innovation_castle_baileys } + scope:build_owner.culture = { has_innovation = innovation_castle_baileys } } trigger_if = { limit = { has_building_or_higher = $BUILDING$_06 } building_requirement_castle_city_church = { LEVEL = 04 } - scope:build_owner.culture ?= { has_innovation = innovation_royal_armory } + scope:build_owner.culture = { has_innovation = innovation_royal_armory } } } @@ -998,7 +973,7 @@ religious_special_building_exclusion_trigger = { # checks if any special buildin building_monastic_schools_holding_level_requirement_trigger = { trigger_if = { - limit = { scope:holder.rite ?= { rite_has_parameter = monastic_schools_allowed_in_every_holding_type } } + limit = { scope:holder.rite = { rite_has_parameter = monastic_schools_allowed_in_every_holding_type } } OR = { has_building_or_higher = castle_$LEVEL$ has_building_or_higher = city_$LEVEL$ @@ -1027,11 +1002,7 @@ building_waterworks_requirement_terrain = { terrain = mountains terrain = desert_mountains } - exists = scope:holder.culture - trigger_if = { - limit = { exists = scope:holder.culture } - scope:holder.culture ?= { has_cultural_parameter = unlocks_waterworks_buildings } - } + scope:holder.culture = { has_cultural_parameter = unlocks_waterworks_buildings } } building_spice_plantation_requirement_terrain = { @@ -1070,22 +1041,12 @@ building_breweries_requirement = { } OR = { religion = religion:catholic_religion - AND = { - exists = faith - trigger_if = { - limit = { exists = faith } - faith ?= { has_doctrine_parameter = allows_brewery } - } - } + rite = { rite_has_parameter = allows_brewery } } } trigger_else = { - building_requirement_castle_city_church = { LEVEL = $NUMBER$ } - exists = culture - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = allows_brewery } - } + building_requirement_castle_city_church = { LEVEL = $NUMBER$ } + culture = { has_cultural_parameter = allows_brewery } } } diff --git a/common/scripted_triggers/00_coa_triggers.txt b/common/scripted_triggers/00_coa_triggers.txt index 755ef389a..f73bf43d3 100644 --- a/common/scripted_triggers/00_coa_triggers.txt +++ b/common/scripted_triggers/00_coa_triggers.txt @@ -8,7 +8,7 @@ coa_african_trigger = { } coa_african_culture_trigger = { - scope:culture ?= { + scope:culture = { OR = { has_coa_gfx = central_african_group_coa_gfx has_coa_gfx = east_african_coa_gfx @@ -41,7 +41,7 @@ coa_bishopric_trigger = { coa_breton_trigger = { OR = { - scope:culture ?= { has_coa_gfx = breton_coa_gfx } + scope:culture = { has_coa_gfx = breton_coa_gfx } scope:title ?= { any_this_title_or_de_jure_above = { this = title:k_brittany @@ -52,12 +52,12 @@ coa_breton_trigger = { coa_byzantine_trigger = { OR = { - scope:culture ?= { has_coa_gfx = byzantine_group_coa_gfx } # scope:title ?= { # any_this_title_or_de_jure_above = { # this = title:e_byzantium # } # } + scope:culture = { has_coa_gfx = byzantine_group_coa_gfx } } } @@ -124,7 +124,7 @@ coa_switch_to_norse_trigger = { } OR = { faith.religion = religion:folk_germanic_religion - culture ?= { has_coa_gfx = norse_coa_gfx } + culture = { has_coa_gfx = norse_coa_gfx } } } } @@ -147,7 +147,7 @@ coa_feudal_trigger = { coa_french_trigger = { OR = { - scope:culture ?= { has_coa_gfx = french_coa_gfx } + scope:culture = { has_coa_gfx = french_coa_gfx } AND = { exists = root any_liege_or_above = { @@ -161,7 +161,7 @@ coa_french_trigger = { coa_irish_trigger = { OR = { - scope:culture ?= { has_coa_gfx = irish_coa_gfx } + scope:culture = { has_coa_gfx = irish_coa_gfx } scope:title ?= { any_this_title_or_de_jure_above = { this = title:k_ireland @@ -172,7 +172,7 @@ coa_irish_trigger = { coa_indian_culture_trigger = { - scope:culture ?= { + scope:culture = { OR = { has_coa_gfx = burman_group_coa_gfx has_coa_gfx = dravidian_group_coa_gfx @@ -189,22 +189,16 @@ coa_indian_region_trigger = { } } coa_indian_religion_trigger = { - trigger_if = { - limit = { exists = scope:faith.religion } - scope:faith.religion = { - save_temporary_scope_as = religion - } - } - trigger_else = { - always = no + scope:faith.religion = { + save_temporary_scope_as = religion } scope:religion = { OR = { this = { is_in_family = rf_eastern } # this = religion:bon_religion this = religion:buddhism_religion -# this = religion:hinduism_religion # this = religion:jainism_religion + this = religion:hinduism_religion } } } @@ -214,27 +208,19 @@ coa_indian_trigger = { coa_indian_region_trigger = yes coa_indian_religion_trigger = yes } - scope:culture ?= { has_graphical_east_asia_culture_group_trigger = no } + scope:culture = { has_graphical_east_asia_culture_group_trigger = no } } coa_jewish_trigger = { OR = { - trigger_if = { - limit = { exists = scope:faith.religion } - scope:faith.religion = religion:judaism_religion - } - trigger_else = { always = no } - trigger_if = { - limit = { exists = scope:culture } - scope:culture ?= { has_coa_gfx = israelite_group_coa_gfx } - } - trigger_else = { always = no } + scope:faith.religion = religion:judaism_religion + scope:culture = { has_coa_gfx = israelite_group_coa_gfx } } } coa_leonese_trigger = { OR = { - scope:culture ?= { has_coa_gfx = leonese_coa_gfx } + scope:culture = { has_coa_gfx = leonese_coa_gfx } scope:title ?= { any_this_title_or_de_jure_above = { this = title:k_leon @@ -267,7 +253,7 @@ coa_manx_trigger = { coa_mena_trigger = { OR = { scope:faith.religion = religion:islam_religion - scope:culture ?= { + scope:culture = { OR = { has_coa_gfx = arabic_group_coa_gfx has_coa_gfx = berber_group_coa_gfx @@ -279,7 +265,7 @@ coa_mena_trigger = { coa_suomenusko_trigger = { OR = { scope:faith.religion = religion:uralic_religion - scope:culture ?= { + scope:culture = { OR = { has_coa_gfx = balto_finnic_group_coa_gfx has_coa_gfx = ugro_permian_group_coa_gfx @@ -291,7 +277,7 @@ coa_suomenusko_trigger = { coa_polish_trigger = { OR = { - scope:culture ?= { has_coa_gfx = polish_coa_gfx } + scope:culture = { has_coa_gfx = polish_coa_gfx } AND = { exists = root any_liege_or_above = { @@ -305,7 +291,7 @@ coa_polish_trigger = { coa_scottish_trigger = { OR = { - scope:culture ?= { has_coa_gfx = scottish_coa_gfx } + scope:culture = { has_coa_gfx = scottish_coa_gfx } scope:title ?= { any_this_title_or_de_jure_above = { this = title:k_scotland @@ -323,15 +309,15 @@ coa_theocratic_trigger = { } coa_welsh_trigger = { - scope:culture ?= { has_coa_gfx = welsh_coa_gfx } + scope:culture = { has_coa_gfx = welsh_coa_gfx } } coa_tamga_trigger = { - scope:culture ?= { has_coa_gfx = steppe_coa_gfx } + scope:culture = { has_coa_gfx = steppe_coa_gfx } } coa_scandinavian_trigger = { - scope:culture ?= { + scope:culture = { OR = { has_coa_gfx = swedish_coa_gfx has_coa_gfx = norwegian_coa_gfx @@ -341,18 +327,18 @@ coa_scandinavian_trigger = { } coa_norse_trigger = { - scope:culture ?= { has_coa_gfx = norse_coa_gfx } + scope:culture = { has_coa_gfx = norse_coa_gfx } } coa_germanic_trigger = { - scope:culture ?= { has_coa_gfx = german_group_coa_gfx } + scope:culture = { has_coa_gfx = german_group_coa_gfx } } coa_iberian_trigger = { OR = { - scope:culture ?= { has_coa_gfx = iberian_group_coa_gfx } + scope:culture = { has_coa_gfx = iberian_group_coa_gfx } AND = { - scope:culture ?= { has_coa_gfx = arabic_group_coa_gfx } + scope:culture = { has_coa_gfx = arabic_group_coa_gfx } scope:title ?= { OR = { this = title:e_spain @@ -364,7 +350,7 @@ coa_iberian_trigger = { } coa_iranian_trigger = { - scope:culture ?= { has_coa_gfx = iranian_group_coa_gfx } + scope:culture = { has_coa_gfx = iranian_group_coa_gfx } } has_recognizable_chinese_seal = { diff --git a/common/scripted_triggers/00_councillor_triggers.txt b/common/scripted_triggers/00_councillor_triggers.txt index c85412c21..f8ff98028 100644 --- a/common/scripted_triggers/00_councillor_triggers.txt +++ b/common/scripted_triggers/00_councillor_triggers.txt @@ -33,11 +33,7 @@ can_be_councillor_gender_trigger = { has_variable = can_be_councillor_override AND = { is_female = yes - exists = $COURT_OWNER$.rite - trigger_if = { - limit = { exists = $COURT_OWNER$.rite } - $COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } } - } + $COURT_OWNER$.rite = { NOT = { rite_has_parameter = male_dominated_council } } } AND = { is_female = yes @@ -47,11 +43,7 @@ can_be_councillor_gender_trigger = { } AND = { is_male = yes - exists = $COURT_OWNER$.rite - trigger_if = { - limit = { exists = $COURT_OWNER$.rite } - $COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } } - } + $COURT_OWNER$.rite = { NOT = { rite_has_parameter = female_dominated_council } } } } } @@ -63,7 +55,7 @@ can_be_chancellor_trigger = { } NAND = { has_council_position = councillor_court_chaplain - rite ?= { rite_has_parameter = clerical_appointment_fixed } + rite = { rite_has_parameter = clerical_appointment_fixed } } NOR = { has_council_position = councillor_spouse @@ -82,7 +74,7 @@ can_be_steward_trigger = { } NAND = { has_council_position = councillor_court_chaplain - rite ?= { rite_has_parameter = clerical_appointment_fixed } + rite = { rite_has_parameter = clerical_appointment_fixed } } NOR = { has_council_position = councillor_spouse @@ -102,7 +94,7 @@ can_be_marshal_trigger = { is_hostage = no NAND = { has_council_position = councillor_court_chaplain - rite ?= { rite_has_parameter = clerical_appointment_fixed } + rite = { rite_has_parameter = clerical_appointment_fixed } } NOR = { has_council_position = councillor_spouse @@ -115,7 +107,7 @@ can_be_marshal_trigger = { can_be_councillor_gender_trigger = { COURT_OWNER = $COURT_OWNER$ } AND = { has_trait = shieldmaiden - $COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens } + $COURT_OWNER$.culture = { has_cultural_parameter = has_access_to_shieldmaidens } } } } @@ -124,7 +116,7 @@ can_be_spymaster_trigger = { can_be_councillor_basics_trigger = yes NAND = { has_council_position = councillor_court_chaplain - rite ?= { rite_has_parameter = clerical_appointment_fixed } + rite = { rite_has_parameter = clerical_appointment_fixed } } NOR = { has_council_position = councillor_spouse @@ -149,18 +141,12 @@ can_be_court_chaplain_trigger = { liege = { has_diarchy_active_parameter = diarchy_is_vizierate } } } - exists = $COURT_OWNER$.rite - trigger_if = { - limit = { exists = $COURT_OWNER$.rite } - $COURT_OWNER$.rite ?= { rite_has_allowed_gender_for_clergy = scope:court_chaplain_check } - } - trigger_if = { - limit = { exists = $COURT_OWNER$.rite } - rite = $COURT_OWNER$.rite - } + $COURT_OWNER$.rite = { rite_has_allowed_gender_for_clergy = scope:court_chaplain_check } + faith = $COURT_OWNER$.faith + rite = { rite_has_allowed_gender_for_clergy = scope:court_chaplain_check } trigger_if = { limit = { - rite ?= { rite_has_doctrine = doctrine_theocracy_temporal } + rite = { rite_has_doctrine = doctrine_theocracy_temporal } } OR = { is_ruler = no @@ -181,7 +167,7 @@ can_be_court_chaplain_trigger = { } trigger_if = { # Married characters are excluded if the doctrine is not there limit = { - rite ?= { + rite = { NOT = { rite_has_parameter = clergy_can_marry } } } @@ -193,7 +179,7 @@ can_be_court_chaplain_trigger = { can_appoint_own_court_chaplain_trigger = { OR = { religious_head_or_challenger ?= this # The appointment authority itself has no one to request a chaplain from - rite ?= { + rite = { NOT = { rite_has_parameter = clerical_appointment_fixed } } tgp_has_access_to_ministry_trigger = yes @@ -281,23 +267,15 @@ can_be_kurultai_trigger = { is_ruler = yes AND = { is_female = yes - exists = $COURT_OWNER$.rite - trigger_if = { - limit = { exists = $COURT_OWNER$.rite } - $COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } } - } + $COURT_OWNER$.rite = { NOT = { rite_has_parameter = male_dominated_council } } } AND = { is_male = yes - exists = $COURT_OWNER$.rite - trigger_if = { - limit = { exists = $COURT_OWNER$.rite } - $COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } } - } + $COURT_OWNER$.rite = { NOT = { rite_has_parameter = female_dominated_council } } } AND = { has_trait = shieldmaiden - $COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens } + $COURT_OWNER$.culture = { has_cultural_parameter = has_access_to_shieldmaidens } } } } @@ -336,15 +314,15 @@ can_be_any_kurultai_trigger = { is_ruler = yes AND = { is_female = yes - $COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = male_dominated_council } } + $COURT_OWNER$.rite = { NOT = { rite_has_parameter = male_dominated_council } } } AND = { is_male = yes - $COURT_OWNER$.rite ?= { NOT = { rite_has_parameter = female_dominated_council } } + $COURT_OWNER$.rite = { NOT = { rite_has_parameter = female_dominated_council } } } AND = { has_trait = shieldmaiden - $COURT_OWNER$.culture ?= { has_cultural_parameter = has_access_to_shieldmaidens } + $COURT_OWNER$.culture = { has_cultural_parameter = has_access_to_shieldmaidens } } } } @@ -459,7 +437,7 @@ can_be_fired_from_council_trigger = { has_council_position = councillor_court_chaplain liege = { tgp_has_access_to_ministry_trigger = no } } - rite ?= { + rite = { OR = { rite_has_doctrine = doctrine_clerical_succession_temporal_appointment rite_has_doctrine = doctrine_clerical_succession_spiritual_appointment @@ -1117,7 +1095,7 @@ task_conversion_valid_county_trigger = { } } NOT = { - rite ?= { has_variable = pam_rite_grace_period } + rite = { has_variable = pam_rite_grace_period } } } trigger_if = { @@ -1126,7 +1104,7 @@ task_conversion_valid_county_trigger = { trigger_if = { limit = { scope:councillor_liege = { - faith ?= { + faith = { has_doctrine_parameter = unreformed } } @@ -1137,7 +1115,7 @@ task_conversion_valid_county_trigger = { vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } } scope:councillor_liege = { ai_zeal >= 50 } - scope:county_check.faith ?= { has_doctrine_parameter = unreformed } + scope:county_check.faith = { has_doctrine_parameter = unreformed } scope:county_check = { # Always convert holy sites any_county_province = { barony = { @@ -1151,7 +1129,7 @@ task_conversion_valid_county_trigger = { trigger_if = { limit = { scope:councillor_liege = { - faith ?= { + faith = { faith_hostility_level = { target = scope:county_check.faith value <= faith_fully_accepted_level @@ -1181,7 +1159,7 @@ task_conversion_valid_county_trigger = { trigger_if = { limit = { scope:councillor_liege = { - faith ?= { + faith = { faith_hostility_level = { target = scope:county_check.faith value <= faith_astray_level @@ -1214,7 +1192,7 @@ task_conversion_valid_county_trigger = { trigger_else_if = { limit = { scope:councillor_liege = { - rite ?= { rite_has_doctrine = doctrine_pluralism_fundamentalist } + rite = { rite_has_doctrine = doctrine_pluralism_fundamentalist } } } OR = { @@ -1284,11 +1262,11 @@ task_conversion_valid_county_trigger = { limit = { scope:councillor_liege = { OR = { - rite ?= { rite_has_tenet = tenet_tax_nonbelievers } - faith ?= { has_doctrine = special_doctrine_jizya } + rite = { rite_has_tenet = tenet_tax_nonbelievers } + faith = { has_doctrine = special_doctrine_jizya } } } - scope:councillor_liege.faith ?= { faith_is_in_same_rf = { FAITH = scope:county_check.faith } } + scope:councillor_liege.faith = { faith_is_in_same_rf = { FAITH = scope:county_check.faith } } } OR = { scope:councillor_liege = { @@ -1296,8 +1274,8 @@ task_conversion_valid_county_trigger = { vassal_is_valid_and_follows_directive_trigger = { VASSAL = this LIEGE = liege } } scope:councillor_liege = { ai_zeal >= 50 } - scope:county_check.faith ?= { has_doctrine_parameter = unreformed } - scope:councillor_liege.faith ?= { + scope:county_check.faith = { has_doctrine_parameter = unreformed } + scope:councillor_liege.faith = { any_holy_site_barony = { kingdom = scope:county_check.kingdom } @@ -1456,7 +1434,7 @@ can_be_trained_as_knight_now_light_trigger = { is_in_army = no has_contagious_deadly_disease_trigger = no is_incapable = no - is_in_activity = yes + is_in_activity = no } teacher_has_trait_that_student_does_not_trigger = { diff --git a/common/scripted_triggers/00_courtier_guest_management_triggers.txt b/common/scripted_triggers/00_courtier_guest_management_triggers.txt index e8a8b167d..fc709673f 100644 --- a/common/scripted_triggers/00_courtier_guest_management_triggers.txt +++ b/common/scripted_triggers/00_courtier_guest_management_triggers.txt @@ -397,37 +397,39 @@ can_recruit_character_to_court_trigger = { trigger_if = { limit = { exists = host } #Are they employed? - is_councillor_of = scope:recruitee.host - is_knight_of = scope:recruitee.host - any_relation = { - type = ward - OR = { - this = scope:recruitee.host - is_close_family_of = scope:recruitee.host + OR = { + is_councillor_of = scope:recruitee.host + is_knight_of = scope:recruitee.host + any_relation = { + type = ward + OR = { + this = scope:recruitee.host + is_close_family_of = scope:recruitee.host + } } - } - any_relation = { - type = guardian - OR = { - this = scope:recruitee.host - is_close_family_of = scope:recruitee.host + any_relation = { + type = guardian + OR = { + this = scope:recruitee.host + is_close_family_of = scope:recruitee.host + } } - } - any_relation = { - type = mentor - OR = { - this = scope:recruitee.host - is_close_family_of = scope:recruitee.host + any_relation = { + type = mentor + OR = { + this = scope:recruitee.host + is_close_family_of = scope:recruitee.host + } } - } - any_relation = { - type = student - OR = { - this = scope:recruitee.host - is_close_family_of = scope:recruitee.host + any_relation = { + type = student + OR = { + this = scope:recruitee.host + is_close_family_of = scope:recruitee.host + } } + any_court_position_employer = { this = scope:recruitee.host } } - any_court_position_employer = { this = scope:recruitee.host } } trigger_if = { limit = { @@ -850,14 +852,7 @@ is_courtier_or_knight_of_root = { guest_herder_candidate_trigger = { government_has_flag = government_is_herder has_trait = lifestyle_seasoned_pastor - trigger_if = { - limit = { root.rite = { rite_has_doctrine = doctrine_gender_male_dominated } } - is_male = yes - } - trigger_if = { - limit = { root.rite = { rite_has_doctrine = doctrine_gender_female_dominated } } - is_female = yes - } + root.rite = { rite_has_dominant_ruling_gender = prev } age < 45 age >= 25 } diff --git a/common/scripted_triggers/00_diarchy_scripted_triggers.txt b/common/scripted_triggers/00_diarchy_scripted_triggers.txt index 9cb8abb7f..aa8496ea1 100644 --- a/common/scripted_triggers/00_diarchy_scripted_triggers.txt +++ b/common/scripted_triggers/00_diarchy_scripted_triggers.txt @@ -165,20 +165,7 @@ diarch_callable_in_internal_war_trigger = { } diarch_matches_liege_faith_gender_preference_trigger = { - OR = { - # Female preference. - AND = { - is_female = yes - liege.rite = { rite_has_doctrine = doctrine_gender_female_dominated } - } - # Male preference. - AND = { - is_male = yes - liege.rite = { rite_has_doctrine = doctrine_gender_male_dominated } - } - # Equality. - liege.rite = { rite_has_doctrine = doctrine_gender_equal } - } + liege.rite = { rite_has_dominant_ruling_gender = prev } } ################################################## diff --git a/common/scripted_triggers/00_interaction_triggers.txt b/common/scripted_triggers/00_interaction_triggers.txt deleted file mode 100644 index ee50c3ba5..000000000 --- a/common/scripted_triggers/00_interaction_triggers.txt +++ /dev/null @@ -1,447 +0,0 @@ -remove_guardian_interaction_visible_ward_trigger = { - OR = { - #If I am the child - this = scope:actor - #The ward has actor as its liege - employer ?= scope:actor - #The guardian is actor - any_relation = { - type = guardian - this = scope:actor - } - #The guardian is actor's courtier - any_relation = { - type = guardian - is_courtier_of = scope:actor - } - } -} - -remove_guardian_interaction_available_ward_trigger = { - #is_imprisoned = no -} - -kick_from_court_validity_trigger = { - NOR = { - is_spouse_of = scope:actor - is_concubine_of = scope:actor - is_close_family_of = scope:actor - has_council_position = councillor_court_chaplain - is_diarch = yes - # Marriage major partners of diarchs. - ## Female. - AND = { - is_married = yes - is_female = yes - matrilinear_marriage = yes - any_consort = { is_diarch = yes } - } - ## Male. - AND = { - is_married = yes - is_male = yes - patrilinear_marriage = yes - any_consort = { is_diarch = yes } - } - } -} - -ask_for_pardon_available_trigger = { - $ACTOR$ = { - top_liege != this - any_liege_or_above = { - OR = { - has_imprisonment_reason = $ACTOR$ - has_banish_reason = $ACTOR$ - has_execute_reason = $ACTOR$ - has_revoke_title_reason = $ACTOR$ - } - } - } -} - -has_extra_criminal_reason_against_trigger = { - OR = { - has_banish_reason = $CRIMINAL$ - has_execute_reason = $CRIMINAL$ - has_revoke_title_reason = $CRIMINAL$ - } -} - -title_revocation_standard_valid_showing_failures_only_trigger = { - scope:puppet_or_actor = { - NOR = { - is_at_war_with = scope:recipient - has_truce = scope:recipient - } - custom_description = { - text = "character_interactions_revoke_title_from_ally_without_reason" - object = scope:recipient - OR = { - NOT = { - is_allied_to = scope:recipient - } - has_revoke_title_reason = scope:recipient - } - } - } - scope:recipient = { - NOT = { has_strong_hook = scope:puppet_or_actor } - } -} - -title_revocation_standard_can_pick_title_trigger = { - is_contested = no - custom_description = { - text = "revoke_title_not_noble_family_title" - is_noble_family_title = no - } - NOT = { - recent_history = { - type = granted - years = 1 - } - } - custom_description = { - text = "character_interactions_not_rel_head_title" - is_head_of_faith = no - } - custom_description = { - text = "character_interactions_not_clerical_region_title" - has_clerical_region = no - } - custom_description = { - text = "character_interactions_not_clerical_elector_title" - pam_title_is_clerical_elector_trigger = no - } - custom_description = { - text = "character_interactions_not_antipope_office_title" - pam_title_is_antipope_office_trigger = no - } - custom_tooltip = { - text = special_title_cannot_be_revoked.tt - NOR = { - this = title:k_papal_state - this = title:k_orthodox - } - } -} - -diarch_revocation_has_claim_check_trigger = { - custom_description = { - text = diarch_has_claim_on_revokable_title - object = scope:recipient - scope:actor = { - any_claim = { - holder ?= scope:recipient - } - } - } -} - -title_revocation_is_admin_governor_trigger = { - government_has_mechanic = administrative - top_liege = this - save_temporary_scope_as = liege_temp - $VASSAL$ = { - government_has_mechanic = administrative - target_is_liege_or_above = scope:liege_temp - } -} - -title_revocation_is_tyrannical_trigger = { - NOR = { - exists = scope:administrative_revocation - has_revoke_title_reason = $VASSAL$ - trigger_if = { - limit = { exists = scope:landed_title } - has_claim_on = scope:landed_title - } - title_revocation_is_admin_governor_trigger = { VASSAL = $VASSAL$ } - AND = { - rite = { rite_has_parameter = tenet_legalism_sinful_revocation } - $VASSAL$ = { - num_sinful_traits = { - value > 0 - target = prev.rite - } - } - } - AND = { - $VASSAL$ = { - NOT = { vassal_contract_has_flag = religiously_protected } - } - OR = { - AND = { - rite = { rite_has_parameter = pluralism_righteous_revocation_tyranny_reduced } - faith = { - faith_hostility_level = { - target = $VASSAL$.faith - value = faith_evil_level - } - } - } - AND = { - rite = { rite_has_parameter = pluralism_fundamentalist_revocation_tyranny_minimal } - faith = { - faith_hostility_level = { - target = $VASSAL$.faith - value >= faith_hostile_level - } - } - } - } - } - } -} - -# The liege is root, and $VASSAL$ is the target -# Sets liege_temp and rebel_temp for revoke_refusal_war_rising_strength_value -revoke_refusal_war_would_be_massive_trigger = { - NOT = { has_revoke_title_reason = $VASSAL$ } - NOT = { government_has_flag = no_powerful_vassals } - save_temporary_scope_as = liege_temp - $VASSAL$ = { save_temporary_scope_as = rebel_temp } - current_military_strength < revoke_refusal_war_rising_strength_value -} - -vassal_revocation_is_tyrannical_trigger = { - NOR = { - exists = scope:administrative_revocation - AND = { - government_has_mechanic = administrative - $VASSAL$ = { - government_has_mechanic = administrative - } - } - has_revoke_title_reason = $VASSAL$ - OR = { - AND = { - rite = { rite_has_parameter = pluralism_righteous_revocation_tyranny_reduced } - faith = { - faith_hostility_level = { - target = $VASSAL$.faith - value = faith_evil_level - } - } - } - AND = { - rite = { rite_has_parameter = pluralism_fundamentalist_revocation_tyranny_minimal } - faith = { - faith_hostility_level = { - target = $VASSAL$.faith - value >= faith_hostile_level - } - } - } - } - } -} - -vassal_retraction_standard_valid_showing_failures_only_trigger = { - NOT = { - scope:puppet_or_actor = { is_at_war_with = scope:recipient } - } - scope:recipient = { - NOT = { has_strong_hook = scope:puppet_or_actor } - } -} - -diarch_retraction_is_de_jure_liege_trigger = { - custom_description = { - text = "diarch_is_de_jure_liege_of_retractable_vassal" - object = scope:recipient - scope:actor = { - any_held_title = { - any_direct_de_jure_vassal_title = { holder.liege = scope:recipient } - } - } - } -} - -is_de_jure_vassal_of_liege_trigger = { - liege = { - save_temporary_scope_as = my_liege - } - primary_title = { - OR = { - de_jure_liege = { - holder ?= scope:my_liege - } - trigger_if = { - limit = { - tier = tier_duchy - } - de_jure_liege = { - de_jure_liege = { - holder ?= scope:my_liege - } - } - } - } - } -} - -send_poem_positive_poem_lock_trigger = { - OR = { - is_ai = no - NOT = { has_relation_rival = scope:recipient } - NOT = { has_relation_nemesis = scope:recipient } - } -} - -send_poem_negative_poem_lock_trigger = { - OR = { - is_ai = no - has_relation_rival = scope:recipient - has_relation_nemesis = scope:recipient - } -} - -can_any_traveling_family_members_travel_trigger = { - NOR = { - this = scope:recipient - is_in_pool_at = scope:actor.capital_province - } - is_ruler = no - trigger_if = { - limit = { - exists = scope:recipient.host - is_child_of = scope:recipient.host - is_adult = no - } - dynasty != scope:recipient.host.dynasty - } -} - -imprison_neutral_is_valid_showing_failures_only_triggers_trigger = { - scope:puppet_or_actor.liege = { - trigger_if = { - limit = { has_realm_law_flag = imprisonment_toggle_enable } - # TIT-43801 - #has_realm_law_flag = imprisonment_toggle_on - NOT = { has_realm_law = tribal_authority_0 } - } - } - scope:puppet_or_actor = { is_imprisoned = no } - custom_description = { - text = cannot_imprison_almohad_leader - subject = scope:recipient - NOT = { - scope:recipient = { has_character_modifier = almohad_leader_modifier } - } - } -} - -grant_title_rivalry_trigger = { - is_ai = yes - is_playable_character = yes - top_liege = scope:actor - faith = scope:actor.faith - reverse_opinion = { - target = top_liege - value > -50 - } - opinion = { - target = top_liege - value > -50 - } - trigger_if = { - limit = { - is_female = yes - faith_dominant_gender_female_or_equal = no - } - scope:recipient = { is_female = yes } - } - trigger_if = { - limit = { - is_male = yes - faith_dominant_gender_male_or_equal = no - } - scope:recipient = { is_male = yes } - } - has_dread_level_towards = { - target = scope:actor - level < 1 - } - is_eunuch_trigger = no - NOR = { - this = scope:actor - this = scope:recipient - has_trait = content - has_trait = humble - has_trait = blind - has_trait = devoted - is_close_family_of = scope:recipient - has_any_good_relationship_with_character_trigger = { CHARACTER = scope:actor } - has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:actor } - } -} - -should_prioritise_hostile_action_against_due_to_personal_relations_trigger = { - $ACTOR$ = { - OR = { - has_any_bad_relationship_with_character_trigger = { CHARACTER = $RECIPIENT$ } - opinion = { - target = $RECIPIENT$ - value <= very_high_negative_opinion - } - } - } -} - -should_avoid_hostile_action_against_due_to_personal_relations_trigger = { - $ACTOR$ = { - OR = { - has_any_good_relationship_with_character_trigger = { CHARACTER = $RECIPIENT$ } - is_allied_to = $RECIPIENT$ - opinion = { - target = $RECIPIENT$ - value >= very_high_positive_opinion - } - # Plus filter out heirs & other family, unless we hate 'em. - AND = { - OR = { - is_close_or_extended_family_of = $RECIPIENT$ - any_spouse = { this = $RECIPIENT$ } - is_heir_of = $RECIPIENT$ - } - NOR = { - has_any_bad_relationship_with_character_trigger = { CHARACTER = $RECIPIENT$ } - exposed_cheating_on_spouse_trigger = { SPOUSE = $RECIPIENT$ } - AND = { - is_ai = yes - opinion = { - target = $RECIPIENT$ - value <= low_negative_opinion - } - } - } - } - } - } -} - -should_avoid_hostile_action_against_due_to_liege_relations_trigger = { - $ACTOR$ = { - liege ?= { - OR = { - has_any_good_relationship_with_character_trigger = { CHARACTER = $RECIPIENT$ } - is_allied_to = $RECIPIENT$ - opinion = { - target = $RECIPIENT$ - value >= very_high_positive_opinion - } - } - } - } -} - -is_asking_for_gold_in_ransom_trigger = { - OR = { - scope:extortionate_gold ?= yes - scope:extortionate_current_gold ?= yes - scope:gold ?= yes - scope:current_gold ?= yes - } -} diff --git a/common/scripted_triggers/00_laamp_triggers.txt b/common/scripted_triggers/00_laamp_triggers.txt index b415594a3..a43367a90 100644 --- a/common/scripted_triggers/00_laamp_triggers.txt +++ b/common/scripted_triggers/00_laamp_triggers.txt @@ -26,7 +26,7 @@ maa_regiments_valid_to_refill_trigger = { maa_current_troops_count < maa_max_troops_count trigger_if = { limit = { - scope:actor = { OR = { government_has_flag = government_is_landless_adventurer government_has_flag = government_is_landless_minority } } + regiment_owner ?= { OR = { government_has_flag = government_is_landless_adventurer government_has_flag = government_is_landless_minority } } is_unit_type = elephant_cavalry } regiment_owner.domicile ?= { has_domicile_parameter = camp_reinforce_elephant_regiments_anywhere } diff --git a/common/scripted_triggers/00_law_triggers.txt b/common/scripted_triggers/00_law_triggers.txt index 8f62afce6..f80b44b6f 100644 --- a/common/scripted_triggers/00_law_triggers.txt +++ b/common/scripted_triggers/00_law_triggers.txt @@ -100,8 +100,11 @@ realm_law_use_government_authority = { } realm_law_authority_level_0 = { - has_realm_law_flag = authority_level_0 - NOT = { has_realm_law_flag = authority_level_1 } + custom_description = { + text = has_lowest_government_authority + has_realm_law_flag = authority_level_0 + NOT = { has_realm_law_flag = authority_level_1 } + } } realm_law_authority_level_1 = { diff --git a/common/scripted_triggers/00_military_triggers.txt b/common/scripted_triggers/00_military_triggers.txt index 0e47fd5ff..9d8cef75b 100644 --- a/common/scripted_triggers/00_military_triggers.txt +++ b/common/scripted_triggers/00_military_triggers.txt @@ -21,7 +21,7 @@ valid_for_maa_trigger = { has_perk = planned_cultivation_perk location.county.culture ?= { has_cultural_parameter = $PARAMETER$ } } - culture ?= { has_cultural_parameter = $PARAMETER$ } + culture = { has_cultural_parameter = $PARAMETER$ } } } diff --git a/common/scripted_triggers/00_relation_triggers.txt b/common/scripted_triggers/00_relation_triggers.txt deleted file mode 100644 index d0f4c0ada..000000000 --- a/common/scripted_triggers/00_relation_triggers.txt +++ /dev/null @@ -1,1246 +0,0 @@ - -###TRIGGER LIST - -################################# -# RELATIONSHIP SETTING TRIGGERS # -################################# - -### FRIEND ### -can_set_relation_potential_friend_trigger = { - NOT = { has_relation_potential_friend = $CHARACTER$ } - can_set_relation_friend_trigger = { CHARACTER = $CHARACTER$ } -} - -can_set_relation_friend_trigger = { - NOR = { - this = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_nemesis = $CHARACTER$ - } -} - -can_set_relation_best_friend_trigger = { - NOR = { - this = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_nemesis = $CHARACTER$ - } - num_of_relation_best_friend = 0 - $CHARACTER$ = { num_of_relation_best_friend = 0 } -} - -### LOVER ### -can_set_relation_potential_lover_trigger = { - NOT = { has_relation_potential_lover = $CHARACTER$ } - can_set_relation_lover_trigger = { CHARACTER = $CHARACTER$ } -} - -can_set_relation_lover_trigger = { - is_adult = yes - NOR = { - this = $CHARACTER$ - has_relation_lover = $CHARACTER$ - } - $CHARACTER$ = { - is_adult = yes - } - matching_gender_and_sexuality_with_trigger = { CHARACTER = $CHARACTER$ } -} - -can_set_relation_soulmate_trigger = { - is_adult = yes - #Some asexuality handling - trigger_if = { - limit = { has_sexuality = asexual } - trigger_if = { - limit = { is_ai = yes } - always = no - } - trigger_else = { - $CHARACTER$ = { is_consort_of = prev } - } - } - trigger_else = { is_attracted_to_gender_of = $CHARACTER$ } - - NOR = { - this = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_nemesis = $CHARACTER$ - } - $CHARACTER$ = { - is_adult = yes - is_attracted_to_gender_of = prev - num_of_relation_soulmate = 0 - } - num_of_relation_soulmate = 0 -} - -### RIVAL ### -can_set_relation_potential_rival_trigger = { - can_set_relation_rival_if_adult_trigger = { CHARACTER = $CHARACTER$ } - NOT = { has_relation_potential_rival = $CHARACTER$ } -} - -can_set_relation_rival_if_adult_trigger = { - NOR = { - this = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_nemesis = $CHARACTER$ - } -} - -can_set_relation_rival_trigger = { - is_adult = yes - $CHARACTER$ = { is_adult = yes } - can_set_relation_rival_if_adult_trigger = { CHARACTER = $CHARACTER$ } -} - -can_set_relation_nemesis_trigger = { - is_adult = yes - NOR = { - this = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - } - num_of_relation_nemesis = 0 - $CHARACTER$ = { - is_adult = yes - num_of_relation_nemesis = 0 - } -} - -can_set_relation_bully_trigger = { - is_adult = no - $CHARACTER$ = { is_adult = no } - NOR = { - this = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - has_relation_bully = $CHARACTER$ - has_relation_victim = $CHARACTER$ - } -} - -can_set_relation_victim_trigger = { - is_adult = no - $CHARACTER$ = { is_adult = no } - NOR = { - this = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - has_relation_bully = $CHARACTER$ - has_relation_victim = $CHARACTER$ - } -} - -can_set_relation_rival_even_if_teen_trigger = { - OR = { - is_adult = yes - child_is_teen_trigger = yes - } - $CHARACTER$ = { - OR = { - is_adult = yes - child_is_teen_trigger = yes - } - } - can_set_relation_rival_if_adult_trigger = { CHARACTER = $CHARACTER$ } -} - -can_set_relation_nemesis_even_if_teen_trigger = { - OR = { - is_adult = yes - child_is_teen_trigger = yes - } - $CHARACTER$ = { - OR = { - is_adult = yes - child_is_teen_trigger = yes - } - } - NOR = { - this = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - } - num_of_relation_nemesis = 0 - $CHARACTER$ = { num_of_relation_nemesis = 0 } -} - -### GRUDGE -can_set_relation_grudge_trigger = { - can_set_relation_grudge_if_adult_trigger = { CHARACTER = $CHARACTER$ } - NOT = { has_relation_grudge = $CHARACTER$ } -} - -can_set_relation_grudge_if_adult_trigger = { - NOT = { this = $CHARACTER$ } - NOR = { - has_relation_friend = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_nemesis = $CHARACTER$ - } -} - -### BLOOD BROTHER -can_set_relation_blood_brother_trigger = { - NOT = { this = $CHARACTER$ } - NOR = { - has_relation_blood_brother = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_nemesis = $CHARACTER$ - } - num_of_relation_blood_brother = 0 - $CHARACTER$ = { num_of_relation_blood_brother = 0 } -} - -has_blood_brother = { - num_of_relation_blood_brother >= 1 -} - -#################### -# RELATION UPGRADE # -#################### - -# These are not hard blockers for upgrading relations, but are used in relation_upgrade events - -### FRIEND -upgrade_ready_potential_friend_to_friend_trigger = { - can_set_relation_friend_trigger = { CHARACTER = $CHARACTER$ } -} - - -### BEST FRIEND -upgrade_ready_friend_to_best_friend_trigger = { - can_set_relation_best_friend_trigger = { CHARACTER = $CHARACTER$ } -} - - -### LOVER -upgrade_ready_potential_lover_to_lover_support_trigger = { - OR = { - is_ai = no #Players chose if they are ready - trigger_if = { - limit = { has_trait = chaste } - opinion = { - target = $CHARACTER$ - value >= high_positive_opinion - } - } - trigger_else_if = { - limit = { - OR = { - has_trait = lustful - has_trait = seducer - $CHARACTER$.attraction >= medium_positive_attraction - } - } - opinion = { - target = $CHARACTER$ - value >= 0 - } - } - trigger_else = { - opinion = { - target = $CHARACTER$ - value >= low_positive_opinion - } - } - } -} - -upgrade_ready_potential_lover_to_lover_trigger = { - can_set_relation_lover_trigger = { CHARACTER = $CHARACTER$ } - upgrade_ready_potential_lover_to_lover_support_trigger = { CHARACTER = $CHARACTER$ } - save_temporary_scope_as = potential_lover_root - $CHARACTER$ = { upgrade_ready_potential_lover_to_lover_support_trigger = { CHARACTER = scope:potential_lover_root } } -} - -### SOULMATE -upgrade_ready_lover_to_soulmate_trigger = { - can_set_relation_soulmate_trigger = { CHARACTER = $CHARACTER$ } -} - - -### RIVAL -upgrade_ready_potential_rival_to_rival_trigger = { - can_set_relation_rival_trigger = { CHARACTER = $CHARACTER$ } -} - -### NEMESIS -upgrade_ready_rival_to_nemesis_trigger = { - can_set_relation_nemesis_trigger = { CHARACTER = $CHARACTER$ } -} - - - - - -######################## -# AI RELATIONSHIP CAPS # -######################## - -# Soft caps, mostly for schemes - -is_below_ai_friend_soft_cap_trigger = { - trigger_if = { - limit = { - is_ai = yes - NOT = { puppeteer ?= { is_ai = no } } - } - - trigger_if = { - limit = { - OR = { - highest_held_title_tier >= tier_kingdom - has_trait = gregarious - } - } - num_of_relation_friend < 3 - } - trigger_else = { - num_of_relation_friend < 1 - } - } - trigger_else = { - always = yes - } -} - -is_below_ai_lover_soft_cap_trigger = { - trigger_if = { - limit = { - is_ai = yes - NOT = { puppeteer ?= { is_ai = no } } - } - - trigger_if = { - limit = { - has_trait = lustful - has_trait = seducer - has_focus = intrigue_temptation_focus - } - num_of_relation_lover < 3 - } - trigger_else = { - num_of_relation_lover < 1 - } - } - trigger_else = { - always = yes - } -} - - -############################### -# Character priority triggers # -############################### - -has_important_relationship_with_character_trigger = { - OR = { - has_relation_lover = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_friend = $CHARACTER$ - } -} - -has_any_moderate_good_relationship_with_character_trigger = { - OR = { - has_relation_lover = $CHARACTER$ - has_relation_friend = $CHARACTER$ - } -} - -has_any_mild_good_relationship_with_character_trigger = { - OR = { - has_relation_potential_lover = $CHARACTER$ - has_relation_crush = $CHARACTER$ - has_relation_potential_friend = $CHARACTER$ - has_relation_guardian = $CHARACTER$ - has_relation_ward = $CHARACTER$ - has_relation_elder = $CHARACTER$ - has_relation_disciple = $CHARACTER$ - } -} - -has_any_only_moderate_good_relationship_with_character_trigger = { - has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = $CHARACTER$ } - # Exclude the max-tier positive relationships if we're being this specific. - NOT = { - has_any_best_good_relationship_with_character_trigger = { CHARACTER = $CHARACTER$ } - } -} - -has_any_fertility_relationship_with_character_trigger = { - OR = { - has_relation_wedding_very_bad_fertility = $CHARACTER$ - has_relation_wedding_bad_fertility = $CHARACTER$ - has_relation_wedding_good_fertility = $CHARACTER$ - has_relation_wedding_very_good_fertility = $CHARACTER$ - } -} - -has_any_fertility_relationship_with_root_trigger = { - has_any_fertility_relationship_with_character_trigger = { CHARACTER = root } -} - -has_any_best_good_relationship_with_character_trigger = { - OR = { - has_relation_best_friend = $CHARACTER$ - has_relation_soulmate = $CHARACTER$ - } -} - -likes_character_trigger = { - OR = { - has_relation_lover = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_crush = $CHARACTER$ - has_relation_potential_friend = $CHARACTER$ - has_relation_elder = $CHARACTER$ - has_relation_disciple = $CHARACTER$ - AND = { - has_trait = loyal - OR = { - liege ?= $CHARACTER$ - is_consort_of = $CHARACTER$ - is_close_or_extended_family_of = $CHARACTER$ - } - } - opinion = { - target = $CHARACTER$ - value >= 25 - } - } - NOR = { - has_relation_victim = $CHARACTER$ - has_relation_bully = $CHARACTER$ - has_relation_rival = $CHARACTER$ - is_at_war_with = $CHARACTER$ - is_imprisoned_by = $CHARACTER$ - } -} - -dislikes_character_trigger = { - OR = { - opinion = { - target = $CHARACTER$ - value <= 25 - } - has_relation_grudge = $CHARACTER$ - has_relation_victim = $CHARACTER$ - has_relation_bully = $CHARACTER$ - has_relation_rival = $CHARACTER$ - - AND = { - has_relation_potential_rival = $CHARACTER$ - opinion = { - target = $CHARACTER$ - value <= 0 - } - } - AND = { - has_trait = disloyal - OR = { - liege ?= $CHARACTER$ - is_consort_of = $CHARACTER$ - is_close_or_extended_family_of = $CHARACTER$ - } - } - } - NOR = { - has_relation_lover = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_crush = $CHARACTER$ - } -} - -has_any_good_relationship_with_character_trigger = { - OR = { - has_any_mild_good_relationship_with_character_trigger = { CHARACTER = $CHARACTER$ } - has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = $CHARACTER$ } - } -} - -has_any_mild_bad_relationship_with_character_trigger = { - OR = { - has_relation_potential_rival = $CHARACTER$ - has_relation_victim = $CHARACTER$ - has_relation_bully = $CHARACTER$ - } -} - -has_any_moderate_bad_relationship_with_character_trigger = { - has_relation_rival = $CHARACTER$ -} - -has_any_only_moderate_bad_relationship_with_character_trigger = { - has_relation_rival = $CHARACTER$ - NOT = { - has_any_worst_bad_relationship_with_character_trigger = { CHARACTER = $CHARACTER$ } - } -} - -has_any_worst_bad_relationship_with_character_trigger = { - has_relation_nemesis = $CHARACTER$ -} - -has_any_bad_relationship_with_character_trigger = { - OR = { - has_any_mild_bad_relationship_with_character_trigger = { CHARACTER = $CHARACTER$ } - has_any_moderate_bad_relationship_with_character_trigger = { CHARACTER = $CHARACTER$ } - } -} - -has_important_relationship_with_root_trigger = { - has_important_relationship_with_character_trigger = { CHARACTER = root } -} - -has_friendly_relationship_with_root_trigger = { - has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = root } -} - -has_any_good_relationship_with_root_trigger = { - has_any_good_relationship_with_character_trigger = { CHARACTER = root } -} - -has_any_bad_relationship_with_root_trigger = { - has_any_bad_relationship_with_character_trigger = { CHARACTER = root } -} - -lover_is_secret_trigger = { - any_secret = { - type = secret_lover - secret_target = $CHARACTER$ - } -} - - - -############################################### -# Triggers that take an argument and NOT root -############################################## - -# List of all localizable relations (e.g, My vassal Alex, My courtier Lisa, My liege Frank, My cousin Teddy, etc.) -has_any_relation_trigger = { - NOT = { this = $CHARACTER$ } - OR = { - # They are our liege - AND = { - exists = $CHARACTER$.liege - this = $CHARACTER$.liege - } - # We are their liege - is_vassal_of = $CHARACTER$ - is_courtier_of = $CHARACTER$ - is_councillor_of = $CHARACTER$ - - # They are our heir/spouse/familyetc. - is_heir_of = $CHARACTER$ - is_consort_of = $CHARACTER$ - is_close_or_extended_family_of = $CHARACTER$ - - #They are the head of our faith - AND = { - exists = $CHARACTER$.faith.religious_head - this = $CHARACTER$.faith.religious_head - } - - # Other relations - has_relation_lover = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_guardian = $CHARACTER$ - has_relation_ward = $CHARACTER$ - has_relation_elder = $CHARACTER$ - has_relation_disciple = $CHARACTER$ - - AND = { - has_employed_any_court_position = yes - any_court_position_holder = { - this = $CHARACTER$ - } - } - } -} - -is_of_major_interest_trigger = { - NOT = { this = $CHARACTER$ } - OR = { - is_heir_of = $CHARACTER$ - is_diarch_of_target = $CHARACTER$ - liege ?= $CHARACTER$ - betrothed ?= $CHARACTER$ - is_spouse_of = $CHARACTER$ - has_relation_soulmate = $CHARACTER$ - has_relation_nemesis = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - has_relation_blood_brother = $CHARACTER$ - is_child_of = $CHARACTER$ - - AND = { - is_theocratic_lessee = yes - is_councillor_of = $CHARACTER$ - } - - #They are the head of our faith - AND = { - exists = $CHARACTER$.faith.religious_head - this = $CHARACTER$.faith.religious_head - } - # Powerful vassals (including fellow) - trigger_if = { - limit = { - top_liege = this - } - any_neighboring_top_liege_realm_owner = { - this = $CHARACTER$ - } - } - # House Head - trigger_if = { - limit = { - exists = $CHARACTER$.house.house_head - } - this = $CHARACTER$.house.house_head - } - # Activity Intents - trigger_if = { - limit = { - exists = involved_activity - exists = intent_target - } - intent_target = $CHARACTER$ - } - # Relations - has_relation_nemesis = $CHARACTER$ - has_relation_soulmate = $CHARACTER$ - has_relation_best_friend = $CHARACTER$ - } -} - -is_of_minor_interest_trigger = { - NOT = { this = $CHARACTER$ } - OR = { - is_consort_of = $CHARACTER$ - is_councillor_of = $CHARACTER$ - has_relation_lover = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_guardian = $CHARACTER$ - has_relation_ward = $CHARACTER$ - has_relation_elder = $CHARACTER$ - has_relation_disciple = $CHARACTER$ - AND = { - $CHARACTER$ = { target_is_liege_or_above = prev } - NOT = { this = $CHARACTER$.liege } - } - is_close_or_extended_family_of = $CHARACTER$ - trigger_if = { - limit = { - exists = liege - exists = $CHARACTER$.liege - } - is_powerful_vassal = yes - liege = $CHARACTER$.liege - } - } -} - -is_of_major_or_minor_interest_trigger = { - OR = { - is_of_major_interest_trigger = { CHARACTER = $CHARACTER$ } - is_of_minor_interest_trigger = { CHARACTER = $CHARACTER$ } - } -} -has_important_relationship_trigger = { - OR = { - has_relation_lover = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_friend = $CHARACTER$ - } -} - -has_friendly_relationship_trigger = { - OR = { - has_relation_lover = $CHARACTER$ - has_relation_friend = $CHARACTER$ - } -} - -has_no_real_status_trigger = { - OR = { - is_lowborn = yes - AND = { - dynasty ?= { - any_dynasty_member = { - count <= 2 - } - } - } - highest_held_title_tier <= tier_barony - } - NOR = { - any_close_or_extended_family_member = { - highest_held_title_tier > tier_barony - } - dynasty.dynasty_prestige_level >= 2 - } - is_clergy = no - is_theocratic_lessee = no - is_claimant = no -} - -has_no_particular_noble_roots_trigger = { - custom_tooltip = { - text = has_no_particular_noble_roots_trigger - OR = { - is_lowborn = yes - dynasty ?= { - any_dynasty_member = { - count <= 2 - } - } - highest_held_title_tier <= tier_barony - government_has_flag = government_is_herder - } - NOR = { - AND = { - highest_held_title_tier > tier_barony - NOT = { government_has_flag = government_is_herder } - } - any_close_or_extended_family_member = { - highest_held_title_tier > tier_barony - NOT = { government_has_flag = government_is_herder } - } - AND = { - exists = dynasty - dynasty.dynasty_prestige_level >= 2 - } - } - } -} - - - -################################### -# Root argument versions -################################### - -is_of_major_interest_to_root_trigger = { - is_of_major_interest_trigger = { - CHARACTER = root - } -} - -is_of_minor_interest_to_root_trigger = { - is_of_minor_interest_trigger = { - CHARACTER = root - } -} - - -############### -# Character Lists -############### - -#Support trigger -major_interest_player_heir_trigger = { - exists = player_heir - NOT = { player_heir = { is_in_list = $LISTNAME$ } } -} - -#Support trigger -major_interest_liege_trigger = { - exists = liege - NOR = { - this = this.liege - liege = { is_in_list = $LISTNAME$ } - } -} - -#Support trigger -major_interest_realm_priest_trigger = { - rite = { rite_has_doctrine = doctrine_theocracy_temporal } - exists = cp:councillor_court_chaplain - NOT = { - cp:councillor_court_chaplain = { is_in_list = $LISTNAME$ } - } -} - -#Support trigger -major_interest_primary_spouse_trigger = { - exists = primary_spouse - NOT = { primary_spouse = { is_in_list = $LISTNAME$ } } -} - - -#Support trigger -major_interest_potential_heirs_trigger = { - player_heir_position = { - target = $CHARACTER$ - value <= 5 - } - NOT = { is_in_list = $LISTNAME$ } -} - -#Makes a list of every character of major interest - #Parameters: - # CHARACTER - the character who the list will be for - # LISTNAME - the name of the list -get_characters_of_major_interest_trigger = { - save_temporary_scope_as = major_root - # 1 - Player heir - trigger_if = { - limit = { - major_interest_player_heir_trigger = { LISTNAME = $LISTNAME$ } - } - player_heir = { add_to_temporary_list = $LISTNAME$ } - } - # 2 - Liege - trigger_if = { - limit = { - major_interest_liege_trigger = { LISTNAME = $LISTNAME$ } - } - liege = { add_to_temporary_list = $LISTNAME$ } - } - # 3 - Realm Priest - trigger_if = { - limit = { - major_interest_realm_priest_trigger = { LISTNAME = $LISTNAME$ } - } - cp:councillor_court_chaplain = { add_to_temporary_list = $LISTNAME$ } - } - # 4 - Primary Spouse - trigger_if = { - limit = { - major_interest_primary_spouse_trigger = { LISTNAME = $LISTNAME$ } - } - primary_spouse = { add_to_temporary_list = $LISTNAME$ } - } - # 5 - Spymaster & # 11 - Other councillors - any_normal_councillor = { - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 6 - Powerful vassals - any_powerful_vassal = { - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 7 - Religious head (Excluded because they're highly context-specific) - # 8 - Potential heirs (Player only) - trigger_if = { - limit = { is_ai = no } - trigger_if = { - limit = { exists = dynasty } - dynasty = { - any_dynasty_member = { - major_interest_potential_heirs_trigger = { LISTNAME = $LISTNAME$ CHARACTER = scope:major_root } - count = all - add_to_temporary_list = $LISTNAME$ - } - } - } - # 9 - Allies (Player only, Enemies are only relevant for content about wars) - any_ally = { - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - } - # 10 - Neighboring rulers (not included in this list, hard to gauge relevance) -} - -#Support trigger -minor_interest_concubines_secondary_spouses_trigger = { - trigger_if = { - limit = { exists = $CHARACTER$.primary_spouse } - NOT = { this = $CHARACTER$.primary_spouse } - } - NOT = { is_in_list = $LISTNAME$ } -} - -#Support trigger -minor_interest_high_tier_vassal_trigger = { - is_powerful_vassal = no #Already included in major -# highest_held_title_tier >= { -# value = liege.highest_held_title_tier -# subtract = 2 -# min = 2 #Must be at least a count -# } - NOT = { is_in_list = $LISTNAME$ } -} - -minor_interest_close_relatives_trigger = { - NOR = { - #Blocking the most common overlap with high prio - AND = { - is_cousin_of = $CHARACTER$ - NOT = { is_close_family_of = $CHARACTER$ } #Because... incest. Sigh. - } - major_interest_potential_heirs_trigger = { CHARACTER = $CHARACTER$ LISTNAME = $LISTNAME$ } - trigger_if = { - limit = { exists = $CHARACTER$.player_heir } - this = $CHARACTER$.player_heir - } - is_in_list = $LISTNAME$ - } -} - -#Support trigger -minor_interest_betrothed_trigger = { - betrothed ?= { NOT = { is_in_list = $LISTNAME$ } } -} - -#Support trigger -minor_interest_skilled_courtiers_trigger = { - OR = { - diplomacy > high_skill_rating - martial > high_skill_rating - stewardship > high_skill_rating - intrigue > high_skill_rating - learning > high_skill_rating - prowess > high_skill_rating - } - average_skill_rating >= average_of_all_skills_and_prowess - NOT = { is_in_list = $LISTNAME$ } -} - -#Support trigger -minor_interest_liege_or_above_trigger = { - NOR = { - this = $CHARACTER$.liege - is_in_list = $LISTNAME$ - } -} - -#Makes a list of every character of minor interest - #Parameters: - # LISTNAME - the name of the list -get_characters_of_minor_interest_trigger = { - save_temporary_scope_as = minor_root - # 1 - Concubines & secondary spouses - any_consort = { - minor_interest_concubines_secondary_spouses_trigger = { CHARACTER = scope:minor_root LISTNAME = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 2 - Direct vassals of high tier - any_vassal = { - minor_interest_high_tier_vassal_trigger = { LISTNAME = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 3 - Betrothed - trigger_if = { - limit = { minor_interest_betrothed_trigger = { LISTNAME = $LISTNAME$ } } - betrothed = { add_to_temporary_list = $LISTNAME$ } - } - # 4 - Lovers - any_relation = { - type = lover - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 5 - Rivals (excluded as they're typically only used in specific contexts) - # 6 - Close relatives - any_close_or_extended_family_member = { - minor_interest_close_relatives_trigger = { CHARACTER = scope:minor_root LISTNAME = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - trigger_if = { #Below is just for players - limit = { is_ai = no } - # 7 - Guardian - any_relation = { - type = guardian - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 8 - Ward - any_relation = { - type = ward - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 9 - Friends - any_relation = { - type = friend - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 10 - Knights - any_knight = { - NOT = { is_in_list = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - # 11 - Highly skilled courtiers (players only) - trigger_if = { - limit = { is_ai = no } - any_courtier = { - minor_interest_skilled_courtiers_trigger = { LISTNAME = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - } - any_liege_or_above = { - minor_interest_liege_or_above_trigger = { CHARACTER = scope:minor_root LISTNAME = $LISTNAME$ } - count = all - add_to_temporary_list = $LISTNAME$ - } - } -} - - - -#Makes a list of all characters of interest - #Parameters: - # CHARACTER - the character the list is for - # LISTNAME - the name of the list -get_characters_of_interest_trigger = { - get_characters_of_major_interest_trigger = { - LISTNAME = $LISTNAME$ - } - get_characters_of_minor_interest_trigger = { - LISTNAME = $LISTNAME$ - } -} - - - -################ -# Potential Enemies -################ - -#Makes a list of characters who are classified as potential enemies - #Parameters - # CHARACTER - The character whose enemies are being found - # LISTNAME - The name of the list -get_potential_enemies_effect = { - $CHARACTER$ = { - trigger_if = { - limit = { - any_vassal = { - always = yes - } - } - any_vassal = { - count = all - add_to_temporary_list = temp_$LISTNAME$ - } - } - trigger_if = { - limit = { - any_relation = { - type = rival - always = yes - } - } - any_relation = { - type = rival - count = all - add_to_temporary_list = temp_$LISTNAME$ - } - } - trigger_if = { - limit = { - top_liege != this - } - liege = { - add_to_temporary_list = temp_$LISTNAME$ - } - } - trigger_if = { - limit = { - top_liege = this - any_neighboring_top_liege_realm_owner = { - always = yes - } - } - any_neighboring_top_liege_realm_owner = { - count = all - add_to_temporary_list = temp_$LISTNAME$ - } - } - #Potential Heirs that do not like you - #A Religious Head that dislikes you and you are powerful enough - - any_in_list = { - count = all - trigger_if = { - limit = { - NOT = { is_in_list = $LISTNAME$ } - OR = { - #Vassal enemies - AND = { - is_vassal_of = $CHARACTER$ - is_powerful = yes - opinion = { - target = $CHARACTER$ - value <= 0 - } - } - #Rivals - has_relation_rival = $CHARACTER$ - #Lieges - AND = { - $CHARACTER$ = { top_liege != this } - this = $CHARACTER$.liege - opinion = { - target = $CHARACTER$ - value <= 0 - } - } - #Neighboring independent rulers - AND = { - any_neighboring_top_liege_realm_owner = { - this = $CHARACTER$ - } - NOT = { is_allied_to = $CHARACTER$ } - OR = { - opinion = { - target = $CHARACTER$ - value <= 20 - } - AND = { - opinion = { - target = $CHARACTER$ - value <= 50 - } - has_any_cb_on = $CHARACTER$ - } - } - } - } - } - add_to_temporary_list = $LISTNAME$ - } - } - } -} - -has_RelationToMe_relation = { - save_temporary_scope_as = relation_check - NOT = { this = $CHARACTER$ } # Don't print our relation to ourselves! - OR = { - is_close_or_extended_family_of = $CHARACTER$ - any_spouse = { - even_if_dead = yes - this = $CHARACTER$ - } - any_spouse = { - even_if_dead = yes - this = $CHARACTER$ - is_concubine = yes - } - $CHARACTER$ = { - player_heir ?= scope:relation_check - } - is_heir_of = $CHARACTER$ - has_relation_rival = $CHARACTER$ - has_relation_lover = $CHARACTER$ - has_relation_friend = $CHARACTER$ - has_relation_bully = $CHARACTER$ - has_relation_victim = $CHARACTER$ - is_councillor_of = $CHARACTER$ - any_spouse = { any_child = { this = $CHARACTER$ } } - any_parent = { any_spouse = { this = $CHARACTER$ } } - any_parent = { any_spouse = { any_child = { this = $CHARACTER$ } } } - liege ?= $CHARACTER$ - this = { is_tributary_of = $CHARACTER$ } - any_courtier = { this = $CHARACTER$ } - any_vassal_or_below = { this = $CHARACTER$ } - AND = { - top_liege != this - $CHARACTER$ = { top_liege != this } - liege = $CHARACTER$.liege - } - AND = { - faith = $CHARACTER$.faith - $CHARACTER$.capital_county.clerical_region_title.holder ?= scope:relation_check - } - has_relation_crush = $CHARACTER$ - has_relation_ward = $CHARACTER$ - has_relation_guardian = $CHARACTER$ - has_relation_mentor = $CHARACTER$ - has_relation_student = $CHARACTER$ - has_relation_elder = $CHARACTER$ - has_relation_disciple = $CHARACTER$ - AND = { - has_employed_any_court_position = yes - any_court_position_holder = { - this = $CHARACTER$ - } - } - $CHARACTER$ = { is_sibling_in_law_of_root_trigger = yes } - AND = { - exists = dynasty - $CHARACTER$ = { exists = dynasty } - dynasty = $CHARACTER$.dynasty - } - $CHARACTER$ = { - any_owned_story = { - type = story_peasant_affair - var:peasant_character = { - this = root - } - } - } - $CHARACTER$ = { - is_courtier_of = scope:relation_check - OR = { - AND = { - inspiration ?= { - inspiration_sponsor = { this = scope:relation_check } - } - } - AND = { - exists = var:created_artifact_for - var:created_artifact_for = scope:relation_check - } - } - } - $CHARACTER$ = { - any_scheme = { - scheme_is_character_agent = root - } - } - is_imprisoned_by = $CHARACTER$ - $CHARACTER$ = { is_imprisoned_by = scope:relation_check } - host ?= $CHARACTER$ - $CHARACTER$ = { - host ?= scope:relation_check - } - superior ?= $CHARACTER$ - $CHARACTER$ = { - superior ?= scope:relation_check - } - is_knight_of = $CHARACTER$ - AND = { - is_female = yes - any_spouse = { - is_child_of = root - } - } - AND = { - is_male = yes - any_spouse = { - is_child_of = root - } - } - } -} diff --git a/common/scripted_triggers/00_religious_triggers.txt b/common/scripted_triggers/00_religious_triggers.txt index eaa5ee720..4b1772f27 100644 --- a/common/scripted_triggers/00_religious_triggers.txt +++ b/common/scripted_triggers/00_religious_triggers.txt @@ -58,11 +58,7 @@ has_strong_religious_conviction_trigger = { } is_christian_trigger = { - trigger_if = { - limit = { exists = faith } - faith ?= { OR = { religion_tag = eastern_orthodox_religion religion_tag = catholic_religion religion_tag = protestant_religion religion_tag = oriental_orthodox_religion } } - } - trigger_else = { always = no } + faith = { OR = { religion_tag = eastern_orthodox_religion religion_tag = catholic_religion religion_tag = protestant_religion religion_tag = oriental_orthodox_religion } } } # Not-non-XYZ triggers allow us to check for specific historical faiths whilst still defaulting to something positive for variant faiths. @@ -121,39 +117,28 @@ can_be_combatant_based_on_gender_trigger = { } trigger_if = { limit = { - exists = $ARMY_OWNER$.culture - trigger_if = { - limit = { exists = $ARMY_OWNER$.culture } - $ARMY_OWNER$.culture ?= { has_cultural_parameter = martial_custom_male_only_combatant } - } + $ARMY_OWNER$.culture = { has_cultural_parameter = martial_custom_male_only_combatant } } is_male = yes } trigger_else_if = { limit = { - exists = $ARMY_OWNER$.culture - trigger_if = { - limit = { exists = $ARMY_OWNER$.culture } - $ARMY_OWNER$.culture ?= { has_cultural_parameter = martial_custom_female_only_combatant } - } + $ARMY_OWNER$.culture = { has_cultural_parameter = martial_custom_female_only_combatant } } is_female = yes } trigger_else = {} } trigger_else = { # Does not have the Royal Court and thus combatant is governed by faith - trigger_if = { - limit = { exists = $ARMY_OWNER$.rite } - OR = { - $ARMY_OWNER$.rite ?= { rite_has_parameter = combatant_can_be_either_gender_if_no_roco } - AND = { - $ARMY_OWNER$.rite ?= { rite_has_parameter = combatant_must_be_male_if_no_roco } - is_male = yes - } - AND = { - $ARMY_OWNER$.rite ?= { rite_has_parameter = combatant_must_be_female_if_no_roco } - is_female = yes - } + OR = { + $ARMY_OWNER$.rite = { rite_has_parameter = combatant_can_be_either_gender_if_no_roco } + AND = { + $ARMY_OWNER$.rite = { rite_has_parameter = combatant_must_be_male_if_no_roco } + is_male = yes + } + AND = { + $ARMY_OWNER$.rite = { rite_has_parameter = combatant_must_be_female_if_no_roco } + is_female = yes } } } @@ -161,7 +146,7 @@ can_be_combatant_based_on_gender_trigger = { # No need to gender diversify this: if they're a right-gender shieldperson of the culture, then they've already got permission to fight from the previous AND conditions. has_trait = shieldmaiden $ARMY_OWNER$ = { - culture ?= { has_cultural_parameter = has_access_to_shieldmaidens } + culture = { has_cultural_parameter = has_access_to_shieldmaidens } } } # Event-based special exceptions @@ -171,12 +156,12 @@ can_be_combatant_based_on_gender_trigger = { } AND = { prowess >= 10 - $ARMY_OWNER$.culture ?= { has_cultural_parameter = high_prowess_ignores_knight_restrictions } - NOT = { $ARMY_OWNER$.culture ?= { has_cultural_parameter = minimum_prowess_for_knights } } + $ARMY_OWNER$.culture = { has_cultural_parameter = high_prowess_ignores_knight_restrictions } + NOT = { $ARMY_OWNER$.culture = { has_cultural_parameter = minimum_prowess_for_knights } } } AND = { prowess >= 12 - $ARMY_OWNER$.culture ?= { + $ARMY_OWNER$.culture = { has_cultural_parameter = high_prowess_ignores_knight_restrictions has_cultural_parameter = minimum_prowess_for_knights } @@ -193,31 +178,17 @@ can_be_combatant_based_on_gender_trigger = { object = this subject = $ARMY_OWNER$ OR = { - trigger_if = { - limit = { exists = rite } - rite ?= { rite_has_parameter = clergy_can_fight } - } - trigger_else = { always = no } + rite = { rite_has_parameter = clergy_can_fight } AND = { has_personal_tenet_flag = clergy_can_fight_personal - trigger_if = { - limit = { exists = rite } - NOT = { rite ?= { rite_has_parameter = pacifist } } + NOT = { + rite = { rite_has_parameter = pacifist } } - trigger_else = { always = no } } - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = culture_clergy_can_fight } - } - trigger_else = { always = no } + culture = { has_cultural_parameter = culture_clergy_can_fight } AND = { - $ARMY_OWNER$ = { - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = high_prowess_ignores_knight_restrictions } - } - trigger_else = { always = no } + $ARMY_OWNER$.culture = { + has_cultural_parameter = high_prowess_ignores_knight_restrictions } prowess >= 10 } @@ -230,14 +201,14 @@ clergy_can_fight_check_trigger = { trigger_if = { limit = { is_clergy = yes } OR = { - rite ?= { rite_has_parameter = clergy_can_fight } + rite = { rite_has_parameter = clergy_can_fight } AND = { has_personal_tenet_flag = clergy_can_fight_personal NOT = { - rite ?= { rite_has_parameter = pacifist } + rite = { rite_has_parameter = pacifist } } } - culture ?= { has_cultural_parameter = culture_clergy_can_fight } + culture = { has_cultural_parameter = culture_clergy_can_fight } } } } @@ -245,14 +216,14 @@ clergy_can_fight_check_trigger = { can_be_clergy_due_to_gender_trigger = { OR = { AND = { - rite ?= { rite_has_parameter = clergy_must_be_female } + rite = { rite_has_parameter = clergy_must_be_female } is_female = yes } AND = { - rite ?= { rite_has_parameter = clergy_must_be_male } + rite = { rite_has_parameter = clergy_must_be_male } is_male = yes } - rite ?= { rite_has_parameter = clergy_can_be_either_gender } + rite = { rite_has_parameter = clergy_can_be_either_gender } } } @@ -272,7 +243,7 @@ is_wrong_gender_in_rite_trigger = { faith_is_aniconic_trigger = { OR = { faith.religion = religion:islam_religion - rite ?= { rite_has_tenet = tenet_aniconism } + rite = { rite_has_tenet = tenet_aniconism } } } @@ -284,10 +255,10 @@ relation_with_character_is_incestuous_in_rite_trigger = { $RITE$ = { rite_has_parameter = consanguinity_restricted_dynastic_marriage } is_lowborn = no $CHARACTER$.dynasty ?= dynasty - } + } #doctrine_consanguinity_restricted; absolutely no family business AND = { - $RITE$ = { rite_has_doctrine = doctrine_consanguinity_restricted } + $RITE$ = { rite_has_parameter = consanguinity_restricted_close_kin_incest } is_close_or_extended_family_of = $CHARACTER$ #[parents, children, siblings, grandparents, grandchildren, cousins, uncles, aunts, nephews, nieces] } #doctrine_consanguinity_cousins; the only acceptable incest is with your cousin @@ -310,26 +281,26 @@ relation_with_character_is_incestuous_in_rite_trigger = { #Note: only checks from the viewpoint of current scope. Needs CHARACTER relation_with_character_is_incestuous_in_my_faith_trigger = { - faith.main_rite ?= { save_temporary_scope_as = my_rite } + faith.main_rite = { save_temporary_scope_as = my_rite } relation_with_character_is_incestuous_in_rite_trigger = { CHARACTER = $CHARACTER$ RITE = scope:my_rite } } relation_with_character_is_incestuous_in_my_rite_trigger = { - rite ?= { save_temporary_scope_as = my_rite } + rite = { save_temporary_scope_as = my_rite } relation_with_character_is_incestuous_in_rite_trigger = { CHARACTER = $CHARACTER$ RITE = scope:my_rite } } relation_with_character_is_incestuous_in_my_or_lieges_rite_trigger = { OR = { AND = { - rite ?= { #My rite doesn't approve + rite = { #My rite doesn't approve save_temporary_scope_as = check_rite } relation_with_character_is_incestuous_in_rite_trigger = { CHARACTER = $CHARACTER$ RITE = scope:check_rite } } AND = { #Liege's rite doesn't approve liege ?= { - rite ?= { + rite = { save_temporary_scope_as = check_rite } } @@ -354,7 +325,7 @@ rite_allows_marriage_consanguinity_trigger = { relation_between_characters_is_sodomy_in_my_rite_trigger = { $CHARACTER_1$ = { is_male = yes } $CHARACTER_2$ = { is_male = yes } - rite ?= { + rite = { NOT = { rite_has_parameter = homosexuality_accepted } } } @@ -369,7 +340,7 @@ relation_with_character_is_sodomy_in_rite_trigger = { #Note: only checks from the viewpoint of current scope. Needs CHARACTER relation_with_character_is_sodomy_by_my_rite_trigger = { - rite ?= { save_temporary_scope_as = my_rite } + rite = { save_temporary_scope_as = my_rite } relation_with_character_is_sodomy_in_rite_trigger = { CHARACTER = $CHARACTER$ RITE = scope:my_rite @@ -379,14 +350,14 @@ relation_with_character_is_sodomy_by_my_rite_trigger = { relation_with_character_is_sodomy_in_my_or_lieges_rite_trigger = { OR = { AND = { - rite ?= { #My rite doesn't approve + rite = { #My rite doesn't approve save_temporary_scope_as = check_rite } relation_with_character_is_sodomy_in_rite_trigger = { CHARACTER = $CHARACTER$ RITE = scope:check_rite } } AND = { #Liege's rite doesn't approve liege ?= { - rite ?= { + rite = { save_temporary_scope_as = check_rite } } @@ -405,7 +376,7 @@ murdering_character_is_kinslaying_in_rite_trigger = { murdering_character_is_kinslaying_in_my_or_same_dynasty_lieges_rite_trigger = { save_temporary_scope_as = kinslayer_me - rite ?= { + rite = { save_temporary_scope_as = check_rite } trigger_if = { @@ -413,7 +384,7 @@ murdering_character_is_kinslaying_in_my_or_same_dynasty_lieges_rite_trigger = { liege ?= { dynasty = scope:kinslayer_me.dynasty } } liege = { - rite ?= { + rite = { save_temporary_scope_as = check_rite_liege } } @@ -566,14 +537,14 @@ trait_is_shunned_or_criminal_in_rite_trigger = { trait_is_shunned_or_criminal_in_my_or_lieges_rite_trigger = { OR = { AND = { - rite ?= { #My rite doesn't approve + rite = { #My rite doesn't approve save_temporary_scope_as = check_rite } trait_is_shunned_or_criminal_in_rite_trigger = { TRAIT = $TRAIT$ RITE = scope:check_rite GENDER_CHARACTER = $GENDER_CHARACTER$ } } AND = { #Liege's rite doesn't approve liege ?= { - rite ?= { + rite = { save_temporary_scope_as = check_rite } } @@ -807,7 +778,7 @@ has_negative_attitude_towards_trait_trigger = { } } - rite ?= { save_temporary_scope_as = my_rite } + rite = { save_temporary_scope_as = my_rite } OR = { trait_is_shunned_in_rite_trigger = { TRAIT = $TRAIT$ RITE = scope:my_rite GENDER_CHARACTER = $GENDER_CHARACTER$ } trait_is_criminal_in_rite_trigger = { TRAIT = $TRAIT$ RITE = scope:my_rite GENDER_CHARACTER = $GENDER_CHARACTER$ } @@ -976,7 +947,7 @@ faiths_are_in_orthodox_christianity_group = { refusing_conversion_is_crime_trigger = { OR = { # has_title = title:e_minister_of_rites - rite ?= { + rite = { trigger_if = { # Only apply imprisonment reason if actor's rite is not the state rite limit = { $CHARACTER$ = { @@ -1007,10 +978,10 @@ refusing_conversion_is_crime_trigger = { character_can_create_holy_order_basic_trigger = { NOR = { - faith ?= { + faith = { has_doctrine_parameter = immaterial_harmony_no_holy_orders } - faith ?= { + faith = { any_faith_holy_order = { #Can be monastic patron and found military order leader ?= { @@ -1034,11 +1005,11 @@ is_hostile_enough_for_holy_war_trigger = { # Character scope: may this attacker press a religious war against TARGET? is_valid_religious_war_target_trigger = { OR = { - rite ?= { is_hostile_enough_for_holy_war_trigger = { RITE = $TARGET$.rite } } + rite = { is_hostile_enough_for_holy_war_trigger = { RITE = $TARGET$.rite } } AND = { - rite ?= { rite_has_parameter = literalism_holy_war_cb_active } + rite = { rite_has_parameter = literalism_holy_war_cb_active } religion = $TARGET$.religion - NOT = { $TARGET$.rite ?= { rite_has_tenet = tenet_literalism } } + NOT = { $TARGET$.rite = { rite_has_tenet = tenet_literalism } } } } } @@ -1182,7 +1153,7 @@ religion_has_circumcision_trigger = { is_heretic_trigger = { $WHO$.faith.religion = $TARGET$.faith.religion - $WHO$.faith ?= { + $WHO$.faith = { faith_hostility_level = { target = $TARGET$.faith value >= religious_cb_enabled_hostility_level @@ -1192,10 +1163,10 @@ is_heretic_trigger = { is_heathen_trigger = { NOT = { $WHO$.faith.religion = $TARGET$.faith.religion } - $TARGET$.faith ?= { + $TARGET$.faith = { has_doctrine = pagan_hostility_doctrine } - $WHO$.faith ?= { + $WHO$.faith = { faith_hostility_level = { target = $TARGET$.faith value >= religious_cb_enabled_hostility_level @@ -1205,10 +1176,10 @@ is_heathen_trigger = { is_infidel_trigger = { NOT = { $WHO$.faith.religion = $TARGET$.faith.religion } - $TARGET$.faith ?= { + $TARGET$.faith = { NOT = { has_doctrine = pagan_hostility_doctrine } } - $WHO$.faith ?= { + $WHO$.faith = { faith_hostility_level = { target = $TARGET$.faith value >= religious_cb_enabled_hostility_level @@ -1287,6 +1258,19 @@ valid_demand_conversion_conditions_trigger = { text = cannot_take_overt_hostile_actions_against_diarch.tt NOT = { scope:recipient ?= scope:puppet_or_actor.diarch } } + custom_tooltip = { + text = demand_conversion_clerical_region_capital_faith_tt + NOT = { + scope:recipient = { + any_held_title = { + has_clerical_region = yes + title_capital_county = { + faith != scope:puppet_or_actor.faith + } + } + } + } + } } valid_ask_for_conversion_conditions_trigger = { # Deliberate variant of the above, so you can ask your diarch nicely to convert if you made a new faith @@ -1353,6 +1337,19 @@ valid_ask_for_conversion_conditions_trigger = { # Deliberate variant of the abov } } } + custom_tooltip = { + text = demand_conversion_clerical_region_capital_faith_tt + NOT = { + scope:recipient = { + any_held_title = { + has_clerical_region = yes + title_capital_county = { + faith != scope:actor.faith + } + } + } + } + } } highgod_is_passive_trigger = { @@ -1378,7 +1375,7 @@ fertilitygod_is_active_trigger = { ###REINCARNATION### can_become_reincarnation_trigger = { save_temporary_scope_as = reincarnated_child - rite ?= { + rite = { rite_has_tenet = tenet_reincarnation } any_parent = { @@ -1574,7 +1571,7 @@ can_create_head_of_faith_title_trigger = { can_perform_the_hajj_trigger = { faith.religion = religion:islam_religion - rite ?= { rite_has_parameter = can_go_on_pilgrimage } + rite = { rite_has_parameter = can_go_on_pilgrimage } } shared_faith_or_hof_trigger = { @@ -1781,7 +1778,7 @@ holy_order_1010_request_target_trigger = { } faith_dominant_gender_male_or_equal = { - rite ?= { + rite = { OR = { rite_has_parameter = male_dominated_law rite_has_parameter = gender_equal_law @@ -1790,7 +1787,7 @@ faith_dominant_gender_male_or_equal = { } faith_dominant_gender_female_or_equal = { - rite ?= { + rite = { OR = { rite_has_parameter = female_dominated_law rite_has_parameter = gender_equal_law @@ -1841,32 +1838,32 @@ would_be_sinful_adulterer_trigger = { trigger_if = { limit = { is_male = yes } NOT = { - rite ?= { rite_has_doctrine = doctrine_adultery_men_accepted } + rite = { rite_has_doctrine = doctrine_adultery_men_accepted } } } trigger_else = { NOT = { - rite ?= { rite_has_doctrine = doctrine_adultery_women_accepted } + rite = { rite_has_doctrine = doctrine_adultery_women_accepted } } } } has_tolerant_faith_or_culture_trigger = { OR = { - rite ?= { rite_has_doctrine = doctrine_pluralism_pluralistic } - culture ?= { has_cultural_parameter = less_likely_to_force_conversion } - culture ?= { has_cultural_tradition = tradition_religion_blending } + rite = { rite_has_doctrine = doctrine_pluralism_pluralistic } + culture = { has_cultural_parameter = less_likely_to_force_conversion } + culture = { has_cultural_tradition = tradition_religion_blending } has_trait = nomadic_philosophy } } is_open_to_inviting_other_faiths_trigger = { OR = { - rite ?= { rite_has_tenet = tenet_adaptive } - faith ?= { has_doctrine = unreformed_faith_doctrine } - rite ?= { rite_has_doctrine = doctrine_pluralism_pluralistic } - culture ?= { has_cultural_tradition = tradition_religion_blending } - culture ?= { has_cultural_tradition = tradition_tgp_religious_hospitality } + rite = { rite_has_tenet = tenet_adaptive } + faith = { has_doctrine = unreformed_faith_doctrine } + rite = { rite_has_doctrine = doctrine_pluralism_pluralistic } + culture = { has_cultural_tradition = tradition_religion_blending } + culture = { has_cultural_tradition = tradition_tgp_religious_hospitality } } } @@ -1877,7 +1874,7 @@ faith_is_open_minded_trigger = { } } -is_mainstream_jewish_faith ?= { +is_mainstream_jewish_faith = { religion = religion:judaism_religion # NOT = { # this = faith:samaritan @@ -1887,8 +1884,8 @@ is_mainstream_jewish_faith ?= { # } } -is_unprotected_hostile_faith ?= { # Checks if the faith is at least hostile but not protected by a contract, used in a county scope - faith ?= { +is_unprotected_hostile_faith = { # Checks if the faith is at least hostile but not protected by a contract, used in a county scope + faith = { faith_hostility_level = { target = prev.holder.top_liege.faith value >= 2 @@ -1919,7 +1916,7 @@ islam_or_syncretic_with_islam_trigger = { $CHARACTER$ = { OR = { faith.religion = religion:islam_religion - rite ?= { rite_has_parameter = islamic_syncretic_actor } + rite = { rite_has_parameter = islamic_syncretic_actor } } } } @@ -1928,7 +1925,7 @@ judaism_or_syncretic_with_judaism_trigger = { $CHARACTER$ = { OR = { faith.religion = religion:judaism_religion - rite ?= { rite_has_parameter = jewish_syncretic_actor } + rite = { rite_has_parameter = jewish_syncretic_actor } } } } @@ -1938,19 +1935,19 @@ christianity_or_syncretic_with_christianity_trigger = { OR = { OR = { faith.religion = religion:oriental_orthodox_religion - rite ?= { rite_has_parameter = christian_syncretic_actor } + rite = { rite_has_parameter = christian_syncretic_actor } } OR = { faith.religion = religion:eastern_orthodox_religion - rite ?= { rite_has_parameter = christian_syncretic_actor } + rite = { rite_has_parameter = christian_syncretic_actor } } OR = { faith.religion = religion:catholic_religion - rite ?= { rite_has_parameter = christian_syncretic_actor } + rite = { rite_has_parameter = christian_syncretic_actor } } OR = { faith.religion = religion:protestant_religion - rite ?= { rite_has_parameter = christian_syncretic_actor } + rite = { rite_has_parameter = christian_syncretic_actor } } } } @@ -1959,8 +1956,8 @@ christianity_or_syncretic_with_christianity_trigger = { unreformed_or_syncretic_with_unreformed_trigger = { $CHARACTER$ = { OR = { - faith ?= { has_doctrine_parameter = unreformed } - rite ?= { rite_has_parameter = unreformed_syncretic_actor } + faith = { has_doctrine_parameter = unreformed } + rite = { rite_has_parameter = unreformed_syncretic_actor } } } } @@ -1969,7 +1966,7 @@ zoroastrian_or_syncretic_with_eastern_trigger = { $CHARACTER$ = { OR = { faith.religion = religion:zoroastrianism_religion - rite ?= { rite_has_parameter = eastern_syncretic_actor } + rite = { rite_has_parameter = eastern_syncretic_actor } } } } @@ -1978,7 +1975,7 @@ eastern_or_syncretic_with_eastern_trigger = { $CHARACTER$ = { OR = { faith.religion = { is_in_family = rf_eastern } - rite ?= { rite_has_parameter = eastern_syncretic_actor } + rite = { rite_has_parameter = eastern_syncretic_actor } } } } @@ -1987,7 +1984,7 @@ sinitic_or_syncretic_with_sinitic_trigger = { $CHARACTER$ = { OR = { faith.religion = { is_in_family = rf_sinitic } - rite ?= { rite_has_parameter = sinitic_syncretic_actor } + rite = { rite_has_parameter = sinitic_syncretic_actor } } } } @@ -1996,7 +1993,7 @@ hindu_or_syncretic_with_eastern_trigger = { $CHARACTER$ = { OR = { faith.religion = religion:hinduism_religion - rite ?= { rite_has_parameter = eastern_syncretic_actor } + rite = { rite_has_parameter = eastern_syncretic_actor } } } } @@ -2005,26 +2002,26 @@ jain_or_syncretic_with_eastern_trigger = { $CHARACTER$ = { OR = { faith.religion = religion:jainism_religion - rite ?= { rite_has_parameter = eastern_syncretic_actor } + rite = { rite_has_parameter = eastern_syncretic_actor } } } } holy_site_adoptable_by_character_trigger = { - any_holy_site_faith ?= { + any_holy_site_faith = { save_temporary_scope_as = compare_faith OR = { - $CHARACTER$.rite ?= { rite_has_parameter = allow_adopt_any_holy_site } + $CHARACTER$.rite = { rite_has_parameter = allow_adopt_any_holy_site } AND = { OR = { religion = $CHARACTER$.faith.religion - $CHARACTER$.faith ?= { + $CHARACTER$.faith = { faith_is_syncretic_with = { FAITH = scope:compare_faith } } } - $CHARACTER$.faith ?= { + $CHARACTER$.faith = { faith_hostility_level = { target = prev value <= faith_astray_level @@ -2146,7 +2143,7 @@ unique_christology_personal_trigger = { #Used on faiths is_dharmic_faith_trigger = { OR = { -# religion = religion:hinduism_religion + religion = religion:hinduism_religion religion = religion:buddhism_religion # religion = religion:jainism_religion } @@ -2161,7 +2158,7 @@ is_faith_dominant_gender = { OR = { AND = { is_male = yes - rite ?= { + rite = { OR = { rite_has_parameter = male_dominated_law rite_has_parameter = gender_equal_law @@ -2170,7 +2167,7 @@ is_faith_dominant_gender = { } AND = { is_female = yes - rite ?= { + rite = { OR = { rite_has_parameter = female_dominated_law rite_has_parameter = gender_equal_law @@ -2181,99 +2178,78 @@ is_faith_dominant_gender = { } religion_is_broadly_asian_trigger = { - trigger_if = { - limit = { exists = faith } - OR = { - religion_is_east_asian_trigger = yes - broadly_dharmic_trigger = yes - broadly_chinese_religion_trigger = yes - } - } - trigger_else = { - always = no + OR = { + religion_is_east_asian_trigger = yes + broadly_dharmic_trigger = yes + broadly_chinese_religion_trigger = yes } } neow_faith_is_eastern_trigger = { - trigger_if = { - limit = { exists = faith } - faith ?= { religion = { is_in_family = rf_eastern } } - } - trigger_else = { - always = no - } + faith = { religion = { is_in_family = rf_eastern } } } religion_is_east_asian_trigger = { - trigger_if = { - limit = { exists = faith } - OR = { - faith.religion = religion:buddhism_religion - faith.religion = religion:confucianism_religion - faith.religion = religion:taoism_religion - faith.religion = religion:shintoism_religion - } - } - trigger_else = { - always = no + OR = { + faith.religion = religion:buddhism_religion + faith.religion = religion:confucianism_religion + faith.religion = religion:taoism_religion + faith.religion = religion:shintoism_religion } } religion_is_non_norse_european_pagan_trigger = { - trigger_if = { - limit = { exists = faith } - OR = { - faith.religion = religion:baltic_religion - faith.religion = religion:finno_ugric_religion - faith.religion = religion:germanic_religion - faith.religion = religion:paganism_religion - faith.religion = religion:slavic_religion - } - } - trigger_else = { - always = no + OR = { + faith.religion = religion:baltic_religion + faith.religion = religion:finno_ugric_religion + faith.religion = religion:germanic_religion + faith.religion = religion:paganism_religion + faith.religion = religion:slavic_religion } } non_dharmic_east_asia_trigger = { - trigger_if = { - limit = { exists = faith } - OR = { - faith.religion = religion:shintoism_religion - faith.religion = religion:dualism_religion - faith.religion = religion:bon_religion - faith.religion = religion:dab_qhuas_religion - faith.religion = religion:aluk_religion - faith.religion = religion:dayawism_religion - faith.religion = religion:hantuism_religion - faith.religion = religion:kaharingan_religion - faith.religion = religion:satsana_phi_religion - faith.religion = religion:tolotang_religion - faith.religion = religion:utaki_religion - faith.religion = religion:bimoism_religion - faith.religion = religion:moism_religion - faith.religion = religion:muism_religion - faith.religion = religion:qiangic_religion - } + OR = { + faith.religion = religion:shintoism_religion + faith.religion = religion:dualism_religion + faith.religion = religion:bon_religion + faith.religion = religion:dab_qhuas_religion + faith.religion = religion:aluk_religion + faith.religion = religion:dayawism_religion + faith.religion = religion:hantuism_religion + faith.religion = religion:kaharingan_religion + faith.religion = religion:satsana_phi_religion + faith.religion = religion:tolotang_religion + faith.religion = religion:utaki_religion + faith.religion = religion:bimoism_religion + faith.religion = religion:moism_religion + faith.religion = religion:muism_religion + faith.religion = religion:qiangic_religion } - trigger_else = { - always = no +} + +religion_uses_east_asian_temple_trigger = { + OR = { + religion = religion:shintoism_religion + religion = religion:muism_religion + religion = religion:utaki_religion + religion = religion:qiangic_religion + religion = religion:bon_religion + religion = religion:dab_qhuas_religion + religion = religion:bimoism_religion + religion = religion:moism_religion + religion = religion:satsana_phi_religion + faith = faith:manichaean_faith } } religion_is_pagan_steppe = { - trigger_if = { - limit = { exists = faith } - OR = { - faith.religion = religion:tengrism_religion - faith.religion = religion:magyar_religion - faith.religion = religion:siberian_religion - faith.religion = religion:shamanism_religion - faith.religion = religion:kamuyism_religion - } - } - trigger_else = { - always = no + OR = { + faith.religion = religion:tengrism_religion + faith.religion = religion:magyar_religion + faith.religion = religion:siberian_religion + faith.religion = religion:shamanism_religion + faith.religion = religion:kamuyism_religion } } @@ -2299,14 +2275,8 @@ broadly_dharmic_faith_trigger = { } broadly_dharmic_trigger = { - trigger_if = { - limit = { exists = faith } - faith ?= { - broadly_dharmic_faith_trigger = yes - } - } - trigger_else = { - always = no + faith = { + broadly_dharmic_faith_trigger = yes } } @@ -2453,7 +2423,7 @@ character_considered_morally_dubious_trigger = { $RITE$ = { save_temporary_scope_as = moral_dubious_judge_rite } - scope:moral_dubious_judge_rite ?= { + scope:moral_dubious_judge_rite = { "rite_hostility_level(scope:judged.rite)" >= faith_evil_level } } @@ -2765,11 +2735,11 @@ rite_embraces_the_secular_flesh_trigger = { OR = { AND = { trait_is_virtue_rite = lustful - $CHARACTER$.rite ?= { NOT = { trait_is_virtue_rite = lustful } } + $CHARACTER$.rite = { NOT = { trait_is_virtue_rite = lustful } } } AND = { trait_is_sin_rite = chaste - $CHARACTER$.rite ?= { NOT = { trait_is_sin_rite = chaste } } + $CHARACTER$.rite = { NOT = { trait_is_sin_rite = chaste } } } #you are a gay person... and their take on the gays is better than yours trigger_if = { @@ -2779,14 +2749,14 @@ rite_embraces_the_secular_flesh_trigger = { has_sexuality = homosexual has_sexuality = bisexual } - rite ?= { NOT = { rite_has_parameter = homosexuality_accepted } } + rite = { NOT = { rite_has_parameter = homosexuality_accepted } } } } OR = { rite_has_parameter = homosexuality_accepted AND = { rite_has_parameter = homosexuality_shunned - $CHARACTER$.rite ?= { rite_has_parameter = homosexuality_illegal } + $CHARACTER$.rite = { rite_has_parameter = homosexuality_illegal } } } } @@ -2795,14 +2765,14 @@ rite_embraces_the_secular_flesh_trigger = { limit = { $CHARACTER$ = { is_female = yes - rite ?= { NOT = { rite_has_parameter = adultery_female_accepted } } + rite = { NOT = { rite_has_parameter = adultery_female_accepted } } } } OR = { rite_has_parameter = adultery_female_accepted AND = { rite_has_parameter = adultery_female_shunned - $CHARACTER$.rite ?= { rite_has_parameter = adultery_female_crime } + $CHARACTER$.rite = { rite_has_parameter = adultery_female_crime } } } } @@ -2811,14 +2781,14 @@ rite_embraces_the_secular_flesh_trigger = { limit = { $CHARACTER$ = { is_male = yes - rite ?= { NOT = { rite_has_parameter = adultery_male_accepted } } + rite = { NOT = { rite_has_parameter = adultery_male_accepted } } } } OR = { rite_has_parameter = adultery_male_accepted AND = { rite_has_parameter = adultery_male_shunned - $CHARACTER$.rite ?= { rite_has_parameter = adultery_male_crime } + $CHARACTER$.rite = { rite_has_parameter = adultery_male_crime } } } } @@ -2829,11 +2799,11 @@ rite_forbids_the_secular_flesh_trigger = { OR = { AND = { trait_is_virtue_rite = chaste - $CHARACTER$.rite ?= { NOT = { trait_is_virtue_rite = chaste } } + $CHARACTER$.rite = { NOT = { trait_is_virtue_rite = chaste } } } AND = { trait_is_sin_rite = lustful - $CHARACTER$.rite ?= { NOT = { trait_is_sin_rite = lustful } } + $CHARACTER$.rite = { NOT = { trait_is_sin_rite = lustful } } } #you are a gay person... and their take on the gays is crueler than yours trigger_if = { @@ -2843,14 +2813,14 @@ rite_forbids_the_secular_flesh_trigger = { has_sexuality = homosexual has_sexuality = bisexual } - rite ?= { NOT = { rite_has_parameter = homosexuality_illegal } } + rite = { NOT = { rite_has_parameter = homosexuality_illegal } } } } OR = { rite_has_parameter = homosexuality_illegal AND = { rite_has_parameter = homosexuality_shunned - $CHARACTER$.rite ?= { rite_has_parameter = homosexuality_accepted } + $CHARACTER$.rite = { rite_has_parameter = homosexuality_accepted } } } } @@ -2859,14 +2829,14 @@ rite_forbids_the_secular_flesh_trigger = { limit = { $CHARACTER$ = { is_female = yes - rite ?= { NOT = { rite_has_parameter = adultery_female_crime } } + rite = { NOT = { rite_has_parameter = adultery_female_crime } } } } OR = { rite_has_parameter = adultery_female_crime AND = { rite_has_parameter = adultery_female_shunned - $CHARACTER$.rite ?= { rite_has_parameter = adultery_female_accepted } + $CHARACTER$.rite = { rite_has_parameter = adultery_female_accepted } } } } @@ -2875,14 +2845,14 @@ rite_forbids_the_secular_flesh_trigger = { limit = { $CHARACTER$ = { is_male = yes - rite ?= { NOT = { rite_has_parameter = adultery_male_crime } } + rite = { NOT = { rite_has_parameter = adultery_male_crime } } } } OR = { rite_has_parameter = adultery_male_crime AND = { rite_has_parameter = adultery_male_shunned - $CHARACTER$.rite ?= { rite_has_parameter = adultery_male_accepted } + $CHARACTER$.rite = { rite_has_parameter = adultery_male_accepted } } } } @@ -2948,8 +2918,8 @@ demand_divorce_marriage_polygamous_trigger = { this = $SPOUSE$ } } - $SPOUSE$.culture ?= { NOT = { has_cultural_tradition = tradition_polygamous } } - $SPOUSE$.rite ?= { NOT = { rite_has_doctrine = doctrine_polygamy } } + $SPOUSE$.culture = { NOT = { has_cultural_tradition = tradition_polygamous } } + $SPOUSE$.rite = { NOT = { rite_has_doctrine = doctrine_polygamy } } } demand_divorce_marriage_offensive_trigger = { @@ -2990,7 +2960,7 @@ rite_growth_in_founder_spread_area_trigger = { OR = { AND = { is_landed = yes - faith ?= { has_doctrine_parameter = has_clerical_regions } + faith = { has_doctrine_parameter = has_clerical_regions } exists = capital_county.clerical_region_title scope:founder.capital_county.clerical_region_title ?= capital_county.clerical_region_title } @@ -3090,13 +3060,13 @@ rite_growth_founder_is_well_versed_trigger = { rite_growth_tenet_is_unique_to_new_rite_trigger = { save_temporary_scope_as = candidate_tenet - scope:source_rite ?= { NOT = { rite_has_tenet = scope:candidate_tenet } } + scope:source_rite = { NOT = { rite_has_tenet = scope:candidate_tenet } } } rite_growth_doctrine_is_unique_to_new_rite_trigger = { save_temporary_scope_as = candidate_doctrine - scope:new_rite ?= { rite_has_doctrine = scope:candidate_doctrine } - scope:source_rite ?= { NOT = { rite_has_doctrine = scope:candidate_doctrine } } + scope:new_rite = { rite_has_doctrine = scope:candidate_doctrine } + scope:source_rite = { NOT = { rite_has_doctrine = scope:candidate_doctrine } } } rite_growth_founder_is_meaningful_relation_trigger = { @@ -3124,7 +3094,7 @@ can_edit_rite_trigger = { is_at_war = no custom_tooltip = { text = ecumenical_council_already_ongoing_tt - NOT = { faith ?= { has_variable = ecumenical_council_ongoing } } + NOT = { faith = { has_variable = ecumenical_council_ongoing } } } trigger_if = { limit = { @@ -3140,7 +3110,7 @@ can_edit_rite_trigger = { trigger_if = { limit = { - rite ?= { + rite = { rite_has_doctrine = doctrine_theocracy_temporal } is_clergy = no @@ -3171,7 +3141,7 @@ can_edit_rite_trigger = { trigger_if = { limit = { - faith ?= { has_doctrine_parameter = unreformed } + faith = { has_doctrine_parameter = unreformed } } NOT = { @@ -3197,13 +3167,18 @@ can_edit_rite_trigger = { text = empire_faith_gate_reformation_piety_level piety_level >= 2 } - custom_tooltip = { - text = empire_faith_gate_reformation_tribal_authority - has_realm_law = tribal_authority_3 + trigger_if = { + limit = { + government_has_flag = government_is_tribal + } + custom_tooltip = { + text = empire_faith_gate_reformation_tribal_authority + has_realm_law = tribal_authority_3 + } } custom_tooltip = { text = empire_faith_gate_reformation_holy_site - faith ?= { + faith = { any_holy_site_barony = { count >= 3 county.holder = { @@ -3215,7 +3190,7 @@ can_edit_rite_trigger = { } # Vanilla: 3 holy sites trigger_else = { - faith ?= { + faith = { num_realm_holy_sites_faithful_holders = { CHARACTER = root COUNT = 3 @@ -3226,7 +3201,7 @@ can_edit_rite_trigger = { custom_tooltip = { text = faith_reformation_via_decision - faith ?= { + faith = { NOT = { has_variable = block_reformation_var } } } @@ -3253,7 +3228,7 @@ can_create_rite_trigger = { trigger_if = { limit = { - rite ?= { + rite = { rite_has_doctrine = doctrine_theocracy_temporal } is_clergy = no @@ -3284,7 +3259,7 @@ can_create_rite_trigger = { trigger_if = { limit = { - faith ?= { has_doctrine_parameter = unreformed } + faith = { has_doctrine_parameter = unreformed } } NOT = { @@ -3310,13 +3285,18 @@ can_create_rite_trigger = { text = empire_faith_gate_reformation_piety_level piety_level >= 2 } - custom_tooltip = { - text = empire_faith_gate_reformation_tribal_authority - has_realm_law = tribal_authority_3 + trigger_if = { + limit = { + government_has_flag = government_is_tribal + } + custom_tooltip = { + text = empire_faith_gate_reformation_tribal_authority + has_realm_law = tribal_authority_3 + } } custom_tooltip = { text = empire_faith_gate_reformation_holy_site - faith ?= { + faith = { any_holy_site_barony = { count >= 3 county.holder = { @@ -3328,7 +3308,7 @@ can_create_rite_trigger = { } # Vanilla: 3 holy sites trigger_else = { - faith ?= { + faith = { num_realm_holy_sites_faithful_holders = { CHARACTER = root COUNT = 3 @@ -3339,7 +3319,7 @@ can_create_rite_trigger = { custom_tooltip = { text = faith_reformation_via_decision - faith ?= { + faith = { NOT = { has_variable = block_reformation_var } } } @@ -3353,7 +3333,7 @@ spiritual_hof_or_realm_priest_superior_recipient_trigger = { NOR = { AND = { religious_head_or_challenger ?= scope:recipient - faith ?= { + faith = { has_doctrine = doctrine_spiritual_head } } @@ -3379,7 +3359,7 @@ spiritual_hof_or_realm_priest_superior_recipient_trigger = { OR = { AND = { religious_head_or_challenger = scope:recipient - faith ?= { + faith = { has_doctrine = doctrine_spiritual_head } } @@ -3390,6 +3370,10 @@ spiritual_hof_or_realm_priest_superior_recipient_trigger = { government_has_flag = government_is_theocracy superior ?= scope:recipient } + AND = { + cp:councillor_court_chaplain ?= scope:recipient + capital_county.clerical_region_title.holder ?= scope:recipient + } } } } @@ -3421,7 +3405,7 @@ hof_or_realm_priest_superior_recipient_trigger = { custom_tooltip = { text = superior_or_hof_tt OR = { - faith ?= { + faith = { religious_head ?= scope:recipient } cp:councillor_court_chaplain ?= { @@ -3475,24 +3459,15 @@ seek_indulgences_show_recipient_trigger = { } # Actor scope: capital region archbishops resolve to themselves and do not count -seek_indulgences_has_capital_archbishop_trigger = { - capital_county ?= { - clerical_region_title ?= { - holder ?= { - NOT = { this = scope:actor } - faith = scope:actor.faith - } +actor_has_capital_archbishop_trigger = { + trigger_if = { + limit = { exists = capital_county.clerical_region_title.holder } + capital_county.clerical_region_title.holder = { + NOT = { this = scope:actor } + faith = scope:actor.faith } } -} - -# Seek Indulgences: a landed prelate of the petitioner's own faith within their top realm. -seek_indulgences_landed_clergy_recipient_trigger = { - scope:recipient = { - pam_is_investiture_landed_prelate_trigger = yes - faith = scope:actor.faith - top_liege ?= scope:actor.top_liege - } + trigger_else = { always = no } } # Your own archbishop outranks the Head of Faith @@ -3500,15 +3475,12 @@ seek_indulgences_landed_clergy_recipient_trigger = { seek_indulgences_recipient_trigger = { trigger_if = { limit = { - seek_indulgences_has_capital_archbishop_trigger = yes + actor_has_capital_archbishop_trigger = yes pam_is_archbishop_or_higher_trigger = no } custom_tooltip = { text = seek_indulgences_recipient_archbishop_tt - OR = { - capital_county.clerical_region_title.holder ?= scope:recipient - seek_indulgences_landed_clergy_recipient_trigger = yes - } + capital_county.clerical_region_title.holder ?= scope:recipient } } trigger_else_if = { @@ -3517,19 +3489,13 @@ seek_indulgences_recipient_trigger = { } custom_tooltip = { text = seek_indulgences_recipient_head_of_faith_tt - OR = { - religious_head_or_challenger ?= scope:recipient - seek_indulgences_landed_clergy_recipient_trigger = yes - } + religious_head_or_challenger ?= scope:recipient } } trigger_else = { custom_tooltip = { text = seek_indulgences_recipient_realm_priest_tt - OR = { - cp:councillor_court_chaplain ?= scope:recipient - seek_indulgences_landed_clergy_recipient_trigger = yes - } + cp:councillor_court_chaplain ?= scope:recipient } } } @@ -3587,7 +3553,7 @@ hof_or_realm_priest_superior_actor_trigger = { custom_tooltip = { text = superior_or_hof_tt OR = { - faith ?= { + faith = { religious_head ?= scope:recipient } cp:councillor_court_chaplain ?= { @@ -3641,19 +3607,19 @@ faith_is_syncretic_with = { prev = { has_doctrine_parameter = unreformed_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = eastern_orthodox_religion } } + limit = { religion_tag = eastern_orthodox_religion } prev = { has_doctrine_parameter = christian_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = catholic_religion } } + limit = { religion_tag = catholic_religion } prev = { has_doctrine_parameter = christian_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = protestant_religion } } + limit = { religion_tag = protestant_religion } prev = { has_doctrine_parameter = christian_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = oriental_orthodox_religion } } + limit = { religion_tag = oriental_orthodox_religion } prev = { has_doctrine_parameter = christian_syncretic_actor } } trigger_else_if = { @@ -3685,35 +3651,35 @@ rite_is_syncretic_with = { prev = { rite_has_parameter = unreformed_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = eastern_orthodox_religion } } + limit = { faith = { religion_tag = eastern_orthodox_religion } } prev = { rite_has_parameter = christian_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = catholic_religion } } + limit = { faith = { religion_tag = catholic_religion } } prev = { rite_has_parameter = christian_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = protestant_religion } } + limit = { faith = { religion_tag = protestant_religion } } prev = { rite_has_parameter = christian_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = oriental_orthodox_religion } } + limit = { faith = { religion_tag = oriental_orthodox_religion } } prev = { rite_has_parameter = christian_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = islam_religion } } + limit = { faith = { religion_tag = islam_religion } } prev = { rite_has_parameter = islamic_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { religion_tag = judaism_religion } } + limit = { faith = { religion_tag = judaism_religion } } prev = { rite_has_parameter = jewish_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { is_in_family = rf_eastern } } + limit = { faith = { is_in_family = rf_eastern } } prev = { rite_has_parameter = eastern_syncretic_actor } } trigger_else_if = { - limit = { faith ?= { is_in_family = rf_sinitic } } + limit = { faith = { is_in_family = rf_sinitic } } prev = { rite_has_parameter = sinitic_syncretic_actor } } trigger_else = { diff --git a/common/scripted_triggers/00_war_and_peace_triggers.txt b/common/scripted_triggers/00_war_and_peace_triggers.txt index c1eaa9a59..e6ecfc0ef 100644 --- a/common/scripted_triggers/00_war_and_peace_triggers.txt +++ b/common/scripted_triggers/00_war_and_peace_triggers.txt @@ -276,7 +276,7 @@ allows_declaring_war_against_target_trigger = { is_in_activity = no trigger_if = { limit = { - culture ?= { has_cultural_parameter = cannot_attack_allies } + culture = { has_cultural_parameter = cannot_attack_allies } } NOT = { is_allied_to = scope:defender_check @@ -284,7 +284,7 @@ allows_declaring_war_against_target_trigger = { } trigger_if = { limit = { - culture ?= { has_cultural_parameter = cannot_attack_truces } + culture = { has_cultural_parameter = cannot_attack_truces } } NOT = { has_truce = scope:defender_check @@ -487,16 +487,8 @@ can_use_conquest_cbs_trigger = { government_has_flag = government_is_clan government_has_flag = government_is_nomadic government_has_flag = government_is_steppe_admin - trigger_if = { - limit = { exists = rite } - rite ?= { rite_has_parameter = conquest_cb_enabled } - } - trigger_else = { always = no } - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = can_use_conquest_cbs } - } - trigger_else = { always = no } + rite = { rite_has_parameter = conquest_cb_enabled } + culture = { has_cultural_parameter = can_use_conquest_cbs } AND = { government_has_flag = government_is_japan_feudal has_realm_law = imperial_expansion_law @@ -514,13 +506,7 @@ can_be_warrior_trigger = { OR = { can_be_combatant_based_on_gender_trigger = { ARMY_OWNER = $ARMY_OWNER$ } AND = { - $ARMY_OWNER$ = { - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = high_prowess_ignores_knight_restrictions } - } - trigger_else = { always = no } - } + $ARMY_OWNER$.culture = { has_cultural_parameter = high_prowess_ignores_knight_restrictions } prowess >= 10 } # Japan Onna-musha @@ -531,17 +517,9 @@ can_be_warrior_trigger = { NOT = { government_has_mechanic = administrative } - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars } - } - trigger_else = { always = no } + culture = { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars } } - trigger_if = { - limit = { exists = culture } - culture ?= { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars } - } - trigger_else = { always = no } + culture = { has_cultural_parameter = non_admin_close_family_non_martial_gender_knights_in_defensive_wars } } AND = { $ARMY_OWNER$ = { is_at_war_as_defender = yes } @@ -580,12 +558,8 @@ can_be_knight_trigger = { } trigger_if = { limit = { - exists = $ARMY_OWNER$.culture - trigger_if = { - limit = { exists = $ARMY_OWNER$.culture } - $ARMY_OWNER$.culture ?= { - has_cultural_parameter = minimum_prowess_for_knights - } + $ARMY_OWNER$.culture = { + has_cultural_parameter = minimum_prowess_for_knights } } prowess >= 12 @@ -595,21 +569,17 @@ can_be_knight_trigger = { is_clergy = yes } OR = { - rite ?= { rite_has_parameter = clergy_can_fight } + rite = { rite_has_parameter = clergy_can_fight } AND = { has_personal_tenet_flag = clergy_can_fight_personal NOT = { - rite ?= { rite_has_parameter = pacifist } + rite = { rite_has_parameter = pacifist } } } - culture ?= { has_cultural_parameter = culture_clergy_can_fight } + culture = { has_cultural_parameter = culture_clergy_can_fight } AND = { - exists = $ARMY_OWNER$.culture - trigger_if = { - limit = { exists = $ARMY_OWNER$.culture } - $ARMY_OWNER$.culture ?= { - has_cultural_parameter = high_prowess_ignores_knight_restrictions - } + $ARMY_OWNER$.culture = { + has_cultural_parameter = high_prowess_ignores_knight_restrictions } prowess >= 10 } @@ -617,12 +587,8 @@ can_be_knight_trigger = { } OR = { AND = { - exists = $ARMY_OWNER$.culture - trigger_if = { - limit = { exists = $ARMY_OWNER$.culture } - $ARMY_OWNER$.culture ?= { - has_cultural_parameter = high_prowess_ignores_knight_restrictions - } + $ARMY_OWNER$.culture = { + has_cultural_parameter = high_prowess_ignores_knight_restrictions } prowess >= 10 } @@ -987,14 +953,14 @@ religious_cb_holder_under_target_can_be_vassalized = { OR = { # For all Faiths, if the attacker views this vassal's faith more favorably than the defender does, they are 'liberated' and become vassals under the attacker. # For example, if Catholics are crusading against Ash'aris(viewed as Evil), any Messalian vassals (viewed as Hostile) will become vassals under the Catholic attacker. - scope:attacker.faith ?= { + scope:attacker.faith = { faith_hostility_level_comparison = { prev.holder.faith < scope:defender.faith } } # Pluralist faiths always attempt to preserve vassals if possible, even if the vassal follows an Evil faith. - scope:attacker.rite ?= { rite_has_parameter = pluralism_pluralistic_holy_wars_preserve_vassals } + scope:attacker.rite = { rite_has_parameter = pluralism_pluralistic_holy_wars_preserve_vassals } } } @@ -1043,16 +1009,8 @@ can_use_viking_invasion_cbs_trigger = { } can_use_viking_invasion_cbs_dlc_trigger = { - trigger_if = { - limit = { exists = culture } - culture ?= { has_innovation = innovation_longboats } - } - trigger_else = { always = no } - trigger_if = { - limit = { exists = rite } - rite ?= { rite_has_tenet = tenet_warmonger } - } - trigger_else = { always = no } + culture = { has_innovation = innovation_longboats } + rite = { rite_has_tenet = tenet_warmonger } any_sub_realm_county = { is_coastal_county = yes } trigger_if = { limit = { is_ai = yes } @@ -1064,11 +1022,7 @@ can_use_viking_invasion_cbs_dlc_trigger = { NOT = { any_liege_or_above = { NOT = { - trigger_if = { - limit = { exists = rite } - rite ?= { rite_has_tenet = tenet_warmonger } - } - trigger_else = { always = no } + rite = { rite_has_tenet = tenet_warmonger } } } } diff --git a/common/scripted_triggers/07_ep3_triggers.txt b/common/scripted_triggers/07_ep3_triggers.txt index 75cc6d0b4..8b48b2be9 100644 --- a/common/scripted_triggers/07_ep3_triggers.txt +++ b/common/scripted_triggers/07_ep3_triggers.txt @@ -1876,7 +1876,7 @@ laamp_as_mercenary_payout_trigger = { scope:merc_temp = { is_attacker_in_war = scope:war_temp } } trigger_else = { - scope:merc_temp = { is_attacker_in_war = scope:war_temp } + scope:merc_temp = { is_defender_in_war = scope:war_temp } } } NOT = { is_leader_in_war = scope:war_temp } diff --git a/common/scripted_triggers/pam_antipope_triggers.txt b/common/scripted_triggers/pam_antipope_triggers.txt deleted file mode 100644 index be8dcc55f..000000000 --- a/common/scripted_triggers/pam_antipope_triggers.txt +++ /dev/null @@ -1,278 +0,0 @@ -# Any theocratic vassal of $LIEGE$'s faith, no matter the rite -pam_valid_antipope_clergy_vassal_trigger = { - save_temporary_scope_as = antipope_temp - is_clergy = yes - custom_tooltip = { - text = pam_antipope_clerical_gender_tt - $LIEGE$.rite = { rite_has_allowed_gender_for_clergy = scope:antipope_temp } - } - faith = $LIEGE$.faith - NOT = { any_held_title = { is_head_of_faith = yes } } - pam_is_antipope_trigger = no -} - -# Holds one of their faith's antipope titles -pam_is_antipope_trigger = { - save_temporary_scope_as = pam_antipope_holder_check - faith ?= { - any_religious_head_challenger = { - holder ?= scope:pam_antipope_holder_check - } - } -} - -pam_title_is_antipope_office_trigger = { - has_variable = pam_antipope_office -} - -# Holds the sponsor title behind one of their faith's antipopes. A self-declared antipope sponsors themselves -pam_is_antipope_sponsor_trigger = { - save_temporary_scope_as = pam_antipope_sponsor_check - faith = { - any_religious_head_challenger = { - challenger_sponsor ?= { - holder ?= scope:pam_antipope_sponsor_check - } - } - } -} - -pam_sponsors_other_antipope_trigger = { - save_temporary_scope_as = pam_other_antipope_sponsor_check - faith = { - any_religious_head_challenger = { - NOT = { holder ?= scope:pam_other_antipope_sponsor_check } - challenger_sponsor ?= { - holder ?= scope:pam_other_antipope_sponsor_check - } - } - } -} - -# Scoped to an antipope: $SPONSOR$ is the ruler whose title backs them -pam_antipope_is_sponsored_by_trigger = { - save_temporary_scope_as = pam_checked_antipope - $SPONSOR$ = { save_temporary_scope_as = pam_expected_sponsor } - faith = { - any_religious_head_challenger = { - holder ?= scope:pam_checked_antipope - challenger_sponsor ?= { - holder ?= scope:pam_expected_sponsor - } - } - } -} - -pam_is_sponsored_antipope_trigger = { - pam_is_antipope_trigger = yes - pam_is_antipope_sponsor_trigger = no -} - -pam_antipope_declaration_discounted_trigger = { - situation:the_christian_church ?= { - has_situation_top_phase_parameter = the_christian_church_cheaper_antipope_declaration - } -} - -# Covers the antipope, their sponsor, and anyone under either of them -pam_antipope_protected_from_excommunication_trigger = { - is_following_religious_head_challenger = yes - faith.religious_head ?= $EXCOMMUNICATOR$ - NOT = { has_personal_tenet_flag = tenet_apostolic_succession_antipope_opposition } -} - -# Clerical requests that the mainline hierarchy would answer -# Anyone under an antipope has to take them to that antipope instead -pam_antipope_clerical_request_trigger = { - trigger_if = { - limit = { pam_is_antipope_trigger = yes } - custom_tooltip = { - text = pam_clerical_request_actor_is_antipope_tt - religious_head_or_challenger ?= $RECIPIENT$ - } - } - trigger_else_if = { - limit = { pam_is_antipope_sponsor_trigger = yes } - custom_tooltip = { - text = pam_clerical_request_actor_is_antipope_sponsor_tt - religious_head_or_challenger ?= $RECIPIENT$ - } - } - trigger_else_if = { - limit = { is_following_religious_head_challenger = yes } - custom_tooltip = { - text = pam_clerical_request_in_antipope_realm_tt - religious_head_or_challenger ?= $RECIPIENT$ - } - } - trigger_else = { - always = yes - } -} - -pam_antipope_may_grant_clerical_region_trigger = { - trigger_if = { - limit = { scope:actor = { pam_is_antipope_trigger = yes } } - trigger_if = { - limit = { exists = $SEE$.holder } - $SEE$.holder.religious_head_or_challenger ?= scope:actor - } - trigger_else = { - $SEE$.title_capital_county.holder.religious_head_or_challenger ?= scope:actor - } - } - trigger_else = { - always = yes - } -} - -# Antipope + Sponsor -pam_can_use_challenge_hof_cb_trigger = { - OR = { - pam_is_antipope_trigger = yes - pam_is_antipope_sponsor_trigger = yes - } - faith = { - exists = religious_head - NOT = { religious_head = scope:attacker } - } -} - -pam_challenge_hof_join_war_trigger = { - is_ai = yes - highest_held_title_tier >= tier_county - NOR = { - is_participant_in_war = scope:war - # Don't add vassals of targets - is_vassal_or_below_of = scope:defender - is_vassal_or_below_of = scope:attacker - # Not part of an attacker's realm - any_liege_or_above = { is_participant_in_war = scope:war } - } - OR = { - # Military Holy Orders always join - government_has_flag = government_is_military_holy_order - AND = { - # Landed rulers join if zealous independents or theocrats, prevent every cardinal and monastic abbot joining - is_landed = yes - OR = { - AND = { - is_independent_ruler = yes - # Attackers always join if rite is different, to reward spreading rite - trigger_if = { - limit = { - scope:defender.rite != scope:attacker.rite - rite = scope:attacker.rite - } - always = yes - } - # Otherwise attackers/defenders join only if zealous - trigger_else = { - ai_zeal >= very_high_positive_ai_value - } - } - government_has_flag = government_is_theocracy - } - } - } -} - -# Against the Antipope sponsor (which can be the antipope themselves if self-declared) -pam_can_target_antiking_cb_trigger = { - scope:defender = { - pam_is_antipope_sponsor_trigger = yes - faith = scope:attacker.faith - top_liege = this - } - scope:attacker = { - is_landed = yes - faith = scope:defender.faith - NOT = { this = scope:defender } - NOR = { - pam_is_antipope_sponsor_trigger = yes - pam_is_antipope_trigger = yes - } - } -} - -antipope_requirements_trigger = { - calc_true_if = { - amount >= $AMOUNT$ - has_trait = herald - trigger_if = { - limit = { religion = religion:islam_religion } - # Sayyids get a free pass. - has_trait = sayyid - } - trigger_else_if = { - limit = { religion = religion:zoroastrianism_religion } - OR = { - has_trait = saoshyant - has_trait = saoshyant_descendant - } - } - # to prevent "false" visible, but you should not get this as a potential antipope since this can only be granted to a HoF - trigger_else = { - has_trait = savior - } - has_trait_xp = { - trait = lifestyle_scholar - value >= 100 - } - custom_description = { - text = is_head_of_rite_tt - subject = root - rite.head_of_rite ?= this - } - # has_relation_rival has no first-person trigger localization, so describe it explicitly - custom_description = { - text = declare_yourself_antipope_decision_hof_rival_tt - has_relation_rival = faith.religious_head - } - custom_description = { - text = appoint_a_righteous_caliph_decision.caliph_not_in_diplo_range - NOT = { in_diplomatic_range = faith.religious_head } - } - # Having a holy site. - custom_description = { - text = appoint_a_righteous_caliph_decision.control_one_holy_site - faith = { - any_holy_site_barony = { - count >= 1 - holder ?= { target_is_same_character_or_above = root } - } - } - } - # Having *2* holy sites. - custom_description = { - text = appoint_a_righteous_caliph_decision.control_two_holy_sites - faith = { - any_holy_site_barony = { - count >= 2 - holder ?= { target_is_same_character_or_above = root } - } - } - } - # Having a higher-than-minimum piety level. - piety_level >= very_high_piety_level - custom_description = { - text = declare_yourself_antipope_decision_hof_piety_level_tt - piety_level > faith.religious_head.piety_level - } - # And just having a caliph who doesn't live up to the root's faith's ideals. - custom_description = { - text = appoint_a_righteous_caliph_decision.caliph_has_x_or_more_traits_sinful_to_your_faith - faith.religious_head = { - num_sinful_traits = { - value >= 2 - target = root.rite - } - } - } - # Has planned to schism off for a *while*. - custom_description = { - text = appoint_a_righteous_caliph_decision.has_wishes_to_schism_caliphate_flag - has_character_flag = wishes_to_schism_caliphate_flag - } - } -} diff --git a/common/scripted_triggers/pam_heresy_triggers.txt b/common/scripted_triggers/pam_heresy_triggers.txt new file mode 100644 index 000000000..40b522608 --- /dev/null +++ b/common/scripted_triggers/pam_heresy_triggers.txt @@ -0,0 +1,378 @@ +###################################### +# Heresy system - scripted triggers # +###################################### +# Per-heresy gating, geography helpers, and component eligibility checks. +# Resurgence model: each historical heresy can fire more than once per game. +# first outbreak: pam_heresy_X_first_fired global var is unset +# resurgence: first_fired set, plus pam_heresy_X_cooldown timed flag absent +# A 50-year cooldown is set after every outbreak via timed global variable. + +# --- Component eligibility (faith scope) --- + +# The second and third heresy components are blocked below this +# The first still fires, but we dampen the pulse with pam_heresy_pulse_no_event_value +pam_heresy_main_rite_substantial_trigger = { + main_rite.rite_counties >= pam_heresy_main_rite_county_threshold_value +} + +# Component 2 gate: main rite must be substantial (size floor) AND hold at least 60% of faith counties (dominance share). +pam_heresy_c2_main_rite_dominant_trigger = { + pam_heresy_main_rite_substantial_trigger = yes + main_rite.rite_counties >= pam_heresy_c2_main_rite_share_required_value +} + +#pam_heresy_c3_eligible_trigger = { +# religion = religion:christianity_religion +# pam_heresy_main_rite_substantial_trigger = yes +# OR = { +# pam_heresy_lollard_eligible_trigger = yes +# pam_heresy_hussite_eligible_trigger = yes +# pam_heresy_joachimite_eligible_trigger = yes +# pam_heresy_cathar_eligible_trigger = yes +# pam_heresy_waldensian_eligible_trigger = yes +# pam_heresy_bogomilist_eligible_trigger = yes +# pam_heresy_paulician_eligible_trigger = yes +# pam_heresy_iconoclast_eligible_trigger = yes +# pam_heresy_adoptionist_eligible_trigger = yes +# pam_heresy_messalian_eligible_trigger = yes +# } +#} + +# --- Per-heresy "is this heresy still available?" --- +# Each heresy can fire if past its earliest_date, the parent faith of the outbreak +# (root) is not the heresy faith itself, optional time windows pass, and the +# 50-year resurgence cooldown has elapsed since the last outbreak (if any). + +#pam_heresy_lollard_eligible_trigger = { +# current_date >= 1340.1.1 +# this != faith:lollard +# pam_heresy_lollard_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_lollard_cooldown } +#} + +#pam_heresy_hussite_eligible_trigger = { +# current_date >= 1360.1.1 +# this != faith:hussite +# pam_heresy_hussite_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_hussite_cooldown } +#} + +#pam_heresy_joachimite_eligible_trigger = { +# current_date >= 1200.1.1 +# this != faith:joachimite +# pam_heresy_joachimite_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_joachimite_cooldown } +#} + +#pam_heresy_cathar_eligible_trigger = { +# current_date >= 1140.1.1 +# this != faith:cathar +# pam_heresy_cathar_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_cathar_cooldown } +#} + +#pam_heresy_waldensian_eligible_trigger = { +# current_date >= 1160.1.1 +# this != faith:waldensian +# pam_heresy_waldensian_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_waldensian_cooldown } +#} + +#pam_heresy_bogomilist_eligible_trigger = { +# current_date >= 950.1.1 +# this != faith:bogomilist +# pam_heresy_bogomilist_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_bogomilist_cooldown } +#} + +# Always-anonymous repeating outbreaks. No first-historical figure - founder is always a generic resurgence preacher. +#pam_heresy_paulician_eligible_trigger = { +# current_date >= 870.1.1 +# this != faith:paulician +# pam_heresy_paulician_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_paulician_cooldown } +#} + +#pam_heresy_iconoclast_eligible_trigger = { +# current_date >= 900.1.1 +# this != faith:iconoclast +# pam_heresy_iconoclast_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_iconoclast_cooldown } +#} + +# Adoptionism: Felix of Urgell died ~818, the Spanish argument fades after the first millennium - hard time-gate to before 1000. +#pam_heresy_adoptionist_eligible_trigger = { +# current_date >= 870.1.1 +# current_date <= 999.12.31 +# this != faith:adoptionist +# NOT = { exists = global_var:pam_heresy_adoptionist_cooldown } +#} + +#pam_heresy_messalian_eligible_trigger = { +# current_date >= 870.1.1 +# this != faith:messalian +# pam_heresy_messalian_strict_window_ok_trigger = yes +# NOT = { exists = global_var:pam_heresy_messalian_cooldown } +#} + +# --- Strict-rule per-heresy historical windows --- +# Only enforced when game rule = strict_regional_heresy. +# The "strict" window is the historical lifetime of the named founder; outside that, strict mode rejects the outbreak entirely. +# Always-anonymous heresies have no strict window (they're resurgence-flavoured by default). + +#pam_heresy_lollard_strict_window_ok_trigger = { +# OR = { +# NOT = { has_game_rule = strict_regional_heresy } +# current_date <= 1430.1.1 +# } +#} +#pam_heresy_hussite_strict_window_ok_trigger = { +# OR = { +# NOT = { has_game_rule = strict_regional_heresy } +# current_date <= 1450.1.1 +# } +#} +# Joachimite: strict mode cuts off after Fra Dolcino's burning, as later Fraticelli are too institutional +#pam_heresy_joachimite_strict_window_ok_trigger = { +# OR = { +# NOT = { has_game_rule = strict_regional_heresy } +# current_date <= 1310.1.1 +# } +#} +#pam_heresy_cathar_strict_window_ok_trigger = { +# OR = { +# NOT = { has_game_rule = strict_regional_heresy } +# current_date <= 1230.1.1 +# } +#} +#pam_heresy_waldensian_strict_window_ok_trigger = { +# OR = { +# NOT = { has_game_rule = strict_regional_heresy } +# current_date <= 1250.1.1 +# } +#} +#pam_heresy_bogomilist_strict_window_ok_trigger = { +# OR = { +# NOT = { has_game_rule = strict_regional_heresy } +# current_date <= 1100.1.1 +# } +#} +# Always-anonymous: strict mode just lets them through (no historical figure to anchor). +pam_heresy_paulician_strict_window_ok_trigger = { always = yes } +pam_heresy_iconoclast_strict_window_ok_trigger = { always = yes } +pam_heresy_messalian_strict_window_ok_trigger = { always = yes } + +# --- Resurgence detection (faith scope on the parent faith) --- +# Always-anonymous heresies skip this and set scope:is_resurgence in the router +#pam_heresy_lollard_is_resurgence_trigger = { +# exists = global_var:pam_heresy_lollard_first_fired +#} +#pam_heresy_hussite_is_resurgence_trigger = { +# exists = global_var:pam_heresy_hussite_first_fired +#} +#pam_heresy_joachimite_is_resurgence_trigger = { +# exists = global_var:pam_heresy_joachimite_first_fired +#} +#pam_heresy_cathar_is_resurgence_trigger = { +# exists = global_var:pam_heresy_cathar_first_fired +#} +#pam_heresy_waldensian_is_resurgence_trigger = { +# exists = global_var:pam_heresy_waldensian_first_fired +#} +#pam_heresy_bogomilist_is_resurgence_trigger = { +# exists = global_var:pam_heresy_bogomilist_first_fired +#} + +# --- Pre-declaration vs already-declared (faith scope on the heresy faith) --- + +pam_heresy_faith_is_pre_declaration_trigger = { + has_variable = block_conversion_till_decision_taken +} + +# True when the recipient is already on the heresy's rite. +# Used to gate "embrace" / reframe "reject" options and description text so the +# event does not address one of the heresy's own followers as an outside observer. +pam_heresy_player_is_heresy_insider_trigger = { + trigger_if = { + limit = { exists = scope:new_rite } + rite = scope:new_rite + } + trigger_else_if = { + limit = { exists = scope:heresy_faith } + faith = scope:heresy_faith + } + trigger_else = { + always = no + } +} + +# --- Geography helpers (province scope) --- +# Callers in county scope must wrap with title_province = { ... }. + +#pam_heresy_lollard_region_trigger = { +# OR = { +# geographical_region = world_europe_west_britannia +# geographical_region = world_europe_west_germania +# } +#} +#pam_heresy_hussite_region_trigger = { +# # Bohemia / Moravia sit inside world_europe_west_germania. +# geographical_region = world_europe_west_germania +#} +#pam_heresy_joachimite_region_trigger = { +# # Calabria, the Italian peninsula, Provence, and southern France +# OR = { +# geographical_region = world_europe_south_italy +# geographical_region = world_europe_west_francia +# } +#} +#pam_heresy_cathar_region_trigger = { +# OR = { +# geographical_region = world_europe_west_francia +# geographical_region = world_europe_south_italy +# } +#} +#pam_heresy_waldensian_region_trigger = { +# OR = { +# geographical_region = world_europe_west_francia +# geographical_region = world_europe_south_italy +# } +#} +#pam_heresy_bogomilist_region_trigger = { +# geographical_region = world_europe_south_east +#} +#pam_heresy_paulician_region_trigger = { +# geographical_region = world_asia_minor +#} +#pam_heresy_iconoclast_region_trigger = { +# OR = { +# geographical_region = world_asia_minor +# geographical_region = world_europe_south_east +# } +#} +#pam_heresy_adoptionist_region_trigger = { +# geographical_region = world_europe_west_iberia +#} +#pam_heresy_messalian_region_trigger = { +# geographical_region = world_middle_east +#} + +# --- Component 2 founder eligibility (character scope) --- +# Mirrors is_eligible_rite_growth_founder_trigger but is permissive about existing heresiarch / herald carriers +# C2 is the "charismatic schismatic" path and those traits are an asset here. +# Archbishop-only candidates (no held county on the source rite) are accepted via the clerical_region branch. +is_eligible_pam_heresy_c2_founder_trigger = { + is_available_ai_adult = yes + rite = scope:source_rite + learning >= medium_skill_rating + NOR = { + recently_converted_faith_trigger = yes + has_character_flag = recently_converted_by_heresy + has_character_flag = recently_converted_by_rite_growth + faith.religious_head ?= this + scope:source_rite.head_of_rite ?= this + highest_held_title_tier >= tier_empire + government_has_flag = government_is_nomadic + government_has_flag = government_is_herder + } + OR = { + AND = { + is_landed = yes + highest_held_title_tier >= tier_duchy + any_held_title = { + tier = tier_county + rite = scope:source_rite + } + } + any_held_title = { has_clerical_region = yes } + } +} + +# Test convenience trigger for narrative branching (e.g. event text). +pam_heresy_c2_founder_is_archbishop_trigger = { + scope:founder = { + any_held_title = { has_clerical_region = yes } + } +} + +# --- Epicenter ruler eligibility (character scope) --- +# A duke+ same-faith landed AI ruler. +# Capital-in-region check is applied separately by the picker (with title_province wrapping). +is_eligible_heresy_epicenter_ruler_trigger = { + is_landed = yes + is_ai = yes + highest_held_title_tier >= tier_duchy + NOR = { + this = faith.religious_head + has_trait = heresiarch + has_trait = herald + recently_converted_faith_trigger = yes + } +} + +# --- Component 3 game-rule gates --- + +pam_heresy_relaxed_rule_trigger = { + has_game_rule = relaxed_regional_heresy +} + +pam_heresy_strict_rule_trigger = { + has_game_rule = strict_regional_heresy +} + +pam_heresy_default_rule_trigger = { + OR = { + has_game_rule = default_regional_heresy + # Defensive: if no rule explicitly matches, treat as default. + AND = { + NOT = { has_game_rule = strict_regional_heresy } + NOT = { has_game_rule = relaxed_regional_heresy } + } + } +} + +# Province scope, branching on scope:heresy_faith +#pam_heresy_capital_in_heresy_region_trigger = { +# OR = { +# AND = { +# scope:heresy_faith = faith:lollard +# pam_heresy_lollard_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:hussite +# pam_heresy_hussite_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:joachimite +# pam_heresy_joachimite_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:cathar +# pam_heresy_cathar_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:waldensian +# pam_heresy_waldensian_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:bogomilist +# pam_heresy_bogomilist_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:paulician +# pam_heresy_paulician_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:iconoclast +# pam_heresy_iconoclast_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:adoptionist +# pam_heresy_adoptionist_region_trigger = yes +# } +# AND = { +# scope:heresy_faith = faith:messalian +# pam_heresy_messalian_region_trigger = yes +# } +# } +#} diff --git a/common/scripted_triggers/pam_saint_triggers.txt b/common/scripted_triggers/pam_saint_triggers.txt new file mode 100644 index 000000000..82f16ea84 --- /dev/null +++ b/common/scripted_triggers/pam_saint_triggers.txt @@ -0,0 +1,254 @@ +############################################ +# Canonizing Saints - scripted triggers +# pam_can_canonize_saint_trigger +# pam_is_canonization_candidate_trigger +# pam_faith_uses_cathedrals_trigger +# pam_character_has_cathedral_trigger +# pam_has_consecration_site_trigger +# pam_site_free_trigger +# pam_province_is_free_burial_site_trigger +# pam_has_free_primary_site_trigger +# pam_county_has_actor_primary_site_trigger +# pam_has_free_adjacent_site_trigger +# pam_needs_hof_approval_for_canonization_trigger +# pam_hof_thinks_well_of_canonizer_trigger +# pam_saint_is_buried_in_my_lands_trigger +# pam_can_extract_relic_from_saint_trigger +# pam_saint_relic_drawable_trigger +# pam_venerated_the_saints_personally_trigger +############################################ +has_corpse_trigger = { + trigger_if = { + limit = { is_alive = no } + NOR = { + has_dead_character_variable = no_corpse_left + saint_burial_location ?= { has_variable = no_corpse_left } + death_reason = death_disappearance + death_reason = death_vanished + death_reason = death_hunted_by_wild_beast + death_reason = death_disappeared_into_slave_markets + death_reason = death_killed_by_monstrous_dog + death_reason = death_killed_by_monstrous_wolf + death_reason = death_killed_by_monstrous_hyena + death_reason = death_killed_by_monstrous_lion + death_reason = death_killed_by_monstrous_tiger + death_reason = death_killed_by_monstrous_leopard + death_reason = death_killed_by_monstrous_panther + death_reason = death_killed_by_monstrous_lynx + death_reason = death_killed_by_monstrous_caracal + death_reason = death_killed_by_monstrous_bear + death_reason = death_killed_by_monstrous_hippo + death_reason = death_killed_by_monstrous_crocodile + } + } +} +# Can this ruler canonize saints at all? (the actor of the decision) +pam_can_canonize_saint_trigger = { + has_pam_dlc_trigger = yes + is_landed_or_landless_administrative_or_theocratic = yes + is_adult = yes + is_ruler = yes + exists = faith + # Christian sainthood needs Dulia not forbidden or unknown; non-Christian (Venerated Ancestor) faiths are unaffected. + trigger_if = { + limit = { + OR = { + faith.religion = religion:catholic_religion + faith.religion = religion:protestant_religion + faith.religion = religion:eastern_orthodox_religion + faith.religion = religion:oriental_orthodox_religion + } + } + rite = { + NOT = { has_tenet_status = { tenet = tenet_dulia status = unknown } } + NOT = { has_tenet_status = { tenet = tenet_dulia status = prohibited } } + } + } +} + +# Can this dead ancestor be canonized? CANONIZER is passed in because the picker runs with root = none; virtue/sin are judged by the canonizer's rite. +pam_is_canonization_candidate_trigger = { + is_alive = no + NOT = { has_trait = saint } + faith ?= $CANONIZER$.faith + dynasty ?= $CANONIZER$.dynasty + # Saintly life: at least one virtue and no sins by our rite's reckoning. + num_virtuous_traits = { + value >= 1 + target = this.rite + } + num_sinful_traits = { + value = 0 + target = this.rite + } +} + +# Faiths with clerical regions and a temporal/appointed clergy build cathedrals; every other faith, including all non-Christian ones, consecrates at a holy site instead. Mirrors the ecclesiastical_government gate (see 02_theocratic_government_types.txt). +pam_faith_uses_cathedrals_trigger = { + faith ?= { has_doctrine_parameter = has_clerical_regions } + NOT = { rite = { rite_has_doctrine = doctrine_theocracy_lay_clergy } } +} + +# We start with government because it is quick, then ecclesiastical_domicile_main_01 or higher +pam_character_has_cathedral_trigger = { + has_government = ecclesiastical_government + domicile ?= { has_domicile_building_or_higher = ecclesiastical_domicile_main_01 } +} + +# Does the actor have somewhere to consecrate a saint? A free (unoccupied) cathedral / holy site, or - once those are all taken - a free county-capital barony neighbouring one. Burial is one saint per province, so "free" means the province holds no saint yet. +pam_has_consecration_site_trigger = { + OR = { + pam_has_free_primary_site_trigger = yes + pam_has_free_adjacent_site_trigger = yes + } +} + +# A consecration barony (barony scope) whose province has no saint buried yet. Burial is province-anchored (the poi_buried_saint marks the province), so one province holds at most one saint. +pam_site_free_trigger = { + title_province ?= { + NOR = { + has_variable = hide_location_for_saint + has_travel_point_of_interest = poi_buried_saint + } + } +} + +# Province can take add_saint: holding present, no buried-saint PoI yet. +pam_province_is_free_burial_site_trigger = { + has_holding = yes + NOR = { + has_variable = hide_location_for_saint + has_travel_point_of_interest = poi_buried_saint + } +} + +# Does the actor have a free primary consecration site? Cathedral faiths: an unoccupied cathedral in their realm. Others: an unoccupied holy site of their faith in realm. +pam_has_free_primary_site_trigger = { + trigger_if = { + limit = { pam_faith_uses_cathedrals_trigger = yes } + OR = { + AND = { + pam_character_has_cathedral_trigger = yes + domicile ?= { domicile_location = { barony ?= { pam_site_free_trigger = yes } } } + } + any_realm_province = { + barony ?= { pam_site_free_trigger = yes } + any_province_domicile = { owner = { pam_character_has_cathedral_trigger = yes } } + } + } + } + trigger_else = { + save_temporary_scope_as = pam_primary_site_actor + any_realm_province = { + barony ?= { is_holy_site_of = scope:pam_primary_site_actor.faith } + NOT = { has_travel_point_of_interest = poi_buried_saint } + } + } +} + +# Does this county (title scope) hold one of $ACTOR$'s primary consecration sites? Used to find provinces adjacent to a real site. Cathedral faiths: a cathedral (an ecclesiastical domicile) in $ACTOR$'s realm sits in the county, whoever owns it. Others: a holy site of $ACTOR$'s faith sits in the county, in realm. Identified from the province's domicile side (same walk as pam_has_free_primary_site_trigger and setup_items) - a cathedral barony's holder isn't reliably the bishop, so a barony->holder lookup misses them. Intentionally intrinsic (cathedral/holy-site nature, not occupancy) so an adjacency burial never seeds further neighbours. +pam_county_has_actor_primary_site_trigger = { + save_temporary_scope_as = pam_primary_site_county + trigger_if = { + limit = { $ACTOR$ = { pam_faith_uses_cathedrals_trigger = yes } } + $ACTOR$ = { + OR = { + AND = { + pam_character_has_cathedral_trigger = yes + domicile ?= { domicile_location ?= { county = scope:pam_primary_site_county } } + } + any_realm_province = { + county = scope:pam_primary_site_county + any_province_domicile = { owner = { pam_character_has_cathedral_trigger = yes } } + } + } + } + } + trigger_else = { + $ACTOR$ = { + any_realm_province = { + barony ?= { is_holy_site_of = $ACTOR$.faith } + county = scope:pam_primary_site_county + } + } + } +} + +# Once every primary site is taken, may the actor consecrate in a neighbouring province instead? True when a free county-capital barony in realm borders a county that holds one of the actor's primary sites (one candidate per county, keeping the picker focused). +pam_has_free_adjacent_site_trigger = { + save_temporary_scope_as = pam_adjacency_actor + any_realm_province = { + is_county_capital = yes + NOT = { has_travel_point_of_interest = poi_buried_saint } + county = { + any_neighboring_county = { + pam_county_has_actor_primary_site_trigger = { ACTOR = scope:pam_adjacency_actor } + } + } + } +} + +# Approval is needed when a Head of Faith exists and it is not the actor. +pam_needs_hof_approval_for_canonization_trigger = { + exists = faith.religious_head + NOT = { faith.religious_head = root } +} + +# A Head of Faith who thinks poorly of the actor will not entertain the petition at all. Vacuously true where approval is not sought anyway - no Head of Faith, or the actor holds the office - and for a puppeted Head of Faith, who cannot refuse their puppeteer (mirrors the certain-approval branch in the canonize decision). +pam_hof_thinks_well_of_canonizer_trigger = { + trigger_if = { + limit = { + pam_needs_hof_approval_for_canonization_trigger = yes + NOT = { faith.religious_head.puppeteer ?= root } + } + faith.religious_head ?= { + opinion = { + target = root + value >= high_positive_opinion + } + } + } +} + +# Is this burial province within $EXTRACTOR$'s realm (held by them or a vassal/sub-vassal)? EXTRACTOR is passed in because the relic picker runs with root = none. +pam_saint_is_buried_in_my_lands_trigger = { + county.holder ?= { + target_is_same_character_or_above = $EXTRACTOR$ + } +} + +# Can $EXTRACTOR$ draw another relic from this site? The AI always leaves one relic +# $SAINT$ is the saint being evaluated +pam_can_extract_relic_from_saint_trigger = { + # add_saint deliberately accepts living characters for modders, so the registry can hold one - never offer them as a relic source + $SAINT$ = { is_alive = no } + pam_saint_is_buried_in_my_lands_trigger = { EXTRACTOR = $EXTRACTOR$ } + trigger_if = { + limit = { $EXTRACTOR$ = { is_ai = yes } } + $SAINT$ = { + remaining_saint_relics > 1 + } + } + trigger_else = { + $SAINT$ = { + remaining_saint_relics > 0 + } + } +} + +# Relic picker is_item_valid helper (scope = picked saint): can $EXTRACTOR$ still draw from this saint? Resolve their burial province, then defer to the shared eligibility trigger (prev = the saint). +pam_saint_relic_drawable_trigger = { + saint_burial_location = { + pam_can_extract_relic_from_saint_trigger = { EXTRACTOR = $EXTRACTOR$ SAINT = prev } + } +} + +pam_venerated_the_saints_personally_trigger = { + trigger_if = { + limit = { is_alive = yes } + has_personal_tenet_flag = tenet_dulia_personal_sainthood_chance + } + trigger_else = { + has_dead_character_variable = pam_dulia_personal_sainthood + } +} diff --git a/common/scripted_triggers/pam_scripted_triggers.txt b/common/scripted_triggers/pam_scripted_triggers.txt new file mode 100644 index 000000000..84958e0ef --- /dev/null +++ b/common/scripted_triggers/pam_scripted_triggers.txt @@ -0,0 +1,7371 @@ +pam_consolamentum_grief_immunity_trigger = { + has_personal_tenet_flag = consolamentum_grief_immunity +} + +# Character scope. Keep this cheap for relation/war-enemy iterators; full target validation is below. +pam_adorcism_curse_target_is_living_adult_trigger = { + is_available_quick = { + adult = yes + alive = yes + } +} + +pam_adorcism_curse_target_is_valid_trigger = { + $TARGET$ ?= { + pam_adorcism_curse_target_is_living_adult_trigger = yes + OR = { + has_relation_rival = $ACTOR$ + has_relation_nemesis = $ACTOR$ + $ACTOR$ = { + any_war_enemy = { + this = $TARGET$ + } + } + } + } +} + +pam_adorcism_has_available_curse_target_trigger = { + OR = { + any_relation = { + type = rival + pam_adorcism_curse_target_is_living_adult_trigger = yes + } + any_war_enemy = { + pam_adorcism_curse_target_is_living_adult_trigger = yes + } + } +} + +# The liturgical language triggers below only evaluate in a rite scope; call them through +# main_rite from a faith and through rite from a character. +# Pre-scripted rites skip the Head of Rite culture fallback. Slavic, Georgian, Antiochian, +# heresies, and custom divergences keep that fallback. +rite_has_pre_scripted_liturgical_language_trigger = { + OR = { + religion = religion:catholic_religion + faith = faith:orthodox + this = rite:byzantine_rite + this = rite:celtic_rite + this = rite:ethiopian_rite + this = rite:armenian_rite + this = rite:coptic_rite + } +} + +# These are founding-see rites in rite scope, not map-wide or ordinary swap traditions +pam_rite_is_regional_trigger = { + OR = { + this = rite:celtic_rite + this = rite:teutonic_rite + this = rite:carpathian_rite + this = rite:iberian_rite + this = rite:orthodox_hellenic_rite + this = rite:coptic_rite + this = rite:ethiopian_rite + this = rite:armenian_rite + } +} + +pam_latin_as_liturgical_language_trigger = { + religion = religion:catholic_religion +} + +pam_greek_as_liturgical_language_trigger = { + OR = { + faith = faith:orthodox + this = rite:byzantine_rite + religion = religion:theomach_religion + AND = { + rite_has_pre_scripted_liturgical_language_trigger = no + head_of_rite.culture ?= { + OR = { + this = culture:greek + has_same_culture_language = culture:greek + } + } + } + } +} + +pam_irish_as_liturgical_language_trigger = { + OR = { + this = rite:celtic_rite + AND = { + rite_has_pre_scripted_liturgical_language_trigger = no + head_of_rite.culture ?= { + OR = { + this = culture:irish + has_same_culture_language = culture:irish + } + } + } + } +} + +pam_ethiopic_as_liturgical_language_trigger = { + OR = { + this = rite:ethiopian_rite + AND = { + rite_has_pre_scripted_liturgical_language_trigger = no + head_of_rite.culture ?= { + OR = { + this = culture:ethiopian + has_same_culture_language = culture:ethiopian + } + } + } + } +} + +pam_armenian_as_liturgical_language_trigger = { + OR = { + this = rite:armenian_rite + AND = { + rite_has_pre_scripted_liturgical_language_trigger = no + head_of_rite.culture ?= { + OR = { + this = culture:armenian + has_same_culture_language = culture:NEOW_armenian + } + } + } + } +} + +can_hold_ecumenical_council_trigger = { + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } +} + +#has_current_phase_any_debate_trigger = { +# OR = { +# has_current_phase = ecumenical_council_phase_first_debate +# has_current_phase = ecumenical_council_phase_second_debate +# has_current_phase = ecumenical_council_phase_third_debate +# } +#} + +pam_is_clerical_region_holder_trigger = { + any_held_title = { + tier >= tier_duchy + has_clerical_region = yes + clerical_region_size > 0 + } +} + +pam_ecumenical_council_has_quorum_trigger = { + trigger_if = { + limit = { scope:host.faith ?= { has_doctrine_parameter = has_clerical_regions } } + trigger_if = { + limit = { scope:host = { pam_is_clerical_region_holder_trigger = yes } } + any_attending_character = { + count >= ecumenical_council_min_clerical_region_guests + faith = scope:host.faith + pam_is_clerical_region_holder_trigger = yes + } + } + trigger_else = { + any_attending_character = { + count >= ecumenical_council_min_clerical_region_holders + faith = scope:host.faith + pam_is_clerical_region_holder_trigger = yes + } + } + } +} + +#the_christian_church_radical_change_allowed_trigger = { +# situation:the_christian_church ?= { +# OR = { +# has_situation_top_phase_parameter = era_type_instability +# has_situation_top_phase_parameter = era_type_crisis +# } +# } +#} + +#pam_mass_rite_conversion_conversion_phase_trigger = { +# situation:the_christian_church ?= { +# has_situation_top_phase_parameter = the_christian_church_mass_rite_conversion_decision +# } +#} + +#pam_mass_rite_conversion_requirements_trigger = { +# has_pam_dlc_trigger = yes +# highest_held_title_tier >= tier_duchy +#} + +# Great Schism: progress can still change. Any scope +#pam_great_schism_progress_can_change_trigger = { +# NOT = { has_global_variable = pam_great_schism_decision_taken } +# exists = situation:the_christian_church +#} + +#pam_can_pick_great_schism_stance_trigger = { +# situation:the_christian_church ?= { +# var:pam_great_schism_status ?= flag:ongoing +# pam_great_schism_progress_can_change_trigger = yes +# exists = var:schism_mainline_rite +# exists = var:schism_competitor_rite +# } +# is_ruler = yes +# faith = faith:christian_faith +#} + +# pam_save_schism_head_of_faith_effect saves the see first, then we run in character scope +# Uses situation main-power faith so this works before 0062 saves christianity +#pam_schism_can_seat_head_of_faith_trigger = { +# this = scope:schism_peacemaker +# exists = scope:new_head_of_faith +# situation:the_christian_church.var:tcc_main_power_faith ?= { NOT = { has_doctrine = doctrine_temporal_head } } +#} + +#pam_is_ecumenical_patriarch_trigger = { +# faith = faith:christian_faith +# exists = faith.religious_head +# this = faith.religious_head +# OR = { +# faith.religious_head_title ?= title:d_et_constantinople +# faith.religious_head_title ?= title:k_orthodox +# } +#} + +# Great Schism: schism stance champions $RITE$ ($OTHER_RITE$ is the opposing side). Character scope +#pam_schism_stance_supports_rite_trigger = { +# OR = { +# AND = { +# var:pam_schism_stance ?= flag:mainline +# faith:christian_faith.main_rite ?= rite:$RITE$ +# } +# AND = { +# var:pam_schism_stance ?= flag:competitor +# faith:christian_faith.main_rite ?= rite:$OTHER_RITE$ +# } +# } +#} + +#pam_schism_is_chalcedonian_trigger = { +# OR = { +# faith = scope:schism_western_faith +# faith = scope:schism_eastern_faith +# faith = faith:christian_faith +# } +#} + +# Great Schism: has a personal tenet dear to $RITE$. Character scope +#pam_has_personal_tenet_of_rite_trigger = { +# any_personal_tenet = { +# rite:$RITE$ ?= { rite_has_tenet = prev } +# } +#} + +# The delegate's rite is $RITE$, not the judging host's, on a character +#pam_ecumenical_council_rite_delegate_trigger = { +# this != root +# rite = rite:$RITE$ +#} + +# Heading a rite does not make the holder follow it +#pam_is_head_of_schism_pair_rite_trigger = { +# OR = { +# AND = { +# rite = rite:roman_rite +# rite:roman_rite.head_of_rite ?= this +# } +# AND = { +# rite = rite:byzantine_rite +# rite:byzantine_rite.head_of_rite ?= this +# } +# } +#} + +# Great Schism: $FIRST$ and $SECOND$ follow opposite schism-pair rites. False if unset. Any scope +#pam_schism_characters_in_opposite_pair_rites_trigger = { +# situation:the_christian_church ?= { +# exists = var:schism_mainline_rite +# exists = var:schism_competitor_rite +# OR = { +# AND = { +# $FIRST$.rite ?= var:schism_mainline_rite +# $SECOND$.rite ?= var:schism_competitor_rite +# } +# AND = { +# $FIRST$.rite ?= var:schism_competitor_rite +# $SECOND$.rite ?= var:schism_mainline_rite +# } +# } +# } +#} + +# Great Schism: $HEAD$ heads one schism-pair rite; $OTHER$ follows the opposing. False if unset. Any scope +#pam_schism_head_of_rite_and_opposing_character_trigger = { +# situation:the_christian_church ?= { +# exists = var:schism_mainline_rite +# exists = var:schism_competitor_rite +# OR = { +# AND = { +# var:schism_mainline_rite.head_of_rite ?= $HEAD$ +# $OTHER$.rite ?= var:schism_competitor_rite +# } +# AND = { +# var:schism_competitor_rite.head_of_rite ?= $HEAD$ +# $OTHER$.rite ?= var:schism_mainline_rite +# } +# } +# } +#} + +# $RITE$ must be absolute (scope:/root./rite:), and this works in any scope +# A bare rite link silently resolves to nothing inside the situation +#pam_schism_rite_in_pair_trigger = { +# situation:the_christian_church ?= { +# exists = var:schism_mainline_rite +# exists = var:schism_competitor_rite +# OR = { +# $RITE$ ?= var:schism_mainline_rite +# $RITE$ ?= var:schism_competitor_rite +# } +# } +#} + +# Great Schism: $COUNTY$'s rite is one of the schism-pair rites. False if unset. Any scope +#pam_schism_county_rite_in_pair_trigger = { +# situation:the_christian_church ?= { +# exists = var:schism_mainline_rite +# exists = var:schism_competitor_rite +# OR = { +# $COUNTY$.rite ?= var:schism_mainline_rite +# $COUNTY$.rite ?= var:schism_competitor_rite +# } +# } +#} + +# Root is the converting ruler, this is the one who stayed on $RITE$ +#pam_schism_rite_dissenter_valid_trigger = { +# this != root +# is_alive = yes +# is_adult = yes +# is_imprisoned = no +# rite ?= $RITE$ +#} + +is_clerical_appointment_valid_trigger = { + $TITLE$ = { save_temporary_scope_as = title_temp } + $CANDIDATE$ = { save_temporary_scope_as = candidate_temp } + $TOP_LIEGE$ = { save_temporary_scope_as = top_liege_temp } + trigger_if = { + limit = { exists = scope:title_temp } + custom_tooltip = { # Has relevant law + text = has_appointment_succession_tt + $TITLE$ = { + OR = { + has_title_law = clerical_appointment_law + holder ?= { has_realm_law = clerical_appointment_law } + } + } + } + custom_tooltip = { # Titles below the holder's primary tier are inherited alongside it, so they cannot be contested on their own + text = follows_other_title_appointment_tt + scope:title_temp.holder ?= { primary_title.tier = scope:title_temp.tier } + } + } + is_clerical_appointment_valid_base_trigger = { + CANDIDATE = $CANDIDATE$ + TOP_LIEGE = $TOP_LIEGE$ + } +} + +# Secular crowns only reach sees in their realm, while ecclesiastical and Head of Rite are unrestricted +pam_clerical_candidacy_reach_limited_trigger = { + scope:actor = { + NOR = { + government_has_flag = government_is_ecclesiastical + this = faith.main_rite.head_of_rite + AND = { + is_landless_adventurer = yes + scope:secondary_recipient ?= this + } + } + } +} + +influence_clerical_candidacy_reach_trigger = { + trigger_if = { + limit = { + pam_clerical_candidacy_reach_limited_trigger = yes + } + custom_tooltip = { + text = influence_clerical_candidacy_outside_realm_tt + scope:target = { + holder ?= { target_is_same_character_or_above = scope:actor } + } + } + } +} + +influence_clerical_candidacy_any_valid_title_trigger = { + scope:actor.faith ?= { + any_clerical_region_title = { + OR = { + has_title_law = clerical_appointment_law + holder ?= { has_realm_law = clerical_appointment_law } + } + NOT = { holder ?= scope:secondary_recipient } + trigger_if = { + limit = { + pam_clerical_candidacy_reach_limited_trigger = yes + } + holder ?= { target_is_same_character_or_above = scope:actor } + } + } + } +} + +pam_head_of_faith_candidacy_valid_title_trigger = { + has_clerical_region = no + trigger_if = { + limit = { exists = holder } + has_order_of_succession = appointment + } +} + +influence_head_of_faith_candidacy_target_trigger = { + custom_tooltip = { + text = influence_head_of_faith_candidacy_not_created_tt + exists = scope:target.holder + } + # has_order_of_succession resolves the holder's realm laws, so both checks stay behind the holder check + trigger_if = { + limit = { exists = scope:target.holder } + custom_tooltip = { + text = has_appointment_succession_tt + scope:target = { has_order_of_succession = appointment } + } + custom_tooltip = { + text = influence_head_of_faith_candidacy_same_faith_tt + scope:target.holder ?= { faith = scope:actor.faith } + } + } +} + +is_clerical_appointment_valid_base_trigger = { + $CANDIDATE$ = { save_temporary_scope_as = candidate_temp } + $TOP_LIEGE$ = { save_temporary_scope_as = top_liege_temp } + scope:candidate_temp = { + is_adult = yes + faith = scope:top_liege_temp.faith # Must be of the same faith + custom_tooltip = { + text = can_be_appointed_interaction_tt + OR = { + can_be_granted_theocratic_titles_by = { RULER = scope:top_liege_temp } # Gender checks + AND = { + is_diarch_of_target = scope:top_liege_temp + scope:top_liege_temp = { has_diarchy_active_parameter = diarchy_is_co_rulership } + } + } + } + custom_tooltip = { + text = can_be_appointed_interaction_clergy_tt + OR = { # Clergy or Lay Clergy + is_clergy = yes + rite = { rite_has_parameter = lay_clergy } # HoF cannot be temporal if you have Theocratic clergy, so no need to check for that + this = scope:top_liege_temp.player_heir # Designated Theocratic Heir + AND = { + is_landless_adventurer = yes + this = scope:top_liege_temp + } + } + } + custom_tooltip = { # Only theocracies + text = only_theocratic_tt + OR = { + government_has_flag = government_is_theocracy + is_landed = no + } + } + custom_tooltip = { # Barred from holding titles + text = can_be_appointed_interaction_can_inherit_tt + NOR = { + has_trait = order_member + has_trait = gallivanter + has_trait = disinherited + } + } + } +} + +# Expects interaction scopes actor/target/secondary_recipient +pam_clerical_self_candidacy_restriction_trigger = { + trigger_if = { + limit = { + exists = scope:secondary_recipient + scope:actor = { + is_landless_adventurer = yes + this = scope:secondary_recipient + } + } + scope:actor = { + employs_court_position = camp_priest_camp_officer + } + } + trigger_if = { + limit = { + exists = scope:target + scope:actor ?= scope:secondary_recipient + scope:actor = { + any_held_title = { has_clerical_region = yes } + } + } + custom_tooltip = { + text = pam_clerical_self_candidacy_restriction_tt + scope:target = { + OR = { + this = title:d_et_constantinople + is_head_of_faith = yes + holder ?= { faith.religious_head ?= this } + } + } + } + } +} + + +pam_investiture_supports_spiritual_revocable_trigger = { + # Both flag values are read so neither is flagged "set but never used". + trigger_if = { + limit = { + has_variable = investiture_stance + var:investiture_stance = flag:spiritual_revocable + } + always = yes + } + trigger_else_if = { + limit = { + has_variable = investiture_stance + var:investiture_stance = flag:temporal_revocable + } + always = no + } + trigger_else = { + # is_clergy too: landless chaplains have no government, so the flag would count them as secular + OR = { + government_is_religious_trigger = yes + is_clergy = yes + } + } +} + +pam_investiture_council_voter_supports_spiritual_trigger = { + trigger_if = { + limit = { + exists = puppeteer + puppeteer = { has_theological_agent_puppet_trigger = yes } + } + puppeteer = { pam_investiture_supports_spiritual_revocable_trigger = yes } + } + trigger_else = { + pam_investiture_supports_spiritual_revocable_trigger = yes + } +} + +pam_investiture_council_voter_has_locked_stance_trigger = { + trigger_if = { + limit = { + exists = puppeteer + puppeteer = { has_theological_agent_puppet_trigger = yes } + } + puppeteer = { has_variable = investiture_stance } + } + trigger_else = { + has_variable = investiture_stance + } +} + +#pam_can_use_investiture_conflict_cb_trigger = { +# has_pam_dlc_trigger = yes +# faith = { religion = religion:christianity_religion } +# situation:the_christian_church ?= { +# has_situation_top_phase_parameter = the_christian_church_investiture_controversy +# } +# # We block new conflicts while the council is pending, as a war would pull the host away and cancel it +# custom_tooltip = { +# text = pam_investiture_cb_council_pending_tt +# NOT = { faith = { has_variable = investiture_council_pending } } +# } +#} + +# scope:attacker is the aggressor, and the defender is root +pam_valid_investiture_conflict_target_trigger = { + this != scope:attacker + faith = scope:attacker.faith + trigger_if = { + limit = { scope:attacker = { pam_investiture_supports_spiritual_revocable_trigger = yes } } + NOT = { pam_investiture_supports_spiritual_revocable_trigger = yes } + } + trigger_else = { + pam_investiture_supports_spiritual_revocable_trigger = yes + } +} + +#pam_main_power_faith_conditional_appointment_trigger = { +# situation:the_christian_church.var:tcc_main_power_faith ?= { +# has_doctrine = doctrine_clerical_succession_conditional +# } +#} + +#pam_investiture_crisis_has_contested_faith_trigger = { +# situation:the_christian_church.var:tcc_main_power_faith ?= { +# has_doctrine = doctrine_clerical_succession_conditional +# exists = religious_head +# } +#} + +pam_available_investiture_hof_ai_trigger = { + is_ai = yes + is_alive = yes + is_adult = yes + is_imprisoned = no + is_incapable = no + is_commanding_army = no + has_contagious_deadly_disease_trigger = no +} + +pam_valid_investiture_council_host_trigger = { + is_ai = yes + is_available_adult = yes + is_landed = yes + # PAM archbishops often fail the is_clergy org match + government_has_flag = government_is_ecclesiastical + can_hold_ecumenical_council_trigger = yes + NOT = { faith.religious_head = this } + # any_held_title avoids the landless context-switch primary_title would cause + any_held_title = { + tier >= tier_duchy + has_clerical_region = yes + } +} + +###Sell Claim### +# True if TARGET, a county title, lies within a clerical region the scoped character holds. +pam_sell_claim_target_in_own_clerical_region_trigger = { + exists = $TARGET$.clerical_region_title + any_held_title = { + has_clerical_region = yes + this = $TARGET$.clerical_region_title + } +} + +# Shared with has_valid_target_showing_failures_only: can_be_picked_title is not rechecked on send +pam_can_sell_claim_on_target_trigger = { + scope:target = { + is_landless_type_title = no + is_head_of_faith = no + } + custom_tooltip = { + text = sell_claim_target_must_be_in_clerical_region_tt + scope:puppet_or_actor ?= { + OR = { + pam_sell_claim_target_in_own_clerical_region_trigger = { TARGET = scope:target } + faith.religious_head ?= this + } + } + } + custom_tooltip = { + text = sell_claim_recipient_must_not_hold_title_tt + scope:target ?= { + NOT = { + holder ?= scope:recipient + } + } + } + custom_tooltip = { + text = sell_claim_recipient_must_not_have_claim_tt + scope:recipient = { + NOT = { + has_claim_on = scope:target + } + } + } + # Realm scan, so it sits behind the cheap ownership and claim gates + custom_tooltip = { + text = sell_claim_recipient_must_border_target_tt + scope:target ?= { + is_neighbor_to_realm = scope:recipient + } + } +} + +###Gift Claim### +pam_gift_claim_recipient_in_own_clerical_region_trigger = { + exists = $TARGET$.capital_county.clerical_region_title + any_held_title = { + has_clerical_region = yes + this = $TARGET$.capital_county.clerical_region_title + } +} + +pam_gift_claim_valid_title_trigger = { + $TITLE$ = { + tier = tier_county + faith ?= scope:puppet_or_actor.faith + NOT = { holder ?= scope:recipient } + holder ?= { + NOR = { + government_has_flag = government_is_ecclesiastical + government_has_flag = government_is_theocracy + } + } + } + scope:puppet_or_actor ?= { + OR = { + pam_sell_claim_target_in_own_clerical_region_trigger = { TARGET = $TITLE$ } + faith.religious_head ?= this + } + } + scope:recipient = { + NOT = { has_claim_on = $TITLE$ } + } +} + +pam_can_gift_claim_on_target_trigger = { + custom_tooltip = { + text = gift_claim_target_must_be_county_of_faith_tt + scope:target ?= { + tier = tier_county + faith ?= scope:puppet_or_actor.faith + } + } + custom_tooltip = { + text = gift_claim_target_must_be_in_clerical_region_tt + trigger_if = { + limit = { scope:target ?= { tier = tier_county } } + scope:puppet_or_actor ?= { + OR = { + pam_sell_claim_target_in_own_clerical_region_trigger = { TARGET = scope:target } + faith.religious_head ?= this + } + } + } + } + custom_tooltip = { + text = gift_claim_target_must_not_be_church_held_tt + scope:target.holder ?= { + NOR = { + government_has_flag = government_is_ecclesiastical + government_has_flag = government_is_theocracy + } + } + } + custom_tooltip = { + text = gift_claim_recipient_must_not_hold_title_tt + scope:target ?= { + NOT = { + holder ?= scope:recipient + } + } + } + custom_tooltip = { + text = gift_claim_recipient_must_not_have_claim_tt + scope:recipient = { + NOT = { + has_claim_on = scope:target + } + } + } +} + +can_influence_clerical_appointment_trigger = { + faith = { has_doctrine_parameter = has_clerical_regions } + OR = { + has_realm_law = clerical_appointment_law + any_held_title = { + has_title_law = clerical_appointment_law + } + cp:councillor_court_chaplain ?= { + OR = { + has_realm_law = clerical_appointment_law + any_held_title = { + has_title_law = clerical_appointment_law + } + } + } + # Capital see filled by appointment still matters even if the realm priest is landless + capital_county.clerical_region_title ?= { + OR = { + has_title_law = clerical_appointment_law + holder ?= { has_realm_law = clerical_appointment_law } + } + } + } +} + +pam_cathedral_project_requirements_trigger = { + has_pam_dlc_trigger = yes + highest_held_title_tier >= tier_duchy + has_spiritual_fulfillment_type = christian_fulfillment +} + +# Landless clerical titles: title_capital_county is the holder's current location, not the fixed see +is_valid_cathedral_clerical_region_capital_trigger = { + trigger_if = { + limit = { exists = county.clerical_region_title } + custom_tooltip = { + text = great_project_cathedral_clerical_region_capital_tt + county.clerical_region_title.title_domicile.domicile_location ?= this + } + } + trigger_else_if = { + limit = { root = { pam_is_clerical_region_holder_trigger = yes } } + custom_tooltip = { + text = great_project_cathedral_clerical_region_holder_capital_tt + always = no + } + } + trigger_else = { + always = yes + } +} + +is_valid_cathedral_spot_in_province_trigger = { + custom_tooltip = { + text = no_under_construction_or_same_level_great_project_cathedral_building_tt + NOR = { + has_building_with_flag = great_project_cathedral_building + any_great_project_in_province = { + OR = { + great_project_type = pam_cathedral_01 + great_project_type = pam_cathedral_02 + great_project_type = pam_cathedral_03 + } + } + } + } + has_great_building = no +} + +has_cathedral_great_project_building_trigger = { + has_building_with_flag = great_project_cathedral_building +} + +is_valid_cathedral_upgrade_spot_in_province_trigger = { + custom_tooltip = { + text = great_project_cathedral_01_required_for_upgrade_tt + has_building = great_project_cathedral_01 + NOT = { has_building = great_project_cathedral_02 } + NOT = { has_building = great_project_cathedral_03 } + } + custom_tooltip = { + text = no_cathedral_upgrade_in_progress_tt + NOR = { + has_building = great_project_cathedral_under_construction + any_great_project_in_province = { + OR = { + great_project_type = pam_cathedral_01 + great_project_type = pam_cathedral_02 + great_project_type = pam_cathedral_03 + } + } + } + } +} + +is_valid_cathedral_tier_3_upgrade_spot_in_province_trigger = { + custom_tooltip = { + text = great_project_cathedral_02_required_for_tier_3_upgrade_tt + has_building = great_project_cathedral_02 + NOT = { has_building = great_project_cathedral_03 } + } + custom_tooltip = { + text = no_cathedral_upgrade_in_progress_tt + NOR = { + has_building = great_project_cathedral_under_construction + any_great_project_in_province = { + OR = { + great_project_type = pam_cathedral_01 + great_project_type = pam_cathedral_02 + great_project_type = pam_cathedral_03 + } + } + } + } +} + +has_accessible_cathedral_tier_2_upgrade_site_trigger = { + trigger_if = { + limit = { + NOT = { + this = faith.religious_head + } + is_clergy = no + } + any_sub_realm_county = { + any_county_province = { + is_valid_cathedral_upgrade_spot_in_province_trigger = yes + } + } + } + trigger_else = { + faith = { + any_faith_ruler = { + highest_held_title_tier >= tier_county + any_realm_county = { + any_county_province = { + is_valid_cathedral_upgrade_spot_in_province_trigger = yes + } + } + } + } + } +} + +has_accessible_cathedral_tier_3_upgrade_site_trigger = { + trigger_if = { + limit = { + NOT = { + this = faith.religious_head + } + is_clergy = no + } + any_sub_realm_county = { + any_county_province = { + is_valid_cathedral_tier_3_upgrade_spot_in_province_trigger = yes + } + } + } + trigger_else = { + faith = { + any_faith_ruler = { + highest_held_title_tier >= tier_county + any_realm_county = { + any_county_province = { + is_valid_cathedral_tier_3_upgrade_spot_in_province_trigger = yes + } + } + } + } + } +} + +is_valid_cathedral_master_mason_contributor_trigger = { + OR = { + AND = { + is_ai = yes + this = scope:founder + } + has_trait = architect + employs_court_position = royal_architect_court_position + stewardship >= $STEWARDSHIP_THRESHOLD$ + any_courtier = { + OR = { + has_trait = architect + stewardship >= $STEWARDSHIP_THRESHOLD$ + } + } + cp:councillor_steward ?= { + stewardship >= $STEWARDSHIP_THRESHOLD$ + } + } +} + +is_valid_cathedral_facade_contributor_trigger = { + OR = { + learning >= extremely_high_skill_rating + AND = { + highest_held_title_tier >= tier_kingdom + custom_tooltip = { + text = has_good_royal_architect_tt + any_court_position_holder = { + type = royal_architect_court_position + aptitude = { court_position = royal_architect_court_position value >= 3 } + } + } + } + } +} + +take_the_vows_valid_monastic_order_trigger = { + leader ?= { + government_has_flag = government_is_monastic_holy_order + NOT = { + is_at_war_with = $CHARACTER$ + } + } +} + +pam_is_monastic_order_member_trigger = { + OR = { + government_has_flag = government_is_monastic_holy_order + AND = { + has_trait = order_member + OR = { + liege ?= { government_has_flag = government_is_monastic_holy_order } + host ?= { government_has_flag = government_is_monastic_holy_order } + } + } + } +} + +pam_is_military_order_member_trigger = { + OR = { + government_has_flag = government_is_military_holy_order + AND = { + has_trait = order_member + OR = { + liege ?= { government_has_flag = government_is_military_holy_order } + host ?= { government_has_flag = government_is_military_holy_order } + } + } + } +} + +hyperdulia_take_the_vows_trigger = { + scope:recipient = { + is_female = yes + is_child_of = scope:puppet_or_actor + } + scope:puppet_or_actor = { + has_personal_tenet_flag = tenet_hyperdulia_daughter_vows_bonus + } +} + + +faith_has_monasticism_trigger = { + OR = { + has_doctrine = doctrine_monasticism_encouraged + has_doctrine = doctrine_monasticism_accepted + main_rite = { + OR = { + rite_has_doctrine = doctrine_monasticism_encouraged + rite_has_doctrine = doctrine_monasticism_accepted + } + } + } +} + +pam_rite_values_martial_clergy_trigger = { + rite = { + OR = { + rite_has_tenet = tenet_warmonger + rite_has_tenet = tenet_unrelenting_faith + } + } +} + +# We skip is_landed because ecclesiastical government is landless_playable +pam_court_wants_monk_courtiers_trigger = { + has_pam_dlc_trigger = yes + is_ruler = yes + highest_held_title_tier >= tier_county # A village priest is not a bishop with a familia + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + pam_government_is_religious_playable_trigger = yes + faith = { faith_has_monasticism_trigger = yes } + primary_title = { + is_mercenary_company = no + is_holy_order = no + } +} + +# Province holds a temple leased to a monastic order +pam_province_has_monastic_lease_trigger = { + has_holding_type = church_holding + barony = { + is_leased_out = yes + lessee = { government_has_flag = government_is_monastic_holy_order } + } +} + +# The courtier is the scope so kin stay eligible for appointment standing +pam_clerical_court_ordain_candidate_trigger = { + is_adult = yes + is_available = yes + is_clergy = no + is_ruler = no + is_landed = no + exists = employer + faith = employer.faith + NOR = { + is_spouse_of = employer + is_consort_of = employer + betrothed ?= employer + } +} + +# Court cleric with room left to grow under the develop-clerical-court caps. Evaluated on the courtier. +pam_clerical_court_pupil_trigger = { + is_adult = yes + is_available = yes + is_clergy = yes + is_ruler = no + exists = employer + faith = employer.faith + OR = { + learning < employer.pam_clerical_court_learning_cap_value + NOT = { has_trait = lifestyle_scholar } + NOT = { has_trait = lifestyle_mystic } + } +} + +pam_clerical_court_novice_trigger = { + is_adult = yes + is_physically_able = yes + age < 60 + NOT = { + culture = { has_cultural_tradition = tradition_diasporic } + } + OR = { + faith = $RULER$.faith + NOT = { has_trait = zealous } + } +} + +faith_has_sacraments_central_trigger = { + OR = { + has_doctrine = doctrine_sacraments_central + main_rite = { rite_has_doctrine = doctrine_sacraments_central } + } +} + +faith_has_sacraments_trigger = { + OR = { + has_doctrine = doctrine_sacraments_central + main_rite = { rite_has_doctrine = doctrine_sacraments_central } + } +} + +#SCRIPTED TRIGGER FOR GENERAL HOLY ORDER INTERACTIONS, TO FIND ORDERS WITH LEASED HOLDINGS NEARBY +#Find leased title within a believe range that you would reasonable have access to or care about +holy_order_range_trigger = { + custom_tooltip = { + text = monastic_holdings_too_distant_tt + any_leased_title = { + OR = { + county = { + save_temporary_scope_as = monastic_county + OR = { + $CHARACTER$ = { + any_sub_realm_county = { + this = scope:monastic_county + } + } + clerical_region_title.holder ?= $CHARACTER$ + } + } + county = { + any_title_to_title_neighboring_and_across_water_county = { + OR = { + clerical_region_title.holder ?= $CHARACTER$ + holder = { + OR = { + this = $CHARACTER$ + any_liege_or_above = { + this = $CHARACTER$ + } + } + } + } + } + } + } + } + } +} + +government_is_religious_trigger = { + OR = { + government_has_flag = government_is_theocracy + government_has_flag = government_is_holy_order + } +} + +#pam_better_siphon_treasury_trigger = { +# top_participant_group:the_christian_church ?= { +# has_participant_group_parameter = the_christian_church_better_siphon_treasury +# } +#} + +# No Annoinments during the Investiture Crisis +#pam_the_christian_church_no_coronation_trigger = { +# top_participant_group:the_christian_church ?= { +# has_participant_group_parameter = the_christian_church_no_coronation +# } +#} + +# Secular rulers who follow an Antipope can be anointed by them while the mainline hierarchy refuses +#pam_the_christian_church_antipope_coronations_trigger = { +# top_participant_group:the_christian_church ?= { +# has_participant_group_parameter = the_christian_church_antipope_coronations +# } +#} + +# Anointment is sought from this authority, and $RULER$ is the ruler seeking it +# We still let an antipope anoint their followers, otherwise Investiture Crisis blocks the mainline +#pam_the_christian_church_no_anointment_trigger = { +# save_temporary_scope_as = pam_anointment_authority_check +# trigger_if = { +# limit = { +# pam_is_antipope_trigger = yes +# $RULER$ = { +# pam_the_christian_church_antipope_coronations_trigger = yes +# religious_head_or_challenger ?= scope:pam_anointment_authority_check +# } +# } +# always = no +# } +# trigger_else = { +# pam_the_christian_church_no_coronation_trigger = yes +# } +#} + +# Any living ruler of kingdom tier or above whose capital lies in Europe and follows a non-Christian religion +pam_non_christian_kingdom_holder_in_europe_trigger = { + any_ruler = { + is_alive = yes + OR = { + religion != religion:catholic_religion + religion != religion:protestant_religion + religion != religion:eastern_orthodox_religion + religion != religion:oriental_orthodox_religion + } + highest_held_title_tier >= tier_kingdom + capital_province = { + geographical_region = world_europe + } + NOT = { has_variable = pam_non_christian_kingdom_holder_in_europe_trigger_var } # To avoid the same ruler counting every year + } +} + +can_have_puppets_trigger = { + is_available_quick = { + adult = yes + advanced_ruler = yes + } + NOR = { + government_has_flag = government_is_mercenary + government_has_flag = government_is_herder + } + highest_held_title_tier >= tier_county +} + +can_have_external_ruler_puppet_trigger = { + can_have_puppets_trigger = yes + has_pam_dlc_trigger = yes +} + +can_have_theological_agent_puppet_trigger = { + can_have_puppets_trigger = yes + rite = { + OR = { + rite_has_doctrine = doctrine_theocracy_temporal + rite_has_doctrine = doctrine_monasticism_accepted + rite_has_doctrine = doctrine_monasticism_encouraged + } + } + has_pam_dlc_trigger = yes +} + +can_have_realm_priest_puppet_trigger = { + can_have_puppets_trigger = yes + government_allows = council + rite = { rite_has_doctrine = doctrine_theocracy_temporal } + is_clergy = no + tgp_has_access_to_ministry_trigger = no + NOT = { government_has_flag = government_is_nomadic } +} + +# Ecclesiastical government is landless_playable, so do not filter these on is_landed +pam_landless_playable_cleric_trigger = { + has_pam_dlc_trigger = yes + government_has_flag = government_is_ecclesiastical +} + +# Archbishop (clerical region title holder) or above them in the hierarchy: Head of Rite or Head of Faith +pam_is_archbishop_or_higher_trigger = { + OR = { + any_held_title = { has_clerical_region = yes } + religious_head_or_challenger ?= this + } +} + +# A cardinal, Head of Rite, or archbishop of $CHARACTER$'s faith +pam_is_senior_cleric_of_character_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + faith = $CHARACTER$.faith + OR = { + exists = clerical_elector_title + $CHARACTER$.rite.head_of_rite ?= this + any_held_title = { has_clerical_region = yes } + } +} + +# A character is a theological puppet if they have a puppeteer who keeps them as a (external) theological puppet. +is_theological_agent_puppet_trigger = { + trigger_if = { + limit = { + exists = scope:puppeteer + } + scope:puppeteer = { + has_theological_agent_puppet_trigger = yes + } + } + trigger_else = { + custom_tooltip = { + text = no_puppeteer_tt + always = no + } + } +} + +# A character has a theological puppet if they keep either an internal or external theological puppet. +has_theological_agent_puppet_trigger = { + custom_tooltip = { + text = no_clerical_puppet_tt + OR = { + exists = scope:puppet + exists = puppet:theological_agent_puppet + exists = puppet:external_theological_agent_puppet + } + } +} + +puppet_action_puppet_is_secular_ruler_trigger = { + puppet:external_ruler_puppet ?= scope:puppet +} + +# The acting character is the scope, and on the puppet action path that is the puppet +# A puppet standing in for a missing Head of Faith defers to its puppeteer +can_manage_faith_holy_sites_trigger = { + trigger_if = { + limit = { exists = faith.religious_head } + custom_tooltip = { + text = manage_holy_sites_hof_or_puppet_tt + OR = { + faith.religious_head ?= this + puppet:theological_agent_puppet ?= faith.religious_head + puppet:external_theological_agent_puppet ?= faith.religious_head + } + } + } + trigger_else = { + trigger_if = { + limit = { exists = puppeteer } + puppeteer = { can_manage_faith_holy_sites_without_hof_trigger = yes } + } + trigger_else = { + can_manage_faith_holy_sites_without_hof_trigger = yes + } + } +} + +# Substitute authority for a faith with no head of faith: a realm priest puppet plus piety standing. +can_manage_faith_holy_sites_without_hof_trigger = { + OR = { + custom_tooltip = { + text = manage_holy_sites_realm_priest_puppet_tt + # puppet: errors on non-playable characters, so we only check playable ones and tooltips never run it + trigger_if = { + limit = { is_playable_character = yes } + exists = puppet:theological_agent_puppet + } + trigger_else = { + always = no + } + } + government_has_flag = government_is_theocracy + } + custom_tooltip = { + text = manage_holy_sites_piety_level_tt + piety_level >= 4 + } +} + +can_create_faith_holy_site_trigger = { + OR = { + can_manage_faith_holy_sites_trigger = yes + AND = { + is_independent_ruler = yes + highest_held_title_tier >= tier_kingdom + piety_level >= 4 + save_temporary_scope_as = holy_site_creator + $BARONY$.holder ?= { + target_is_same_character_or_above = scope:holy_site_creator + } + $BARONY$.county.holder.faith ?= faith + exists = faith.religious_head + faith.religious_head = { + opinion = { + target = scope:holy_site_creator + value > 0 + } + } + } + } +} + +holy_site_free_action_show_usage_trigger = { + trigger_if = { + limit = { faith_has_free_holy_site_action_trigger = yes } + save_temporary_scope_as = faith + custom_tooltip = { + text = holy_site_decision_free_action_cost + always = yes + } + } +} + +# The attendee is the teacher, and root is the student receiving the activity event +ecumenical_shareable_unknown_tenet_for_root_trigger = { + save_temporary_scope_as = ecumenical_tenet_teacher + any_character_tenet = { + knowledge_filter = known + save_temporary_scope_as = ecumenical_tenet_candidate + NOT = { root = { knows_tenet = scope:ecumenical_tenet_candidate } } + root.faith.main_rite = { + has_tenet_status = { + tenet = scope:ecumenical_tenet_candidate + status = unknown + } + } + trigger_if = { + limit = { + exists = scope:tenet_a_temp + } + NOT = { + this = scope:tenet_a_temp + } + } + trigger_if = { + limit = { + exists = scope:tenet_target_a_shareable_tenet + } + NOT = { + this = scope:tenet_target_a_shareable_tenet + } + } + count >= 1 + } +} + +pam_request_legitimacy_priest_trigger = { + this != $CHARACTER$ + OR = { + $CHARACTER$.religious_head_or_challenger = this + government_has_flag = government_is_ecclesiastical + } + faith = $CHARACTER$.faith +} + +pam_ecclesiastical_superior_or_subordinate_trigger = { + NOR = { + $ACTOR$ = $RECIPIENT$ + AND = { + exists = $ACTOR$.religious_head_or_challenger + exists = $RECIPIENT$.religious_head_or_challenger + $ACTOR$.religious_head_or_challenger != $RECIPIENT$.religious_head_or_challenger + } + } + OR = { + $ACTOR$ = { + OR = { + superior ?= $RECIPIENT$ + superior.superior ?= $RECIPIENT$ + } + } + $RECIPIENT$ = { + OR = { + superior ?= $ACTOR$ + superior.superior ?= $ACTOR$ + } + } + } +} + +pam_not_antipope_when_recipient_is_hof_tt = { + trigger_if = { + limit = { + scope:recipient ?= $CHARACTER$.faith.religious_head + } + $CHARACTER$ = { + trigger_if = { + limit = { pam_is_antipope_trigger = yes } + custom_tooltip = { + text = is_antipope_blocked_tt + always = no + } + } + } + } +} + +#Does the province have a domicile that whose owner is the same rite as the character in question and also has a cathedral school level 3 (has_domicile_parameter = domicile_building_is_university) +has_domicile_building_cathedral_school = { + $LOCATION$ = { + any_province_domicile = { + has_domicile_parameter = domicile_building_is_university + owner = { + rite = $CHARACTER$.rite + $CHARACTER$.capital_county.clerical_region_title.holder ?= this + } + } + } +} + +# Kingdom of Heaven — no other character of your faith has a higher Piety Level (ties at same level allowed) +pam_kingdom_of_heaven_has_highest_piety_level_in_faith_trigger = { + NOT = { + root.faith = { + any_faith_character = { + NOT = { this = root } + piety_level > root.piety_level + } + } + } +} + +# Either there is no independent emperor-tier ruler of your faith, or you have a hook on each of them +pam_kingdom_of_heaven_hooks_on_all_faith_emperors_or_none_trigger = { + NOT = { + any_independent_ruler = { + NOT = { this = root } + is_landed = yes + faith = root.faith + highest_held_title_tier >= tier_empire + save_temporary_scope_as = emperor_temp + NOT = { + root = { has_hook = scope:emperor_temp } + } + } + } +} + +# At least half of the worldwide same faith counties are in your realm +pam_kingdom_of_heaven_half_faith_in_realm_trigger = { + pam_koh_same_faith_realm_counties_value >= pam_koh_half_faith_counties_required_value +} + +# For identifying religious player trigger (Theocratic ruler events) +pam_government_is_religious_playable_trigger = { + OR = { + government_has_flag = government_is_theocracy + government_has_flag = government_is_ecclesiastical + } +} + +pam_actor_is_clerical_title_authority_of_this_trigger = { + trigger_if = { + limit = { exists = religious_head_or_challenger } + religious_head_or_challenger = scope:puppet_or_actor + } + trigger_else = { + faith.main_rite.head_of_rite ?= scope:puppet_or_actor + } +} + +pam_is_clerical_title_authority_trigger = { + trigger_if = { + limit = { exists = religious_head_or_challenger } + religious_head_or_challenger = this + } + trigger_else = { + faith.main_rite.head_of_rite ?= this + } +} + +pam_recipient_is_clerical_title_authority_trigger = { + trigger_if = { + limit = { exists = scope:puppet_or_actor.religious_head_or_challenger } + scope:puppet_or_actor.religious_head_or_challenger ?= scope:recipient + } + trigger_else = { + scope:puppet_or_actor.faith.main_rite.head_of_rite ?= scope:recipient + } +} + +# secondary_recipient if present (replace), else recipient (grant) +pam_grant_ecclesiastical_title_appointee_changes_rite_trigger = { + trigger_if = { + limit = { exists = scope:secondary_recipient } + scope:secondary_recipient.rite != scope:target.holder.rite + } + trigger_else = { + scope:recipient.rite != scope:target.holder.rite + } +} + +# Non-military clergy ruler: generic theocracy, Christian ecclesiastical, or monastic holy order. +pam_is_clergy_ruler_trigger = { + OR = { + government_has_flag = government_is_theocracy + government_has_flag = government_is_ecclesiastical + government_has_flag = government_is_monastic_holy_order + } +} + +# Dynastic approval is a separate authority and still applies +# We require the DLC because government_is_theocracy already exists in the base game +pam_grants_own_divorce_trigger = { + has_pam_dlc_trigger = yes + pam_is_clergy_ruler_trigger = yes +} + +pam_clergy_continence_expected_trigger = { + rite = { + NOR = { + rite_has_parameter = tenet_carnal_exaltation_clergy_no_continence + trait_is_virtue_rite = lustful + } + } +} + +# Antipopes are filed as subordinates of the top superior +pam_court_scene_resident_subordinate_trigger = { + exists = location + location = scope:ruler.capital_province + is_available_healthy_ai_adult = yes + NOT = { has_short_disease_trigger = yes } + is_clergy = yes + pam_is_antipope_trigger = no +} + +pam_clergy_interactions_faith_trigger = { + faith = { NOT = { has_doctrine_parameter = unreformed } } + OR = { + #Has a theocratic head of faith + faith = { has_doctrine_parameter = spiritual_head_of_faith } + rite = { rite_has_parameter = theocracy_temple_lease } + } +} +claim_valid_faith_subordinate_trigger = { + pam_request_legitimacy_priest_trigger = { CHARACTER = scope:puppet_or_actor } + NOR = { + is_at_war_with = scope:puppet_or_actor + has_trait = excommunicated + } + # Also used to populate the recipient list, where no recipient exists yet + trigger_if = { + limit = { exists = scope:recipient } + NOR = { + this = scope:recipient + is_at_war_with = scope:recipient + } + } + is_available_quick = { + incapable = no + imprisoned = no + hostage = no + ruler = yes + adult = yes + } + highest_held_title_tier >= tier_duchy + OR = { + #Is head of faith + scope:puppet_or_actor.religious_head_or_challenger ?= scope:recipient + clergy_claim_title_responsibility_trigger = yes + #you gotta be able to use your puppet + scope:puppeteer ?= scope:puppet_or_actor + } +} +clergy_claim_title_responsibility_trigger = { + OR = { + #Clerical region overlaps + AND = { + any_held_title = { + has_clerical_region = yes + any_county_in_clerical_region = { + any_this_title_or_de_jure_above = { + holder ?= scope:recipient + } + } + } + } + #Landed title overlaps + AND = { + is_landed = yes + any_held_title = { + OR = { + #they have a title beneath recipient's titles + any_this_title_or_de_jure_above = { + holder ?= scope:recipient + } + #they have a title that presides over recipient's titles + any_in_de_jure_hierarchy = { + holder ?= scope:recipient + } + } + } + } + } +} +clergy_claims_hof_trigger = { + pam_request_legitimacy_priest_trigger = { CHARACTER = scope:puppet_or_actor } + NOT = { + is_at_war_with = scope:puppet_or_actor + } + is_available_quick = { + incapable = no + imprisoned = no + hostage = no + adult = yes + } + NOT = { + has_trait = excommunicated + } +} + +#When AI should be bothering player clergy with requests +pam_should_bother_clergy_interaction_trigger = { + $PRIEST$ = { + trigger_if = { + limit = { + scope:puppet_or_actor = { is_ai = yes } + is_ai = no + } + OR = { + scope:puppet_or_actor.highest_held_title_tier >= $PRIEST$.highest_held_title_tier + AND = { + scope:puppet_or_actor = { is_vassal_of = $PRIEST$ } + scope:puppet_or_actor.highest_held_title_tier >= $PRIEST$.highest_held_title_tier_minus_one + } + is_allied_to = scope:puppet_or_actor + AND = { + exists = house + house ?= scope:puppet_or_actor.house + } + is_heir_of = scope:puppet_or_actor + any_heir = { + this = scope:puppet_or_actor + } + } + } + } +} + +# Show the Offer Pilgrimage send option at all - hidden for rites that cannot pilgrimage +pam_offer_pilgrimage_option_shown_trigger = { + NOT = { + $ACTOR$.rite = { + rite_has_parameter = forbidden_from_pilgrimage + } + } +} + +pam_offer_pilgrimage_option_valid_trigger = { + $ACTOR$ = { + custom_tooltip = { + text = can_host_pilgrimage_tt + can_host_activity = activity_pilgrimage + } + gold > 0 + trigger_if = { + limit = { is_ai = yes } + highest_held_title_tier >= tier_kingdom + short_term_gold > monumental_gold_value + NOT = { + any_realm_county = { + has_province_with_epidemic = { intensity >= major } + } + } + } + } +} + +# Clerical interactions are blocked while a promised pilgrimage is unfulfilled +pam_not_promised_pilgrimage_trigger = { + $ACTOR$ = { + custom_tooltip = { + text = pam_blocked_by_promised_pilgrimage_tt + NOT = { has_character_modifier = promised_pilgrimage_to_clergy_modifier } + } + } +} + +pam_ai_deposable_cleric_trigger = { + NOR = { + has_relation_friend = $HEAD_OF_FAITH$ + has_relation_lover = $HEAD_OF_FAITH$ + } + OR = { + has_relation_rival = $HEAD_OF_FAITH$ + AND = { + $HEAD_OF_FAITH$ = { + NOR = { + has_trait = cynical + has_trait = arbitrary + has_trait = excommunicated + } + } + NOT = { has_imprisonment_reason = $HEAD_OF_FAITH$ } + OR = { + has_trait = excommunicated + $HEAD_OF_FAITH$ = { has_imprisonment_reason = prev } + } + } + } +} + +# We set this just under the default heresy threshold so rites convert before heresy fires +# Phase first: outside Reform the global lookup ends this before the per-see checks +#pam_ai_reform_rite_replacement_trigger = { +# situation:the_christian_church ?= { situation_current_phase = reform_phase } +# scope:actor.faith = { fervor < 50 } +# scope:target.holder ?= { +# rite != scope:actor.rite +# is_ai = yes +# rite = { +# "divergence(faith.main_rite)" >= 45 +# } +# } +# scope:recipient = { rite = scope:actor.rite } +# years_from_game_start >= 25 +#} + +pam_beseech_claims_access_trigger = { + has_pam_dlc_trigger = yes + pam_clergy_interactions_faith_trigger = yes + NOT = { + government_has_flag = government_is_ecclesiastical + } +} +pam_actor_rite_has_core_simony_trigger = { + scope:actor = { + rite = { + rite_has_parameter = tenet_simony_gold_donations + } + } +} + +pam_actor_has_simony_trigger = { + scope:actor = { + OR = { + rite = { rite_has_parameter = tenet_simony_ecclesiastical_purchase } + has_personal_tenet_flag = tenet_simony_ecclesiastical_purchase + } + } +} + +# Head of Rite dies while still subject to short_reign on their primary title. +pam_head_of_rite_had_short_reign_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + rite.head_of_rite ?= root + primary_title ?= { + title_held_years < 10 + } +} + +# Recipient is the scope, and we check the pointers before scanning counties +pam_rite_sway_connected_recipient_trigger = { + OR = { + is_courtier_of = $ACTOR$ + is_vassal_or_below_of = $ACTOR$ + top_liege ?= $ACTOR$.top_liege + capital_county.clerical_region_title.holder ?= $ACTOR$ + any_sub_realm_county = { + any_neighboring_county = { rite = $ACTOR$.rite } + } + } +} + +# We keep this in sync with sway_ruler_to_my_rite_interaction is_shown and is_valid +pam_sway_to_rite_diocese_candidate_trigger = { + this != $ARCHBISHOP$ + is_ruler = yes + is_adult = yes + faith = $ARCHBISHOP$.faith + rite != $ARCHBISHOP$.rite + NOR = { + has_trait = incapable + rite.head_of_rite ?= this + religious_head_or_challenger ?= this + } + capital_county.clerical_region_title.holder ?= $ARCHBISHOP$ +} + +# These are prelates of other dioceses still on another rite, for the peer petition important actions +pam_sway_to_rite_adjacent_prelate_candidate_trigger = { + this != $ARCHBISHOP$ + is_ruler = yes + is_adult = yes + faith = $ARCHBISHOP$.faith + rite != $ARCHBISHOP$.rite + NOR = { + has_trait = incapable + rite.head_of_rite ?= this + religious_head_or_challenger ?= this + } + any_held_title = { has_clerical_region = yes } +} + +# A Head of Faith on the mainline rite may call other Heads of Rite back to it, which Sway to Rite otherwise forbids +pam_sway_to_rite_head_of_faith_reclaims_trigger = { + $ACTOR$ = { + faith.religious_head ?= this + faith.main_rite ?= rite + } +} + +# Sway to Rite reach lane: petitioning a fellow prelate. +pam_rite_sway_peer_prelate_lane_trigger = { + $RECIPIENT$ = { + any_held_title = { has_clerical_region = yes } + } + $ACTOR$ = { + pam_is_archbishop_or_higher_trigger = yes + piety_level >= high_piety_level + } +} + +# Sway to Rite reach lane: petitioning the liege chain. +pam_rite_sway_liege_lane_trigger = { + $RECIPIENT$ = { is_liege_or_above_of = $ACTOR$ } + $ACTOR$ = { piety_level >= very_high_piety_level } +} + +# $ACTOR$ and $RECIPIENT$ dioceses border or are nearby, and the scan is bounded by the actor's diocese +pam_rite_sway_adjacent_diocese_trigger = { + OR = { + $ACTOR$.capital_county.clerical_region_title ?= { + any_county_in_clerical_region = { + any_neighboring_county = { + clerical_region_title ?= $RECIPIENT$.capital_county.clerical_region_title + } + } + } + AND = { + # No diocese seat on the far end means there is no adjacent diocese to measure + exists = $RECIPIENT$.capital_county.clerical_region_title.title_capital_county + $ACTOR$.capital_county.clerical_region_title.title_capital_county ?= { + squared_distance = { + target = $RECIPIENT$.capital_county.clerical_region_title.title_capital_county + value <= squared_distance_small + } + } + } + } +} + +# We put quick checks first and leave the bordering realm scan last, behind a capital distance check +pam_rite_sway_clergy_reach_trigger = { + OR = { + custom_tooltip = { + text = sway_ruler_to_my_rite_interaction_flock_reach_tt + OR = { + $RECIPIENT$ = { + superior ?= $ACTOR$ + } + trigger_if = { + limit = { $RECIPIENT$ = { is_ruler = yes } } + $RECIPIENT$.capital_county.clerical_region_title.holder ?= $ACTOR$ + } + trigger_else = { + $RECIPIENT$.location.county.clerical_region_title.holder ?= $ACTOR$ + } + } + } + custom_tooltip = { + text = sway_ruler_to_my_rite_interaction_prelate_reach_tt + pam_rite_sway_peer_prelate_lane_trigger = { + ACTOR = $ACTOR$ + RECIPIENT = $RECIPIENT$ + } + } + custom_tooltip = { + text = sway_ruler_to_my_rite_interaction_liege_reach_tt + pam_rite_sway_liege_lane_trigger = { + ACTOR = $ACTOR$ + RECIPIENT = $RECIPIENT$ + } + } + custom_tooltip = { + text = sway_ruler_to_my_rite_interaction_border_reach_tt + # A landless recipient has no capital county for the distance pre-gate to measure + exists = $RECIPIENT$.capital_county + $ACTOR$.capital_county ?= { + squared_distance = { + target = $RECIPIENT$.capital_county + value <= squared_distance_large + } + } + $ACTOR$ = { + any_neighboring_realm_owner = { this = $RECIPIENT$ } + } + } + } +} + +# Sway to Rite: landed house or bloc kin, as with Demand Conversion. Lives on the vassal variant. +pam_rite_sway_house_lane_trigger = { + $RECIPIENT$ = { is_ruler = yes } + $ACTOR$ = { is_house_head = yes } + OR = { + $RECIPIENT$.house ?= $ACTOR$.house + $RECIPIENT$.house.house_confederation ?= { # House Bloc + $ACTOR$.house.house_confederation ?= this + has_cohesion_level_parameter = bloc_members_join_leaders_faith + } + } +} + +# Iterates the faith's few holy sites instead of scanning the recipient's whole sub-realm +pam_sway_recipient_holds_holy_site_trigger = { + scope:puppet_or_actor.faith ?= { + any_holy_site = { + exists = holy_site_county.holder + holy_site_county.holder = { + OR = { + this = scope:recipient + target_is_liege_or_above = scope:recipient + } + } + } + } +} + +# We keep this in sync with how the three Sway to Rite variants split is_shown +pam_sway_to_rite_variant_can_send_trigger = { + trigger_if = { + limit = { $TARGET$ = { is_courtier_of = $ARCHBISHOP$ } } + $ARCHBISHOP$ = { + is_character_interaction_potentially_accepted = { + recipient = $TARGET$ + interaction = sway_courtier_to_my_rite_interaction + } + } + } + trigger_else_if = { + limit = { + $TARGET$ = { + OR = { + target_is_liege_or_above = $ARCHBISHOP$ + is_tributary_of = $ARCHBISHOP$ + pam_rite_sway_house_lane_trigger = { + ACTOR = $ARCHBISHOP$ + RECIPIENT = this + } + } + } + } + $ARCHBISHOP$ = { + is_character_interaction_potentially_accepted = { + recipient = $TARGET$ + interaction = sway_vassal_to_my_rite_interaction + } + } + } + trigger_else = { + $ARCHBISHOP$ = { + is_character_interaction_potentially_accepted = { + recipient = $TARGET$ + interaction = sway_ruler_to_my_rite_interaction + } + } + } +} + +# As above, but also demands the given ai_accept threshold from the matching variant. +pam_sway_to_rite_variant_acceptance_trigger = { + trigger_if = { + limit = { $TARGET$ = { is_courtier_of = $ARCHBISHOP$ } } + $ARCHBISHOP$ = { + is_character_interaction_potentially_accepted = { + recipient = $TARGET$ + interaction = sway_courtier_to_my_rite_interaction + ai_accept = $ACCEPT$ + } + } + } + trigger_else_if = { + limit = { + $TARGET$ = { + OR = { + target_is_liege_or_above = $ARCHBISHOP$ + is_tributary_of = $ARCHBISHOP$ + pam_rite_sway_house_lane_trigger = { + ACTOR = $ARCHBISHOP$ + RECIPIENT = this + } + } + } + } + $ARCHBISHOP$ = { + is_character_interaction_potentially_accepted = { + recipient = $TARGET$ + interaction = sway_vassal_to_my_rite_interaction + ai_accept = $ACCEPT$ + } + } + } + trigger_else = { + $ARCHBISHOP$ = { + is_character_interaction_potentially_accepted = { + recipient = $TARGET$ + interaction = sway_ruler_to_my_rite_interaction + ai_accept = $ACCEPT$ + } + } + } +} + +# Runs in the ruler's scope +pam_rite_locally_present_trigger = { + any_sub_realm_county = { + OR = { + rite = $RITE$ + any_neighboring_county = { rite = $RITE$ } + } + } +} + +pam_died_from_murder_reason_trigger = { + trigger_if = { + limit = { is_alive = no } + OR = { + exists = scope:killer + death_reason = death_murder + death_reason = death_murder_known + death_reason = death_plotting + death_reason = death_poison + death_reason = death_murder_feast + death_reason = death_mysterious + death_reason = death_killed_while_attempting_murder + } + } + trigger_else = { + exists = scope:killer + } +} + +pam_clergy_court_chaplain_murdered_catalyst_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + has_council_position = councillor_court_chaplain + pam_died_from_murder_reason_trigger = yes +} + +pam_clergy_archbishop_murdered_catalyst_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + any_held_title = { has_clerical_region = yes } + pam_died_from_murder_reason_trigger = yes +} + +pam_clergy_cardinal_murdered_catalyst_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + exists = clerical_elector_title + pam_died_from_murder_reason_trigger = yes +} + +pam_clergy_head_of_rite_murdered_catalyst_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + rite.head_of_rite ?= this + pam_died_from_murder_reason_trigger = yes +} + +pam_the_christian_church_head_of_faith_murdered_catalyst_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + pam_died_from_murder_reason_trigger = yes + any_held_title = { is_head_of_faith = yes } +} + +pam_the_christian_church_civil_war_in_christian_kingdom_participant_trigger = { + has_pam_dlc_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + highest_held_title_tier >= tier_kingdom + any_character_situation = { + situation_type = the_christian_church + situation_top_has_catalyst = catalyst_the_christian_church_civil_war_in_christian_kingdom + } +} + +pam_neighboring_unreformed_pagan_raid_you_catalyst_trigger = { + scope:raider = { + religion = { + is_in_family = rf_pagan + } + faith = { has_doctrine_parameter = unreformed } + any_neighboring_and_across_water_realm_owner = { + this = scope:county.holder.top_liege + } + } + scope:county.holder.top_liege = { + has_pam_dlc_trigger = yes + any_character_situation = { + situation_type = the_christian_church + situation_top_has_catalyst = catalyst_neighboring_unreformed_pagan_raid_you + } + } +} + +pam_the_christian_church_civil_war_in_christian_kingdom_trigger = { + scope:war = { + using_civil_war_cb_trigger = yes + } + OR = { + AND = { + scope:attacker.top_liege = scope:defender.top_liege + scope:defender.top_liege = { + pam_the_christian_church_civil_war_in_christian_kingdom_participant_trigger = yes + } + } + AND = { + scope:defender = scope:attacker.top_liege + scope:defender = { + pam_the_christian_church_civil_war_in_christian_kingdom_participant_trigger = yes + } + } + AND = { + scope:attacker = scope:defender.top_liege + scope:attacker = { + pam_the_christian_church_civil_war_in_christian_kingdom_participant_trigger = yes + } + } + } +} + +pam_the_christian_church_ruler_died_in_battle_against_non_christian_catalyst_trigger = { + has_pam_dlc_trigger = yes + is_ruler = yes + # death_reason errors on living characters; in on_death the dier is still is_alive = yes, so use has_variable = battle_death_enemy there. + trigger_if = { + limit = { is_alive = no } + death_reason = death_battle + } + trigger_else = { + has_variable = battle_death_enemy + } + OR = { + exists = scope:killer + has_variable = battle_death_enemy + } + trigger_if = { + limit = { exists = scope:killer } + scope:killer = { + OR = { + religion != religion:catholic_religion + religion != religion:protestant_religion + religion != religion:eastern_orthodox_religion + religion != religion:oriental_orthodox_religion + } + } + } + trigger_else = { + has_variable = battle_death_enemy + var:battle_death_enemy = { + OR = { + religion != religion:catholic_religion + religion != religion:protestant_religion + religion != religion:eastern_orthodox_religion + religion != religion:oriental_orthodox_religion + } + } + } + any_character_situation = { + situation_type = the_christian_church + situation_top_has_catalyst = catalyst_the_christian_church_ruler_died_in_battle_against_non_christian + } +} + +pam_ecclesiastic_transfer_land_access_trigger = { + has_pam_dlc_trigger = yes + pam_clergy_interactions_faith_trigger = yes + NOT = { + government_has_flag = government_is_ecclesiastical + } +} +#The recipient of the "Give me land" interaction will back down without any convincing required +#The crit, the instant success +pam_instant_negotiate_land_success_trigger = { + scope:recipient = { + is_ai = yes + } + OR = { + #They don't have the legitimacy or piety + scope:recipient = { + piety_level <= 0 + legitimacy_level <= 0 + } + #You have the pope in your pocket + trigger_if = { + limit = { + exists = scope:secondary_recipient + } + pam_negotiate_land_instant_pope_hook_trigger = yes + } + #You intimidate them militarily or through dread + OR = { + #Mostly milstrength + AND = { + #Milstrength 4x as high + half_current_military_strength >= scope:recipient.twice_current_military_strength + has_dread_level_towards = { + target = scope:recipient + level >= 1 + } + } + #Milstrength and intimidation + AND = { + #Milstrength twice as high + current_military_strength >= scope:recipient.twice_current_military_strength + has_dread_level_towards = { + target = scope:recipient + level >= 2 + } + } + } + } +} + +pam_negotiate_land_instant_pope_hook_trigger = { + has_strong_hook = scope:secondary_recipient + highest_held_title_tier >= scope:recipient.highest_held_title_tier + #Won't give away primary title or its aboves + scope:target = { + NOR = { + this = scope:recipient.primary_title + any_in_de_jure_hierarchy = { + this = scope:recipient.primary_title + } + } + } + scope:target.tier < tier_kingdom + faith.religious_head = scope:secondary_recipient + scope:recipient = { + NOR = { + has_trait = cynical + has_trait = excommunicated + } + rite = faith.main_rite + } +} + +#You DEFINITELY can force the recipient to give in, if you sacrifice +pam_forced_negotiate_land_success_trigger = { + OR = { + pam_negotiate_land_forced_hook_trigger = yes + pam_negotiate_land_forced_relation_trigger = yes + pam_negotiate_land_forced_piety_level_trigger = yes + pam_negotiate_land_forced_legitimacy_level_trigger = yes + pam_negotiate_land_forced_gold_trigger = yes + } +} + +#There is a CHANCE you can convince the recipient to give +pam_possible_negotiate_land_success_trigger = { + OR = { + pam_negotiate_land_possible_hook_trigger = yes + pam_negotiate_land_possible_relation_trigger = yes + pam_negotiate_land_possible_piety_level_trigger = yes + pam_negotiate_land_possible_legitimacy_level_trigger = yes + pam_negotiate_land_possible_gold_trigger = yes + } +} + +pam_intimidate_clerical_transfer_recipient_trigger = { + scope:recipient = { + is_ai = yes + #Needs non-combative personality + NOR = { + has_trait = greatest_of_khans + has_trait = conqueror + } + } +} +pam_negotiate_land_forced_hook_trigger = { + has_usable_hook = scope:recipient + has_strong_hook = scope:recipient + #Isn't root's capital county/doesn't contain recipient's capital county + trigger_if = { + limit = { + exists = scope:target + } + scope:target = { + NOR = { + this = scope:recipient.primary_title + any_in_de_jure_hierarchy = { + this = scope:recipient.capital_county + } + } + } + scope:target.tier < scope:recipient.highest_held_title_tier + } + scope:recipient = { + is_ai = yes + } +} +pam_negotiate_land_forced_relation_trigger = { + OR = { + AND = { + has_relation_friend = scope:recipient + has_relation_soulmate = scope:recipient + } + AND = { + has_relation_disciple = scope:recipient + has_relation_soulmate = scope:recipient + } + AND = { + has_relation_friend = scope:recipient + has_relation_disciple = scope:recipient + } + has_relation_best_friend = scope:recipient + } +} +pam_negotiate_land_forced_piety_level_trigger = { + OR = { + AND = { + piety_level > scope:recipient.piety_level + scope:recipient.piety_level = 0 + } + AND = { + piety_level >= 5 + scope:recipient.piety_level <= 1 + } + } +} +pam_negotiate_land_forced_legitimacy_level_trigger = { + has_legitimacy = yes + scope:recipient = { has_legitimacy = yes } + OR = { + AND = { + legitimacy_level > scope:recipient.legitimacy_level + scope:recipient.legitimacy_level = 0 + } + AND = { + legitimacy_level >= 5 + scope:recipient.legitimacy_level <= 1 + } + } +} +pam_negotiate_land_forced_gold_trigger = { + gold >= scope:recipient.pam_transfer_land_gold_value + scope:recipient = { + OR = { + debt_level >= 4 + treasury_debt_level >= 4 + #Losing a war and needs the money + AND = { + is_at_war = yes + any_character_war = { + OR = { + AND = { + primary_defender = scope:recipient + defender_war_score <= -50 + primary_attacker.current_military_strength > scope:recipient.twice_current_military_strength + } + AND = { + primary_attacker = scope:recipient + attacker_war_score <= -50 + primary_attacker.current_military_strength > scope:recipient.twice_current_military_strength + } + } + } + OR = { + gold < major_gold_value + treasury < major_gold_value + } + } + } + } +} +pam_negotiate_land_possible_hook_trigger = { + #Hook + has_usable_hook = scope:recipient + scope:recipient = { + is_ai = yes + } +} +pam_negotiate_land_possible_relation_trigger = { + OR = { + #Strong relations you can destroy + has_relation_friend = scope:recipient + has_relation_soulmate = scope:recipient + has_relation_disciple = scope:recipient + } +} +pam_negotiate_land_possible_piety_level_trigger = { + #Superior devotion + piety_level > scope:recipient.piety_level +} +pam_negotiate_land_possible_legitimacy_level_trigger = { + has_legitimacy = yes + scope:recipient = { has_legitimacy = yes } + #Superior legitimacy + legitimacy_level > scope:recipient.legitimacy_level +} +pam_negotiate_land_possible_gold_trigger = { + #Gold to pay for land + treasury_or_gold >= scope:recipient.pam_transfer_land_gold_value +} + +pam_clergy_land_interaction_likely_acceptance_no_methods_trigger = { + scope:recipient = { + is_ai = yes + } + OR = { + AND = { + OR = { + religious_head_or_challenger = scope:secondary_recipient + is_allied_to = scope:recipient + } + OR = { + highest_held_title_tier > scope:recipient.highest_held_title_tier + scope:recipient = { ai_zeal >= medium_positive_ai_value } + scope:recipient = { ai_greed <= medium_negative_ai_value } + } + } + #You intimidate them militarily or through dread + OR = { + #Mostly milstrength + AND = { + #Milstrength 2x as high + current_military_strength >= scope:recipient.twice_current_military_strength + has_dread_level_towards = { + target = scope:recipient + level >= 1 + } + } + #Milstrength and intimidation + AND = { + #Milstrength higher + current_military_strength > scope:recipient.twice_current_military_strength + has_dread_level_towards = { + target = scope:recipient + level >= 2 + } + } + #Milstrength + #Milstrength 4x as high + half_current_military_strength >= scope:recipient.twice_current_military_strength + } + } +} + + +pam_tenet_can_be_permitted_trigger = { + save_temporary_scope_as = pam_tenet_candidate + custom_tooltip = { + text = pam_tenet_stance_can_be_permitted_tt + scope:actor.rite = { + NOR = { + has_tenet_status = { tenet = scope:pam_tenet_candidate status = permitted } + has_tenet_status = { tenet = scope:pam_tenet_candidate status = core } + } + } + } +} + +pam_tenet_can_be_permitted_no_actor_trigger = { + save_temporary_scope_as = pam_tenet_candidate + custom_tooltip = { + text = pam_tenet_stance_can_be_permitted_tt + root.rite = { + NOR = { + has_tenet_status = { tenet = scope:pam_tenet_candidate status = permitted } + has_tenet_status = { tenet = scope:pam_tenet_candidate status = core } + } + } + } +} + +pam_tenet_can_be_prohibited_trigger = { + save_temporary_scope_as = pam_tenet_candidate + custom_tooltip = { + text = pam_tenet_stance_can_be_prohibited_tt + scope:actor.rite = { + NOR = { + has_tenet_status = { tenet = scope:pam_tenet_candidate status = prohibited } + has_tenet_status = { tenet = scope:pam_tenet_candidate status = core } + } + } + } +} + +pam_tenet_can_be_prohibited_no_actor_trigger = { + save_temporary_scope_as = pam_tenet_candidate + custom_tooltip = { + text = pam_tenet_stance_can_be_prohibited_tt + root.rite = { + NOR = { + has_tenet_status = { tenet = scope:pam_tenet_candidate status = prohibited } + has_tenet_status = { tenet = scope:pam_tenet_candidate status = core } + } + } + } +} + +# Tenet scope. Practices a Christian church reads as corruption rather than doctrine. +pam_tenet_is_christian_vice_trigger = { + OR = { + this = tenet:tenet_simony + this = tenet:tenet_polyamory + this = tenet:tenet_hedonistic + this = tenet:tenet_gnosticism + this = tenet:tenet_carnal_exaltation + this = tenet:tenet_natural_primitivism + this = tenet:tenet_consolamentum + } +} + +# Tenet scope. Christologies settled against by Nicaea, Chalcedon and Antioch. +pam_tenet_is_christological_heresy_trigger = { + OR = { + this = tenet:tenet_monophysitism + this = tenet:tenet_miaphysitism + this = tenet:tenet_adoptionism + } +} + +# Decision-side counterpart of pam_ec_tenet_is_christian_abomination_trigger +# We leave Ritual Cannibalism off because the Eucharist already invites the charge +pam_tenet_is_christian_abomination_trigger = { + OR = { + this = tenet:tenet_human_sacrifice + this = tenet:tenet_cranial_trophies + this = tenet:tenet_gruesome_festivals + this = tenet:tenet_sacrificial_ceremonies + } +} + +# We pool these in tenet scope, since prohibit and core checks already close the wrong paths per faith +pam_tenet_is_christian_dogma_trigger = { + OR = { + this = tenet:tenet_apostolic_succession + this = tenet:tenet_divine_liturgy + this = tenet:tenet_communion + this = tenet:tenet_original_sin + this = tenet:tenet_transubstantiation + this = tenet:tenet_pentarchy + this = tenet:tenet_celestial_hierarchy + this = tenet:tenet_confession + this = tenet:tenet_philanthropia + this = tenet:tenet_hyperdulia + this = tenet:tenet_armed_pilgrimages + this = tenet:tenet_scholasticism + this = tenet:tenet_holy_myron + this = tenet:tenet_alexandrian_catechism + } +} + +# $CHARACTER$ is the Head of Faith deciding, and the tenet is the scope +# We only apply this to the AI, so players keep the full list +pam_tenet_ai_may_permit_trigger = { + trigger_if = { + limit = { + $CHARACTER$.faith = { has_tenet_popularity_trigger = yes } + pam_tenet_is_christian_vice_trigger = yes + } + OR = { + situation:the_christian_church ?= { situation_current_phase = saeculum_obscurum } + pam_tenet_is_at_least_very_popular_trigger = { CHARACTER = $CHARACTER$ } + } + } + trigger_else_if = { + limit = { + $CHARACTER$.faith = { has_tenet_popularity_trigger = yes } + OR = { + pam_tenet_is_christological_heresy_trigger = yes + pam_tenet_is_christian_abomination_trigger = yes + } + } + pam_tenet_is_overwhelmingly_popular_trigger = { CHARACTER = $CHARACTER$ } + } + trigger_else = { + always = yes + } +} + +pam_tenet_ai_may_prohibit_trigger = { + trigger_if = { + limit = { + $CHARACTER$.faith = { has_tenet_popularity_trigger = yes } + pam_tenet_is_christian_dogma_trigger = yes + } + pam_tenet_is_unpopular_trigger = { CHARACTER = $CHARACTER$ } + } +} + +# Phase first: this runs per candidate tenet, so outside Reform the global lookup ends it at once +pam_tenet_ai_should_purge_trigger = { + situation:the_christian_church ?= { situation_current_phase = reform_phase } + OR = { + pam_tenet_is_christian_vice_trigger = yes + pam_tenet_is_christian_abomination_trigger = yes + } + $CHARACTER$.faith = { has_tenet_popularity_trigger = yes } +} + +pam_tenet_can_be_persecuted_trigger = { + save_temporary_scope_as = pam_tenet_candidate + custom_tooltip = { + text = pam_tenet_can_be_persecuted_tt + NOT = { + scope:actor = { + any_personal_tenet = { this = scope:pam_tenet_candidate } + } + } + } +} + +pam_tenet_can_be_persecuted_no_actor_trigger = { + save_temporary_scope_as = pam_tenet_candidate + custom_tooltip = { + text = pam_tenet_can_be_persecuted_tt + NOT = { + root = { + any_personal_tenet = { this = scope:pam_tenet_candidate } + } + } + } +} + +pam_tenet_is_incompatible_with_armed_pilgrimages_trigger = { + OR = { + this = tenet:tenet_peace_of_god + this = tenet:tenet_pacifism + this = tenet:tenet_dharmic_pacifism + } +} + +pam_tenet_can_be_replaced_for_armed_pilgrimages_trigger = { + trigger_if = { + limit = { + scope:actor.faith.main_rite ?= { + any_rite_tenet = { + status = core + pam_tenet_is_incompatible_with_armed_pilgrimages_trigger = yes + } + } + } + custom_tooltip = { + text = pam_secure_pilgrim_routes_incompatible_tenet_tt + pam_tenet_is_incompatible_with_armed_pilgrimages_trigger = yes + } + } +} + +pam_faith_tenet_is_core_trigger = { + main_rite = { + has_tenet_status = { tenet = $TENET$ status = core } + } +} + +pam_faith_is_at_core_tenet_cap_trigger = { + main_rite = { + any_rite_tenet = { + count >= pam_faith_core_tenets_cap_value + } + } +} + +# $CHARACTER$'s faith supplies the popularity, from tenet scope +pam_tenet_is_overwhelmingly_popular_trigger = { + save_temporary_scope_as = pam_popularity_tenet + $CHARACTER$.faith = { + has_tenet_popularity_trigger = yes + pam_faith_tenet_popularity_value >= pam_tenet_popularity_ai_override_threshold + } +} + +# At or above the Popular display tier +pam_tenet_is_at_least_popular_trigger = { + save_temporary_scope_as = pam_popularity_tenet + $CHARACTER$.faith = { + has_tenet_popularity_trigger = yes + pam_faith_tenet_popularity_value >= tenet_popularity_popular_threshold + } +} + +# As above, but for the Very Popular display tier. +pam_tenet_is_at_least_very_popular_trigger = { + save_temporary_scope_as = pam_popularity_tenet + $CHARACTER$.faith = { + has_tenet_popularity_trigger = yes + pam_faith_tenet_popularity_value >= tenet_popularity_very_popular_threshold + } +} + +# Below the Neutral display tier: the faithful have turned against it, not merely indifferent +pam_tenet_is_unpopular_trigger = { + save_temporary_scope_as = pam_popularity_tenet + $CHARACTER$.faith = { + has_tenet_popularity_trigger = yes + pam_faith_tenet_popularity_value < tenet_popularity_neutral_threshold + } +} + +pam_rite_can_be_declared_heresy_trigger = { + save_temporary_scope_as = pam_rite_candidate + custom_tooltip = { + text = pam_rite_heresy_not_mainline_tt + this != faith.main_rite + } + custom_tooltip = { + text = pam_rite_heresy_no_antipope_tt + faith = { + NOT = { + any_faith_ruler = { + rite = scope:pam_rite_candidate + is_following_religious_head_challenger = yes + } + } + } + } + trigger_if = { + limit = { + faith.religious_head ?= { has_trait = zealous } + } + custom_tooltip = { + text = pam_rite_heresy_divergence_zealous_tt + "divergence(faith.main_rite)" > faith_heresy_threshold_times_4_over_5 + } + } + trigger_else = { + custom_tooltip = { + text = pam_rite_heresy_divergence_tt + "divergence(faith.main_rite)" > faith.heresy_threshold + } + } +} + +pam_ai_meaningful_jewish_presence_trigger = { + OR = { + any_vassal = { + faith ?= { religion_tag = judaism_religion } + } + any_sub_realm_county = { + faith ?= { religion_tag = judaism_religion } + } + any_neighboring_and_across_water_realm_owner = { + faith ?= { religion_tag = judaism_religion } + } + } +} + +pam_ai_meaningful_christian_presence_trigger = { + OR = { + any_vassal = { + OR = { + faith ?= { religion_tag = catholic_religion } + faith ?= { religion_tag = protestant_religion } + faith ?= { religion_tag = eastern_orthodox_religion } + faith ?= { religion_tag = oriental_orthodox_religion } + } + } + any_sub_realm_county = { + OR = { + faith ?= { religion_tag = catholic_religion } + faith ?= { religion_tag = protestant_religion } + faith ?= { religion_tag = eastern_orthodox_religion } + faith ?= { religion_tag = oriental_orthodox_religion } + } + } + any_neighboring_and_across_water_realm_owner = { + OR = { + faith ?= { religion_tag = catholic_religion } + faith ?= { religion_tag = protestant_religion } + faith ?= { religion_tag = eastern_orthodox_religion } + faith ?= { religion_tag = oriental_orthodox_religion } + } + } + } +} + +pam_ai_meaningful_islamic_presence_trigger = { + OR = { + any_vassal = { + faith ?= { religion_tag = islam_religion } + } + any_sub_realm_county = { + faith ?= { religion_tag = islam_religion } + } + any_neighboring_and_across_water_realm_owner = { + faith ?= { religion_tag = islam_religion } + } + } +} + +pam_ai_meaningful_eastern_presence_trigger = { + OR = { + any_vassal = { + faith.religion ?= { is_in_family = rf_eastern } + } + any_sub_realm_county = { + faith.religion ?= { is_in_family = rf_eastern } + } + any_neighboring_and_across_water_realm_owner = { + faith.religion ?= { is_in_family = rf_eastern } + } + } +} + +pam_ai_meaningful_sinitic_presence_trigger = { + OR = { + any_vassal = { + faith.religion ?= { is_in_family = rf_sinitic } + } + any_sub_realm_county = { + faith.religion ?= { is_in_family = rf_sinitic } + } + any_neighboring_and_across_water_realm_owner = { + faith.religion ?= { is_in_family = rf_sinitic } + } + } +} + +pam_ai_meaningful_unreformed_presence_trigger = { + OR = { + any_vassal = { + faith ?= { has_doctrine_parameter = unreformed } + } + any_sub_realm_county = { + faith ?= { has_doctrine_parameter = unreformed } + } + any_neighboring_and_across_water_realm_owner = { + faith ?= { has_doctrine_parameter = unreformed } + } + } +} + +pam_ai_oriental_christian_actor_trigger = { + OR = { + culture = { has_cultural_pillar = heritage_egyptian } + culture = { has_cultural_pillar = heritage_syriac } + culture = { has_cultural_pillar = heritage_caucasian } + culture = { has_same_culture_language = culture:ethiopian } + faith ?= faith:miaphysitism + faith ?= faith:armenian_apostolic + } +} + +pam_ai_armenian_actor_trigger = { + OR = { + culture = culture:armenian + culture = { has_same_culture_language = culture:armenian } + } +} + +pam_ai_pentarchy_christian_actor_trigger = { + OR = { + culture = culture:greek + culture = { has_same_culture_language = culture:greek } + rite ?= { pam_greek_as_liturgical_language_trigger = yes } + # Alexandria and Antioch are Oriental Orthodox sees, so those churches count the five as their own. + pam_ai_oriental_christian_actor_trigger = yes + } +} + +pam_ai_southeast_asian_actor_trigger = { + OR = { + culture = { has_cultural_pillar = heritage_austronesian } + culture = { has_cultural_pillar = heritage_mon_khmer } + culture = { has_cultural_pillar = heritage_viet } + culture = { has_cultural_pillar = heritage_tai } + culture = { has_cultural_pillar = heritage_hmongic } + culture = { has_cultural_pillar = heritage_burman } + } +} + +pam_ai_mountain_capital_actor_trigger = { + capital_province ?= { + OR = { + terrain = mountains + terrain = hills + } + } +} + +# title_preferred_capital_county is the de jure capital even if k_papal_state is uncreated +pam_catholic_hof_weak_papal_state_control_trigger = { + has_pam_dlc_trigger = yes + title:k_papal_state = { + title_preferred_capital_county = { + holder ?= { + is_alive = yes + faith = { + NOR = { + has_doctrine = special_doctrine_ecumenical_christian + this = faith:catholic + this = faith:christian_faith + } + } + } + } + } +} + +# Holder of the Byzantine Empire (or Eastern Roman hegemony) with a non-Christian religion +#pam_byzantine_emperor_non_christian_trigger = { +# OR = { +# title:e_byzantium.holder ?= { +# is_alive = yes +# religion != religion:christianity_religion +# } +# title:h_eastern_roman_empire.holder ?= { +# is_alive = yes +# religion != religion:christianity_religion +# } +# } +#} + +# Used by demand_child_as_monk_interaction. +# True if scope:recipient genuinely cares about losing scope:secondary_recipient, either their own direct child, or any child betrothed to one of their close family members. +pam_demand_child_recipient_cares_trigger = { + OR = { + scope:secondary_recipient = { is_child_of = scope:recipient } + scope:secondary_recipient = { + exists = betrothed + betrothed = { is_close_family_of = scope:recipient } + } + } +} + +pam_has_forbidden_personal_tenet_trigger = { + faith = { save_temporary_scope_as = temp_faith } + any_personal_tenet = { + scope:temp_faith.main_rite = { + has_tenet_status = { + tenet = prev + status = prohibited + } + } + } +} + +pam_ai_can_consider_forbidden_personal_tenet_trigger = { + ai_boldness >= -25 + OR = { + ai_zeal >= 100 + AND = { + ai_boldness >= 100 + ai_zeal >= 0 + } + AND = { + ai_rationality < 0 + ai_zeal >= 0 + } + } + NOR = { + has_trait = humble + has_trait = content + } + # Clergy: a prohibited personal tenet is a criminal secret, so the elected pontiff never considers one + # This goes last because it iterates held titles, unlike the simple checks above + pam_holds_college_elected_church_seat_trigger = no +} + +pam_is_christian_clergy_trigger = { + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + OR = { + government_has_flag = government_is_theocracy + government_has_flag = government_is_monastic_holy_order + } +} +pam_is_eastern_christian_trigger = { + OR = { + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + rite = { + rite_has_doctrine = special_doctrine_is_eastern_christian_faith + } +} +pam_is_western_christian_trigger = { + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + } + rite = { + rite_has_doctrine = special_doctrine_is_western_christian_faith + } +} + +# Character scope. The College is a faith-locked doctrine (Catholicism). +pam_can_hold_cardinalate_trigger = { + faith ?= { has_doctrine_parameter = has_clerical_electors } + trigger_if = { + limit = { NOT = { has_global_variable = pam_great_schism_decision_taken } } + NOT = { has_title = title:d_et_constantinople } + } +} + +# Character scope. Before the Great Schism, AI only chooses Western candidates. +pam_ai_cardinal_candidate_is_immersive_trigger = { + OR = { + has_global_variable = pam_great_schism_decision_taken + rite = { + NOT = { rite_has_doctrine = special_doctrine_is_eastern_christian_faith } + } + } +} + +# Character scope. The seat carries no government of its own, so a lay ruler handed one stays lay. +pam_can_receive_cardinalate_trigger = { + OR = { + government_has_flag = government_is_theocracy + government_has_flag = government_is_holy_order + is_ruler = no + } + pam_is_antipope_trigger = no +} + +# Held title scope. Any faith's cardinalate - faith.any_clerical_elector_title only lists its own. +pam_title_is_clerical_elector_trigger = { + holder.clerical_elector_title ?= this +} + +pam_church_background_location_is_mediterranean_or_urban_trigger = { + OR = { + culture ?= { has_graphical_mediterranean_culture_group_trigger = yes } + steppe_building_gfx_use_mediterranean_trigger = yes + has_holding_type = city_holding + } +} + +# Grand cathedral is the highest church background +pam_church_event_background_is_grand_western_trigger = { + #Gothic movement starts in 12th century + current_year >= 1130 + trigger_if = { + limit = { + scope:activity.activity_location ?= { + OR = { + faith.religion = religion:catholic_religion + faith.religion = religion:protestant_religion + faith.religion = religion:eastern_orthodox_religion + faith.religion = religion:oriental_orthodox_religion + } + } + } + scope:activity.activity_location.rite = { + rite_has_doctrine = special_doctrine_is_western_christian_faith + } + } + trigger_else_if = { + limit = { + exists = scope:activity.activity_host + } + scope:activity.activity_host.rite = { + rite_has_doctrine = special_doctrine_is_western_christian_faith + } + } + trigger_else = { + location.rite ?= { + rite_has_doctrine = special_doctrine_is_western_christian_faith + } + } + OR = { + AND = { + this = faith.religious_head + highest_held_title_tier >= tier_kingdom + capital_county.faith ?= faith + } + domicile ?= { has_domicile_building_or_higher = ecclesiastical_domicile_main_03 } + capital_county ?= { + any_county_province = { + has_building_with_flag = { flag = grand_cathedral_flag } + } + } + holy_order ?= { + num_leased_titles >= 12 + } + } +} +#pam_church_event_background_is_grand_western_pre_gothic_trigger = { +# #Gothic movement starts in 12th century +# current_year < 1130 +# trigger_if = { +# limit = { +# scope:activity.activity_location ?= { +# faith.religion = religion:christianity_religion +# } +# } +# scope:activity.activity_location.rite = { +# rite_has_doctrine = special_doctrine_is_western_christian_faith +# } +# } +# trigger_else_if = { +# limit = { +# exists = scope:activity.activity_host +# } +# scope:activity.activity_host.rite = { +# rite_has_doctrine = special_doctrine_is_western_christian_faith +# } +# } +# trigger_else = { +# location.rite ?= { +# rite_has_doctrine = special_doctrine_is_western_christian_faith +# } +# } +# OR = { +# AND = { +# this = faith.religious_head +# highest_held_title_tier >= tier_kingdom +# capital_county.faith ?= faith +# } +# domicile ?= { has_domicile_building_or_higher = ecclesiastical_domicile_main_03 } +# capital_county ?= { +# any_county_province = { +# has_building_with_flag = { flag = grand_cathedral_flag } +# } +# } +# holy_order ?= { +# num_leased_titles >= 12 +# } +# } +#} + +#For using the Hagia Sophia background +pam_church_event_background_is_grand_eastern_trigger = { + trigger_if = { + limit = { + scope:activity.activity_location ?= { + OR = { + faith.religion = religion:catholic_religion + faith.religion = religion:protestant_religion + faith.religion = religion:eastern_orthodox_religion + faith.religion = religion:oriental_orthodox_religion + } + } + } + scope:activity.activity_location.rite = { + rite_has_doctrine = special_doctrine_is_eastern_christian_faith + } + } + trigger_else_if = { + limit = { + exists = scope:activity.activity_host + } + scope:activity.activity_host.rite = { + rite_has_doctrine = special_doctrine_is_eastern_christian_faith + } + } + trigger_else = { + location.rite ?= { + rite_has_doctrine = special_doctrine_is_eastern_christian_faith + } + } + OR = { + AND = { + this = faith.religious_head + highest_held_title_tier >= tier_kingdom + capital_county.faith ?= faith + } + domicile ?= { has_domicile_building_or_higher = ecclesiastical_domicile_main_03 } + capital_county ?= { + any_county_province = { + has_building_with_flag = { flag = grand_cathedral_flag } + } + } + holy_order ?= { + num_leased_titles >= 12 + } + } +} + + +# This grandeur check does not care about religion, so the call site checks religion +pam_church_event_background_is_developed_trigger = { + OR = { + domicile ?= { has_domicile_building_or_higher = ecclesiastical_domicile_main_02 } + capital_county ?= { + OR = { + this = title:c_ile_de_france + this = title:c_antiocheia + any_county_province = { + OR = { + has_building_or_higher = temple_02 + has_building_with_flag = holy_building + #A wooden church looks wrong here + geographical_region = world_middle_east + geographical_region = world_africa + geographical_region = world_steppe_tarim + geographical_region = world_steppe_central + } + } + } + } + AND = { + highest_held_title_tier >= tier_duchy + this = rite.head_of_rite + } + holy_order ?= { + OR = { + num_leased_titles >= 5 + holy_order_patron.highest_held_title_tier >= tier_empire + } + } + } +} + +# Khachkar is removed when a county leaves the commissioning dynasty (like runestones). +pam_remove_khachkar_new_holder_trigger = { + $TITLE$ = { + exists = var:pam_khachkar_ancestor + has_county_modifier = pam_khachkar_ancestral_county + } + $NEW_HOLDER$ = { + dynasty != $PREVIOUS_HOLDER$.dynasty + } + $TITLE$ = { + NOT = { var:pam_khachkar_ancestor.dynasty = $NEW_HOLDER$.dynasty } + } +} + +# Cheap pre-filter for HoF split secular ruler lists (since split_clerical_region_size might not be performant) +pam_potential_secular_clerical_split_ruler_trigger = { + $RULER$ = { + is_alive = yes + is_landed = yes + faith = scope:actor.faith + NOR = { + this = scope:recipient + trigger_if = { + limit = { exists = scope:recipient.liege } + this = scope:recipient.liege + } + } + highest_held_title_tier >= tier_duchy + NOT = { pam_government_is_religious_playable_trigger = yes } + capital_county = { + exists = clerical_region_title + clerical_region_title.holder = scope:recipient + # We always keep the region capital, because splitting it off would leave the new region with no capital + NOT = { this = clerical_region_title.title_preferred_capital_county } + } + } + # any_sub_realm_county, not any_realm_county: for a vassal the latter is the liege's whole realm + trigger_if = { + limit = { scope:recipient = scope:actor } + $RULER$ = { + NOT = { + any_sub_realm_county = { + any_neighboring_county = { this = scope:recipient.capital_county } + } + } + } + } +} + +# Full validation including code-side split size calc — use sparingly +pam_valid_secular_clerical_split_ruler_trigger = { + pam_potential_secular_clerical_split_ruler_trigger = { RULER = $RULER$ } + $RULER$ = { + split_clerical_region_size > 0 + } +} + +# This has to be the region at their capital, which is what the clerical_region pickers list +# Hides the interaction when a landed archbishop's capital sits in someone else's region +pam_acting_clerical_region_trigger = { + $ARCHBISHOP$ = { + save_temporary_scope_as = acting_archbishop_temp + custom_tooltip = { + text = pam_acting_clerical_region_trigger + capital_province.county.clerical_region_title ?= { + has_clerical_region = yes + is_head_of_faith = no + holder ?= scope:acting_archbishop_temp + } + } + } +} + +# Cheap pre-filter for HoF merge clerical region title list +pam_potential_merge_clerical_region_title_trigger = { + $TITLE$ = { + has_clerical_region = yes + is_head_of_faith = no + # Absorbed regions stay as empty picker shells until reload + clerical_region_size > 0 + custom_tooltip = { + text = pam_potential_merge_clerical_region_title_same_title_trigger + this != $ABSORBING_TITLE$ + } + trigger_if = { + limit = { exists = holder } + custom_tooltip = { + text = request_elevation_cannot_unseat_player_tt + holder = { is_ai = yes } + } + custom_tooltip = { + text = pam_potential_merge_clerical_region_title_rite_trigger + NOT = { rite.head_of_rite ?= holder } + } + custom_tooltip = { + text = pam_potential_merge_clerical_region_title_same_hof_trigger + holder.religious_head_or_challenger = $ABSORBING_TITLE$.holder.religious_head_or_challenger + } + } + trigger_else = { + custom_tooltip = { + text = pam_potential_merge_clerical_region_title_no_holder_trigger + exists = holder + } + } + } + $ABSORBING_TITLE$ ?= { + has_clerical_region = yes + is_head_of_faith = no + custom_tooltip = { + text = pam_potential_merge_clerical_region_title_neighboring_trigger + any_county_in_clerical_region = { + any_neighboring_county = { clerical_region_title ?= $TITLE$ } + } + } + } +} + +# True when the scoped clerical region title covers at most three distinct de jure duchies (TIT-76192) +pam_clerical_region_at_most_three_duchies_trigger = { + NAND = { + any_county_in_clerical_region = { + save_temporary_scope_as = small_region_county_1 + } + any_county_in_clerical_region = { + NOT = { duchy = scope:small_region_county_1.duchy } + save_temporary_scope_as = small_region_county_2 + } + any_county_in_clerical_region = { + NOR = { + duchy = scope:small_region_county_1.duchy + duchy = scope:small_region_county_2.duchy + } + save_temporary_scope_as = small_region_county_3 + } + any_county_in_clerical_region = { + NOR = { + duchy = scope:small_region_county_1.duchy + duchy = scope:small_region_county_2.duchy + duchy = scope:small_region_county_3.duchy + } + } + } +} + +pam_has_adjacent_mergeable_clerical_region_trigger = { + custom_tooltip = { + text = pam_has_adjacent_mergeable_clerical_region_trigger + save_temporary_scope_as = absorbing_clerical_region_temp + any_county_in_clerical_region = { + any_neighboring_county = { + clerical_region_title ?= { + has_clerical_region = yes + is_head_of_faith = no + this != scope:absorbing_clerical_region_temp + holder ?= { + religious_head_or_challenger = scope:absorbing_clerical_region_temp.holder.religious_head_or_challenger + NOT = { this = rite.head_of_rite } + } + } + } + } + } +} + +# Same-faith land in another de jure kingdom +pam_expand_target_is_same_faith_outside_home_kingdom_trigger = { + exists = $TITLE$.kingdom + exists = $ARCHBISHOP$.capital_county.kingdom + NOT = { $TITLE$.kingdom = $ARCHBISHOP$.capital_county.kingdom } + $TITLE$ = { + any_de_jure_county = { + count >= all + OR = { + exists = clerical_region_title + faith = $ARCHBISHOP$.faith + } + } + } +} + +# Picked title only chooses the see, then create_clerical_region fills from that county's de jure kingdom +# The lowest tier decides who may petition, not how large the region ends up +pam_valid_new_clerical_region_anchor_trigger = { + trigger_if = { + limit = { $PETITIONER$ ?= { has_government = ecclesiastical_government } } + tier >= tier_county + } + trigger_else = { + tier >= tier_duchy + } + is_landless_type_title = no + is_head_of_faith = no + exists = title_capital_county + exists = title_capital_county.kingdom + title_capital_county = { + NOT = { exists = clerical_region_title } + exists = holder + faith = $PETITIONER$.faith # the region takes its faith from this county, and a mismatch destroys the new title + OR = { + holder = $PETITIONER$ + holder = { + any_liege_or_above = { + this = $PETITIONER$ + } + } + } + } +} + +# At least one eligible title exists +pam_valid_expand_ecclesiastical_title_target_trigger = { + $ARCHBISHOP$ = { save_temporary_scope_as = archbishop_temp } + $TITLE$ = { + tier = tier_duchy + is_landless_type_title = no + is_head_of_faith = no + custom_tooltip = { + text = pam_valid_expand_ecclesiastical_title_de_jure_county_faith_trigger + OR = { + holder.faith ?= $ARCHBISHOP$.faith + any_de_jure_county = { + count = all + holder.faith ?= $ARCHBISHOP$.faith + } + } + } + trigger_if = { + limit = { + any_de_jure_county = { + NOT = { exists = clerical_region_title } + } + } + scope:archbishop_temp = { + custom_tooltip = { + text = pam_valid_expand_ecclesiastical_title_adjacent_to_clerical_region_trigger + capital_province.county.clerical_region_title ?= { + has_clerical_region = yes + is_head_of_faith = no + holder ?= scope:archbishop_temp + is_adjacent_to_clerical_region = $TITLE$ # very unperformant + } + } + } + } + trigger_else = { + custom_tooltip = { + text = pam_valid_expand_ecclesiastical_title_clerical_region_exists_trigger + always = no + } + } + } +} + +# At least one selectable expand target exists +pam_has_eligible_expand_ecclesiastical_title_target_trigger = { + save_temporary_scope_as = archbishop_temp + capital_county.clerical_region_title = { # must work like this due to clerical_region_adjacent_duchies behaviour + has_clerical_region = yes + is_head_of_faith = no + holder ?= scope:archbishop_temp + save_temporary_scope_as = clerical_region_title_temp + any_county_in_clerical_region = { + any_neighboring_county = { + NOT = { clerical_region_title ?= scope:clerical_region_title_temp } + duchy = { + save_temporary_scope_as = duchy_temp + pam_valid_expand_ecclesiastical_title_target_trigger = { TITLE = scope:duchy_temp ARCHBISHOP = scope:archbishop_temp } + } + } + } + } +} + +pam_can_expand_clerical_region_after_war_trigger = { + exists = scope:target + #You hold a clerical region that neighbors or is within target + save_temporary_scope_as = archbishop_temp + any_held_title = { + has_clerical_region = yes + save_temporary_scope_as = clerical_region_title_temp + any_county_in_clerical_region = { + trigger_if = { + limit = { + scope:target = { + tier = tier_county + } + } + any_neighboring_county = { + this = scope:target + NOT = { exists = clerical_region_title } + } + #The rest of the duchy needs to be ready + scope:target = { + duchy = { + #All counties must have no clerical region + #All counties must be within recipient's realm OR held by a same-faith ruler + any_de_jure_county = { + count >= all + NOT = { exists = clerical_region_title } + OR = { + this = scope:target + NOT = { + holder = { + faith = scope:puppet_or_actor.faith + } + } + } + } + } + } + } + trigger_else_if = { + limit = { + scope:target = { + tier = tier_duchy + } + } + any_neighboring_county = { + duchy = scope:target + NOT = { exists = scope:clerical_region_title } + } + scope:target = { + #All counties must have no clerical region + #All counties must be within recipient's realm OR held by a same-faith ruler + any_de_jure_county = { + count >= all + NOT = { exists = clerical_region_title } + holder = { + OR = { + this = $HEATHEN$ + target_is_liege_or_above = $HEATHEN$ + faith = scope:puppet_or_actor.faith + } + } + } + } + } + trigger_else = { + any_neighboring_county = { + kingdom = scope:target + NOT = { exists = clerical_region_title } + save_temporary_scope_as = county_temp + } + scope:target = { + any_direct_de_jure_vassal_title = { + #All counties must have no clerical region + #All counties must be within recipient's realm OR held by a same-faith ruler + any_de_jure_county = { + count >= all + NOT = { + exists = clerical_region_title + } + holder = { + OR = { + this = $HEATHEN$ + target_is_liege_or_above = $HEATHEN$ + faith = scope:puppet_or_actor.faith + } + } + } + any_de_jure_county = { + this = scope:county_temp + } + } + } + } + } + } +} + +# Evaluated in county scope for the Convert Faith cardinal order. +pam_cardinal_order_convert_faith_in_region_county_trigger = { + faith != $CARDINAL$.faith + exists = holder + holder.top_liege.faith = $CARDINAL$.faith +} + +pam_cardinal_order_convert_faith_neighboring_county_trigger = { + has_clerical_region = no + faith != $CARDINAL$.faith + exists = holder + holder.top_liege.faith = $CARDINAL$.faith +} + +pam_any_christian_holy_site_not_under_christian_control_trigger = { + religion:catholic_religion = { + any_holy_site_barony = { + OR = { + holder.top_liege.faith.religion != religion:catholic_religion + holder.top_liege.faith.religion != religion:protestant_religion + holder.top_liege.faith.religion != religion:eastern_orthodox_religion + holder.top_liege.faith.religion != religion:oriental_orthodox_religion + } + } + } +} + +pam_any_muslim_holy_site_not_under_muslim_control_trigger = { + religion:islam_religion = { + any_faith = { + any_holy_site_barony = { + holder.top_liege.faith.religion != religion:islam_religion + } + } + } +} + +pam_is_the_christian_church_main_power_trigger = { + top_participant_group:the_christian_church ?= { + OR = { + participant_group_type = christian_clerical_main_power_rulers + participant_group_type = christian_regular_main_power_rulers + } + } +} + +pam_ai_can_proclaim_armed_pilgrimages_core_trigger = { + faith = { + this = faith:catholic + has_doctrine = doctrine_spiritual_head + main_rite = { + NOT = { + has_tenet_status = { + tenet = tenet_armed_pilgrimages + status = core + } + } + } + } +} + +pam_ai_can_proclaim_struggle_submission_core_trigger = { + faith.religion = { + this = religion:islam_religion + exists = var:variable_ghw_unlocked # You've entered the Age of Crusades + } + faith = { + main_rite = { + NOT = { + has_tenet_status = { + tenet = tenet_struggle_submission + status = core + } + } + } + } +} + +divorce_is_justified_trigger = { + OR = { + relation_with_character_is_incestuous_in_my_faith_trigger = { CHARACTER = scope:secondary_recipient } + AND = { + faith = scope:recipient.faith + sex_same_as = scope:secondary_recipient + allowed_to_marry_same_sex_trigger = no + } + scope:secondary_recipient = { + has_character_modifier = wedding_accused_impotency_modifier + } + scope:secondary_recipient = { + any_relation = { + type = lover + NOR = { + this = $DIVORCER$ + this = scope:recipient + } + relation_with_character_is_incestuous_in_my_rite_trigger = { CHARACTER = scope:secondary_recipient } + } + } + scope:secondary_recipient = { + exposed_cheating_on_spouse_trigger = { SPOUSE = $DIVORCER$ } + } + scope:secondary_recipient = { + is_female = no + is_eunuch_trigger = yes + } + AND = { + any_consort = { + is_alive = yes + this != scope:secondary_recipient + } + any_consort = { + this = scope:secondary_recipient + } + AND = { + scope:secondary_recipient.culture = { NOT = { has_cultural_tradition = tradition_polygamous } } + scope:secondary_recipient.rite = { NOT = { rite_has_doctrine = doctrine_polygamy } } + } + } + scope:secondary_recipient.faith = { + faith_hostility_level = { + target = scope:recipient.faith + value >= faith_hostile_level + } + } + scope:secondary_recipient = { + has_trait = adulterer + } + scope:secondary_recipient = { + fertility < 0.1 + NOT = { + any_child = { + any_parent = { + this = $DIVORCER$ + } + } + } + } + $DIVORCER$ = { + has_opinion_modifier = { + modifier = attempted_murder_me_crime + target = scope:secondary_recipient + } + } + } +} + +amicable_infertile_divorce_trigger = { + rite = { rite_has_parameter = tenet_be_fruitful_and_multiply_low_fertility_divorce } + $DIVORCEE$ = { + fertility < 0.1 + } +} + +# Mendicant Preachers personal tenet: guests a preaching host can win over at an activity +pam_mendicant_preachers_apa_convert_trigger = { + this != $PREACHER$ + highest_held_title_tier < tier_duchy + is_physically_able_ai_adult = yes + faith != $PREACHER$.faith + NOT = { has_trait = zealous } + opinion = { + target = $PREACHER$ + value >= 0 + } +} + +# PAM Reincarnation personal tenet: a parent or grandparent that root could claim as a past life +# Checked in the forebear's scope, with root as the character doing the remembering +pam_recallable_forebear_trigger = { + save_temporary_scope_as = candidate_forebear + is_alive = no + OR = { + root = { is_child_of = scope:candidate_forebear } + root = { is_grandchild_of = scope:candidate_forebear } + } + any_character_trait = { + has_trait_category = personality + NOT = { root = { has_trait = prev } } + } +} + +divorce_can_cause_house_feud_trigger = { + scope:recipient = { + intrigue >= decent_skill_rating + } + scope:divorcer = { + house.house_head = { + trigger_if = { + limit = { + is_ai = no + } + OR = { + this = scope:divorcer + this = scope:actor + } + } + OR = { + this = scope:divorcer + this = scope:actor + is_close_family_of = scope:divorcer + } + } + } + scope:secondary_recipient = { + house ?= { + any_house_relation = { + #Not already feuding or quite fond of one another + OR = { + has_house_relation_level = quarrel + has_house_relation_level = rivalry + has_house_relation_level = neutral + } + any_relation_house = { + this = scope:divorcer.house + } + } + } + house.house_head = { + trigger_if = { + limit = { + is_ai = no + } + this = scope:secondary_recipient + } + OR = { + this = scope:secondary_recipient + is_close_family_of = scope:secondary_recipient + } + } + } + scope:divorcer.house.house_head = { valid_for_feud_events_with_target_trigger = { TARGET = scope:secondary_recipient.house.house_head } } +} +divorce_can_cause_holy_order_lease_trigger = { + scope:recipient = { + diplomacy >= decent_skill_rating + } + OR = { + #Monastic lease + scope:divorcer = { + any_held_title = { + title_tier = county + any_county_province = { + barony = { + barony_is_valid_for_monastic_order_lease_trigger = { CHARACTER = scope:divorcer } + } + } + } + faith = { + any_faith_holy_order = { + leader ?= { + government_has_flag = government_is_monastic_holy_order + } + holy_order_range_trigger = { CHARACTER = scope:recipient } + } + } + } + #Military lease + scope:divorcer = { + any_held_title = { + title_tier = county + any_county_province = { + barony = { + barony_is_valid_for_holy_order_lease_trigger = { CHARACTER = scope:divorcer } + } + } + } + faith = { + any_faith_holy_order = { + leader ?= { + government_has_flag = government_is_military_holy_order + } + holy_order_range_trigger = { CHARACTER = scope:recipient } + } + } + } + } + +} +divorce_can_cause_hook_trigger = { + scope:recipient = { + trigger_if = { + limit = { + exists = scope:forcing_divorce + } + NOT = { + has_hook = scope:forcing_divorce + } + } + trigger_else = { + NOT = { + has_hook = scope:divorcer + } + } + } +} +divorce_can_put_spouse_in_monastery_trigger = { + scope:secondary_recipient = { + NOR = { + has_trait = devoted + has_trait = order_member + } + is_ai = yes + is_ruler = no + faith = { + this = scope:recipient.faith + any_faith_holy_order = { + leader ?= { + government_has_flag = government_is_monastic_holy_order + trigger_if = { + limit = { + scope:secondary_recipient = { + is_male = yes + } + } + NOT = { + has_realm_law = female_monastic_holy_order_succession_law + } + } + trigger_else = { + NOT = { + has_realm_law = male_monastic_holy_order_succession_law + } + } + } + holy_order_range_trigger = { CHARACTER = scope:recipient } + } + } + } +} + +# Would a priest consider marriage in Saeculum Obscurum? +saeculum_obscurum_clergy_would_marry_trigger = { + # Older priests just don't bother + age < 50 + # Must be somewhat inclined + NOR = { + has_trait = chaste + has_trait = celibate + } + OR = { + # Strict personality/actions + has_trait = lustful + has_trait = seducer + has_trait = rakish + any_relation = { type = lover } + is_deviant_trigger = yes + rite = { trait_is_virtue_rite = lustful } + any_personal_tenet = { + OR = { + this = tenet:tenet_carnal_exaltation + this = tenet:tenet_hedonistic + this = tenet:tenet_polyamory + this = tenet:tenet_sacred_childbirth + this = tenet:tenet_be_fruitful_and_multiply + } + } + # General vibes + saeculum_obscurum_clergy_marry_ai_value_trigger = yes + } +} + +saeculum_obscurum_would_marry_clergy_trigger = { + # General vibes + saeculum_obscurum_clergy_marry_ai_value_trigger = yes +} + +saeculum_obscurum_clergy_marry_ai_value_trigger = { + # Higher tiers need less honor and zeal, and more boldness + trigger_if = { + limit = { highest_held_title_tier > tier_duchy } + ai_honor < low_negative_ai_value + ai_zeal < low_negative_ai_value + ai_boldness > high_positive_ai_value + } + trigger_if = { + limit = { highest_held_title_tier = tier_duchy } + ai_honor < medium_positive_ai_value + ai_zeal < medium_positive_ai_value + ai_boldness > low_positive_ai_value + } + trigger_else = { + ai_honor < high_positive_ai_value + ai_zeal < high_positive_ai_value + ai_boldness > medium_negative_ai_value + } +} + +is_in_same_religious_family_trigger = { + OR = { + AND = { + is_in_family = rf_abrahamic + $FAITH$ = { is_in_family = rf_abrahamic } + } + AND = { + is_in_family = rf_eastern + $FAITH$ = { is_in_family = rf_eastern } + } + AND = { + is_in_family = rf_sinitic + $FAITH$ = { is_in_family = rf_sinitic } + } + AND = { + is_in_family = rf_pagan + $FAITH$ = { is_in_family = rf_pagan } + } + AND = { + is_in_family = rf_esoteric + $FAITH$ = { is_in_family = rf_esoteric } + } + AND = { + is_in_family = rf_antediluvianist + $FAITH$ = { is_in_family = rf_antediluvianist } + } + AND = { + is_in_family = rf_iranic + $FAITH$ = { is_in_family = rf_iranic } + } + } +} + +can_request_priest_from_recipient_trigger = { + OR = { + cp:councillor_court_chaplain ?= { + OR = { + this = $RECIPIENT$ + superior ?= $RECIPIENT$ + superior.superior ?= $RECIPIENT$ + } + } + # A realm under an antipope asks them instead + religious_head_or_challenger ?= $RECIPIENT$ + trigger_if = { + limit = { NOT = { exists = faith.religious_head } } + faith.main_rite.head_of_rite ?= $RECIPIENT$ + } + } +} + +# Gates the tenet popularity system, for PAM it's only for Christian faiths. Runs in a faith scope. +has_tenet_popularity_trigger = { + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } +} +has_papacy_trigger = { + religion = religion:catholic_religion +} +valid_holy_war_incited_attacker_trigger = { + highest_held_title_tier >= tier_county + is_at_war = no + is_landed = yes + gold > 0 + + is_available_quick = { + alive = yes + imprisoned = no + incapable = no + } + current_military_strength >= $RECIPIENT$.one_tenth_current_military_strength + NOR = { + government_has_flag = government_is_landless_adventurer + government_has_flag = government_is_nomadic + government_has_flag = government_is_celestial + government_has_flag = government_is_theocracy + this = scope:puppet_or_actor + this = $RECIPIENT$ + is_allied_to = $RECIPIENT$ + has_truce = $RECIPIENT$ + is_tributary_of = $RECIPIENT$.top_liege + is_tributary_of = $RECIPIENT$ + top_liege = $RECIPIENT$.top_liege + liege = $RECIPIENT$ + puppet:theological_agent_puppet ?= scope:puppet_or_actor + puppet:external_theological_agent_puppet ?= scope:puppet_or_actor + } + NOT = { + any_liege_or_above = { + is_at_war_with = $RECIPIENT$ + } + } + any_character_to_title_neighboring_and_across_water_county = { + OR = { + holder = $RECIPIENT$ + holder.top_liege = $RECIPIENT$ + } + } + tgp_japan_offensive_wars_ban_trigger = yes + $RECIPIENT$ = { + save_temporary_scope_as = defender + } + save_temporary_scope_as = attacker + trigger_if = { + limit = { + scope:attacker = { + any_character_struggle = { + involvement = involved + is_struggle_type = iberian_struggle + } + } + scope:defender = { + any_character_struggle = { + involvement = involved + is_struggle_type = iberian_struggle + } + } + } + are_holy_wars_disabled_in_struggle_phase_trigger = yes + } +} +pam_clergy_title_interaction_player_recipient_auto_accept_trigger = { + scope:secondary_recipient = { save_temporary_scope_as = cleric } + scope:recipient = { save_temporary_scope_as = owner } + scope:recipient = { + is_ai = no + scope:puppet_or_actor = { + OR = { + puppet:theological_agent_puppet ?= scope:secondary_recipient + ai_zeal >= 75 + has_trait = saint + has_trait = herald + has_trait = saoshyant_descendant + has_trait = order_member + has_trait = faith_warrior + has_trait = saoshyant + has_trait = paragon + has_trait = savior + has_trait = crusader_king + reverse_opinion = { + target = scope:secondary_recipient + value >= 70 + } + scope:recipient = { + reverse_opinion = { + target = scope:secondary_recipient + value <= -70 + } + } + is_close_family_of = scope:secondary_recipient + has_perk = sanctioned_loopholes_perk + scope:use_hook = yes + AND = { + scope:offer_hook = yes + highest_held_title_tier >= tier_kingdom + } + AND = { + scope:donate_faith = yes + medium_gold_value >= scope:secondary_recipient.medium_gold_value + } + AND = { + highest_held_title_tier >= tier_duchy + scope:offer_pilgrimage = yes + } + AND = { + scope:threaten_priest = yes + scope:puppet_or_actor = { + OR = { + highest_held_title_tier > scope:secondary_recipient.highest_held_title_tier + is_liege_or_above_of = scope:secondary_recipient + scope:secondary_recipient = { + any_held_title = { + is_neighbor_to_realm = scope:puppet_or_actor + } + } + scope:secondary_recipient.capital_county.holder ?= { + OR = { + this = scope:puppet_or_actor + this = scope:recipient + any_liege_or_above = { + this = scope:puppet_or_actor + } + } + } + liege ?= scope:secondary_recipient.liege + } + } + } + AND = { + exists = scope:target.holder + clerical_hesitation_from_target_holder_value <= -2 + } + AND = { + scope:recipient = { + is_independent_ruler = no + NOT = { + top_liege = scope:puppet_or_actor.top_liege + } + } + clerical_hesitation_from_potential_defender_value <= -2 + } + situation:the_christian_church ?= { + any_participant_group = { # Both characters are involved in the situation + any_situation_group_participant = { + this = scope:puppet_or_actor + } + trigger_if = { + limit = { scope:recipient = { is_ruler = yes } } + any_situation_group_participant = { + this = scope:recipient + } + } + } + has_situation_top_phase_parameter = claim_seeking_acceptance_bonus + } + scope:secondary_recipient = { has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:recipient } } + has_any_good_relationship_with_character_trigger = { CHARACTER = scope:secondary_recipient } + scope:secondary_recipient = { + has_dread_level_towards = { + target = scope:puppet_or_actor + level >= 2 + } + highest_held_title_tier <= scope:puppet_or_actor.highest_held_title_tier + } + scope:recipient = { character_considered_wicked_trigger = { RITE = scope:secondary_recipient.rite } } + AND = { + rite.head_of_rite ?= scope:actor + rite = scope:secondary_recipient.rite + } + } + NOR = { + scope:recipient = { + reverse_opinion = { + target = scope:secondary_recipient + value >= 80 + } + } + scope:secondary_recipient = { + has_dread_level_towards = { + target = scope:recipient + level >= 2 + } + OR = { + top_liege = scope:recipient.top_liege + character_is_realm_neighbor = scope:recipient + } + } + scope:secondary_recipient = { has_any_good_relationship_with_character_trigger = { CHARACTER = scope:recipient } } + has_any_bad_relationship_with_character_trigger = { CHARACTER = scope:secondary_recipient } + AND = { + exists = scope:target.holder + clerical_hesitation_from_target_holder_value >= 3 + } + AND = { + scope:recipient = { + is_independent_ruler = no + NOT = { + top_liege = scope:puppet_or_actor.top_liege + } + } + clerical_hesitation_from_potential_defender_value >= 3 + } + AND = { + NOT = { rite = scope:secondary_recipient.rite } + any_tenet = { + scope:puppet_or_actor.rite = { + has_tenet_status = { + tenet = prev + status = core + } + } + scope:secondary_recipient.rite = { + has_tenet_status = { + tenet = prev + status = prohibited + } + } + } + } + trigger_if = { + limit = { + highest_held_title_tier >= tier_hegemony + } + sub_realm_size >= 1500 + } + trigger_else_if = { + limit = { + highest_held_title_tier = tier_empire + } + sub_realm_size >= 300 + } + trigger_else_if = { + limit = { + highest_held_title_tier = tier_kingdom + } + sub_realm_size >= 120 + } + trigger_else_if = { + limit = { + highest_held_title_tier = tier_duchy + } + sub_realm_size >= 18 + } + trigger_else = { + sub_realm_size >= 10 + } + has_realm_law = uncrowned + AND = { + exists = scope:target + scope:secondary_recipient = { + any_claim = { + this = scope:target + } + } + } + AND = { + scope:recipient.rite = scope:secondary_recipient.rite + scope:recipient.rite = { + rite_counties <= 10 + } + } + AND = { + exists = scope:secondary_recipient.house + scope:recipient.house ?= scope:secondary_recipient.house + NOT = { house ?= scope:secondary_recipient.house } + } + scope:secondary_recipient = { + is_allied_to = scope:recipient + } + #Must be neighboring or overlapping + scope:target ?= { + NOR = { + any_de_jure_county = { + is_neighbor_to_realm = scope:actor + } + any_de_jure_county = { + OR = { + holder = scope:actor + holder.top_liege = scope:actor + } + } + any_in_de_jure_hierarchy = { + holder ?= scope:actor + } + any_this_title_or_de_jure_above = { + holder ?= scope:actor + } + } + } + } + } + } +} +# PAM Peace of God: is prosecuting an offensive war against a ruler of their own faith. +pam_peace_of_god_coreligionist_aggressor_trigger = { + save_temporary_scope_as = pam_aggressor + any_character_war = { + is_attacker = scope:pam_aggressor + primary_defender ?= { faith = scope:pam_aggressor.faith } + } +} + +pam_valid_excommunication_target_trigger = { + age >= 12 + save_temporary_scope_as = target_char + $EXCOMMUNICATOR$ = { save_temporary_scope_as = excommunicator } + trigger_if = { + limit = { has_title = title:k_papal_state } + custom_tooltip = { + text = cannot_excommunicate_pope_without_patriarch_or_antipope_tt + liege ?= $EXCOMMUNICATOR$ + $EXCOMMUNICATOR$ = { + OR = { + pam_holds_christian_patriarch_title_trigger = yes + pam_is_antipope_trigger = yes + } + } + } + } + #always valid if Hof + #This trigger is only relevant if excommunicator is not + trigger_if = { + limit = { + scope:target_char = { need_hof_for_clergy_interaction_trigger = yes } + scope:target_char.faith = { + has_doctrine = doctrine_spiritual_head + exists = scope:target_char.religious_head_or_challenger + } + } + custom_tooltip = { + text = excommunicator_must_be_hof_tt + scope:excommunicator = scope:target_char.religious_head_or_challenger + } + } + trigger_else_if = { + limit = { + scope:target_char.religious_head_or_challenger = scope:excommunicator + } + } + trigger_else = { + # If there is no HoF, a clergy HoR can take it + trigger_if = { + limit = { + NOT = { exists = scope:target_char.faith.religious_head } + scope:target_char.rite.head_of_rite ?= $EXCOMMUNICATOR$ + } + } + #Wanderers and courtiers + trigger_else_if = { + limit = { + is_ruler = no + } + #Courtiers + trigger_if = { + limit = { + exists = liege + } + custom_tooltip = { + text = bishop_excommunication_target_courtier_tt + liege = { + OR = { + target_is_same_character_or_above = $EXCOMMUNICATOR$ + AND = { + is_landed = yes + any_character_to_title_neighboring_county = { + holder ?= { + target_is_same_character_or_above = $EXCOMMUNICATOR$ + } + } + } + capital_province.county = { + clerical_region_title ?= { + holder = $EXCOMMUNICATOR$ + } + } + cp:councillor_court_chaplain ?= $EXCOMMUNICATOR$ + any_liege_or_above = { + cp:councillor_court_chaplain ?= $EXCOMMUNICATOR$ + } + } + } + } + } + #Wanderers + trigger_else = { + custom_tooltip = { + text = bishop_excommunication_target_wanderer_tt + location.county = { + OR = { + holder ?= { + target_is_same_character_or_above = $EXCOMMUNICATOR$ + } + any_neighboring_county = { + holder ?= { + target_is_same_character_or_above = $EXCOMMUNICATOR$ + } + } + clerical_region_title ?= { + holder = $EXCOMMUNICATOR$ + } + holder.cp:councillor_court_chaplain ?= $EXCOMMUNICATOR$ + holder = { + any_liege_or_above = { + cp:councillor_court_chaplain ?= $EXCOMMUNICATOR$ + } + } + } + } + } + } + } + #Theocrats/ecclesiasticals + trigger_else_if = { + limit = { + government_has_flag = government_is_theocracy + } + custom_tooltip = { + text = target_char_must_be_clerical_subordinate_tt + OR = { + $EXCOMMUNICATOR$ = { + any_subordinate = { + OR = { + this = scope:target_char + any_subordinate = { + OR = { + this = scope:target_char + any_subordinate = { + OR = { + this = scope:target_char + any_subordinate = { + this = scope:target_char + } + } + } + } + } + } + } + } + target_is_liege_or_above = $EXCOMMUNICATOR$ + } + + } + } + #Secular rulers + trigger_else = { + custom_tooltip = { + text = bishop_excommunication_target_secular_tt + OR = { + $EXCOMMUNICATOR$ = { + exists = scope:target_char.cp:councillor_court_chaplain + OR = { + AND = { + this = scope:target_char.cp:councillor_court_chaplain + NOT = { + exists = superior + } + } + any_subordinate = { + OR = { + this = scope:target_char.cp:councillor_court_chaplain + any_subordinate = { + OR = { + this = scope:target_char.cp:councillor_court_chaplain + any_subordinate = { + OR = { + this = scope:target_char.cp:councillor_court_chaplain + any_subordinate = { + this = scope:target_char.cp:councillor_court_chaplain + } + } + } + } + } + } + } + } + } + target_is_liege_or_above = $EXCOMMUNICATOR$ + AND = { + is_landed = yes + any_character_to_title_neighboring_county = { + holder ?= { + target_is_same_character_or_above = $EXCOMMUNICATOR$ + } + } + } + capital_county ?= { + clerical_region_title ?= { + holder = $EXCOMMUNICATOR$ + } + } + any_liege_or_above = { + cp:councillor_court_chaplain ?= $EXCOMMUNICATOR$ + } + } + } + } + } +} +actor_incite_holy_war_shown_trigger = { + is_ruler = yes + OR = { + government_has_flag = government_is_ecclesiastical + this = religious_head_or_challenger + } + faith = { + NOR = { + has_doctrine_parameter = holy_wars_forbidden + has_doctrine_parameter = unreformed + } + } +} +incite_holy_war_title_can_be_picked_trigger = { + tier <= tier_kingdom + tier >= tier_county + is_landless_type_title = no + any_in_de_jure_hierarchy = { + tier = tier_county + holder ?= { + target_is_same_character_or_above = $RECIPIENT$ + } + } + trigger_if = { + limit = { + exists = $SECONDARY$ + } + any_in_de_jure_hierarchy = { + tier = tier_county + holder ?= { + target_is_same_character_or_above = $RECIPIENT$ + } + OR = { + holder.top_liege = $SECONDARY$.top_liege + any_title_to_title_neighboring_and_across_water_county = { + holder.top_liege = $SECONDARY$.top_liege + } + } + } + } + trigger_if = { + limit = { + tier >= tier_kingdom + } + custom_tooltip = { + text = piety_too_low_target_kingdom_tt + scope:puppet_or_actor = { piety_level >= 4 } + } + } + trigger_if = { + limit = { + tier >= tier_duchy + } + custom_tooltip = { + text = piety_too_low_target_duchy_tt + scope:puppet_or_actor = { piety_level >= 3 } + } + } + trigger_if = { + limit = { + scope:puppet_or_actor = { + is_at_war_with = $RECIPIENT$ + } + } + custom_tooltip = { + text = not_at_war_for_target_title_or_above_tt + scope:puppet_or_actor = { + NOT = { + any_character_war = { + casus_belli = { + any_target_title = { + OR = { + any_this_title_or_de_jure_above = { + this = scope:target + } + any_in_de_jure_hierarchy = { + this = scope:target + } + } + } + } + } + } + } + } + } +} + +valid_claim_war_incited_attacker_trigger = { + faith = scope:puppet_or_actor.faith + highest_held_title_tier >= tier_county + is_at_war = no + is_landed = yes + gold > 0 + + is_available_quick = { + alive = yes + imprisoned = no + incapable = no + } + current_military_strength >= $RECIPIENT$.one_tenth_current_military_strength + NOR = { + government_has_flag = government_is_landless_adventurer + government_has_flag = government_is_nomadic + government_has_flag = government_is_celestial + government_has_flag = government_is_theocracy + government_has_flag = government_is_ecclesiastical + this = scope:puppet_or_actor + this = $RECIPIENT$ + is_allied_to = $RECIPIENT$ + has_truce = $RECIPIENT$ + is_tributary_of = $RECIPIENT$.top_liege + is_tributary_of = $RECIPIENT$ + top_liege = $RECIPIENT$.top_liege + liege = $RECIPIENT$ + puppet:theological_agent_puppet ?= scope:puppet_or_actor + puppet:external_theological_agent_puppet ?= scope:puppet_or_actor + } + NOT = { + any_liege_or_above = { + is_at_war_with = $RECIPIENT$ + } + } + any_claim = { + tier >= tier_county + tier <= tier_kingdom + is_landless_type_title = no + holder ?= { + target_is_same_character_or_above = $RECIPIENT$ + } + } + tgp_japan_offensive_wars_ban_trigger = yes +} +claim_war_incited_attacker_can_be_picked_trigger = { + custom_description = { + text = incite_claim_war_attacker_must_share_faith_tt + faith = scope:puppet_or_actor.faith + } + custom_description = { + text = incite_claim_war_attacker_must_be_landed_count_tt + is_landed = yes + highest_held_title_tier >= tier_county + } + custom_description = { + text = incite_claim_war_attacker_must_not_be_at_war_tt + is_at_war = no + } + custom_description = { + text = incite_claim_war_attacker_must_not_be_in_debt_tt + gold > 0 + } + is_available_quick = { + alive = yes + imprisoned = no + incapable = no + } + custom_description = { + text = incite_claim_war_attacker_must_be_strong_enough_tt + current_military_strength >= $RECIPIENT$.one_tenth_current_military_strength + } + custom_description = { + text = incite_claim_war_attacker_must_be_secular_tt + NOR = { + government_has_flag = government_is_landless_adventurer + government_has_flag = government_is_nomadic + government_has_flag = government_is_celestial + government_has_flag = government_is_theocracy + government_has_flag = government_is_ecclesiastical + } + } + custom_description = { + text = incite_claim_war_attacker_must_not_be_blocked_diplomacy_tt + NOR = { + this = scope:puppet_or_actor + this = $RECIPIENT$ + is_allied_to = $RECIPIENT$ + has_truce = $RECIPIENT$ + is_tributary_of = $RECIPIENT$.top_liege + is_tributary_of = $RECIPIENT$ + top_liege = $RECIPIENT$.top_liege + liege = $RECIPIENT$ + puppet:theological_agent_puppet ?= scope:puppet_or_actor + puppet:external_theological_agent_puppet ?= scope:puppet_or_actor + } + } + custom_description = { + text = incite_claim_war_attacker_liege_not_at_war_tt + NOT = { + any_liege_or_above = { + is_at_war_with = $RECIPIENT$ + } + } + } + custom_description = { + text = incite_claim_war_attacker_must_have_claim_on_recipient_tt + any_claim = { + tier >= tier_county + tier <= tier_kingdom + is_landless_type_title = no + holder ?= { + target_is_same_character_or_above = $RECIPIENT$ + } + } + } + trigger_if = { + limit = { exists = scope:target } + custom_description = { + text = incite_claim_war_attacker_must_have_claim_on_target_tt + has_claim_on = scope:target + } + } + tgp_japan_offensive_wars_ban_trigger = yes +} +incite_claim_war_title_can_be_picked_trigger = { + tier <= tier_kingdom + tier >= tier_county + is_landless_type_title = no + holder ?= { + target_is_same_character_or_above = $RECIPIENT$ + } + trigger_if = { + limit = { + exists = $SECONDARY$ + } + custom_tooltip = { + text = sponsored_claim_war_attacker_must_have_claim_tt + $SECONDARY$ = { has_claim_on = scope:target } + } + } + trigger_else = { + custom_tooltip = { + text = sponsored_claim_war_someone_must_have_claim_tt + any_claimant = { + valid_claim_war_incited_attacker_trigger = { RECIPIENT = $RECIPIENT$ } + } + } + } + trigger_if = { + limit = { + tier >= tier_kingdom + } + custom_tooltip = { + text = piety_too_low_target_kingdom_tt + scope:puppet_or_actor = { piety_level >= 4 } + } + } + trigger_if = { + limit = { + tier >= tier_duchy + } + custom_tooltip = { + text = piety_too_low_target_duchy_tt + scope:puppet_or_actor = { piety_level >= 3 } + } + } + trigger_if = { + limit = { + scope:puppet_or_actor = { + is_at_war_with = $RECIPIENT$ + } + } + custom_tooltip = { + text = not_at_war_for_target_title_or_above_tt + scope:puppet_or_actor = { + NOT = { + any_character_war = { + casus_belli = { + any_target_title = { + OR = { + any_this_title_or_de_jure_above = { + this = scope:target + } + any_in_de_jure_hierarchy = { + this = scope:target + } + } + } + } + } + } + } + } + } +} +incite_holy_war_ai_invalidation_trigger = { + #One condition must be true, and none of the NOR true + OR = { + $SECONDARY$ = { ai_zeal >= 80 } + $SECONDARY$ = { ai_boldness >= 100 } + #Being forced to (despite having precariously comparable mil strength) + scope:use_hook ?= yes + trigger_if = { + limit = { + exists = $SECONDARY$ + } + AND = { + scope:fund_war ?= yes + scope:puppet_or_actor.major_gold_value >= $SECONDARY$.monumental_gold_value + } + } + AND = { + scope:join_war ?= yes + scope:puppet_or_actor.current_military_strength >= $RECIPIENT$.half_current_military_strength + } + #Can probably win + trigger_if = { + limit = { + exists = $SECONDARY$ + } + current_military_strength <= $SECONDARY$.seventy_percent_of_current_military_strength + } + scope:puppet_or_actor = { is_allied_to = $SECONDARY$ } + AND = { + scope:puppet_or_actor.house.house_head ?= scope:puppet_or_actor + $SECONDARY$.house ?= scope:puppet_or_actor.house + } + $SECONDARY$ = { + has_relation_best_friend = scope:puppet_or_actor + } + AND = { + $SECONDARY$ = { + target_is_liege_or_above = scope:puppet_or_actor + has_dread_level_towards = { + target = scope:puppet_or_actor + level >= 2 + } + } + } + } + $SECONDARY$ = { + NOR = { + ai_zeal < -80 + opinion = { + target = scope:puppet_or_actor + value <= -90 + } + opinion = { + target = $RECIPIENT$ + value >= 75 + } + has_any_good_relationship_with_character_trigger = { CHARACTER = $RECIPIENT$ } + rite = { rite_has_parameter = holy_wars_forbidden } + any_personal_tenet = { + OR = { + this = tenet:tenet_pacifism + this = tenet:tenet_dharmic_pacifism + } + } + AND = { + scope:puppet_or_actor = { + NOT = { rite = $SECONDARY$.rite } + } + any_tenet = { + scope:puppet_or_actor.rite = { + has_tenet_status = { + tenet = prev + status = core + } + } + $SECONDARY$.rite = { + has_tenet_status = { + tenet = prev + status = prohibited + } + } + } + } + $RECIPIENT$ = { + has_trait = greatest_of_khans + } + scope:target ?= { + NOT = { + tier = tier_county + } + any_de_jure_county = { + count >= 4 + holder = { + target_is_same_character_or_above = $RECIPIENT$ + } + any_county_province = { + is_county_capital = yes + OR = { + has_holding_type = nomad_holding + has_holding_type = herder_holding + } + } + } + } + has_dread_level_towards = { + target = $RECIPIENT$ + level >= 2 + } + } + } +} + +pam_valid_enforce_succession_title_trigger = { + $TITLE$ = { + tier >= tier_county + is_landless_type_title = no + exists = current_heir + NOT = { + holder ?= current_heir + } + holder ?= { + is_ai = yes + this != $ACTOR$ + faith = $ACTOR$.faith + NOT = { is_at_war_with = $ACTOR$ } + } + } +} + +pam_demand_church_succession_cs_candidate_trigger = { + this != $ACTOR$ + age >= 50 + NOT = { any_child = { is_alive = yes } } + is_landed = yes + faith = $ACTOR$.faith + is_valid_demand_church_succession_target_trigger = yes + primary_title ?= { tier >= tier_county } + NOR = { + has_character_flag = demand_church_succession_refused_immunity + exists = fallback_succession_title + exists = fallback_succession_character + } +} + +pam_request_white_peace_enemy_trigger = { + is_ruler = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } + OR = { + rite ?= scope:puppet_or_actor.rite + faith ?= scope:puppet_or_actor.faith + religious_head_or_challenger ?= { + scope:puppet_or_actor.religious_head_or_challenger ?= this + } + } + NOR = { + government_has_flag = government_is_theocracy + has_trait = excommunicated + } + scope:puppet_or_actor = { + is_at_war_with = prev + } +} + +pam_request_white_peace_war_with_enemy_trigger = { + has_valid_casus_belli = yes + is_white_peace_possible = yes + war_days >= 730 + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + OR = { + AND = { + casus_belli = { + primary_attacker = scope:puppet_or_actor + primary_defender = $ENEMY$ + } + } + AND = { + casus_belli = { + primary_defender = scope:puppet_or_actor + primary_attacker = $ENEMY$ + } + } + } +} +pam_request_victory_war_with_enemy_trigger = { + has_valid_casus_belli = yes + #A war the design will not let you negotiate to a white peace is not one the clergy may rule won either + is_white_peace_possible = yes + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + OR = { + AND = { + casus_belli = { + primary_attacker = scope:puppet_or_actor + primary_defender = $ENEMY$ + } + attacker_war_score >= 90 + } + AND = { + casus_belli = { + primary_defender = scope:puppet_or_actor + primary_attacker = $ENEMY$ + } + defender_war_score >= 90 + } + } +} + +#A war that can already be won outright, so there is nothing for the clergy to do +pam_request_victory_war_already_won_trigger = { + has_valid_casus_belli = yes + #Kept in step with pam_request_victory_war_with_enemy_trigger so an ineligible war cannot block an eligible one + is_white_peace_possible = yes + NOR = { + using_cb = undirected_great_holy_war + using_cb = directed_great_holy_war + } + OR = { + AND = { + casus_belli = { + primary_attacker = scope:puppet_or_actor + primary_defender = $ENEMY$ + } + attacker_war_score >= 100 + } + AND = { + casus_belli = { + primary_defender = scope:puppet_or_actor + primary_attacker = $ENEMY$ + } + defender_war_score >= 100 + } + } +} + +pam_characters_to_evangelize_personal_tenet_trigger = { + is_adult = yes + is_ai = yes + faith = root.faith + highest_held_title_tier <= root.highest_held_title_tier + trigger_if = { + limit = { + exists = scope:selected_item + } + any_personal_tenet = { + this != scope:selected_item + } + trigger_if = { + limit = { + faith.main_rite = { + has_tenet_status = { + tenet = scope:selected_item + status = prohibited + } + } + } + pam_ai_can_consider_forbidden_personal_tenet_trigger = yes + } + } +} +pam_monastic_tenet_spread_target_trigger = { + is_adult = yes + faith = $ORDER_LEADER$.faith + NOR = { + any_personal_tenet = { + this = $ORDER_LEADER$.holy_order.order_tenet + } + is_in_list = personal_tenet_targets + } + trigger_if = { + limit = { + faith.main_rite = { + has_tenet_status = { + tenet = $ORDER_LEADER$.holy_order.order_tenet + status = prohibited + } + } + } + pam_ai_can_consider_forbidden_personal_tenet_trigger = yes + } + trigger_if = { + limit = { + exists = scope:actor + } + NOT = { + this = scope:actor + } + } +} +monastic_lease_can_be_suborned_trigger = { + barony.lessee = { + save_temporary_scope_as = lessee + } + trigger_if = { + limit = { + county.holder ?= { + is_ai = no + } + } + county.holder = { + NAND = { + this = $ORDER$.holy_order_patron + this = scope:lessee.holy_order.holy_order_patron + } + NOT = { + scope:lessee.puppeteer ?= this + } + } + NOT = { + county = scope:lessee.capital_county + } + } + OR = { + county.holder ?= { + OR = { + AND = { + exists = $ORDER$.leader.puppeteer + this = $ORDER$.leader.puppeteer + } + AND = { + exists = $ORDER$.holy_order_patron + this = $ORDER$.holy_order_patron + rite = $ORDER$.leader.rite + } + } + } + county.clerical_region_title.holder.rite ?= { + this = $ORDER$.leader.rite + NOT = { + this = scope:lessee.rite + } + } + county.clerical_region_title.holder ?= { + OR = { + AND = { + exists = $ORDER$.leader.puppeteer + this = $ORDER$.leader.puppeteer + } + AND = { + exists = $ORDER$.holy_order_patron + this = $ORDER$.holy_order_patron + rite = $ORDER$.leader.rite + } + } + } + county.clerical_region_title.holder ?= { + rite = $ORDER$.leader.rite + any_personal_tenet = { + this = $ORDER$.order_tenet + } + NOT = { + any_personal_tenet = { + this = scope:lessee.holy_order.order_tenet + } + } + OR = { + piety_level >= 4 + learning >= extremely_high_skill_rating + has_trait = theologian + } + } + AND = { + exists = scope:lessee.holy_order.order_tenet + county.holder ?= { + rite = $ORDER$.leader.rite + any_personal_tenet = { + this = $ORDER$.order_tenet + } + NOT = { + any_personal_tenet = { + this = scope:lessee.holy_order.order_tenet + } + } + } + } + AND = { + county.holder.rite ?= { + this = $ORDER$.leader.rite + NOT = { + scope:lessee.rite ?= this + } + } + } + } + county.kingdom ?= { save_temporary_scope_as = target_kingdom } + $ORDER$ = { + any_leased_title = { + kingdom ?= scope:target_kingdom + } + } +} + + +pam_tenet_can_be_evangelized_trigger = { + scope:actor = { + has_personal_tenet = $TENET$ + } +} + +pam_evangelize_personal_tenet_send_option_selected_trigger = { + OR = { + scope:tenet_aniconism = yes + scope:tenet_alexandrian_catechism = yes + scope:tenet_armed_pilgrimages = yes + scope:tenet_carnal_exaltation = yes + scope:tenet_communal_identity = yes + scope:tenet_communion = yes + scope:tenet_consolamentum = yes + scope:tenet_divine_marriage = yes + scope:tenet_gnosticism = yes + scope:tenet_mendicant_preachers = yes + scope:tenet_pacifism = yes + scope:tenet_pentarchy = yes + scope:tenet_unrelenting_faith = yes + scope:tenet_vows_of_poverty = yes + scope:tenet_pastoral_isolation = yes + scope:tenet_adaptive = yes + scope:tenet_esotericism = yes + scope:tenet_legalism = yes + scope:tenet_literalism = yes + scope:tenet_reincarnation = yes + scope:tenet_religious_legal_pronouncements = yes + scope:tenet_struggle_submission = yes + scope:tenet_false_conversion_sanction = yes + scope:tenet_tax_nonbelievers = yes + scope:tenet_asceticism = yes + scope:tenet_bhakti = yes + scope:tenet_dharmic_pacifism = yes + scope:tenet_inner_journey = yes + scope:tenet_ritual_hospitality = yes + scope:tenet_adorcism = yes + scope:tenet_ancestor_worship = yes + scope:tenet_astrology = yes + scope:tenet_hedonistic = yes + scope:tenet_human_sacrifice = yes + scope:tenet_mystical_birthright = yes + scope:tenet_ritual_celebrations = yes + scope:tenet_sacred_childbirth = yes + scope:tenet_sanctity_of_nature = yes + scope:tenet_sun_worship = yes + scope:tenet_warmonger = yes + scope:tenet_gruesome_festivals = yes + scope:tenet_cthonic_redoubts = yes + scope:tenet_household_gods = yes + scope:tenet_sinitic_syncretism = yes + scope:tenet_eastern_syncretism = yes + scope:tenet_unreformed_syncretism = yes + scope:tenet_christian_syncretism = yes + scope:tenet_islamic_syncretism = yes + scope:tenet_jewish_syncretism = yes + scope:tenet_exaltation_of_pain = yes + scope:tenet_natural_primitivism = yes + scope:tenet_pursuit_of_power = yes + scope:tenet_ritual_cannibalism = yes + scope:tenet_sacred_shadows = yes + scope:tenet_polyamory = yes + scope:tenet_sacrificial_ceremonies = yes + scope:tenet_megaliths = yes + scope:tenet_fp3_fedayeen = yes + scope:tenet_communal_possessions = yes + scope:tenet_pure_land = yes + scope:tenet_no_mind = yes + scope:tenet_mountain_worship = yes + scope:tenet_extinction_of_dharma = yes + scope:tenet_cranial_trophies = yes + scope:tenet_pursuit_of_knowledge = yes + scope:tenet_benevolent_governance = yes + scope:tenet_filial_piety = yes + scope:tenet_harmonious_society = yes + scope:tenet_sacred_destruction = yes + scope:tenet_preservation = yes + scope:tenet_takamin = yes + scope:tenet_peace_of_god = yes + scope:tenet_dulia = yes + scope:tenet_transubstantiation = yes + scope:tenet_ora_et_labora = yes + scope:tenet_hyperdulia = yes + scope:tenet_simony = yes + scope:tenet_monophysitism = yes + scope:tenet_acts_of_apostles = yes + scope:tenet_purgatory = yes + scope:tenet_be_fruitful_and_multiply = yes + scope:tenet_apostolic_succession = yes + scope:tenet_confession = yes + scope:tenet_original_sin = yes + scope:tenet_celestial_hierarchy = yes + scope:tenet_miles_christi = yes + scope:tenet_philanthropia = yes + scope:tenet_scholasticism = yes + scope:tenet_adoptionism = yes + scope:tenet_love_thy_neighbour = yes + scope:tenet_divine_liturgy = yes + scope:tenet_miaphysitism = yes + scope:tenet_hesychasm = yes + scope:tenet_anachoresis = yes + scope:tenet_mortification_of_the_flesh = yes + scope:tenet_holy_myron = yes + scope:tenet_khachkar = yes + } +} + +pam_evangelize_recipient_desires_selected_tenet_trigger = { + exists = scope:pam_evangelize_tenet + scope:recipient = { + any_desired_tenet = { + this = scope:pam_evangelize_tenet + } + } +} + +pam_evangelize_selected_tenet_prohibited_trigger = { + exists = scope:pam_evangelize_tenet + scope:recipient.rite = { + has_tenet_status = { + tenet = scope:pam_evangelize_tenet + status = prohibited + } + } +} + +# scope:pam_evangelize_tenet_check is the tenet being weighed on a character +# Saved scope not $TENET$: a macro inside a quoted script value drops the opening parenthesis +pam_evangelize_tenet_below_very_popular_trigger = { + "faith.tenet_popularity(scope:pam_evangelize_tenet_check)" < tenet_popularity_very_popular_threshold +} + +pam_character_has_peaceful_tenet_trigger = { + $CHARACTER$ = { + OR = { + rite = { + OR = { + rite_has_tenet = tenet_peace_of_god + rite_has_tenet = tenet_pacifism + rite_has_tenet = tenet_dharmic_pacifism + } + } + has_personal_tenet = tenet_peace_of_god + has_personal_tenet = tenet_pacifism + has_personal_tenet = tenet_dharmic_pacifism + } + } +} + +pam_evangelize_personal_tenet_send_option_valid_trigger = { + scope:recipient = { + NOT = { has_personal_tenet = $TENET$ } + } + custom_tooltip = { + text = pam_evangelize_only_one_personal_tenet_tt + OR = { + scope:$TENET$ = yes + pam_evangelize_personal_tenet_send_option_selected_trigger = no + } + } +} + +pam_college_of_cardinals_election_active_trigger = { + exists = title:k_papal_state + title:k_papal_state.holder ?= { + has_realm_law = theocratic_elective_succession_law + } +} + +pam_leads_college_of_cardinals_trigger = { + has_title = title:k_papal_state + pam_college_of_cardinals_election_active_trigger = yes +} + +pam_pope_is_head_of_faith_or_rite_trigger = { + OR = { + rite.head_of_rite ?= { has_title = title:k_papal_state } + faith.main_rite.head_of_rite ?= { has_title = title:k_papal_state } + faith.religious_head ?= { has_title = title:k_papal_state } + } +} + +# Cardinal scope needs $POPE$ here +# Both dynasty sides need exists or two lowborn prelates match each other +pam_cardinal_is_nepotistic_appointment_trigger = { + OR = { + AND = { + exists = dynasty + exists = $POPE$.dynasty + dynasty = $POPE$.dynasty + } + has_any_moderate_good_relationship_with_character_trigger = { CHARACTER = $POPE$ } + has_any_best_good_relationship_with_character_trigger = { CHARACTER = $POPE$ } + } +} + +# $TITLE$ is the seat that heads this character's Church, and this runs on a character +# Rome is named directly: headless Chalcedonianism has no religious_head_title to compare +pam_title_is_church_seat_trigger = { + OR = { + $TITLE$ = title:k_papal_state + AND = { + exists = faith.religious_head_title + $TITLE$ = faith.religious_head_title + } + } +} + +pam_holds_christian_patriarch_title_trigger = { + OR = { + has_title = title:d_et_constantinople + has_title = title:k_orthodox + has_title = title:d_et_alexandria + has_title = title:d_et_antioch + has_title = title:d_et_jerusalem + has_title = title:d_et_aquileia + has_title = title:d_et_armenia + } +} + +# While Chalcedonianism is headless the Pope heads it as head of rite +pam_holds_church_seat_trigger = { + OR = { + any_held_title = { is_head_of_faith = yes } + has_title = title:k_papal_state + } +} + +pam_college_election_title_has_electors_trigger = { + trigger_if = { + limit = { exists = faith.religious_head_title } + # any_elector rather than a bare exists: is_candidate_from_set errors on a title with no election law. + faith.religious_head_title = { any_elector = {} } + } + trigger_else = { + title:k_papal_state = { any_elector = {} } + } +} + +pam_college_election_title_is_theocratic_elective_trigger = { + trigger_if = { + limit = { exists = faith.religious_head_title } + faith.religious_head_title.holder ?= { has_realm_law = theocratic_elective_succession_law } + } + trigger_else = { + title:k_papal_state.holder ?= { has_realm_law = theocratic_elective_succession_law } + } +} + +# Character scope. Do they sit on the Church seat the College of Cardinals elects? +pam_holds_college_elected_church_seat_trigger = { + pam_holds_church_seat_trigger = yes + pam_college_election_title_has_electors_trigger = yes + pam_college_election_title_is_theocratic_elective_trigger = yes +} + +pam_is_college_election_candidate_trigger = { + trigger_if = { + limit = { pam_college_election_title_has_electors_trigger = yes } + trigger_if = { + limit = { exists = faith.religious_head_title } + is_candidate_from_set = { + title = faith.religious_head_title + source = $SOURCE$ + } + } + trigger_else = { + is_candidate_from_set = { + title = title:k_papal_state + source = $SOURCE$ + } + } + } + trigger_else = { # Error log suppressing + always = no + } +} + +# We check the clerical title, because the government flag and is_clergy miss many PAM prelates +pam_is_investiture_clergy_trigger = { + OR = { + any_held_title = { has_clerical_region = yes } + government_has_flag = government_is_ecclesiastical + is_clergy = yes + } +} + +# Only landed county tier and above, because temple baronies match has_clerical_region and flood the guests +pam_is_investiture_landed_prelate_trigger = { + is_landed = yes + highest_held_title_tier >= tier_county + OR = { + any_held_title = { has_clerical_region = yes } + government_has_flag = government_is_ecclesiastical + } +} + +pam_valid_ecumenical_council_voter_trigger = { + faith = involved_activity.activity_host.faith + OR = { + pam_is_investiture_clergy_trigger = yes + rite.head_of_rite ?= this + has_variable = investiture_stance + # puppet:X errors on non-playable characters, and only landed county tier rulers own that puppet + AND = { + is_landed = yes + highest_held_title_tier >= tier_county + OR = { + has_theological_agent_puppet_trigger = yes + is_theological_agent_puppet_trigger = yes + } + } + } +} + +pam_ec_doctrine_status_is_criminal_trigger = { + OR = { + scope:doctrine = doctrine:doctrine_witchcraft_crime + scope:doctrine = doctrine:doctrine_deviancy_crime + scope:doctrine = doctrine:doctrine_homosexuality_crime + scope:doctrine = doctrine:doctrine_adultery_men_crime + scope:doctrine = doctrine:doctrine_adultery_women_crime + scope:doctrine = doctrine:doctrine_kinslaying_any_dynasty_member_crime + scope:doctrine = doctrine:doctrine_kinslaying_extended_family_crime + scope:doctrine = doctrine:doctrine_kinslaying_close_kin_crime + } +} + +pam_ec_doctrine_status_is_shunned_trigger = { + OR = { + scope:doctrine = doctrine:doctrine_witchcraft_shunned + scope:doctrine = doctrine:doctrine_deviancy_shunned + scope:doctrine = doctrine:doctrine_homosexuality_shunned + scope:doctrine = doctrine:doctrine_adultery_men_shunned + scope:doctrine = doctrine:doctrine_adultery_women_shunned + scope:doctrine = doctrine:doctrine_kinslaying_shunned + } +} + +pam_ec_doctrine_status_is_accepted_trigger = { + OR = { + scope:doctrine = doctrine:doctrine_witchcraft_accepted + scope:doctrine = doctrine:doctrine_deviancy_accepted + scope:doctrine = doctrine:doctrine_homosexuality_accepted + scope:doctrine = doctrine:doctrine_adultery_men_accepted + scope:doctrine = doctrine:doctrine_adultery_women_accepted + scope:doctrine = doctrine:doctrine_kinslaying_accepted + } +} + +pam_ec_doctrine_status_is_virtuous_trigger = { + OR = { + scope:doctrine = doctrine:doctrine_witchcraft_virtuous + scope:doctrine = doctrine:doctrine_deviancy_virtuous + } +} + +pam_ec_doctrine_is_graded_trigger = { + OR = { + pam_ec_doctrine_status_is_criminal_trigger = yes + pam_ec_doctrine_status_is_shunned_trigger = yes + pam_ec_doctrine_status_is_accepted_trigger = yes + pam_ec_doctrine_status_is_virtuous_trigger = yes + } +} + +pam_ec_doctrine_is_change_trigger = { + scope:host.faith ?= { + NOT = { has_doctrine = scope:doctrine } + } +} + +# The AI Conservative named to oppose the host in this debate; stands down while a player argues the Conservative side +pam_ec_is_active_counterplayer_trigger = { + is_ai = yes + is_in_guest_subset = { name = conservative } + involved_activity ?= { + exists = var:ec_counterplayer + var:ec_counterplayer = prev + NOT = { + any_attending_character = { + is_ai = no + is_in_guest_subset = { name = conservative } + } + } + } +} + +# AI proposers who may skip the nearest-step rule at an Ecumenical Council +pam_ec_doctrine_extremist_proposer_trigger = { + OR = { + has_trait = herald + has_trait = heresiarch + has_trait = lunatic_1 + has_trait = lunatic_genetic + has_trait = possessed_1 + has_trait = possessed_genetic + } +} + +# The proposed scope:ec_step_to is the closest step from the held scope:ec_step_from that the rite can choose +pam_ec_doctrine_is_nearest_step_trigger = { + NOT = { + root = { + any_character_doctrine = { + doctrine_in_same_group = scope:ec_step_from + this != scope:ec_step_from + this != scope:ec_step_to + save_temporary_scope_as = ec_step_other + root.faith.main_rite = { rite_can_choose_doctrine = scope:ec_step_other } + "doctrine_divergence(scope:ec_step_from)" < ecumenical_council_doctrine_change_divergence_value + } + } + } +} + +pam_ec_doctrine_is_binary_trigger = { + OR = { + scope:doctrine = doctrine:doctrine_theocracy_temporal + scope:doctrine = doctrine:doctrine_theocracy_lay_clergy + scope:doctrine = doctrine:doctrine_clerical_marriage_allowed + scope:doctrine = doctrine:doctrine_clerical_marriage_disallowed + scope:doctrine = doctrine:doctrine_monotheist + scope:doctrine = doctrine:doctrine_polytheist + scope:doctrine = doctrine:doctrine_sacraments_central + scope:doctrine = doctrine:doctrine_sacraments_absent + } +} + +pam_ec_doctrine_in_christian_abomination_group_trigger = { + scope:host.faith ?= { has_doctrine = special_doctrine_is_christian_faith } + OR = { + scope:doctrine = doctrine:doctrine_witchcraft_crime + scope:doctrine = doctrine:doctrine_witchcraft_shunned + scope:doctrine = doctrine:doctrine_witchcraft_accepted + scope:doctrine = doctrine:doctrine_witchcraft_virtuous + scope:doctrine = doctrine:doctrine_deviancy_crime + scope:doctrine = doctrine:doctrine_deviancy_shunned + scope:doctrine = doctrine:doctrine_deviancy_accepted + scope:doctrine = doctrine:doctrine_deviancy_virtuous + scope:doctrine = doctrine:doctrine_kinslaying_any_dynasty_member_crime + scope:doctrine = doctrine:doctrine_kinslaying_extended_family_crime + scope:doctrine = doctrine:doctrine_kinslaying_close_kin_crime + scope:doctrine = doctrine:doctrine_kinslaying_shunned + scope:doctrine = doctrine:doctrine_kinslaying_accepted + } +} + +pam_ec_doctrine_in_christian_scandal_group_trigger = { + scope:host.faith ?= { has_doctrine = special_doctrine_is_christian_faith } + OR = { + scope:doctrine = doctrine:doctrine_homosexuality_crime + scope:doctrine = doctrine:doctrine_homosexuality_shunned + scope:doctrine = doctrine:doctrine_homosexuality_accepted + scope:doctrine = doctrine:doctrine_adultery_men_crime + scope:doctrine = doctrine:doctrine_adultery_men_shunned + scope:doctrine = doctrine:doctrine_adultery_men_accepted + scope:doctrine = doctrine:doctrine_adultery_women_crime + scope:doctrine = doctrine:doctrine_adultery_women_shunned + scope:doctrine = doctrine:doctrine_adultery_women_accepted + } +} + +pam_ec_doctrine_in_christian_clerical_order_group_trigger = { + scope:host.faith ?= { has_doctrine = special_doctrine_is_christian_faith } + OR = { + scope:doctrine = doctrine:doctrine_clerical_gender_male_only + scope:doctrine = doctrine:doctrine_clerical_gender_either + scope:doctrine = doctrine:doctrine_clerical_gender_female_only + } +} + +pam_ec_tenet_is_christian_abomination_trigger = { + scope:host.faith ?= { has_doctrine = special_doctrine_is_christian_faith } + OR = { + scope:tenet = tenet:tenet_ritual_cannibalism + scope:tenet = tenet:tenet_natural_primitivism + scope:tenet = tenet:tenet_human_sacrifice + scope:tenet = tenet:tenet_cranial_trophies + scope:tenet = tenet:tenet_gruesome_festivals + scope:tenet = tenet:tenet_sacrificial_ceremonies + scope:tenet = tenet:tenet_carnal_exaltation + } +} + +pam_custom_kingdom_can_claim_duchy_exclave_trigger = { + tier = tier_duchy + save_temporary_scope_as = duchy_temp + NOR = { + $NEW_KING$ = { + completely_controls = prev + } + holder ?= $NEW_KING$ + holder ?= { + target_is_liege_or_above = $NEW_KING$ + } + } + NOT = { + any_de_jure_county = { + kingdom.title_capital_county ?= this + } + } + #Is not only duchy in kingdom + kingdom = { + any_direct_de_jure_vassal_title = { + tier = tier_duchy + NOR = { + this = scope:duchy_temp + $NEW_KING$ = { + completely_controls = prev + } + holder ?= $NEW_KING$ + holder ?= { + target_is_liege_or_above = $NEW_KING$ + } + } + } + } + #Is not controlled by de jure liege + trigger_if = { + limit = { + exists = kingdom.holder + } + kingdom.holder = { + NOR = { + this = scope:duchy_temp.holder + any_vassal_or_below = { + this = scope:duchy_temp.holder + } + completely_controls = scope:duchy_temp + } + } + } + #Not bordering any other county of de jure kingdom (not held by new king) + NOT = { + any_de_jure_county = { + save_temporary_scope_as = county_temp + + any_neighboring_county = { + kingdom = scope:county_temp.kingdom + duchy = { + NOR = { + this = scope:county_temp.duchy + $NEW_KING$ = { + completely_controls = prev + } + holder ?= { + target_is_same_character_or_above = $NEW_KING$ + } + } + } + } + } + } + any_de_jure_county = { + any_neighboring_county = { + duchy = { + OR = { + holder ?= { + target_is_same_character_or_above = $NEW_KING$ + } + $NEW_KING$ = { + completely_controls = prev + } + } + } + } + } +} +pam_custom_empire_can_claim_kingdom_exclave_trigger = { + tier = tier_kingdom + save_temporary_scope_as = kingdom_temp + NOR = { + $NEW_EMPEROR$ = { + completely_controls = prev + } + holder ?= $NEW_EMPEROR$ + holder ?= { + target_is_liege_or_above = $NEW_EMPEROR$ + } + } + NOT = { + any_de_jure_county = { + empire.title_capital_county ?= this + } + } + #Is not only kingdom in empire + empire = { + any_direct_de_jure_vassal_title = { + tier = tier_kingdom + NOR = { + this = scope:kingdom_temp + $NEW_EMPEROR$ = { + completely_controls = prev + } + holder ?= $NEW_EMPEROR$ + holder ?= { + target_is_liege_or_above = $NEW_EMPEROR$ + } + } + } + } + #Is not controlled by de jure liege + trigger_if = { + limit = { + exists = empire.holder + } + empire.holder = { + NOR = { + this = scope:kingdom_temp.holder + any_vassal_or_below = { + this = scope:kingdom_temp.holder + } + completely_controls = scope:kingdom_temp + } + } + } + #Not bordering any other county of de jure empire (not held by new empire) + NOT = { + any_de_jure_county = { + save_temporary_scope_as = county_temp + any_title_to_title_neighboring_and_across_water_county = { + empire = scope:county_temp.empire + kingdom = { + NOR = { + this = scope:county_temp.kingdom + $NEW_EMPEROR$ = { + completely_controls = prev + } + holder ?= { + target_is_same_character_or_above = $NEW_EMPEROR$ + } + } + } + } + } + } + any_de_jure_county = { + any_neighboring_county = { + kingdom = { + OR = { + holder ?= { + target_is_same_character_or_above = $NEW_EMPEROR$ + } + $NEW_EMPEROR$ = { + completely_controls = prev + } + } + } + } + } +} + +ai_religious_request_blocker_trigger = { + scope:actor = { + trigger_if = { + limit = { + is_ai = yes + scope:recipient = { is_ai = no } + } + # Each religious request has its own cooldown against a player Head of Faith + NOT = { scope:recipient = { has_character_flag = $INTERACTION$_received_cooldown } } + } + } +} + +target_valid_ecclesiastical_de_jure_shifting_trigger = { + is_landless_type_title = no + is_head_of_faith = no + tier = scope:puppet_or_actor.highest_held_title_tier_minus_one + custom_tooltip = { + text = petition_de_jure_integration_not_already_de_jure_tt + NOT = { + de_jure_liege = scope:puppet_or_actor.primary_title + } + } + custom_tooltip = { + text = petition_de_jure_integration_target_is_connected_tt + any_de_jure_county = { + holder ?= { + target_is_same_character_or_above = scope:puppet_or_actor + } + } + } + custom_tooltip = { + text = recipient_not_targets_de_jure_liege_tt + NOT = { + de_jure_liege.holder ?= scope:recipient + } + } + trigger_if = { + limit = { + exists = scope:recipient.religious_head_or_challenger + scope:recipient.religious_head_or_challenger != scope:recipient + exists = scope:target.de_jure_liege.holder + } + custom_tooltip = { + text = hof_is_target_de_jure_liege_tt + NOT = { + scope:recipient.religious_head_or_challenger ?= scope:target.de_jure_liege.holder + } + } + } + #AI should only do direct borders, not over water - ew gross + trigger_if = { + limit = { + scope:puppet_or_actor = { + is_ai = no + } + } + custom_tooltip = { + text = target_must_border_your_de_jure + any_de_jure_county = { + any_title_to_title_neighboring_and_across_water_county = { + any_this_title_or_de_jure_above = { + this = scope:puppet_or_actor.primary_title + } + } + } + } + } + trigger_else = { + custom_tooltip = { + text = target_must_border_your_de_jure_land + any_de_jure_county = { + any_title_to_title_neighboring_county = { + any_this_title_or_de_jure_above = { + this = scope:puppet_or_actor.primary_title + } + } + } + } + } +} +clergy_interaction_generic_piety_level_or_puppet_req_trigger = { + trigger_if = { + limit = { + NOT = { + government_has_flag = government_is_theocracy + } + } + custom_tooltip = { + text = piety_level_or_puppet_req_tt + OR = { + has_theological_agent_puppet_trigger = yes + piety_level >= 3 + } + } + } + trigger_else = { + piety_level >= 1 + } +} + +#Title scope. An uncreated title the petitioner already has a foothold in; scope:puppet_or_actor is the petitioning ruler. +target_valid_request_unformed_title_trigger = { + is_landless_type_title = no + is_head_of_faith = no + tier > tier_county + custom_tooltip = { + text = target_has_holder_tt + NOT = { exists = holder } + } + custom_tooltip = { + text = request_unformed_title_no_hegemony_tt + tier < tier_hegemony + } + custom_tooltip = { + text = request_unformed_title_tier_range_tt + NOR = { + tier > scope:puppet_or_actor.highest_held_title_tier_plus_one + tier < scope:puppet_or_actor.highest_held_title_tier + } + } + custom_tooltip = { + text = request_unformed_title_hold_de_jure_vassal_tt + any_direct_de_jure_vassal_title = { + holder ?= scope:puppet_or_actor + } + } + custom_tooltip = { + text = request_unformed_title_third_of_de_jure_tt + any_de_jure_county = { + percent >= 0.33 + holder ?= { + target_is_same_character_or_above = scope:puppet_or_actor + } + faith = scope:puppet_or_actor.faith + } + } +} + +pam_personal_pacifism_offensive_war_ban_trigger = { + custom_tooltip = { + text = pam_personal_pacifism_offensive_war_ban_tt + scope:attacker = { + NOT = { has_personal_tenet_flag = tenet_pacifism_no_offensive_war } + } + } +} + +has_different_doctrine_with_rite_trigger = { + rite_has_doctrine = $DOCTRINE$ + NOT = { $RITE$ = { rite_has_doctrine = $DOCTRINE$ } } +} + +pam_doctrine_can_be_reaffirm = { + OR = { + this = doctrine:doctrine_monogamy + this = doctrine:doctrine_polygamy + this = doctrine:doctrine_concubines + + this = doctrine:doctrine_divorce_disallowed + this = doctrine:doctrine_divorce_approval + this = doctrine:doctrine_divorce_allowed + + this = doctrine:doctrine_bastardry_none + this = doctrine:doctrine_bastardry_legitimization + this = doctrine:doctrine_bastardry_all + + this = doctrine:doctrine_homosexuality_crime + this = doctrine:doctrine_homosexuality_shunned + this = doctrine:doctrine_homosexuality_accepted + + this = doctrine:doctrine_deviancy_crime + this = doctrine:doctrine_deviancy_shunned + this = doctrine:doctrine_deviancy_accepted + this = doctrine:doctrine_deviancy_virtuous + + this = doctrine:doctrine_adultery_men_crime + this = doctrine:doctrine_adultery_men_shunned + this = doctrine:doctrine_adultery_men_accepted + + this = doctrine:doctrine_adultery_women_crime + this = doctrine:doctrine_adultery_women_shunned + this = doctrine:doctrine_adultery_women_accepted + + this = doctrine:doctrine_kinslaying_any_dynasty_member_crime + this = doctrine:doctrine_kinslaying_extended_family_crime + this = doctrine:doctrine_kinslaying_close_kin_crime + this = doctrine:doctrine_kinslaying_shunned + this = doctrine:doctrine_kinslaying_accepted + + this = doctrine:doctrine_witchcraft_crime + this = doctrine:doctrine_witchcraft_shunned + this = doctrine:doctrine_witchcraft_accepted + this = doctrine:doctrine_witchcraft_virtuous + + this = doctrine:doctrine_gender_male_dominated + this = doctrine:doctrine_gender_equal + this = doctrine:doctrine_gender_female_dominated + + this = doctrine:doctrine_consanguinity_dynastic + this = doctrine:doctrine_consanguinity_restricted + this = doctrine:doctrine_consanguinity_cousins + this = doctrine:doctrine_consanguinity_aunt_nephew_and_uncle_niece + this = doctrine:doctrine_consanguinity_unrestricted + + this = doctrine:doctrine_pluralism_fundamentalist + this = doctrine:doctrine_pluralism_righteous + this = doctrine:doctrine_pluralism_pluralistic + + this = doctrine:doctrine_theocracy_temporal + this = doctrine:doctrine_theocracy_lay_clergy + + this = doctrine:doctrine_no_head + this = doctrine:doctrine_spiritual_head + this = doctrine:doctrine_temporal_head + + this = doctrine:doctrine_clerical_function_taxation + this = doctrine:doctrine_clerical_function_alms_and_pacification + this = doctrine:doctrine_clerical_function_recruitment + + this = doctrine:doctrine_clerical_gender_male_only + this = doctrine:doctrine_clerical_gender_either + this = doctrine:doctrine_clerical_gender_female_only + + this = doctrine:doctrine_clerical_marriage_allowed + this = doctrine:doctrine_clerical_marriage_disallowed + + this = doctrine:doctrine_clerical_succession_temporal_appointment + this = doctrine:doctrine_clerical_succession_spiritual_appointment + this = doctrine:doctrine_clerical_succession_temporal_fixed_appointment + this = doctrine:doctrine_clerical_succession_spiritual_fixed_appointment + this = doctrine:doctrine_clerical_succession_conditional + + this = doctrine:doctrine_pilgrimage_forbidden + this = doctrine:doctrine_pilgrimage_encouraged + this = doctrine:doctrine_pilgrimage_local_rites + this = doctrine:doctrine_pilgrimage_mandatory + this = doctrine:doctrine_pilgrimage_mandatory_hajj + + this = doctrine:doctrine_funeral_stoic + this = doctrine:doctrine_funeral_bewailment + this = doctrine:doctrine_funeral_cremation + this = doctrine:doctrine_funeral_sky_burial + this = doctrine:doctrine_funeral_mummification + this = doctrine:doctrine_family_rites + + this = doctrine:doctrine_no_anointment + this = doctrine:doctrine_anointment_permitted + this = doctrine:doctrine_imperial_anointment + + this = doctrine:doctrine_monotheist + this = doctrine:doctrine_polytheist + + this = doctrine:doctrine_monasticism_encouraged + this = doctrine:doctrine_monasticism_accepted + this = doctrine:doctrine_monasticism_absent + this = doctrine:doctrine_monasticism_forbidden + + this = doctrine:doctrine_sacraments_central + this = doctrine:doctrine_sacraments_absent + } +} + +pam_reaffirm_doctrine_send_option_valid_trigger = { + custom_tooltip = { + text = pam_reaffirm_doctrine_one_doctrine_tt + OR = { + scope:$DOCTRINE$ = yes + pam_reaffirm_doctrine_send_option_selected_trigger = no + } + } +} + +pam_vows_of_poverty_premium_activity_option_valid_trigger = { + custom_tooltip = { + text = pam_vows_of_poverty_premium_activity_option_blocked_tt + NOT = { has_personal_tenet_flag = tenet_vows_of_poverty_humble_host } + } +} + +pam_reaffirm_doctrine_send_option_selected_trigger = { + OR = { + scope:doctrine_monogamy = yes + scope:doctrine_polygamy = yes + scope:doctrine_concubines = yes + + scope:doctrine_divorce_disallowed = yes + scope:doctrine_divorce_approval = yes + scope:doctrine_divorce_allowed = yes + + scope:doctrine_bastardry_none = yes + scope:doctrine_bastardry_legitimization = yes + scope:doctrine_bastardry_all = yes + + scope:doctrine_homosexuality_crime = yes + scope:doctrine_homosexuality_shunned = yes + scope:doctrine_homosexuality_accepted = yes + + scope:doctrine_deviancy_crime = yes + scope:doctrine_deviancy_shunned = yes + scope:doctrine_deviancy_accepted = yes + scope:doctrine_deviancy_virtuous = yes + + scope:doctrine_adultery_men_crime = yes + scope:doctrine_adultery_men_shunned = yes + scope:doctrine_adultery_men_accepted = yes + + scope:doctrine_adultery_women_crime = yes + scope:doctrine_adultery_women_shunned = yes + scope:doctrine_adultery_women_accepted = yes + + scope:doctrine_kinslaying_any_dynasty_member_crime = yes + scope:doctrine_kinslaying_extended_family_crime = yes + scope:doctrine_kinslaying_close_kin_crime = yes + scope:doctrine_kinslaying_shunned = yes + scope:doctrine_kinslaying_accepted = yes + + scope:doctrine_witchcraft_crime = yes + scope:doctrine_witchcraft_shunned = yes + scope:doctrine_witchcraft_accepted = yes + scope:doctrine_witchcraft_virtuous = yes + + scope:doctrine_gender_male_dominated = yes + scope:doctrine_gender_equal = yes + scope:doctrine_gender_female_dominated = yes + + scope:doctrine_consanguinity_dynastic = yes + scope:doctrine_consanguinity_restricted = yes + scope:doctrine_consanguinity_cousins = yes + scope:doctrine_consanguinity_aunt_nephew_and_uncle_niece = yes + scope:doctrine_consanguinity_unrestricted = yes + + scope:doctrine_pluralism_fundamentalist = yes + scope:doctrine_pluralism_righteous = yes + scope:doctrine_pluralism_pluralistic = yes + + scope:doctrine_theocracy_temporal = yes + scope:doctrine_theocracy_lay_clergy = yes + + scope:doctrine_no_head = yes + scope:doctrine_spiritual_head = yes + scope:doctrine_temporal_head = yes + + scope:doctrine_clerical_function_taxation = yes + scope:doctrine_clerical_function_alms_and_pacification = yes + scope:doctrine_clerical_function_recruitment = yes + + scope:doctrine_clerical_gender_male_only = yes + scope:doctrine_clerical_gender_either = yes + scope:doctrine_clerical_gender_female_only = yes + + scope:doctrine_clerical_marriage_allowed = yes + scope:doctrine_clerical_marriage_disallowed = yes + + scope:doctrine_clerical_succession_temporal_appointment = yes + scope:doctrine_clerical_succession_spiritual_appointment = yes + scope:doctrine_clerical_succession_temporal_fixed_appointment = yes + scope:doctrine_clerical_succession_spiritual_fixed_appointment = yes + scope:doctrine_clerical_succession_conditional = yes + + scope:doctrine_pilgrimage_forbidden = yes + scope:doctrine_pilgrimage_encouraged = yes + scope:doctrine_pilgrimage_local_rites = yes + scope:doctrine_pilgrimage_mandatory = yes + scope:doctrine_pilgrimage_mandatory_hajj = yes + + scope:doctrine_funeral_stoic = yes + scope:doctrine_funeral_bewailment = yes + scope:doctrine_funeral_cremation = yes + scope:doctrine_funeral_sky_burial = yes + scope:doctrine_funeral_mummification = yes + scope:doctrine_family_rites = yes + + scope:doctrine_no_anointment = yes + scope:doctrine_anointment_permitted = yes + scope:doctrine_imperial_anointment = yes + + scope:doctrine_monotheist = yes + scope:doctrine_polytheist = yes + + scope:doctrine_monasticism_encouraged = yes + scope:doctrine_monasticism_accepted = yes + scope:doctrine_monasticism_absent = yes + scope:doctrine_monasticism_forbidden = yes + + scope:doctrine_sacraments_central = yes + scope:doctrine_sacraments_absent = yes + } +} + +pam_reaffirm_doctrine_kinslayer_decline_trigger = { + OR = { + has_trait = kinslayer + any_secret = { + type = secret_murder + secret_target = { save_temporary_scope_as = target } + scope:recipient = { + murdering_character_is_crime_in_rite_trigger = { + CHARACTER = scope:target + RITE = scope:actor.rite + } + } + } + } +} +pam_reaffirm_doctrine_kinslayer_accept_trigger = { + OR = { + has_trait = kinslayer + any_secret = { + type = secret_murder + secret_target = { save_temporary_scope_as = target } + scope:recipient = { + murdering_character_is_kinslaying_in_rite_trigger = { + CHARACTER = scope:target + RITE = scope:recipient.rite + } + } + } + } +} + +pam_reaffirm_doctrine_consanguinity_decline_trigger = { + OR = { + any_relation = { + type = lover + relation_with_character_is_incestuous_in_rite_trigger = { + CHARACTER = scope:recipient + RITE = scope:actor.rite + } + } + any_spouse = { + relation_with_character_is_incestuous_in_rite_trigger = { + CHARACTER = scope:recipient + RITE = scope:actor.rite + } + } + } +} + +pam_reaffirm_doctrine_consanguinity_accept_trigger = { + OR = { + any_relation = { + type = lover + relation_with_character_is_incestuous_in_rite_trigger = { + CHARACTER = scope:recipient + RITE = scope:recipient.rite + } + } + any_spouse = { + relation_with_character_is_incestuous_in_rite_trigger = { + CHARACTER = scope:recipient + RITE = scope:recipient.rite + } + } + } +} + +skill_support_trigger = { + #AI precautions + trigger_if = { + limit = { + is_ai = yes + } + ai_greed > low_negative_ai_value + ai_rationality > low_negative_ai_value + } + + custom_tooltip = { + text = sum_of_all_skills_comparison_unlock_tt + scope:actor = { + sum_of_all_skills_value > scope:recipient.sum_of_all_skills_value + } + } + custom_tooltip = { + text = sum_of_all_skills_unlock_tt + scope:actor = { + sum_of_all_skills_value >= 50 + } + } +} +piety_support_trigger = { + #AI precautions + trigger_if = { + limit = { + is_ai = yes + } + ai_zeal >= 0 + ai_boldness >= low_negative_ai_value + } + + NOT = { + has_trait = excommunicated + } + rite = scope:recipient.rite + custom_tooltip = { + text = comparable_piety_to_recipient_req_tt + piety_level >= scope:recipient.piety_level + } + OR = { + has_trait = saint + has_trait = herald + has_trait = saoshyant + has_trait = paragon + has_trait = savior + has_trait = crusader_king + has_trait = divine_blood + has_trait = faith_warrior + has_trait = theologian + has_trait = zealous + custom_tooltip = { + text = you_are_head_of_faith_req_tt + trigger_if = { + limit = { exists = scope:recipient.faith.religious_head } + this = scope:recipient.faith.religious_head + } + } + custom_tooltip = { + text = pilgrim_xp_req_tt + has_trait = pilgrim + has_trait_xp = { + trait = pilgrim + value >= 50 + } + } + custom_tooltip = { + text = scholar_xp_req_tt + has_trait = lifestyle_scholar + has_trait_xp = { + trait = lifestyle_scholar + value >= 50 + } + } + } + scope:recipient = { + NOT = { + has_trait = cynical + } + } +} +dread_support_trigger = { + #AI precautions + trigger_if = { + limit = { + is_ai = yes + } + ai_compassion < 0 + ai_honor < low_positive_ai_value + ai_zeal < low_positive_ai_value + } + + custom_tooltip = { + text = recipient_must_be_terrified_tt + scope:recipient = { + has_dread_level_towards = { + target = scope:actor + level >= 2 + } + } + } +} +dread_support_secular_trigger = { + dread_support_trigger = yes + scope:actor = { + dread >= medium_dread_value + } +} +friendly_support_base_trigger = { + #AI precautions + trigger_if = { + limit = { + is_ai = yes + } + ai_compassion >= 0 + ai_honor >= 0 + ai_sociability >= low_negative_ai_value + ai_greed >= low_negative_ai_value + } + + scope:actor = { + NOR = { + has_trait = disloyal + has_trait = denounced + } + piety_level >= 1 + } + custom_tooltip = { + text = recipient_opinion_80_req + scope:recipient = { + opinion = { + target = scope:actor + value >= 80 + } + } + } + scope:actor = { + OR = { + has_relation_friend = scope:recipient + is_close_family_of = scope:recipient + has_relation_soulmate = scope:recipient + is_spouse_of = scope:recipient + has_relation_blood_brother = scope:recipient + has_relation_ward = scope:recipient + } + } +} +friendly_support_trigger = { + friendly_support_base_trigger = yes + scope:actor = { + prestige_level >= 1 + } +} +friendly_support_secular_trigger = { + friendly_support_base_trigger = yes + scope:actor = { + prestige_level >= 2 + } +} +lunacy_support_trigger = { + #AI precautions + trigger_if = { + limit = { + is_ai = yes + } + ai_compassion <= medium_negative_ai_value + ai_rationality <= low_positive_ai_value + ai_sociability <= low_positive_ai_value + ai_boldness <= low_positive_ai_value + OR = { + custom_tooltip = { + text = witch_secret_unlock_tt + any_secret = { + type = secret_witch + } + } + has_trait = witch + has_trait = schemer + has_trait = torturer + ai_compassion <= high_negative_ai_value + } + } + + scope:recipient = { + intrigue < mediocre_skill_rating + } + OR = { + custom_tooltip = { + text = witch_secret_unlock_tt + any_secret = { + type = secret_witch + } + } + has_trait = witch + has_trait = schemer + has_trait = lifestyle_herbalist + has_trait = torturer + custom_tooltip = { + text = high_trickster_xp_unlock_tt + has_trait = gallowsbait + has_trait_xp = { + trait = gallowsbait + track = trickster + value >= 40 + } + } + } + scope:recipient = { + OR = { + has_trait = eccentric + has_trait = lunatic + has_trait = possessed + has_trait = drunkard + has_trait = hashishiyah + has_trait = withering_mind + has_trait = ergotism + has_trait = bubonic_plague + is_adult = no + } + } +} + +# 5+ counties so small dukes do not found theocracies +# When no theocratic vassal exists we skip the percent scan so this stays fast +realm_theocratic_county_share_ai_below_cap_trigger = { + any_sub_realm_county = { + count >= 5 + } + OR = { + NOT = { any_vassal = { government_has_flag = government_is_theocracy } } + any_sub_realm_county = { + percent < 0.10 + holder = { government_has_flag = government_is_theocracy } + } + } +} + +realm_theocratic_county_share_player_below_cap_trigger = { + OR = { + NOT = { any_vassal = { government_has_flag = government_is_theocracy } } + any_sub_realm_county = { + percent < 0.25 + holder = { government_has_flag = government_is_theocracy } + } + } +} + +# The granting ruler is root, and scope:title is the highest-tier title being granted +pam_nomad_grant_settled_government_trigger = { + OR = { + government_has_flag = government_is_nomadic + government_has_flag = government_is_herder + } + NOT = { has_variable = grant_vassal_government_cooldown } + pam_nomad_inclined_to_settle_trigger = yes + scope:title = { + tier = tier_county + title_province = { + OR = { + has_holding_type = castle_holding + has_holding_type = city_holding + has_holding_type = church_holding + } + } + } +} + +# Follows settle_people_decision ai_potential so an AI nomad always or never grants settled holdings +pam_nomad_inclined_to_settle_trigger = { + NOR = { + has_trait = greatest_of_khans + has_trait = conqueror + any_owned_story = { + OR = { + story_type = story_mongol_invasion + story_type = story_greatest_of_khans + } + } + } + OR = { + has_trait = content + domicile ?= { herd <= 500 } + is_independent_ruler = no + } +} + +# Artifact scope +pam_holy_weapon_trigger = { + is_equipped = yes + artifact_slot_type = primary_armament + is_holy_relic_for = artifact_owner.faith +} + +############################################### +# Harmonious Society - the Five Bonds +############################################### +# A bond only counts while it is actually kept, so each one asks for a living partner who thinks +# well of the scoped character. 50 opinion is the threshold throughout. + +pam_five_bonds_ruler_subject_trigger = { + OR = { + AND = { + exists = liege + liege = { + opinion = { + target = prev + value >= 50 + } + } + } + any_vassal = { + opinion = { + target = prev + value >= 50 + } + } + } +} + +pam_five_bonds_parent_child_trigger = { + OR = { + any_parent = { + opinion = { + target = prev + value >= 50 + } + } + any_child = { + is_adult = yes + opinion = { + target = prev + value >= 50 + } + } + } +} + +pam_five_bonds_spouse_trigger = { + any_spouse = { + opinion = { + target = prev + value >= 50 + } + } +} + +pam_five_bonds_sibling_trigger = { + any_sibling = { + is_adult = yes + opinion = { + target = prev + value >= 50 + } + } +} + +pam_five_bonds_friend_trigger = { + any_relation = { + type = friend + count >= 1 + opinion = { + target = prev + value >= 50 + } + } +} + +# Same rules as release_from_prison_interaction and only valid inside that interaction +tenet_benevolent_governance_unconditional_release_trigger = { + scope:demand_conversion = no + scope:renounce_claims = no + scope:banish = no + scope:take_vows = no + scope:recruit = no + scope:disfigure = no + scope:blind = no + scope:castrate = no + scope:demand_admin = no + scope:gain_hook = no + scope:make_puppet = no + scope:change_prison = no + scope:become_executioner = no +} + +theocratic_lay_clergy_trigger = { + trigger_if = { + limit = { + rite = { rite_has_doctrine = doctrine_theocracy_lay_clergy } + } + OR = { + # Cardinals + exists = clerical_elector_title + # Archdioceses + primary_title ?= { has_clerical_region = yes } + # Other landless explicit clergy + AND = { + is_landed = no + is_clergy = yes + } + } + } +} + +pam_is_clerical_comprehensive_trigger = { + OR = { + # Cardinals + exists = clerical_elector_title + # Archdioceses + primary_title ?= { has_clerical_region = yes } + # Landed and landless ecclesiastical rulers + government_has_flag = government_is_ecclesiastical + # Other landless explicit clergy + AND = { + is_landed = no + is_clergy = yes + } + } +} + +# Current scope is a faith and root is the character choosing the personal tenet +pam_personal_syncretism_faith_matches_trigger = { + OR = { + AND = { + root = { has_personal_tenet = tenet_sinitic_syncretism } + religion = { is_in_family = rf_sinitic } + } + AND = { + root = { has_personal_tenet = tenet_eastern_syncretism } + religion = { is_in_family = rf_eastern } + } + AND = { + root = { has_personal_tenet = tenet_unreformed_syncretism } + has_doctrine_parameter = unreformed + } + AND = { + root = { has_personal_tenet = tenet_christian_syncretism } + religion_tag = catholic_religion + } + AND = { + root = { has_personal_tenet = tenet_christian_syncretism } + religion_tag = protestant_religion + } + AND = { + root = { has_personal_tenet = tenet_christian_syncretism } + religion_tag = eastern_orthodox_religion + } + AND = { + root = { has_personal_tenet = tenet_christian_syncretism } + religion_tag = oriental_orthodox_religion + } + AND = { + root = { has_personal_tenet = tenet_islamic_syncretism } + religion_tag = islam_religion + } + AND = { + root = { has_personal_tenet = tenet_jewish_syncretism } + religion_tag = judaism_religion + } + } +} + +# Exile pool eligibility probe for the personal syncretism decision tooltip. +pam_personal_syncretism_exile_rite_probe_trigger = { + pam_personal_syncretism_exile_rite_trigger = yes +} + +# Valid exile pool entry for the personal syncretism decision. +pam_personal_syncretism_exile_rite_trigger = { + exists = var:converted_development + var:converted_development >= 1 + NOT = { rite_has_parameter = unreformed } + exists = var:associated_culture + exists = var:associated_county + save_temporary_scope_as = rite_scope + trigger_if = { + limit = { + root = { exists = capital_province } + exists = var:associated_county + } + "root.capital_province.squared_distance(scope:rite_scope.var:associated_county.title_province)" <= squared_distance_mega + } + root = { + trigger_if = { + limit = { + has_variable_list = rites_converted_in_counties + } + NOT = { + is_target_in_variable_list = { + name = rites_converted_in_counties + target = scope:rite_scope + } + } + } + any_sub_realm_county = { + faith = root.faith + trigger_if = { + limit = { + has_variable_list = rites_converted_in_the_county + } + NOT = { + is_target_in_variable_list = { + name = rites_converted_in_the_county + target = scope:rite_scope + } + } + } + } + } + faith = { + pam_personal_syncretism_faith_matches_trigger = yes + } +} + +pam_personal_syncretism_invite_exiles_available_trigger = { + has_personal_tenet_flag = tenet_syncretism_invite_religious_exiles +} + +pam_personal_syncretism_county_bonus_trigger = { + # The yearly pulse evaluates this on a held county; root is its ruler. + root = { + has_personal_tenet_flag = tenet_syncretism_county_bonus + } + faith = { + pam_personal_syncretism_faith_matches_trigger = yes + } +} + +############################################### +# Holy Myron + +# Until pam_holy_myron.0002 destroys it, an emptied vessel stays as an artifact +# trigger_if keeps the variable fetch from evaluating on ordinary artifacts +pam_is_holy_myron_artifact_trigger = { + trigger_if = { + limit = { has_variable = pam_holy_myron_charges } + var:pam_holy_myron_charges >= 1 + } + trigger_else = { + always = no + } +} + +# Character scope: owns an ampulla with oil left to spend. +pam_has_usable_holy_myron_trigger = { + any_character_artifact = { + pam_is_holy_myron_artifact_trigger = yes + } +} + +eligible_for_pam_legacy_trigger = { + has_pam_dlc_trigger = yes + OR = { + game_rule_unrestricted_dynasty_legacies_trigger = yes + dynasty = { + OR = { + dynast = { + OR = { + faith.religion = religion:catholic_religion + faith.religion = religion:protestant_religion + faith.religion = religion:eastern_orthodox_religion + faith.religion = religion:oriental_orthodox_religion + } + } + has_dynasty_perk = pam_legacy_1 + } + } + } +} + +############################################### +# Religious Study scheme + +pam_study_scripture_pursuit_of_knowledge_trigger = { + OR = { + rite ?= { rite_has_parameter = tenet_pursuit_of_knowledge_study_scripture_bonus } + has_personal_tenet_flag = tenet_pursuit_of_knowledge_study_scripture_bonus + } +} + +pam_study_scripture_scholasticism_trigger = { + OR = { + rite ?= { rite_has_parameter = tenet_scholasticism_study_scripture_bonus } + has_personal_tenet_flag = tenet_scholasticism_study_scripture_bonus + } +} + +pam_study_scripture_confession_tenet_trigger = { + OR = { + rite ?= { rite_has_parameter = tenet_confession_study_scripture_bonus } + has_personal_tenet_flag = tenet_confession_study_scripture_bonus + } +} + +# An eloquent cleric root could learn homiletics from +pam_study_scripture_preacher_trigger = { + diplomacy >= 8 + is_physically_able_ai_adult = yes + NOT = { has_relation_rival = root } + has_trait_malicious_trigger = no + pam_is_investiture_clergy_trigger = yes +} + +pam_study_scripture_mysticism_trigger = { + OR = { + has_trait = lifestyle_mystic + rite ?= { + OR = { + rite_has_tenet = tenet_hesychasm + rite_has_tenet = tenet_anachoresis + rite_has_tenet = tenet_esotericism + rite_has_tenet = tenet_astrology + rite_has_tenet = tenet_gnosticism + rite_has_tenet = tenet_inner_journey + rite_has_tenet = tenet_mystical_birthright + } + } + has_personal_tenet = tenet_hesychasm + has_personal_tenet = tenet_anachoresis + has_personal_tenet = tenet_esotericism + has_personal_tenet = tenet_astrology + has_personal_tenet = tenet_gnosticism + has_personal_tenet = tenet_inner_journey + has_personal_tenet = tenet_mystical_birthright + } +} + +# A vow of chastity, or a marriage the Church has just dissolved, keeps a character off the marriage market. +pam_under_clerical_marriage_restraint_trigger = { + OR = { + has_character_modifier = clerical_chastity_vow_modifier + has_variable = pam_clerical_divorce_enforced + } +} + +# Only the AI is held to this: a player may still discard the vow's intent and arrange the match anyway. +pam_ai_marriage_respects_clerical_restraint_trigger = { + trigger_if = { + limit = { + scope:actor ?= { is_ai = yes } + } + NOR = { + scope:secondary_actor ?= { pam_under_clerical_marriage_restraint_trigger = yes } + scope:secondary_recipient ?= { pam_under_clerical_marriage_restraint_trigger = yes } + } + } +} + +# $SLOT$ is the papabile shortlist seat being claimed +pam_papabile_slot_open_to_trigger = { + exists = clerical_elector_title + NOT = { has_variable = pam_refuses_papacy } + pam_college_election_title_has_electors_trigger = yes + NOT = { + pam_is_college_election_candidate_trigger = { SOURCE = $SLOT$ } + } +} + +pam_papal_ruling_rite_has_parameter_trigger = { + trigger_if = { + limit = { exists = faith.religious_head_title } + faith.religious_head_title.holder.rite ?= { rite_has_parameter = $PARAMETER$ } + } + trigger_else = { + title:k_papal_state.holder.rite ?= { rite_has_parameter = $PARAMETER$ } + } +} + +pam_papabile_barred_by_clerical_gender_trigger = { + trigger_if = { + limit = { is_female = yes } + pam_papal_ruling_rite_has_parameter_trigger = { PARAMETER = clergy_must_be_male } + } + trigger_else = { + pam_papal_ruling_rite_has_parameter_trigger = { PARAMETER = clergy_must_be_female } + } +} + +# Divergent rites only: an Ecumenical Council can give the main rite Lay Clergy, and its College must still have candidates +pam_papabile_barred_by_lay_clergy_trigger = { + rite ?= { rite_has_doctrine = doctrine_theocracy_lay_clergy } + rite != faith.main_rite +} + +# Only the patron's own personal tenets may be imposed, and not one the order already advocates. +pam_reform_order_tenet_option_shown_trigger = { + scope:actor = { + has_personal_tenet = $TENET$ + any_patroned_holy_order = { + leader = scope:recipient + NOT = { order_tenet = tenet:$TENET$ } + } + } +} + +monastic_movement_potential_leader_trigger = { + is_adult = yes + is_ruler = no + has_trait = devoted + is_physically_able_ai_adult = yes + in_diplomatic_range = root + OR = { + opinion = { + target = root + value >= 100 + } + root = { + has_usable_hook = prev + } + } +} +monastic_movement_non_order_size_reqs_trigger = { + OR = { + custom_tooltip = { + text = character_is_rite_head_first + rite.head_of_rite ?= root + } + custom_tooltip = { + text = house_member_potential_leader + house ?= { + any_house_member = { + monastic_movement_potential_leader_trigger = yes + } + } + } + trigger_if = { + limit = { + government_has_flag = government_is_ecclesiastical + } + custom_tooltip = { + text = has_cloister_building_tt + domicile ?= { + has_domicile_parameter = estate_cloister_monastic_movement + } + } + } + } +} + +# Core tenet or personal pick; shared by scheme success/prediction +pam_study_rite_tenet_bonus_trigger = { + OR = { + rite ?= { rite_has_parameter = $PARAM$ } + has_personal_tenet_flag = $PARAM$ + } +} + +can_send_make_external_ruler_puppet_trigger = { + custom_tooltip = { + text = make_external_ruler_puppet_tt + OR = { + $ACTOR$ = { + is_clergy = yes + is_vassal_of = $RECIPIENT$ + } + AND = { + $ACTOR$ = { + has_trait = seducer + } + trigger_if = { + limit = { + $RECIPIENT$ = { + highest_held_title_tier >= tier_kingdom + } + } + $RECIPIENT$ = { + has_relation_soulmate = $ACTOR$ + } + } + trigger_else = { + $RECIPIENT$ = { + has_relation_lover = $ACTOR$ + } + } + } + AND = { + $ACTOR$ = { + has_trait = torturer + } + $RECIPIENT$ = { + is_imprisoned_by = $ACTOR$ + is_in_prison_type = dungeon + } + } + AND = { + $ACTOR$ = { + has_trait = family_first + } + $RECIPIENT$ = { + is_close_family_of = $ACTOR$ + } + } + $ACTOR$ = { + has_trait = schemer + trigger_if = { + limit = { + $RECIPIENT$ = { + highest_held_title_tier >= tier_kingdom + } + } + has_strong_hook = $RECIPIENT$ + } + trigger_else = { + has_hook = $RECIPIENT$ + } + } + $ACTOR$ = { + has_trait = diplomat + is_allied_to = $RECIPIENT$ + } + AND = { + $ACTOR$ = { + has_trait = gallant + } + $RECIPIENT$ = { + is_spouse_of = $ACTOR$ + } + } + AND = { + $ACTOR$ = { + is_diarch_of_target = $RECIPIENT$ + } + $RECIPIENT$ = { + has_diarchy_parameter = diarchy_type_is_entrenched_regency + } + } + AND = { + exists = $RECIPIENT$.religious_head_or_challenger + $RECIPIENT$.religious_head_or_challenger = $ACTOR$ + } + AND = { + exists = $RECIPIENT$.rite.head_of_rite + $RECIPIENT$.rite.head_of_rite = $ACTOR$ + } + } + } + $ACTOR$ = { + trigger_if = { + limit = { + $RECIPIENT$ = { + highest_held_title_tier >= tier_empire + } + } + custom_tooltip = { + text = pam_empire_dread_or_strong_hook_tt + OR = { + has_strong_hook = $RECIPIENT$ + $RECIPIENT$ = { + has_dread_level_towards = { + target = $ACTOR$ + level >= 2 + } + } + $RECIPIENT$.religious_head_or_challenger ?= $ACTOR$ + } + } + } + trigger_else_if = { + limit = { + $RECIPIENT$ = { + highest_held_title_tier >= tier_kingdom + } + } + custom_tooltip = { + text = piety_level_4_dread_or_strong_hook_tt + OR = { + piety_level >= 4 + has_strong_hook = $RECIPIENT$ + $RECIPIENT$ = { + has_dread_level_towards = { + target = $ACTOR$ + level >= 2 + } + } + $RECIPIENT$.religious_head_or_challenger ?= $ACTOR$ + } + } + } + trigger_else = { + custom_tooltip = { + text = piety_level_3_dread_or_hook_tt + OR = { + piety_level >= 3 + has_hook = $RECIPIENT$ + $RECIPIENT$ = { + has_dread_level_towards = { + target = $ACTOR$ + level >= 2 + } + } + $RECIPIENT$.religious_head_or_challenger ?= $ACTOR$ + } + } + } + } +} diff --git a/common/scripted_triggers/pam_secular_faith_triggers.txt b/common/scripted_triggers/pam_secular_faith_triggers.txt new file mode 100644 index 000000000..abd10bf16 --- /dev/null +++ b/common/scripted_triggers/pam_secular_faith_triggers.txt @@ -0,0 +1,65 @@ + +# Base gate shared by every Secular Faith event. +pam_secular_faith_base_trigger = { + has_pam_dlc_trigger = yes + is_available_adult = yes +} + +# The default ambient actor. +pam_secular_faith_landed_actor_trigger = { + pam_secular_faith_base_trigger = yes + is_landed_or_landless_administrative = yes +} + +# As above, but also open to clergy rulers (visions, scripture, hermits, etc. make sense for them too). +pam_secular_faith_clergy_ok_actor_trigger = { + pam_secular_faith_base_trigger = yes + is_landed_or_landless_administrative_or_theocratic = yes +} + +# Christian-primary convenience gate. +pam_secular_faith_christian_actor_trigger = { + pam_secular_faith_landed_actor_trigger = yes + OR = { + religion = religion:catholic_religion + religion = religion:protestant_religion + religion = religion:eastern_orthodox_religion + religion = religion:oriental_orthodox_religion + } +} + +pam_can_adopt_forbidden_personal_tenet_trigger = { + any_desired_tenet = { + only_positive = yes + threshold = 1 + selection_count = 97 + save_temporary_scope_as = pam_sf_forbidden_candidate + NOT = { root = { any_personal_tenet = { this = scope:pam_sf_forbidden_candidate } } } + root.faith.main_rite = { + has_tenet_status = { + tenet = scope:pam_sf_forbidden_candidate + status = prohibited + } + } + } +} + + +pam_sf_carnal_art_indian_setting_trigger = { + OR = { + culture = { has_cultural_pillar = heritage_indo_aryan } + culture = { has_cultural_pillar = heritage_dravidian } + location = { geographical_region = world_india } + } +} + +pam_poverty_tenets_trigger = { + OR = { + this = tenet:tenet_mendicant_preachers + this = tenet:tenet_vows_of_poverty + this = tenet:tenet_asceticism + this = tenet:tenet_sanctity_of_nature + this = tenet:tenet_communal_possessions + this = tenet:tenet_philanthropia + } +} \ No newline at end of file